Browse Source

Topmenu fix

* Will no longer duplicate topmenu buttons (no need to destroy in the module now)
* Menu items will no longer change position when reloaded.
BeniS 8 years ago
parent
commit
35e5dd8af8

+ 0
- 6
modules/client_entergame/entergame.lua View File

@@ -136,17 +136,11 @@ function EnterGame.terminate()
136 136
   removeEvent(autoLoginEvent)
137 137
   enterGame:destroy()
138 138
   enterGame = nil
139
-  enterGameButton:destroy()
140
-  enterGameButton = nil
141 139
   protocolBox = nil
142 140
   if motdWindow then
143 141
     motdWindow:destroy()
144 142
     motdWindow = nil
145 143
   end
146
-  if motdButton then
147
-    motdButton:destroy()
148
-    motdButton = nil
149
-  end
150 144
   if loadBox then
151 145
     loadBox:destroy()
152 146
     loadBox = nil

+ 0
- 2
modules/client_modulemanager/modulemanager.lua View File

@@ -23,8 +23,6 @@ end
23 23
 function terminate()
24 24
   moduleManagerWindow:destroy()
25 25
   moduleManagerWindow = nil
26
-  moduleManagerButton:destroy()
27
-  moduleManagerButton = nil
28 26
   moduleList = nil
29 27
 end
30 28
 

+ 0
- 4
modules/client_options/options.lua View File

@@ -119,15 +119,11 @@ function terminate()
119 119
   g_keyboard.unbindKeyDown('Ctrl+Shift+F')
120 120
   optionsWindow:destroy()
121 121
   optionsWindow = nil
122
-  optionsButton:destroy()
123
-  optionsButton = nil
124 122
   optionsTabBar = nil
125 123
   generalPanel = nil
126 124
   consolePanel = nil
127 125
   graphicsPanel = nil
128 126
   audioPanel = nil
129
-  audioButton:destroy()
130
-  audioButton = nil
131 127
 end
132 128
 
133 129
 function toggle()

+ 0
- 2
modules/client_terminal/terminal.lua View File

@@ -150,8 +150,6 @@ function terminate()
150 150
   g_settings.setList('terminal-history', commandHistory)
151 151
   g_keyboard.unbindKeyDown('Ctrl+T')
152 152
   g_logger.setOnLog(nil)
153
-  terminalButton:destroy()
154
-  terminalButton = nil
155 153
   commandTextEdit = nil
156 154
   terminalBuffer = nil
157 155
   terminalWindow:destroy()

+ 8
- 5
modules/client_topmenu/topmenu.lua View File

@@ -14,11 +14,14 @@ local function addButton(id, description, icon, callback, panel, toggle, front)
14 14
     class = 'TopButton'
15 15
   end
16 16
 
17
-  local button = g_ui.createWidget(class)
18
-  if front then
19
-    panel:insertChild(1, button)
20
-  else
21
-    panel:addChild(button)
17
+  local button = panel:getChildById(id)
18
+  if not button then
19
+    button = g_ui.createWidget(class)
20
+    if front then
21
+      panel:insertChild(1, button)
22
+    else
23
+      panel:addChild(button)
24
+    end
22 25
   end
23 26
   button:setId(id)
24 27
   button:setTooltip(description)

+ 0
- 1
modules/game_combatcontrols/combatcontrols.lua View File

@@ -50,7 +50,6 @@ function terminate()
50 50
   end
51 51
 
52 52
   fightModeRadioGroup:destroy()
53
-  combatControlsButton:destroy()
54 53
   combatControlsWindow:destroy()
55 54
 
56 55
   disconnect(g_game, {

+ 0
- 1
modules/game_cooldown/cooldown.lua View File

@@ -35,7 +35,6 @@ function terminate()
35 35
                        onSpellGroupCooldown = onSpellGroupCooldown,
36 36
                        onSpellCooldown = onSpellCooldown })
37 37
 
38
-  cooldownButton:destroy()
39 38
   cooldownWindow:destroy()
40 39
 end
41 40
 

+ 0
- 1
modules/game_healthinfo/healthinfo.lua View File

@@ -70,7 +70,6 @@ function terminate()
70 70
   disconnect(g_game, { onGameEnd = offline })
71 71
 
72 72
   healthInfoWindow:destroy()
73
-  healthInfoButton:destroy()
74 73
   healthInfoWindow = nil
75 74
   healthInfoButton = nil
76 75
 

+ 0
- 1
modules/game_hotkeys/hotkeys_manager.lua View File

@@ -88,7 +88,6 @@ function terminate()
88 88
   unload()
89 89
 
90 90
   hotkeysWindow:destroy()
91
-  hotkeysButton:destroy()
92 91
   mouseGrabberWidget:destroy()
93 92
 end
94 93
 

+ 0
- 1
modules/game_interface/gameinterface.lua View File

@@ -123,7 +123,6 @@ function terminate()
123 123
 
124 124
   disconnect(gameLeftPanel, { onVisibilityChange = onLeftPanelVisibilityChange })
125 125
 
126
-  logoutButton:destroy()
127 126
   gameRootPanel:destroy()
128 127
 end
129 128
 

+ 0
- 1
modules/game_inventory/inventory.lua View File

@@ -39,7 +39,6 @@ function terminate()
39 39
   g_keyboard.unbindKeyDown('Ctrl+I')
40 40
 
41 41
   inventoryWindow:destroy()
42
-  inventoryButton:destroy()
43 42
 end
44 43
 
45 44
 function refresh()

+ 0
- 1
modules/game_minimap/minimap.lua View File

@@ -48,7 +48,6 @@ function terminate()
48 48
   g_keyboard.unbindKeyPress('Alt+Down', gameRootPanel)
49 49
   g_keyboard.unbindKeyDown('Ctrl+M')
50 50
 
51
-  minimapButton:destroy()
52 51
   minimapWindow:destroy()
53 52
 end
54 53
 

+ 0
- 3
modules/game_questlog/questlog.lua View File

@@ -17,9 +17,6 @@ function terminate()
17 17
                        onQuestLine = onGameQuestLine,
18 18
                        onGameEnd = destroyWindows})
19 19
 
20
-  if questLogButton then
21
-    questLogButton:destroy()
22
-  end
23 20
   destroyWindows()
24 21
 end
25 22
 

+ 0
- 1
modules/game_skills/skills.lua View File

@@ -60,7 +60,6 @@ function terminate()
60 60
   })
61 61
 
62 62
   g_keyboard.unbindKeyDown('Ctrl+S')
63
-  skillsButton:destroy()
64 63
   skillsWindow:destroy()
65 64
 end
66 65
 

+ 0
- 2
modules/game_spelllist/spelllist.lua View File

@@ -172,8 +172,6 @@ function terminate()
172 172
                           updateSpellInformation(focusedChild)
173 173
                         end })   
174 174
 
175
-  spelllistButton:destroy()
176
-  spelllistButton       = nil
177 175
   spelllistWindow:destroy()
178 176
   spelllistWindow       = nil
179 177
   

Loading…
Cancel
Save