diff --git a/modules/client_entergame/entergame.lua b/modules/client_entergame/entergame.lua index fced9c85..5c572a51 100644 --- a/modules/client_entergame/entergame.lua +++ b/modules/client_entergame/entergame.lua @@ -122,10 +122,6 @@ function EnterGame.init() protocolBox = enterGame:getChildById('protocolComboBox') protocolBox.onOptionChange = onChangeProtocol - for _i, proto in pairs(g_game.getSupportedProtocols()) do - protocolBox:addOption(proto) - end - if protocolVersion then protocolBox:setCurrentOption(protocolVersion) end diff --git a/modules/client_entergame/entergame.otui b/modules/client_entergame/entergame.otui index b026c430..39213c98 100644 --- a/modules/client_entergame/entergame.otui +++ b/modules/client_entergame/entergame.otui @@ -57,6 +57,7 @@ EnterGameWindow ServerListButton id: serverListButton + !tooltip: tr('Server list') anchors.right: parent.right anchors.top: serverLabel.bottom margin-top: 3 @@ -88,6 +89,10 @@ EnterGameWindow margin-top: 2 margin-right: 3 width: 90 + @onSetup: | + for _, proto in pairs(g_game.getSupportedProtocols()) do + self:addOption(proto) + end MenuLabel id: portLabel diff --git a/modules/client_serverlist/addserver.otui b/modules/client_serverlist/addserver.otui index c3f2ed0f..3fd3b07d 100644 --- a/modules/client_serverlist/addserver.otui +++ b/modules/client_serverlist/addserver.otui @@ -4,8 +4,7 @@ MainWindow size: 180 180 visible: false @onEscape: AddServer.hide() - @onEnter: | - AddServer.add() + @onEnter: AddServer.add() Label id: hostLabel @@ -60,9 +59,8 @@ MainWindow width: 64 anchors.right: parent.horizontalCenter anchors.bottom: parent.bottom - margin-right: 5 - @onClick: | - AddServer.add() + margin-right: 2 + @onClick: AddServer.add() Button id: buttonCancel @@ -70,4 +68,5 @@ MainWindow width: 64 anchors.left: parent.horizontalCenter anchors.bottom: parent.bottom + margin-left: 2 @onClick: AddServer.hide() diff --git a/modules/game_hotkeys/hotkeys_manager.lua b/modules/game_hotkeys/hotkeys_manager.lua index 13c4a6ec..d6289150 100644 --- a/modules/game_hotkeys/hotkeys_manager.lua +++ b/modules/game_hotkeys/hotkeys_manager.lua @@ -109,6 +109,9 @@ function offline() end function show() + if not g_game.isOnline() then + return + end hotkeysWindow:show() hotkeysWindow:raise() hotkeysWindow:focus() @@ -190,7 +193,6 @@ function save() local hotkeys = hotkeySettings if perServer then - hotkeys[G.host] = {} hotkeys = hotkeys[G.host] end @@ -210,6 +212,8 @@ function save() } end + table.dump(hotkeys) + hotkeyList = hotkeys g_settings.setNode('game_hotkeys', hotkeySettings) g_settings.save() diff --git a/modules/game_playerdeath/playerdeath.lua b/modules/game_playerdeath/playerdeath.lua index 34ed40e6..361076af 100644 --- a/modules/game_playerdeath/playerdeath.lua +++ b/modules/game_playerdeath/playerdeath.lua @@ -33,7 +33,10 @@ function displayDeadMessage() end function openWindow() - if deathWindow then return end + if deathWindow then + deathWindow:destroy() + return + end deathWindow = g_ui.createWidget('DeathWindow', rootWidget) local okButton = deathWindow:getChildById('buttonOk') local cancelButton = deathWindow:getChildById('buttonCancel') diff --git a/src/client/game.cpp b/src/client/game.cpp index f3cef166..097a0754 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -1380,14 +1380,17 @@ void Game::setProtocolVersion(int version) m_features.reset(); enableFeature(Otc::GameFormatCreatureName); + if(version >= 840) { + enableFeature(Otc::GameProtocolChecksum); + enableFeature(Otc::GameChallengeOnLogin); + enableFeature(Otc::GameAccountNames); + } + if(version <= 854) { enableFeature(Otc::GameChargeableItems); } if(version >= 854) { - enableFeature(Otc::GameProtocolChecksum); - enableFeature(Otc::GameAccountNames); - enableFeature(Otc::GameChallengeOnLogin); enableFeature(Otc::GameDoubleFreeCapacity); enableFeature(Otc::GameCreatureEmblems); }