diff --git a/game/engines/default/engine/ui/Textzone.lua b/game/engines/default/engine/ui/Textzone.lua index 77ddc6bcc9cacf260cc73cbee4f7a7c969559614..ac13e434b9d21547aefb4e74b025fba313ca016d 100644 --- a/game/engines/default/engine/ui/Textzone.lua +++ b/game/engines/default/engine/ui/Textzone.lua @@ -42,20 +42,18 @@ function _M:generate() self.mouse:reset() self.key:reset() - local list - if not self.auto_width then - list = self.text:splitLines(self.w, self.font) - else - list = {self.text} - self.w = self.font:size(self.text) + local text, max_w = self.text:toTString():splitLines(self.w, self.font) + local max_lines = text:countLines() + if self.auto_width then + self.w = max_w end self.scroll = 1 - self.max = #list + self.max = max_lines local fw, fh = self.w, self.font_h self.fw, self.fh = fw, fh - if self.auto_height then self.h = self.fh * #list end + if self.auto_height then self.h = self.fh * max_lines end self.max_display = math.floor(self.h / self.fh) self.can_focus = false @@ -64,19 +62,7 @@ function _M:generate() end -- Draw the list items - local old_style = self.font:getStyle() - self.list = {} - local r, g, b = 255, 255, 255 - local s = core.display.newSurface(fw, fh) - for i, l in ipairs(list) do - s:erase() - r, g, b = s:drawColorStringBlended(self.font, l, 0, 0, r, g, b, true) - if self.no_color_bleed then r, g, b = 255, 255, 255 end - - local item = {} - item._tex, item._tex_w, item._tex_h = s:glTexture() - self.list[#self.list+1] = item - end + self.list = tstring.makeLineTextures(text, self.fw, self.font) -- Draw the scrollbar if self.scrollbar then @@ -91,8 +77,6 @@ function _M:generate() self.scrollbar.bar.w, self.scrollbar.bar.h, self.scrollbar.bar.tex, self.scrollbar.bar.texw, self.scrollbar.bar.texh = ssb_w, self.h - fh, s:glTexture() end - self.font:setStyle(old_style) - -- Add UI controls self.mouse:registerZone(0, 0, self.w, self.h, function(button, x, y, xrel, yrel, bx, by, event) if button == "wheelup" and event == "button" then self.key:triggerVirtual("MOVE_UP") diff --git a/game/modules/tome/class/NPC.lua b/game/modules/tome/class/NPC.lua index e93427475f5f15b8a3a140ad65b053e58d10aef7..e266e630dd4bfda18b6c72b48a6d9d63bde87142 100644 --- a/game/modules/tome/class/NPC.lua +++ b/game/modules/tome/class/NPC.lua @@ -30,7 +30,7 @@ function _M:init(t, no_default) ActorAI.init(self, t) -- Grab default image name if none is set - if not self.image then self.image = "npc/"..(self.type or "unknown").."_"..(self.subtype or "unknown").."_"..(self.name or "unknown"):lower():gsub("[^a-z0-9]", "_")..".png" end + if not self.image and self.name ~= "unknown actor" then self.image = "npc/"..(self.type or "unknown").."_"..(self.subtype or "unknown").."_"..(self.name or "unknown"):lower():gsub("[^a-z0-9]", "_")..".png" end end function _M:act() @@ -207,9 +207,10 @@ function _M:tooltip(x, y, seen_by) str:add( true, ("Killed by you: "):format(killed), true, - "Target: ", self.ai_target.actor and self.ai_target.actor.name or "none", true, - "UID: "..self.uid + "Target: ", self.ai_target.actor and self.ai_target.actor.name or "none" ) + if config.settings.cheat then str:add(true, "UID: "..self.uid, true, self.image) end + return str end diff --git a/game/modules/tome/data/birth/descriptors.lua b/game/modules/tome/data/birth/descriptors.lua index 47d16e1143b37188cb82bf411fa9ecb7c162cf22..0a0a5674cc47763b44bc5f8fa20c37cf44dfdae7 100644 --- a/game/modules/tome/data/birth/descriptors.lua +++ b/game/modules/tome/data/birth/descriptors.lua @@ -90,8 +90,8 @@ newBirthDescriptor{ selection_default = not profile.mod.allow_build.tutorial_done, desc = { - "#GOLD##{bold}#Tutorial mode#WHITE# start with a simplified character and discover the game in a simple quest.#{normal}#", - "You will be guided by a helpful spirit while learning.", + "#GOLD##{bold}#Tutorial mode", + "#WHITE#Starts with a simplified character and discover the game in a simple quest.#{normal}#", "All damage done to the player reduced by 20%", "All healing for the player increased by 10%", "No main game achievements possible.", @@ -116,7 +116,9 @@ newBirthDescriptor{ display_name = "Discovery", desc = { - "#GOLD##{bold}#Discovery mode#WHITE# provides an easier game experience.\nUse it if you feel uneasy tackling the harder modes.#{normal}#", + "#GOLD##{bold}#Discovery mode#WHITE#", + "Provides an easier game experience.", + "Use it if you feel uneasy tackling the harder modes.#{normal}#", "All damage done to the player decreased by 30%", "All healing for the player increased by 30%", "At level 1,2,3,5,7,10,14,18,24,30,40 get one more 'life' that allows to resurrect at the start of the level.", @@ -139,7 +141,9 @@ newBirthDescriptor{ selection_default = profile.mod.allow_build.tutorial_done, desc = { - "#GOLD##{bold}#Adventure mode#WHITE# provides the normal game experience but with limited extra lifes.\nUse it if you want a normal playing conditions but do not feel ready for just one life.#{normal}#", + "#GOLD##{bold}#Adventure mode#WHITE#", + "Provides the normal game experience but with limited extra lifes.", + "Use it if you want a normal playing conditions but do not feel ready for just one life.#{normal}#", "At level 1,2,3,5,7,10,14,18,24,30,40 get one more 'life' that allows to resurrect at the start of the level.", }, descriptor_choices = @@ -157,7 +161,9 @@ newBirthDescriptor{ name = "Roguelike", desc = { - "#GOLD##{bold}#Roguelike mode provides the closer experience to 'classic' roguelike games. You will only have one life, you *ARE* your character.#WHITE##{normal}#", + "#GOLD##{bold}#Roguelike mode#WHITE#", + "Provides the closer experience to 'classic' roguelike games.", + "You will only have one life, you *ARE* your character.#{normal}#", "Only one life, unless ways to self-resurrect are found in-game.", }, descriptor_choices = @@ -172,7 +178,8 @@ newBirthDescriptor{ name = "Insane", desc = { - "#GOLD##{bold}#Insane mode#WHITE# the basic roguelike mode rules with add unfairness!#{normal}#", + "#GOLD##{bold}#Insane mode#WHITE#", + "The basic roguelike mode rules with added unfairness!#{normal}#", "Absolutely unfair game setting", "Only one life, unless ways to self-resurrect are found in-game.", "All zone levels increased by 100% + 10", diff --git a/game/modules/tome/data/gfx/shockbolt/npc/army_ant.png b/game/modules/tome/data/gfx/shockbolt/npc/army_ant.png new file mode 100644 index 0000000000000000000000000000000000000000..a05cd735d9ce307a997ef36dbdcdb716416e5534 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/npc/army_ant.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/npc/carpenter_ant.png b/game/modules/tome/data/gfx/shockbolt/npc/carpenter_ant.png new file mode 100644 index 0000000000000000000000000000000000000000..6434d846effe691464014359035cf9aca379d2a6 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/npc/carpenter_ant.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/npc/ice_ant.png b/game/modules/tome/data/gfx/shockbolt/npc/ice_ant.png index ec0473f0779db055db5248a1404a67141b354999..43b5410bdcf157f14aa8f2e53f659202af0b5506 100644 Binary files a/game/modules/tome/data/gfx/shockbolt/npc/ice_ant.png and b/game/modules/tome/data/gfx/shockbolt/npc/ice_ant.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_gigantic_sandworm_tunneler.png b/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_gigantic_sandworm_tunneler.png new file mode 100644 index 0000000000000000000000000000000000000000..d358af18509141f40be8191d04b30bf0a04d8fd9 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_gigantic_sandworm_tunneler.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_sandworm.png b/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_sandworm.png new file mode 100644 index 0000000000000000000000000000000000000000..bb382eb91506072f6744d657f324997633ced2c2 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_sandworm.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_sandworm_destroyer.png b/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_sandworm_destroyer.png new file mode 100644 index 0000000000000000000000000000000000000000..1dfa707a51f66b22c0150ad0af98244f50ba27bf Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/npc/vermin_sandworm_sandworm_destroyer.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/object/lite_brass.png b/game/modules/tome/data/gfx/shockbolt/object/lite_brass.png new file mode 100644 index 0000000000000000000000000000000000000000..a1f372b92ef40751bbe5e07af4c143921d019c69 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/object/lite_brass.png differ diff --git a/game/modules/tome/data/gfx/shockbolt/object/scroll-lore.png b/game/modules/tome/data/gfx/shockbolt/object/scroll-lore.png new file mode 100644 index 0000000000000000000000000000000000000000..c5062c41edb85f9e71a3aaaea88059e3254fc781 Binary files /dev/null and b/game/modules/tome/data/gfx/shockbolt/object/scroll-lore.png differ