diff --git a/game/engines/default/engine/ui/TreeList.lua b/game/engines/default/engine/ui/TreeList.lua index e0cbfb90a0dabe699f32e296c8b58d0867cbf144..85f93986b2a1c035dc1762cf4951376ed7cf1bfe 100644 --- a/game/engines/default/engine/ui/TreeList.lua +++ b/game/engines/default/engine/ui/TreeList.lua @@ -273,7 +273,7 @@ function _M:setList(tree) -- the name is a bit misleading but legacy self:setTree(tree) end -function _M:drawItem(item) +function _M:drawItem(item, smallcaps) local is_header = item._is_header if not item._container then item.cols = {} @@ -315,7 +315,7 @@ function _M:drawItem(item) if is_header then opts = {frame="ui/heading-sel", frame_sel="ui/heading"} end - item.cols[i]._entry = Entry.new(opts, text, color, col.width - offset, self.fh, offset, 1, not is_header) + item.cols[i]._entry = Entry.new(opts, text, color, col.width - offset, self.fh, offset, 1, not is_header, is_header) item.cols[i]._entry:translate(x + offset, 0, 0) item.cols[i]._entry:select(is_header) local ec = item.cols[i]._entry:get() diff --git a/game/engines/default/engine/ui/blocks/Entry.lua b/game/engines/default/engine/ui/blocks/Entry.lua index f322a8be0d6f12c6015abee318f076e8df8dbd1f..7f4ded25a84a81d307fa8e2102f999048582048b 100644 --- a/game/engines/default/engine/ui/blocks/Entry.lua +++ b/game/engines/default/engine/ui/blocks/Entry.lua @@ -24,7 +24,7 @@ local Block = require "engine.ui.blocks.Block" -- @classmod engine.ui.blocks.block module(..., package.seeall, class.inherit(Block)) -function _M:init(t, text, color, w, h, offset, max_lines, default_unseen) +function _M:init(t, text, color, w, h, offset, max_lines, default_unseen, smallcaps) color = color or {255,255,255} self.color = color self.offset = offset @@ -33,6 +33,7 @@ function _M:init(t, text, color, w, h, offset, max_lines, default_unseen) self.selected = false self.default_unseen = true + self.smallcaps = smallcaps t = t or {} self.t = t @@ -64,6 +65,7 @@ function _M:generateContainer() self.max_text_w = w - self.frame.b4.w - self.frame.b6.w self.up_text_h = (h - self.font_h * self.max_lines) / 2 self.text = core.renderer.text(self.parent.font):translate(0, 0, 10) + if self.smallcaps then self.text:smallCaps(true):textStyle("bold") end self.text:maxLines(self.max_lines) if self.max_lines > 1 then self.text:maxWidth(self.max_text_w) end self.text:textColor(self.color[1] / 255, self.color[2] / 255, self.color[3] / 255, 1) diff --git a/game/engines/default/engine/ui/blocks/Input.lua b/game/engines/default/engine/ui/blocks/Input.lua index cf511bcfcdd5ba188eed4c03529593d065530e0f..8b93d28754e5c5c622f6f3c64ad7c2c1afa24478 100644 --- a/game/engines/default/engine/ui/blocks/Input.lua +++ b/game/engines/default/engine/ui/blocks/Input.lua @@ -30,7 +30,7 @@ function _M:init(t, text, color, w, h) Block.init(self, t) self.cursor_t = self.parent:getAtlasTexture("ui/textbox-cursor.png") - self.cursor = core.renderer.fromTextureTable(self.cursor_t, 0, 0) + self.cursor = core.renderer.fromTextureTable(self.cursor_t, 0, 0):color(0.5, 1, 1, 1) self.frame = self.parent:makeFrameDO("ui/textbox", nil, nil, w, h) self.frame_sel = self.parent:makeFrameDO("ui/textbox-sel", nil, nil, w, h) diff --git a/game/modules/tome/dialogs/ShowEquipInven.lua b/game/modules/tome/dialogs/ShowEquipInven.lua index 6615da62babc2d41961f4e66a62b8264f8234d5b..abf03f4375e9b31933916e12f1fb891c53c530ea 100644 --- a/game/modules/tome/dialogs/ShowEquipInven.lua +++ b/game/modules/tome/dialogs/ShowEquipInven.lua @@ -92,7 +92,7 @@ function _M:init(title, equip_actor, filter, action, on_select, inven_actor, for self.c_inven = Inventory.new{actor=inven_actor, inven=inven_actor:getInven("INVEN") or {}, width=self.iw - vsep.w - self.c_doll.w, height=self.ih - 10, filter=filter, default_last_tabs = "all", fct=function(item, sel, button, event) self:use(item, button, event) end, - select=function(item, sel) if self.c_inven and item._pos_y then + select=function(item, sel) if self.c_inven and item and item._pos_y then item.last_display_x = self.c_inven.c_inven.last_display_x + self.c_inven.w item.last_display_y = self.c_inven.c_inven.last_display_y + item._pos_y self:select(item)