From 38d3c781e09ac50d10e1a9d8d133524dbca09575 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Sun, 20 Nov 2011 22:53:18 +0000 Subject: [PATCH] option to display status effects as text git-svn-id: http://svn.net-core.org/repos/t-engine4@4654 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/modules/tome/class/PlayerDisplay.lua | 8 ++++---- game/modules/tome/data/timed_effects/physical.lua | 2 +- game/modules/tome/dialogs/GameOptions.lua | 10 ++++++++++ game/modules/tome/load.lua | 1 + 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/game/modules/tome/class/PlayerDisplay.lua b/game/modules/tome/class/PlayerDisplay.lua index d04a414a10..854afe7f66 100644 --- a/game/modules/tome/class/PlayerDisplay.lua +++ b/game/modules/tome/class/PlayerDisplay.lua @@ -173,7 +173,7 @@ function _M:handleEffect(eff_id, e, p, ex, h) desc = ("#{bold}##GOLD#%s\n(%s: %s)#WHITE##{normal}#\n"):format(name, e.type, eff_subtype)..e.long_desc(player, p) end - if config.settings.tome.hotkey_icons and e.display_entity then + if config.settings.tome.effects_icons and e.display_entity then local txt = nil if e.decrease > 0 then dur = tostring(dur) @@ -398,7 +398,7 @@ function _M:display() if t.getDisplayName then displayName = t.getDisplayName(player, t, player:isTalentActive(tid)) end local desc = "#GOLD##{bold}#"..displayName.."#{normal}##WHITE#\n"..tostring(player:getTalentFullDescription(t)) - if config.settings.tome.hotkey_icons and t.display_entity then + if config.settings.tome.effects_icons and t.display_entity then self:makeEntityIcon(t.display_entity, game.hotkeys_display_icons.tiles, ex, h, desc, txt, self.icon_yellow) ex = ex + 40 if ex + 40 >= self.w then ex = 0 h = h + 40 end @@ -408,7 +408,7 @@ function _M:display() end end end - h = h + 40 ex = 0 + if config.settings.tome.effects_icons then h = h + 40 ex = 0 end local good_e, bad_e = {}, {} for eff_id, p in pairs(player.tmp) do local e = player.tempeffect_def[eff_id] @@ -419,7 +419,7 @@ function _M:display() local e = player.tempeffect_def[eff_id] ex, h = self:handleEffect(eff_id, e, p, ex, h) end - h = h + 40 ex = 0 + if config.settings.tome.effects_icons then h = h + 40 ex = 0 end for eff_id, p in pairs(bad_e) do local e = player.tempeffect_def[eff_id] ex, h = self:handleEffect(eff_id, e, p, ex, h) diff --git a/game/modules/tome/data/timed_effects/physical.lua b/game/modules/tome/data/timed_effects/physical.lua index c52ddb1df5..395d79e6be 100644 --- a/game/modules/tome/data/timed_effects/physical.lua +++ b/game/modules/tome/data/timed_effects/physical.lua @@ -92,7 +92,7 @@ newEffect{ desc = "Poisoned", long_desc = function(self, eff) return ("The target is poisoned, taking %0.2f nature damage per turn."):format(eff.power) end, type = "physical", - subtype = { poison=true, nature=true }, + subtype = { poison=true, nature=true }, no_ct_effect = true, status = "detrimental", parameters = { power=10 }, on_gain = function(self, err) return "#Target# is poisoned!", "+Poison" end, diff --git a/game/modules/tome/dialogs/GameOptions.lua b/game/modules/tome/dialogs/GameOptions.lua index 66c3d275e8..216e453880 100644 --- a/game/modules/tome/dialogs/GameOptions.lua +++ b/game/modules/tome/dialogs/GameOptions.lua @@ -214,6 +214,16 @@ function _M:generateList() })) end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Uses the icons for status effects instead of text.#WHITE#"} + list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Icons status effects#WHITE##{normal}#", status=function(item) + return tostring(config.settings.tome.effects_icons and "enabled" or "disabled") + end, fct=function(item) + config.settings.tome.effects_icons = not config.settings.tome.effects_icons + game:saveSettings("tome.effects_icons", ("tome.effects_icons = %s\n"):format(tostring(config.settings.tome.effects_icons))) + game.player.changed = true + self.c_list:drawItem(item) + end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Uses the icons hotkeys toolbar or the textual one.#WHITE#"} list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Icons hotkey toolbar#WHITE##{normal}#", status=function(item) return tostring(config.settings.tome.hotkey_icons and "enabled" or "disabled") diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua index 20183caa2d..56d3360e18 100644 --- a/game/modules/tome/load.lua +++ b/game/modules/tome/load.lua @@ -64,6 +64,7 @@ if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome if type(config.settings.tome.smooth_fov) == "nil" then config.settings.tome.smooth_fov = true end if type(config.settings.tome.daynight) == "nil" then config.settings.tome.daynight = true end if type(config.settings.tome.hotkey_icons) == "nil" then config.settings.tome.hotkey_icons = true end +if type(config.settings.tome.effects_icons) == "nil" then config.settings.tome.effects_icons = true end if type(config.settings.tome.autoassign_talents_on_birth) == "nil" then config.settings.tome.autoassign_talents_on_birth = true end if type(config.settings.tome.chat_log) == "nil" then config.settings.tome.chat_log = true end if type(config.settings.tome.actor_based_movement_mode) == "nil" then config.settings.tome.actor_based_movement_mode = true end -- GitLab