From 9ab179906bb1387d694b73b894ce28c007e2419f Mon Sep 17 00:00:00 2001
From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54>
Date: Thu, 23 Feb 2012 11:59:50 +0000
Subject: [PATCH] moved ressource handle; minimap popup can be used to move &
 scroll

git-svn-id: http://svn.net-core.org/repos/t-engine4@4915 51575b47-30f0-44d4-a5cc-537603b46e54
---
 game/modules/tome/class/uiset/Minimalist.lua |  4 ++--
 game/modules/tome/dialogs/ShowMap.lua        | 13 ++++++++++---
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/game/modules/tome/class/uiset/Minimalist.lua b/game/modules/tome/class/uiset/Minimalist.lua
index c61357ccfd..79ed1e5e9c 100644
--- a/game/modules/tome/class/uiset/Minimalist.lua
+++ b/game/modules/tome/class/uiset/Minimalist.lua
@@ -176,7 +176,7 @@ function _M:init()
 
 	self.mhandle_pos = {
 		player = {x=296, y=73, name="Player Infos"},
-		resources = {x=fshat[6] - move_handle[6], y=0, name="Resources"},
+		resources = {x=fshat[6] / 2 - move_handle[6], y=0, name="Resources"},
 		minimap = {x=208, y=176, name="Minimap"},
 		buffs = {x=40 - move_handle[6], y=0, name="Current Effects"},
 		party = {x=portrait[6] - move_handle[6], y=0, name="Party Members"},
@@ -560,7 +560,7 @@ function _M:displayResources(scale, bx, by, a)
 		x, y = self:resourceOrientStep(orient, bx, by, scale, x, y, fshat[6], fshat[7])
 
 		if not self.locked then
-			move_handle[1]:toScreenFull(fshat[6] - move_handle[6], 0, move_handle[6], move_handle[7], move_handle[2], move_handle[3])
+			move_handle[1]:toScreenFull(fshat[6] / 2 - move_handle[6], 0, move_handle[6], move_handle[7], move_handle[2], move_handle[3])
 		end
 
 		-----------------------------------------------------------------------------------
diff --git a/game/modules/tome/dialogs/ShowMap.lua b/game/modules/tome/dialogs/ShowMap.lua
index 1c62eb7b8f..09861003ef 100644
--- a/game/modules/tome/dialogs/ShowMap.lua
+++ b/game/modules/tome/dialogs/ShowMap.lua
@@ -29,13 +29,13 @@ function _M:init()
 
 	self.ui = "parchment"
 
-	self.bsize = 12
+	self.bsize = 22
 	local map = game.level.map
 	local mw, mh = map.w * self.bsize, map.h * self.bsize
 	local Mw, Mh = math.floor(game.w * 0.9), math.floor(game.h * 0.9)
 
 	while mw > Mw or mh > Mh do
-		if self.bsize <= 3 then break end
+		if self.bsize <= 22 then break end
 		self.bsize = self.bsize - 1
 		mw, mh = map.w * self.bsize, map.h * self.bsize
 	end
@@ -62,13 +62,20 @@ function _M:init()
 		local ts = game.tooltip:getTooltipAtMap(dx, dy, dx, dy)
 		if ts then game.tooltip:set(ts) game.tooltip:display() else game.tooltip:erase() end
 
-		if event == "button" and button == "left" then
+		if xrel and yrel and button == "left" and core.key.modState("ctrl") then
 			game.minimap_scroll_x = dx - math.floor(t_per_w / 2)
 			game.minimap_scroll_y = dy - math.floor(t_per_h / 2)
 
 			game.minimap_scroll_x = util.bound(game.minimap_scroll_x, 0, math.max(0, map.w - t_per_w))
 			game.minimap_scroll_y = util.bound(game.minimap_scroll_y, 0, math.max(0, map.h - t_per_h))
+		elseif button == "left" and not xrel and not yrel and event == "button" then
+			game.player:mouseMove(dx, dy)
+		elseif button == "right" then
+			game.level.map:moveViewSurround(dx, dy, 1000, 1000)
+		elseif event == "button" and button == "middle" then
+			game.key:triggerVirtual("SHOW_MAP")
 		end
+
 	end, nil, nil, true)
 
 	self:loadUI(uis)
-- 
GitLab