Add player mana bar

This commit is contained in:
Kamil Chojnowski
2017-11-07 07:23:25 +01:00
parent 2095951e07
commit 93f51fe127
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
}
@@ -155,15 +156,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
@@ -222,6 +225,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