From 053d29a64bc36587b95ac529643c189d7d840b12 Mon Sep 17 00:00:00 2001 From: Samuel Date: Fri, 12 Oct 2012 01:42:10 +0200 Subject: [PATCH] Finishing Minimap Icons Added rightclick menues: - on map mark: 'Delete Mark' - on minimap: 'Create Mark' Dialog: http://i.imgur.com/BY33k.png --- modules/game_minimap/flagwindow.otui | 190 +++++++++++++++++++ modules/game_minimap/images/flagcheckbox.png | Bin 0 -> 349 bytes modules/game_minimap/minimap.lua | 78 +++++++- 3 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 modules/game_minimap/flagwindow.otui create mode 100644 modules/game_minimap/images/flagcheckbox.png diff --git a/modules/game_minimap/flagwindow.otui b/modules/game_minimap/flagwindow.otui new file mode 100644 index 00000000..935a2f79 --- /dev/null +++ b/modules/game_minimap/flagwindow.otui @@ -0,0 +1,190 @@ +FlagButton < CheckBox + size: 15 15 + margin-left: 2 + image-source: images/flagcheckbox.png + image-size: 15 15 + image-border: 3 + icon-source: images/mapflags.png + icon-size: 11 11 + icon-clip: 0 0 11 11 + icon-offset: 2 4 + text: + + $!checked: + image-clip: 26 0 26 26 + + $hover !checked: + image-clip: 78 0 26 26 + + $checked: + image-clip: 0 0 26 26 + + $hover checked: + image-clip: 52 0 26 26 + + +FlagWindow < MainWindow + id: flagWindow + !text: tr('Create Map Mark') + size: 196 170 + + Label + id: position + !text: tr('Position:') + text-auto-resize: true + anchors.top: parent.top + anchors.left: parent.left + margin-top: 2 + + Label + !text: tr('Description:') + anchors.left: parent.left + anchors.top: prev.bottom + margin-top: 7 + + TextEdit + id: description + margin-top: 3 + anchors.left: parent.left + anchors.top: prev.bottom + width: 158 + + FlagButton + id: flag1 + anchors.left: parent.left + anchors.top: prev.bottom + margin-top: 6 + margin-left: 0 + + FlagButton + id: flag2 + icon-clip: 11 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag3 + icon-clip: 22 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag4 + icon-clip: 33 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag5 + icon-clip: 44 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag6 + icon-clip: 55 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag7 + icon-clip: 66 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag8 + icon-clip: 77 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag9 + icon-clip: 88 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag10 + icon-clip: 99 0 11 11 + anchors.left: prev.right + anchors.top: prev.top + + + FlagButton + id: flag11 + icon-clip: 0 11 11 11 + anchors.left: parent.left + anchors.top: prev.bottom + margin-top: 6 + margin-left: 0 + + FlagButton + id: flag12 + icon-clip: 11 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag13 + icon-clip: 22 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag14 + icon-clip: 33 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag15 + icon-clip: 44 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag16 + icon-clip: 55 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag17 + icon-clip: 66 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag18 + icon-clip: 77 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag19 + icon-clip: 88 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + FlagButton + id: flag20 + icon-clip: 99 11 11 11 + anchors.left: prev.right + anchors.top: prev.top + + Button + id: okButton + !text: tr('Ok') + anchors.top: prev.bottom + anchors.left: parent.left + margin-top: 10 + width: 60 + + Button + id: cancelButton + !text: tr('Cancel') + anchors.top: prev.top + anchors.left: prev.right + margin-left: 15 + width: 60 diff --git a/modules/game_minimap/images/flagcheckbox.png b/modules/game_minimap/images/flagcheckbox.png new file mode 100644 index 0000000000000000000000000000000000000000..b479c4049ccc014cfb9ac13aacc8d379d5d4a2f2 GIT binary patch literal 349 zcmeAS@N?(olHy`uVBq!ia0vp^89*$>!3HFwze#2TDYhhUcNd2LAh=-f^2tCE&H|6f zVg?3oVGw3ym^DWND9B#o>FdgVhl^WS%{*|{r7)n7Y-UJAiF1B#Zfaf$kjuc}T$Gwv zlA5AWo>`Ki;O^-gkfN8$4irD=>EalYaqsOdMZQA@5^WF57#kHK_j-dT zJDlDJ=`{fPx737%1-cd`3Vod1^*wa 0 then + flagWidget:setTooltip(tr(message)) + end flagWidget.id = flagId flagWidget.version = version updateMapFlag(flagId) + flagWidget.onMousePress = createThingMenu end function getMapArea() @@ -235,6 +307,8 @@ function center() local player = g_game.getLocalPlayer() if not player then return end minimapWidget:followCreature(player) + + updateMapFlags() end function compassClick(self, mousePos, mouseButton, elapsed)