diff --git a/game/engines/default/engine/ui/Inventory.lua b/game/engines/default/engine/ui/Inventory.lua index b83af46eb5901063edad3d9fb91ebed661d30934..4c4ae8b2c78c8be6f61ae7eb725d0782a9ab6ee5 100644 --- a/game/engines/default/engine/ui/Inventory.lua +++ b/game/engines/default/engine/ui/Inventory.lua @@ -40,6 +40,7 @@ function _M:init(t) self.on_select_tab = t.select_tab self.on_drag = t.on_drag self.on_drag_end = t.on_drag_end + self.special_bg = t.special_bg if self.tabslist == nil and self.default_tabslist then if type(self.default_tabslist) == "function" then self.tabslist = self.default_tabslist(self) @@ -250,7 +251,7 @@ function _M:generateList(no_update) local enc = 0 o:forAllStack(function(o) enc=enc+o.encumber end) - list[#list+1] = { id=#list+1, char=char, name=o:getName(), sortname=o:getName():toString():removeColorCodes(), color=o:getDisplayColor(), object=o, inven=self.actor.INVEN_INVEN, item=item, cat=o.subtype, encumberance=enc, desc=o:getDesc() } + list[#list+1] = { id=#list+1, char=char, name=o:getName(), sortname=o:getName():toString():removeColorCodes(), color=o:getDisplayColor(), object=o, inven=self.actor.INVEN_INVEN, item=item, cat=o.subtype, encumberance=enc, desc=o:getDesc(), special_bg=self.special_bg } chars[char] = #list i = i + 1 end diff --git a/game/engines/default/engine/ui/ListColumns.lua b/game/engines/default/engine/ui/ListColumns.lua index a6873491070b956741ded407324260c170e5d139..9513494a4d4ed636c10ec6802218c0443f3d4d3f 100644 --- a/game/engines/default/engine/ui/ListColumns.lua +++ b/game/engines/default/engine/ui/ListColumns.lua @@ -65,6 +65,7 @@ function _M:init(t) col.surface = core.display.newSurface(col.width, self.fh) col.frame = self:makeFrame(nil, col.width, self.fh) + col.frame_special = self:makeFrame("ui/selector", col.width, self.fh) col.frame_sel = self:makeFrame("ui/selector-sel", col.width, self.fh) col.frame_usel = self:makeFrame("ui/selector", col.width, self.fh) col.frame_col = self:makeFrame("ui/heading", col.width, self.fh) @@ -326,6 +327,15 @@ function _M:display(x, y, nb_keyframes, screen_x, screen_y) if item.focus_decay <= 0 then item.focus_decay = nil end end end + + if item.special_bg then + local c = item.special_bg + if type(c) == "function" then c = c(item) end + if c then + self:drawFrame(col.frame_special, x, y, c.r, c.g, c.b, c.a or 1) + end + end + if col.direct_draw then col.direct_draw(item, x, y, col.fw, self.fh) elseif item._tex then diff --git a/game/modules/tome/data/chats/unremarkable-cave-bosses.lua b/game/modules/tome/data/chats/unremarkable-cave-bosses.lua index ce444f1e26f8d0eb0665ae0ee276ecd6a294869a..24b7e453451396f45fa7d05cdd0f941cc00c3c48 100644 --- a/game/modules/tome/data/chats/unremarkable-cave-bosses.lua +++ b/game/modules/tome/data/chats/unremarkable-cave-bosses.lua @@ -54,8 +54,7 @@ Fillarel: "You! @playerdescriptor.race@! Help me defeat this monster or begone!" Krogar: "Ah, looking for help? Bah. @playerdescriptor.race@, kill this wench for me and I shall reward you!"]], answers = { {"[attack Krogar]", action=attack_krogar}, --- Not available yet --- {"[attack Fillarel]", action=attack_fillarel}, + {"[attack Fillarel]", action=attack_fillarel, cond=function(npc, player) return not player:hasQuest("start-sunwall") and config.settings.cheat end}, } } return "welcome" diff --git a/game/modules/tome/dialogs/ShowEquipInven.lua b/game/modules/tome/dialogs/ShowEquipInven.lua index 85d95e9dcd4d422657708884fea82d1dcbee22d3..e45c5f21e90dacc3b6cb4bd8027f65359af13951 100644 --- a/game/modules/tome/dialogs/ShowEquipInven.lua +++ b/game/modules/tome/dialogs/ShowEquipInven.lua @@ -67,6 +67,7 @@ function _M:init(title, actor, filter, action, on_select) select_tab=function(item) self:select(item) end, on_drag=function(item) self:onDrag(item) end, on_drag_end=function() self:onDragTakeoff() end, + special_bg=function(item) if item.object and item.object.__transmo then return colors.GOLD end end, } local uis = { @@ -181,7 +182,7 @@ function _M:updateTitle(title) end function _M:onDrag(item) - if item and item.object and not item.object.__transmo then + if item and item.object then local s = item.object:getEntityFinalSurface(nil, 64, 64) local x, y = core.mouse.get() game.mouse:startDrag(x, y, s, {kind="inventory", item_idx=item.item, inven=item.inven, object=item.object, id=item.object:getName{no_add_name=true, force_id=true, no_count=true}}, function(drag, used)