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)
This commit is contained in:
BeniS 2013-02-28 01:01:51 +13:00
parent ef20f59a98
commit 0bf909d52f
6 changed files with 24 additions and 14 deletions

View File

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

View File

@ -57,6 +57,7 @@ EnterGameWindow
ServerListButton ServerListButton
id: serverListButton id: serverListButton
!tooltip: tr('Server list')
anchors.right: parent.right anchors.right: parent.right
anchors.top: serverLabel.bottom anchors.top: serverLabel.bottom
margin-top: 3 margin-top: 3
@ -88,6 +89,10 @@ EnterGameWindow
margin-top: 2 margin-top: 2
margin-right: 3 margin-right: 3
width: 90 width: 90
@onSetup: |
for _, proto in pairs(g_game.getSupportedProtocols()) do
self:addOption(proto)
end
MenuLabel MenuLabel
id: portLabel id: portLabel

View File

@ -4,8 +4,7 @@ MainWindow
size: 180 180 size: 180 180
visible: false visible: false
@onEscape: AddServer.hide() @onEscape: AddServer.hide()
@onEnter: | @onEnter: AddServer.add()
AddServer.add()
Label Label
id: hostLabel id: hostLabel
@ -60,9 +59,8 @@ MainWindow
width: 64 width: 64
anchors.right: parent.horizontalCenter anchors.right: parent.horizontalCenter
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
margin-right: 5 margin-right: 2
@onClick: | @onClick: AddServer.add()
AddServer.add()
Button Button
id: buttonCancel id: buttonCancel
@ -70,4 +68,5 @@ MainWindow
width: 64 width: 64
anchors.left: parent.horizontalCenter anchors.left: parent.horizontalCenter
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
margin-left: 2
@onClick: AddServer.hide() @onClick: AddServer.hide()

View File

@ -109,6 +109,9 @@ function offline()
end end
function show() function show()
if not g_game.isOnline() then
return
end
hotkeysWindow:show() hotkeysWindow:show()
hotkeysWindow:raise() hotkeysWindow:raise()
hotkeysWindow:focus() hotkeysWindow:focus()
@ -190,7 +193,6 @@ function save()
local hotkeys = hotkeySettings local hotkeys = hotkeySettings
if perServer then if perServer then
hotkeys[G.host] = {}
hotkeys = hotkeys[G.host] hotkeys = hotkeys[G.host]
end end
@ -210,6 +212,8 @@ function save()
} }
end end
table.dump(hotkeys)
hotkeyList = hotkeys hotkeyList = hotkeys
g_settings.setNode('game_hotkeys', hotkeySettings) g_settings.setNode('game_hotkeys', hotkeySettings)
g_settings.save() g_settings.save()

View File

@ -33,7 +33,10 @@ function displayDeadMessage()
end end
function openWindow() function openWindow()
if deathWindow then return end if deathWindow then
deathWindow:destroy()
return
end
deathWindow = g_ui.createWidget('DeathWindow', rootWidget) deathWindow = g_ui.createWidget('DeathWindow', rootWidget)
local okButton = deathWindow:getChildById('buttonOk') local okButton = deathWindow:getChildById('buttonOk')
local cancelButton = deathWindow:getChildById('buttonCancel') local cancelButton = deathWindow:getChildById('buttonCancel')

View File

@ -1380,14 +1380,17 @@ void Game::setProtocolVersion(int version)
m_features.reset(); m_features.reset();
enableFeature(Otc::GameFormatCreatureName); enableFeature(Otc::GameFormatCreatureName);
if(version >= 840) {
enableFeature(Otc::GameProtocolChecksum);
enableFeature(Otc::GameChallengeOnLogin);
enableFeature(Otc::GameAccountNames);
}
if(version <= 854) { if(version <= 854) {
enableFeature(Otc::GameChargeableItems); enableFeature(Otc::GameChargeableItems);
} }
if(version >= 854) { if(version >= 854) {
enableFeature(Otc::GameProtocolChecksum);
enableFeature(Otc::GameAccountNames);
enableFeature(Otc::GameChallengeOnLogin);
enableFeature(Otc::GameDoubleFreeCapacity); enableFeature(Otc::GameDoubleFreeCapacity);
enableFeature(Otc::GameCreatureEmblems); enableFeature(Otc::GameCreatureEmblems);
} }