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:
parent
ef20f59a98
commit
0bf909d52f
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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')
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue