diff --git a/game/engines/default/modules/boot/dialogs/Credits.lua b/game/engines/default/modules/boot/dialogs/Credits.lua index 6861b57f3edd4c1ece4a3024a4fc72cf5a85ab04..4d2382ef198efd590ba75de4a14c12c0043d3c04 100644 --- a/game/engines/default/modules/boot/dialogs/Credits.lua +++ b/game/engines/default/modules/boot/dialogs/Credits.lua @@ -160,7 +160,7 @@ local credits = { {"lpeg - http://www.inf.puc-rio.br/~roberto/lpeg/"}, {"LuaSocket - http://w3.impa.br/~diego/software/luasocket/"}, {"Physfs - https://icculus.org/physfs/"}, - {"Awesomium - http://awesomium.com/"}, + {"CEF3 - http://code.google.com/p/chromiumembedded/"}, {"Font: Droid - http://www.droidfonts.com/"}, {"Font: Vera - http://www.gnome.org/fonts/"}, {"Font: INSULA, USENET: http://www.dafont.com/fr/apostrophic-labs.d128"}, diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua index 87bee9e9048eb2412f93e37101f4d72c2ee48546..eca2e210065f453e53f40d75a4b5f24e1b2a3b79 100644 --- a/game/modules/tome/class/Game.lua +++ b/game/modules/tome/class/Game.lua @@ -223,7 +223,11 @@ function _M:newGame() self:updateCurrentChar() end - self.always_target = true + if not config.settings.tome.tactical_mode_set then + self.always_target = true + else + self.always_target = config.settings.tome.tactical_mode + end local nb_unlocks, max_unlocks = self:countBirthUnlocks() self.creating_player = true local birth; birth = Birther.new("Character Creation ("..nb_unlocks.."/"..max_unlocks.." unlocked birth options)", self.player, {"base", "world", "difficulty", "permadeath", "race", "subrace", "sex", "class", "subclass" }, function(loaded) @@ -271,6 +275,7 @@ function _M:newGame() birth_done() self.player:check("on_birth_done") + self:setTacticalMode(self.always_target) if __module_extra_info.birth_done_script then loadstring(__module_extra_info.birth_done_script)() end end, true) @@ -280,7 +285,6 @@ function _M:newGame() if self.player.no_birth_levelup or __module_extra_info.no_birth_popup then birthend() else self.player:playerLevelup(birthend, true) end - -- Player was loaded from a premade else self.calendar = Calendar.new("/data/calendar_"..(self.player.calendar or "allied")..".lua", "Today is the %s %s of the %s year of the Age of Ascendancy of Maj'Eyal.\nThe time is %02d:%02d.", 122, 167, 11) @@ -311,6 +315,7 @@ function _M:newGame() birth_done() self.player:check("on_birth_done") + self:setTacticalMode(self.always_target) end end, quickbirth, 800, 600) self:registerDialog(birth) @@ -1504,6 +1509,38 @@ function _M:onUnregisterDialog(d) if self.player then self.player:updateMainShader() self.player.changed = true end end +function _M:setTacticalMode(mode, silent) + local vs = "true" + if mode == "old" then + self.always_target = "old" + vs = "'old'" + Map:setViewerFaction(self.player.faction) + if not silent then self.log("Showing big healthbars and tactical borders.") end + elseif mode == "health" then + self.always_target = "health" + vs = "'health'" + Map:setViewerFaction(nil) + if not silent then self.log("Showing healthbars only.") end + elseif mode == nil then + self.always_target = nil + vs = "nil" + Map:setViewerFaction(nil) + if not silent then self.log("Showing no tactical information.") end + elseif mode == true then + self.always_target = true + vs = "true" + Map:setViewerFaction(self.player.faction) + if not silent then self.log("Showing small healthbars and tactical borders.") end + end + + config.settings.tome.tactical_mode = self.always_target + config.settings.tome.tactical_mode_set = true + game:saveSettings("tome.tactical_mode", ([[ +tome.tactical_mode = %s +tome.tactical_mode_set = true +]]):format(vs)) +end + function _M:setupCommands() -- Make targeting work self.normal_key = self.key @@ -1840,21 +1877,13 @@ do return end TACTICAL_DISPLAY = function() if self.always_target == true then - self.always_target = "old" - Map:setViewerFaction(self.player.faction) - self.log("Showing big healthbars and tactical borders.") + self:setTacticalMode("old") elseif self.always_target == "old" then - self.always_target = "health" - Map:setViewerFaction(nil) - self.log("Showing healthbars only.") + self:setTacticalMode("health") elseif self.always_target == "health" then - self.always_target = nil - Map:setViewerFaction(nil) - self.log("Showing no tactical information.") + self:setTacticalMode(nil) elseif self.always_target == nil then - self.always_target = true - Map:setViewerFaction(self.player.faction) - self.log("Showing small healthbars and tactical borders.") + self:setTacticalMode(true) end end, diff --git a/game/modules/tome/dialogs/GameOptions.lua b/game/modules/tome/dialogs/GameOptions.lua index dae63742cb0a59a9c897e53c442b66f14c834b82..7adb264a0b97c05c11be412d270d1e58b803bc47 100644 --- a/game/modules/tome/dialogs/GameOptions.lua +++ b/game/modules/tome/dialogs/GameOptions.lua @@ -265,6 +265,36 @@ function _M:generateListUi() self.c_list:drawItem(item) end,} + local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString[[Toggles between various tactical information display: +- Combined healthbar and small tactical frame +- Combined healthbar and big tactical frame +- Only healthbar +- No tactical information at all + +#{italic}#You can also change this directly ingame by pressing shift+T.#{normal}##WHITE#]]} + list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Tactical overlay.#WHITE##{normal}#", status=function(item) + local vs = "Combined Small" + if game.always_target == "old" then + local vs = "Combined Big" + elseif game.always_target == "health" then + local vs = "Only Healthbars" + elseif game.always_target == nil then + local vs = "Nothing" + elseif game.always_target == true then + local vs = "Combined Small" + end + return vs + end, fct=function(item) + Dialog:listPopup("Tactical overlay", "Select overlay mode", { + {name="Combined Small", mode=true}, + {name="Combined Big", mode="old"}, + {name="Only Healthbars", mode="health"}, + {name="Nothing", mode=nil}, + }, 300, 200, function(sel) + if not sel then return end + game:setTacticalMode(sel.mode) + end) + end,} local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Toggles between a bottom or side display for tactial healthbars.#WHITE#"} list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Healthbars position.#WHITE##{normal}#", status=function(item)