From b2d8ebc4a91484d9020703e28761e348aef06e2b Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Sun, 21 Apr 2013 14:06:12 +0000
Subject: [PATCH] New option to change the speed of flying texts
 Randboss/randelites kills are not recorded in the uniques kill list

git-svn-id: http://svn.net-core.org/repos/t-engine4@6629 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/Actor.lua         |  2 +-
 game/modules/tome/class/Game.lua          |  9 +++++++++
 game/modules/tome/dialogs/GameOptions.lua | 14 +++++++++++++-
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/game/modules/tome/class/Actor.lua b/game/modules/tome/class/Actor.lua
index 02884c71f4..e94fd3d010 100644
--- a/game/modules/tome/class/Actor.lua
+++ b/game/modules/tome/class/Actor.lua
@@ -2453,7 +2453,7 @@ function _M:die(src, death_note)
 		world:gainAchievement("PEST_CONTROL", p, self)
 		world:gainAchievement("REAVER", p, self)
 
-		if self.unique then
+		if self.unique and not self.randboss then
 			game.player:registerUniqueKilled(self)
 		end
 
diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index f0ed6ff517..5d944107f2 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -475,6 +475,15 @@ function _M:setupMiniMap()
 	if self.level and self.level.map and self.level.map.finished then self.uiset:setupMinimap(self.level) end
 end
 
+--- Sets up a text flyers
+function _M:setFlyingText(fl)
+	self.flyers = fl
+	function self.flyers:add(x, y, duration, xvel, yvel, str, color, bigfont)
+		local slowness = (config.settings.tome.flyers_fade_time or 10)/10
+		return FlyingText.add(fl, x, y, duration*slowness, xvel/slowness, yvel/slowness, str, color, bigfont)
+	end
+end
+
 function _M:save()
 	self.total_playtime = (self.total_playtime or 0) + (os.time() - (self.last_update or self.real_starttime))
 	self.last_update = os.time()
diff --git a/game/modules/tome/dialogs/GameOptions.lua b/game/modules/tome/dialogs/GameOptions.lua
index 499a30177a..fa3b720386 100644
--- a/game/modules/tome/dialogs/GameOptions.lua
+++ b/game/modules/tome/dialogs/GameOptions.lua
@@ -212,7 +212,19 @@ function _M:generateList()
 			self.c_list:drawItem(item)
 		end, 0))
 	end,}
-
+	
+	local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"How long will flying text messages be visible on screen.\nThe range is 1 (very short) to 100 (10x slower) than the normal duration, which varies with each individual message."}
+	list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Duration of flying text#WHITE##{normal}#", status=function(item)
+		return tostring((config.settings.tome.flyers_fade_time or 10) )
+	end, fct=function(item)
+		game:registerDialog(GetQuantity.new("Relative duration", "From 1 to 100", (config.settings.tome.flyers_fade_time or 10), 100, function(qty)
+			qty = util.bound(qty, 1, 100)
+			config.settings.tome.flyers_fade_time = qty
+			game:saveSettings("tome.flyers_fade_time", ("tome.flyers_fade_time = %d\n"):format(qty))
+			self.c_list:drawItem(item)
+		end, 1))
+	end,}
+	
 	local zone = Textzone.new{width=self.c_desc.w, height=self.c_desc.h, text=string.toTString"Configure the chat filters to select what kind of messages to see.#WHITE#"}
 	list[#list+1] = { zone=zone, name=string.toTString"#GOLD##{bold}#Chat message filters#WHITE##{normal}#", status=function(item)
 		return "select to configure"
-- 
GitLab