From bd8c270fc2c4882edcb6983bb7b56ba07ec96eae Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Mon, 9 May 2011 09:58:04 +0000
Subject: [PATCH] fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@3326 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/engines/default/engine/BSP.lua        |  3 +++
 game/modules/tome/class/Game.lua           |  2 +-
 game/modules/tome/data/zones/test/zone.lua | 18 +++++++++---------
 game/modules/tome/dialogs/LorePopup.lua    | 10 ++++++----
 4 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/game/engines/default/engine/BSP.lua b/game/engines/default/engine/BSP.lua
index 8d70ce689c..26aab303f9 100644
--- a/game/engines/default/engine/BSP.lua
+++ b/game/engines/default/engine/BSP.lua
@@ -27,6 +27,7 @@ function _M:init(w, h, min_w, min_h, max_depth)
 	self.max_depth = max_depth or 8
 	self.min_w, self.min_h = min_w, min_h
 	self.node_id = 1
+	self.splits = { vert={}, hor={} }
 	self.leafs = {}
 	self.bsp = {x=0, y=0, rx=0, ry=0, w=w, h=h, nodes={}, id=0, depth=0}
 	print("[BSP] ", w, h)
@@ -52,6 +53,7 @@ function _M:partition(store)
 --		print("[BSP] vertical split", s)
 		store.nodes[1] = {depth=store.depth+1, x=0, y=0, rx=store.rx, ry=store.ry, w=store.w, h=s, nodes={}, id=self.node_id} self.node_id = self.node_id + 1
 		store.nodes[2] = {depth=store.depth+1, x=0, y=s, rx=store.rx, ry=store.ry + s, w=store.w, h=store.h - s, nodes={}, id=self.node_id} self.node_id = self.node_id + 1
+		self.splits.vert[store.ry + s] = true
 		self:partition(store.nodes[1])
 		self:partition(store.nodes[2])
 
@@ -60,6 +62,7 @@ function _M:partition(store)
 --		print("[BSP] horizontal split", s)
 		store.nodes[1] = {depth=store.depth+1, x=0, y=0, rx=store.rx, ry=store.ry, w=s, h=store.h, nodes={}, id=self.node_id} self.node_id = self.node_id + 1
 		store.nodes[2] = {depth=store.depth+1, x=s, y=0, rx=store.rx + s, ry=store.ry, w=store.w -s , h=store.h, nodes={}, id=self.node_id} self.node_id = self.node_id + 1
+		self.splits.hor[store.rx + s] = true
 		self:partition(store.nodes[1])
 		self:partition(store.nodes[2])
 	end
diff --git a/game/modules/tome/class/Game.lua b/game/modules/tome/class/Game.lua
index 9311a5e403..5584be2605 100644
--- a/game/modules/tome/class/Game.lua
+++ b/game/modules/tome/class/Game.lua
@@ -937,7 +937,7 @@ function _M:setupCommands()
 --			self.state:debugRandomZone()
 --			local m = game.zone:makeEntity(game.level, "actor", {random_boss=true}, nil, true)
 --			if m then game.zone:addEntity(game.level, m, "actor", game.player.x, game.player.y + 1) end
-			self:registerDialog(require("mod.dialogs.Donation").new())
+			self:changeLevel(1, "test")
 		end end,
 	}
 
diff --git a/game/modules/tome/data/zones/test/zone.lua b/game/modules/tome/data/zones/test/zone.lua
index ce251ea338..ce8b074921 100644
--- a/game/modules/tome/data/zones/test/zone.lua
+++ b/game/modules/tome/data/zones/test/zone.lua
@@ -28,17 +28,17 @@ return {
 	all_remembered = true,
 	all_lited = true,
 --	persistent = "zone",
+	no_level_connectivity = true,
 	generator =  {
 		map = {
-			class = "engine.generator.map.Octopus",
-			main_radius = {0.3, 0.4},
-			arms_radius = {0.1, 0.2},
-			arms_range = {0.7, 0.8},
-			nb_rooms = {5, 9},
-			['.'] = "FLOOR",
-			['#'] = "WALL",
-			up = "FLOOR",
-			down = "FLOOR",
+			class = "engine.generator.map.Building",
+			max_building_w = 5, max_building_h = 5,
+			floor = "FLOOR",
+			external_floor = "FLOOR",
+			wall = "WALL",
+			up = "FLAT_UP6",
+			down = "FLAT_DOWN4",
+			door = "DOOR",
 		},
 		actor = {
 			class = "engine.generator.actor.Random",
diff --git a/game/modules/tome/dialogs/LorePopup.lua b/game/modules/tome/dialogs/LorePopup.lua
index 2a4a11d76d..d7d5c1c651 100644
--- a/game/modules/tome/dialogs/LorePopup.lua
+++ b/game/modules/tome/dialogs/LorePopup.lua
@@ -49,11 +49,13 @@ function _M:init(l, w, force_height)
 	end
 
 	local h = math.min(force_height and (force_height * game.h) or 999999999, self.font_h * #list)
+	local c_text = require("engine.ui.Textzone").new{
+		width=w+10, height=h, scrollbar=(h < self.font_h * #list) and true or false, text=text, color={r=0x3a, g=0x35, b=0x33},
+	}
+	c_text:setTextShadow(false)
+
 	self:loadUI{
-		{left = 3, top = 3, ui=require("engine.ui.Textzone").new{
-				width=w+10, height=h, scrollbar=(h < self.font_h * #list) and true or false, text=text, color={r=0x3a, g=0x35, b=0x33},
-			}
-		}
+		{left = 3, top = 3, ui=c_text}
 	}
 	self.key:addBind("EXIT", function() game:unregisterDialog(self) if fct then fct() end end)
 	self.key:addBind("ACCEPT", function() game:unregisterDialog(self) if fct then fct() end end)
-- 
GitLab