Merge pull request #909 from diath/player_mana_bar

Add player mana bar
This commit is contained in:
Eduardo Bart
2017-11-16 22:47:54 -02:00
committed by GitHub
8 changed files with 49 additions and 4 deletions

View File

@@ -34,6 +34,10 @@ Panel
id: displayHealth
!text: tr('Display creature health bars')
OptionCheckBox
id: displayMana
!text: tr('Display player mana bar')
OptionCheckBox
id: displayText
!text: tr('Display text messages')

View File

@@ -25,6 +25,7 @@ local defaultOptions = {
ambientLight = 25,
displayNames = true,
displayHealth = true,
displayMana = true,
displayText = true,
dontStretchShrink = false,
turnDelay = 50,
@@ -157,15 +158,17 @@ function hide()
end
function toggleDisplays()
if options['displayNames'] and options['displayHealth'] then
if options['displayNames'] and options['displayHealth'] and options['displayMana'] then
setOption('displayNames', false)
elseif options['displayHealth'] then
setOption('displayHealth', false)
setOption('displayMana', false)
else
if not options['displayNames'] and not options['displayHealth'] then
setOption('displayNames', true)
else
setOption('displayHealth', true)
setOption('displayMana', true)
end
end
end
@@ -224,6 +227,8 @@ function setOption(key, value, force)
gameMapPanel:setDrawNames(value)
elseif key == 'displayHealth' then
gameMapPanel:setDrawHealthBars(value)
elseif key == 'displayMana' then
gameMapPanel:setDrawManaBar(value)
elseif key == 'displayText' then
gameMapPanel:setDrawTexts(value)
elseif key == 'dontStretchShrink' then