From 711109539237f3229bf59ef83fe0d6a55f54cf37 Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 26 Jun 2012 10:06:13 +0000
Subject: [PATCH] Items in the transmo chest will appear with a greenish
 background in the inventory

git-svn-id: http://svn.net-core.org/repos/t-engine4@5291 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/ui/Inventory.lua           |  3 ++-
 game/engines/default/engine/ui/ListColumns.lua         | 10 ++++++++++
 .../tome/data/chats/unremarkable-cave-bosses.lua       |  3 +--
 game/modules/tome/dialogs/ShowEquipInven.lua           |  3 ++-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/game/engines/default/engine/ui/Inventory.lua b/game/engines/default/engine/ui/Inventory.lua
index b83af46eb5..4c4ae8b2c7 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 a687349107..9513494a4d 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 ce444f1e26..24b7e45345 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 85d95e9dcd..e45c5f21e9 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)
-- 
GitLab