From: <cl...@us...> - 2007-06-19 17:35:34
|
Revision: 7 http://fortress.svn.sourceforge.net/fortress/?rev=7&view=rev Author: clrg Date: 2007-06-19 10:35:36 -0700 (Tue, 19 Jun 2007) Log Message: ----------- - make map follow cursor instead of following view - switch off cursor while dragging map Modified Paths: -------------- trunk/Prototype/src/net/sourceforge/fortress/app.t trunk/Prototype/src/net/sourceforge/fortress/map.t trunk/Prototype/src/net/sourceforge/fortress/minimap.t Modified: trunk/Prototype/src/net/sourceforge/fortress/app.t =================================================================== --- trunk/Prototype/src/net/sourceforge/fortress/app.t 2007-06-19 17:01:06 UTC (rev 6) +++ trunk/Prototype/src/net/sourceforge/fortress/app.t 2007-06-19 17:35:36 UTC (rev 7) @@ -17,10 +17,10 @@ vexi.ui.frame = thisbox; - $map.activeTile ++= function(v) + $map.active ++= function(v) { - $position.text = "( "+v.posx+", "+v.posy+" )"; - $tiletype.text = v.type; + $position.text = "( "+$map.activeTile.posx+", "+$map.activeTile.posy+" )"; + $tiletype.text = $map.activeTile.type; cascade = v; } Modified: trunk/Prototype/src/net/sourceforge/fortress/map.t =================================================================== --- trunk/Prototype/src/net/sourceforge/fortress/map.t 2007-06-19 17:01:06 UTC (rev 6) +++ trunk/Prototype/src/net/sourceforge/fortress/map.t 2007-06-19 17:35:36 UTC (rev 7) @@ -25,6 +25,8 @@ //////// map movement ///////////////////////////////////////// + var dragging = false; + var mx; var my; var ox; @@ -35,8 +37,8 @@ var dragMove = function(v) { var m = thisbox.mouse; - var nx = ox - m.x + mx; - var ny = oy - m.y + my; + var nx = ox + m.x - mx; + var ny = oy + m.y - my; nx = 0 > nx ? (nx > vx ? nx : vx) : 0; ny = 0 > ny ? (ny > vy ? ny : vy) : 0; $map.x = nx; @@ -49,11 +51,15 @@ { surface.delMoveTrap(dragMove); surface.Release2 --= dragStop; + dragging = false; cascade = v; + active = true; } var dragStart = function(v) { + dragging = true; + $cur.display = false; var m = thisbox.mouse; mx = m.x; my = m.y; @@ -72,21 +78,21 @@ thisbox.activeTile = null; - var active = function() + thisbox.active ++= function(v) { - var d = thisbox.distanceto(activeTile); + var d = $map.distanceto(activeTile); $cur.display = true; $cur.width = activeTile.width; $cur.height = activeTile.height; - $cur.x = d.x; - $cur.y = d.y; + $cur.x = d.x + $map.x; + $cur.y = d.y + $map.y; } var enterFunc = function(v) { + cascade = v; activeTile = trapee; - cascade = v; - active(); + if (!dragging) active = true; } thisbox.Leave ++= function(v) { $cur.display = false; } Modified: trunk/Prototype/src/net/sourceforge/fortress/minimap.t =================================================================== --- trunk/Prototype/src/net/sourceforge/fortress/minimap.t 2007-06-19 17:01:06 UTC (rev 6) +++ trunk/Prototype/src/net/sourceforge/fortress/minimap.t 2007-06-19 17:35:36 UTC (rev 7) @@ -24,8 +24,8 @@ var syncView = function() { - $viewbox.width = $minimap.width * (vw / mw); - $viewbox.height = $minimap.height * (vh / mh); + $viewbox.width = $minimap.width * (vw / mw) + 1; + $viewbox.height = $minimap.height * (vh / mh) + 1; $viewbox.x = $minimap.width * (-mx / mw); $viewbox.y = $minimap.height * (-my / mh); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |