mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 22:23:28 +02:00
Added keypad, fixed one crash bug and few more features for mobile version
This commit is contained in:
@@ -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()
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user