Added keypad, fixed one crash bug and few more features for mobile version

This commit is contained in:
OTCv8
2020-06-12 17:58:54 +02:00
parent 8391355c42
commit 82018bf3c9
23 changed files with 294 additions and 36 deletions

View File

@@ -126,7 +126,11 @@ end
function getSortType()
local settings = g_settings.getNode('BattleList')
if not settings then
return 'name'
if g_app.isMobile() then
return 'distance'
else
return 'name'
end
end
return settings['sortType']
end
@@ -219,7 +223,7 @@ function updateBattleList()
end
function checkCreatures()
if not g_game.isOnline() then
if not battlePanel or not g_game.isOnline() then
return
end
@@ -257,11 +261,17 @@ function checkCreatures()
local battleButton = battleButtons[i]
battleButton:creatureSetup(creature)
battleButton:show()
battleButton:setOn(true)
end
if g_app.isMobile() and #creatures > 0 then
onBattleButtonHoverChange(battleButtons[1], true)
end
for i=#creatures + 1,maxCreatures do
if battleButtons[i]:isHidden() then break end
battleButtons[i]:hide()
battleButton:setOn(false)
end
battlePanel:getLayout():enableUpdates()

View File

@@ -66,11 +66,13 @@ MiniWindow
BattlePlayers
id: hidePlayers
!tooltip: tr('Hide players')
@onSetup: if g_app.isMobile() then self:setChecked(true) end
@onCheckChange: modules.game_battle.checkCreatures()
BattleNPCs
id: hideNPCs
!tooltip: tr('Hide Npcs')
@onSetup: if g_app.isMobile() then self:setChecked(true) end
@onCheckChange: modules.game_battle.checkCreatures()
BattleMonsters
@@ -86,6 +88,7 @@ MiniWindow
BattleParty
id: hideParty
!tooltip: tr('Hide party members')
@onSetup: if g_app.isMobile() then self:setChecked(true) end
@onCheckChange: modules.game_battle.checkCreatures()
Panel