Browse Source

Fix #283 and more:

* Might have fixed death window issue but not confirmed
* Stop hotkey window from display while offline
* Moved some required features to >= 840 if statement
  (protocol 840/842 arent supported in otclient yet)
BeniS 8 years ago
parent
commit
0bf909d52f

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

@@ -122,10 +122,6 @@ function EnterGame.init()
122 122
 
123 123
   protocolBox = enterGame:getChildById('protocolComboBox')
124 124
   protocolBox.onOptionChange = onChangeProtocol
125
-  for _i, proto in pairs(g_game.getSupportedProtocols()) do
126
-    protocolBox:addOption(proto)
127
-  end
128
-
129 125
   if protocolVersion then
130 126
     protocolBox:setCurrentOption(protocolVersion)
131 127
   end

+ 5
- 0
modules/client_entergame/entergame.otui View File

@@ -57,6 +57,7 @@ EnterGameWindow
57 57
 
58 58
   ServerListButton
59 59
     id: serverListButton
60
+    !tooltip: tr('Server list')
60 61
     anchors.right: parent.right
61 62
     anchors.top: serverLabel.bottom
62 63
     margin-top: 3
@@ -88,6 +89,10 @@ EnterGameWindow
88 89
     margin-top: 2
89 90
     margin-right: 3
90 91
     width: 90
92
+    @onSetup: |
93
+      for _, proto in pairs(g_game.getSupportedProtocols()) do
94
+        self:addOption(proto)
95
+      end
91 96
 
92 97
   MenuLabel
93 98
     id: portLabel

+ 4
- 5
modules/client_serverlist/addserver.otui View File

@@ -4,8 +4,7 @@ MainWindow
4 4
   size: 180 180
5 5
   visible: false
6 6
   @onEscape: AddServer.hide()
7
-  @onEnter: |
8
-    AddServer.add()
7
+  @onEnter: AddServer.add()
9 8
 
10 9
   Label
11 10
     id: hostLabel
@@ -60,9 +59,8 @@ MainWindow
60 59
     width: 64
61 60
     anchors.right: parent.horizontalCenter
62 61
     anchors.bottom: parent.bottom
63
-    margin-right: 5
64
-    @onClick: |
65
-      AddServer.add()
62
+    margin-right: 2
63
+    @onClick: AddServer.add()
66 64
 
67 65
   Button
68 66
     id: buttonCancel
@@ -70,4 +68,5 @@ MainWindow
70 68
     width: 64
71 69
     anchors.left: parent.horizontalCenter
72 70
     anchors.bottom: parent.bottom
71
+    margin-left: 2
73 72
     @onClick: AddServer.hide()

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

@@ -109,6 +109,9 @@ function offline()
109 109
 end
110 110
 
111 111
 function show()
112
+  if not g_game.isOnline() then
113
+    return
114
+  end
112 115
   hotkeysWindow:show()
113 116
   hotkeysWindow:raise()
114 117
   hotkeysWindow:focus()
@@ -190,7 +193,6 @@ function save()
190 193
   local hotkeys = hotkeySettings
191 194
 
192 195
   if perServer then
193
-    hotkeys[G.host] = {}
194 196
     hotkeys = hotkeys[G.host]
195 197
   end
196 198
 
@@ -210,6 +212,8 @@ function save()
210 212
     }
211 213
   end
212 214
 
215
+  table.dump(hotkeys)
216
+
213 217
   hotkeyList = hotkeys
214 218
   g_settings.setNode('game_hotkeys', hotkeySettings)
215 219
   g_settings.save()

+ 4
- 1
modules/game_playerdeath/playerdeath.lua View File

@@ -33,7 +33,10 @@ function displayDeadMessage()
33 33
 end
34 34
 
35 35
 function openWindow()
36
-  if deathWindow then return end
36
+  if deathWindow then
37
+    deathWindow:destroy()
38
+    return
39
+  end
37 40
   deathWindow = g_ui.createWidget('DeathWindow', rootWidget)
38 41
   local okButton = deathWindow:getChildById('buttonOk')
39 42
   local cancelButton = deathWindow:getChildById('buttonCancel')

+ 6
- 3
src/client/game.cpp View File

@@ -1380,14 +1380,17 @@ void Game::setProtocolVersion(int version)
1380 1380
     m_features.reset();
1381 1381
     enableFeature(Otc::GameFormatCreatureName);
1382 1382
 
1383
+    if(version >= 840) {
1384
+        enableFeature(Otc::GameProtocolChecksum);
1385
+        enableFeature(Otc::GameChallengeOnLogin);
1386
+        enableFeature(Otc::GameAccountNames);
1387
+    }
1388
+
1383 1389
     if(version <= 854) {
1384 1390
         enableFeature(Otc::GameChargeableItems);
1385 1391
     }
1386 1392
 
1387 1393
     if(version >= 854) {
1388
-        enableFeature(Otc::GameProtocolChecksum);
1389
-        enableFeature(Otc::GameAccountNames);
1390
-        enableFeature(Otc::GameChallengeOnLogin);
1391 1394
         enableFeature(Otc::GameDoubleFreeCapacity);
1392 1395
         enableFeature(Otc::GameCreatureEmblems);
1393 1396
     }

Loading…
Cancel
Save