From 654cc4b79e4cb08c1e5a2086b829f90f3142780b Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Tue, 14 Jun 2011 15:37:34 +0000
Subject: [PATCH] New artifact gem fix tooltips

git-svn-id: http://svn.net-core.org/repos/t-engine4@3650 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/Tooltip.lua       |  7 +++--
 game/engines/default/engine/utils.lua         |  4 +++
 .../objects/world-artifacts-far-east.lua      | 31 +++++++++++++++++++
 game/modules/tome/dialogs/GraphicMode.lua     |  2 +-
 game/modules/tome/load.lua                    |  1 +
 5 files changed, 42 insertions(+), 3 deletions(-)

diff --git a/game/engines/default/engine/Tooltip.lua b/game/engines/default/engine/Tooltip.lua
index 7b0a4da518..41f55ea8c7 100644
--- a/game/engines/default/engine/Tooltip.lua
+++ b/game/engines/default/engine/Tooltip.lua
@@ -246,9 +246,11 @@ function _M:set(str, ...)
 	if str.is_tstring then
 		self:erase()
 		self.default_ui[1]:switchItem(str, str)
+		self.empty = str:isEmpty()
 	else
 		if self.uids == self.default_ui then self.uids = {} end
 		self.uids[#self.uids+1] = str
+		self.empty = false
 	end
 
 	local uih = 0
@@ -260,6 +262,7 @@ end
 function _M:erase()
 	self.uis = self.default_ui
 	self.default_ui[1].list = nil
+	self.empty = true
 end
 
 function _M:display() end
@@ -359,7 +362,7 @@ function _M:displayAtMap(tmx, tmy, mx, my, text)
 		end
 	end
 
---	if self.texture then
+	if not self.empty then
 --		mx = mx - self.w / 2 + game.level.map.tile_w / 2
 --		my = my - self.h
 		if mx < 0 then mx = 0 end
@@ -369,5 +372,5 @@ function _M:displayAtMap(tmx, tmy, mx, my, text)
 		self.last_display_x = mx
 		self.last_display_y = my
 		self:toScreen(mx, my)
---	end
+	end
 end
diff --git a/game/engines/default/engine/utils.lua b/game/engines/default/engine/utils.lua
index f2b5512558..ce8e002d30 100644
--- a/game/engines/default/engine/utils.lua
+++ b/game/engines/default/engine/utils.lua
@@ -725,6 +725,10 @@ function tstring:extractLines()
 	return rets
 end
 
+function tstring:isEmpty()
+	return #self == 0
+end
+
 function tstring:makeLineTextures(max_width, font, no_split, r, g, b)
 	local list = no_split and self or self:splitLines(max_width, font)
 	local fh = font:lineSkip()
diff --git a/game/modules/tome/data/general/objects/world-artifacts-far-east.lua b/game/modules/tome/data/general/objects/world-artifacts-far-east.lua
index 1e39786d3e..26d6750df8 100644
--- a/game/modules/tome/data/general/objects/world-artifacts-far-east.lua
+++ b/game/modules/tome/data/general/objects/world-artifacts-far-east.lua
@@ -123,3 +123,34 @@ newEntity{ base = "BASE_HEAVY_BOOTS",
 		inc_damage = { [DamageType.BLIGHT] = 15 },
 	},
 }
+
+newEntity{ base = "BASE_GEM",
+	power_source = {arcane=true},
+	unique = true,
+	unided_name = "unearthly black stone",
+	name = "Goedalath Rock", subtype = "black",
+	color = colors.PURPLE, image="object/onyx.png",
+	level_range = {42, 50},
+	desc = [[A small rock that seems from beyond this world, vibrating with a fierce energy.  It feels warped and terrible and evil... and yet oh so powerful.]],
+	rarity = 300,
+	cost = 300,
+	material_level = 5,
+	carrier = {
+		on_melee_hit = {[DamageType.HEAL] = 34},
+		life_regen = -2,
+		lite = -2,
+		combat_mentalresist = -18,
+		healing_factor = -0.5,
+	},
+	imbue_powers = {
+		combat_dam = 12,
+		combat_spellpower = 16,
+		see_invisible = 14,
+		infravision = 3,
+		inc_damage = {all = 9},
+		inc_damage_type = {demon = 20},
+		esp = {["demon/major"]=1, ["demon/minor"]=1},
+		on_melee_hit = {[DamageType.DARKNESS] = 34},
+		healing_factor = 0.5,
+	},
+}
diff --git a/game/modules/tome/dialogs/GraphicMode.lua b/game/modules/tome/dialogs/GraphicMode.lua
index bd2cfd47ac..f47fcd7244 100644
--- a/game/modules/tome/dialogs/GraphicMode.lua
+++ b/game/modules/tome/dialogs/GraphicMode.lua
@@ -25,7 +25,7 @@ module(..., package.seeall, class.inherit(Dialog))
 
 local tiles_packs = {
 	shockbolt = {name= "Shockbolt", order=1},
-	mushroom = {name= "Mushroom", order=2},
+--	mushroom = {name= "Mushroom", order=2},
 	ascii = {name= "ASCII", order=5},
 	ascii_full = {name= "ASCII with background", order=6},
 }
diff --git a/game/modules/tome/load.lua b/game/modules/tome/load.lua
index 2b87180d03..3271dfe93b 100644
--- a/game/modules/tome/load.lua
+++ b/game/modules/tome/load.lua
@@ -49,6 +49,7 @@ profile.mod.allow_build = profile.mod.allow_build or {}
 if type(config.settings.tome.autosave) == "nil" then config.settings.tome.autosave = true end
 if not config.settings.tome.smooth_move then config.settings.tome.smooth_move = 3 end
 if not config.settings.tome.gfx then config.settings.tome.gfx = {size="32x32", tiles="shockbolt"} end
+if config.settings.tome.gfx.tiles == "mushroom" then config.settings.tome.gfx.tiles="shockbolt" end
 if type(config.settings.tome.weather_effects) == "nil" then config.settings.tome.weather_effects = true end
 if type(config.settings.tome.smooth_fov) == "nil" then config.settings.tome.smooth_fov = true end
 if type(config.settings.tome.daynight) == "nil" then config.settings.tome.daynight = true end
-- 
GitLab