Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions modules/client_options/data_options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,18 @@ return {
modules.game_interface.getRightExtraPanel():setOn(value)
end
},
showActionbar = {
value = false,
action = function(value, options, controller, panels, extraWidgets)
modules.game_actionbar.setActionBarVisible(value)
end
},
showSpellGroupCooldowns = {
value = true,
action = function(value, options, controller, panels, extraWidgets)
modules.game_cooldown.setSpellGroupCooldownsVisible(value)
end
},
dontStretchShrink = {
value = false,
action = function(value, options, controller, panels, extraWidgets)
Expand Down
22 changes: 22 additions & 0 deletions modules/client_options/general.otui
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,28 @@ Panel
id: showRightExtraPanel
!text: tr('Show an extra right panel')

SmallReversedQtPanel
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 7
height: 22

OptionCheckBox
id: showActionbar
!text: tr('Show action bar')

SmallReversedQtPanel
anchors.left: parent.left
anchors.right: parent.right
anchors.top: prev.bottom
margin-top: 7
height: 22

OptionCheckBox
id: showSpellGroupCooldowns
!text: tr('Show spell group cooldowns')

SmallReversedQtPanel
anchors.left: parent.left
anchors.right: parent.right
Expand Down
10 changes: 10 additions & 0 deletions modules/game_actionbar/game_actionbar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,16 @@ function loadActionBar()
setupHotkeys()
end

function setActionBarVisible(visible)
if visible then
actionBar:setHeight(34)
actionBar:show()
else
actionBar:setHeight(0)
actionBar:hide()
end
end

function round(n)
return n % 1 >= 0.5 and math.ceil(n) or math.floor(n)
end
Expand Down
41 changes: 25 additions & 16 deletions modules/game_cooldown/cooldown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ function init()
cooldownButton = modules.game_mainpanel.addToggleButton('cooldownButton', tr('Cooldowns'),
'/images/options/cooldowns', toggle, false, 5)

cooldownButton:setOn(true)
if modules.client_options.getOption('showSpellGroupCooldowns') then
cooldownButton:setOn(true)
modules.client_options.setOption('showSpellGroupCooldowns', true)
else
cooldownButton:setOn(false)
modules.client_options.setOption('showSpellGroupCooldowns', false)
end

cooldownButton:hide()

Expand Down Expand Up @@ -100,43 +106,34 @@ end

function onMiniWindowOpen()
cooldownButton:setOn(true)
modules.client_options.setOption('showSpellGroupCooldowns', true)
end

function onMiniWindowClose()
cooldownButton:setOn(false)
modules.client_options.setOption('showSpellGroupCooldowns', false)
end

function toggle()
local console = modules.game_console.consolePanel
if cooldownButton:isOn() then
cooldownWindow:hide()
modules.client_options.setOption('showSpellGroupCooldowns', false)
cooldownButton:setOn(false)

if console then
console:addAnchor(AnchorTop, modules.game_actionbar.getPanelActionbar():getId(), AnchorBottom)
end
else
cooldownWindow:show()
modules.client_options.setOption('showSpellGroupCooldowns', true)
cooldownButton:setOn(true)

if console then
console:addAnchor(AnchorTop, cooldownWindow:getId(), AnchorBottom)
end

end
end

function online()

if g_game.getFeature(GameSpellList) then

cooldownButton:show()
cooldownButton:setOn(true)
modules.client_options.setOption('showSpellGroupCooldowns', true)
else

cooldownButton:hide()
cooldownButton:setOn(false)
cooldownWindow:hide()
modules.client_options.setOption('showSpellGroupCooldowns', false)
end

if not lastPlayer or lastPlayer ~= g_game.getCharacterName() then
Expand Down Expand Up @@ -275,3 +272,15 @@ function onSpellGroupCooldown(groupId, duration)
groupCooldown[groupId] = true
end
end

function setSpellGroupCooldownsVisible(visible)
if visible then
cooldownWindow:setHeight(30)
cooldownWindow:show()
else
cooldownWindow:hide()
cooldownWindow:setHeight(10)
end

cooldownButton:setOn(visible)
end