mirror of
https://github.com/edubart/otclient.git
synced 2025-10-14 11:34:54 +02:00
Tweak modules interface
Minimize miniwindows space usage Implement easier minimap navigation Redesign inventory, minimap and healthinfo layout
This commit is contained in:
@@ -44,6 +44,7 @@ function CombatControls.init()
|
||||
combatControlsButton = TopMenu.addRightGameToggleButton('combatControlsButton', tr('Combat Controls'), 'combatcontrols.png', CombatControls.toggle)
|
||||
combatControlsButton:setOn(true)
|
||||
combatControlsWindow = g_ui.loadUI('combatcontrols.otui', GameInterface.getRightPanel())
|
||||
combatControlsWindow:disableResize()
|
||||
|
||||
fightOffensiveBox = combatControlsWindow:recursiveGetChildById('fightOffensiveBox')
|
||||
fightBalancedBox = combatControlsWindow:recursiveGetChildById('fightBalancedBox')
|
||||
@@ -134,9 +135,9 @@ function CombatControls.online()
|
||||
local player = g_game.getLocalPlayer()
|
||||
if(player) then
|
||||
local char = player:getName()
|
||||
|
||||
|
||||
local lastCombatControls = g_settings.getNode('LastCombatControls')
|
||||
|
||||
|
||||
if(not table.empty(lastCombatControls)) then
|
||||
if(lastCombatControls[char]) then
|
||||
g_game.setFightMode(lastCombatControls[char].fightMode)
|
||||
@@ -145,7 +146,7 @@ function CombatControls.online()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
combatControlsWindow:setVisible(combatControlsButton:isOn())
|
||||
CombatControls.update()
|
||||
end
|
||||
@@ -155,16 +156,16 @@ function CombatControls.offline()
|
||||
if(not lastCombatControls) then
|
||||
lastCombatControls = {}
|
||||
end
|
||||
|
||||
|
||||
local player = g_game.getLocalPlayer()
|
||||
if(player) then
|
||||
local char = player:getName()
|
||||
local char = player:getName()
|
||||
lastCombatControls[char] = {
|
||||
fightMode = g_game.getFightMode(),
|
||||
chaseMode = g_game.getChaseMode(),
|
||||
safeFight = g_game.isSafeFight()
|
||||
}
|
||||
|
||||
|
||||
-- save last combat control settings
|
||||
g_settings.setNode('LastCombatControls', lastCombatControls)
|
||||
end
|
||||
|
@@ -2,8 +2,11 @@ CombatBox < UICheckBox
|
||||
size: 20 20
|
||||
image-clip: 0 0 20 20
|
||||
anchors.top: parent.top
|
||||
margin-left: 5
|
||||
margin-right: 5
|
||||
margin: 0 4
|
||||
$first:
|
||||
margin: 0 1
|
||||
$last:
|
||||
margin: 0 1
|
||||
|
||||
$checked:
|
||||
image-clip: 0 20 20 20
|
||||
@@ -23,27 +26,28 @@ MiniWindow
|
||||
id: combatControlsWindow
|
||||
!text: tr('Combat Controls')
|
||||
icon: combatcontrols.png
|
||||
height: 64
|
||||
height: 48
|
||||
@onClose: CombatControls.onMiniWindowClose()
|
||||
&save: true
|
||||
|
||||
MiniWindowContents
|
||||
FightOffensiveBox
|
||||
id: fightOffensiveBox
|
||||
anchors.right: next.left
|
||||
anchors.top: next.top
|
||||
anchors.left: parent.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FightBalancedBox
|
||||
id: fightBalancedBox
|
||||
anchors.right: next.left
|
||||
anchors.top: next.top
|
||||
anchors.left: prev.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
FightDefensiveBox
|
||||
id: fightDefensiveBox
|
||||
anchors.centerIn: parent
|
||||
anchors.left: prev.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
ChaseModeBox
|
||||
id: chaseModeBox
|
||||
anchors.left: prev.right
|
||||
anchors.top: prev.top
|
||||
anchors.right: next.left
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
SafeFightBox
|
||||
id: safeFightBox
|
||||
anchors.left: prev.right
|
||||
anchors.top: prev.top
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
Reference in New Issue
Block a user