From: <cl...@us...> - 2007-06-24 23:13:29
|
Revision: 11 http://fortress.svn.sourceforge.net/fortress/?rev=11&view=rev Author: clrg Date: 2007-06-24 16:13:29 -0700 (Sun, 24 Jun 2007) Log Message: ----------- Update after major changes to Vexi layout strategy - increase map size to 100 - sync prototype with development version of Vexi - change map management to $map[x][y] instead of $map[y][x] 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-20 15:57:46 UTC (rev 10) +++ trunk/Prototype/src/net/sourceforge/fortress/app.t 2007-06-24 23:13:29 UTC (rev 11) @@ -3,16 +3,15 @@ <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress" xmlns:role="org.vexi.lib.role"> <role:surface /> <ui:box titlebar="Fortress Prototype"> - <ui:box cols="1" hshrink="true"> + <ui:box orient="vertical" shrink="true"> <minimap /> <ui:box fill="#888888" height="1" /> <ui:box height="5" /> - <ui:box id="tiletype" textcolor="white" vshrink="true" /> + <ui:box id="tiletype" textcolor="white" /> <ui:box height="5" /> - <ui:box id="position" textcolor="white" vshrink="true" /> - <ui:box /> + <ui:box id="position" textcolor="white" /> </ui:box> - <ui:box fill="#888888" width="1" /> + <ui:box fill="#888888" width="1" hshrink="true" /> <map id="map" /> vexi.ui.frame = thisbox; Modified: trunk/Prototype/src/net/sourceforge/fortress/map.t =================================================================== --- trunk/Prototype/src/net/sourceforge/fortress/map.t 2007-06-20 15:57:46 UTC (rev 10) +++ trunk/Prototype/src/net/sourceforge/fortress/map.t 2007-06-24 23:13:29 UTC (rev 11) @@ -1,9 +1,9 @@ <!-- Copyright 2007 licensed under GPL v3 --> <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <ui:box> - <ui:box id="map" align="topleft" cols="1" packed="false" shrink="true" /> - <ui:box id="cur" align="topleft" fill="#88ffffff" display="false" packed="false" /> + <ui:box layout="absolute"> + <ui:box id="map" shrink="true" /> + <ui:box id="cur" fill="#88ffffff" display="false" /> //////// sample road creation ///////////////////////////////// @@ -19,33 +19,33 @@ var posx = tile.posx; var posy = tile.posy; var comp = ""; - if (posy > 0 and $map[posy-1][posx].type == "mud") + if (posy > 0 and $map[posx][posy-1].type == "mud") { - var nt = $map[posy-1][posx]; + var nt = $map[posx][posy-1]; nt.comp = nt.comp.substring(0, 2) + "m" + nt.comp.substring(3); nt.sync(); comp = comp + "m"; } else comp = comp + "_"; - if ($map[posy].numchildren > posx + 1 and $map[posy][posx+1].type == "mud") + if ($map.numchildren > posx+1 and $map[posx+1][posy].type == "mud") { - var nt = $map[posy][posx+1]; + var nt = $map[posx+1][posy]; nt.comp = nt.comp.substring(0, 3) + "m"; nt.sync(); comp = comp + "m"; } else comp = comp + "_"; - if ($map.numchildren > posy + 1 and $map[posy+1][posx].type != "grass") + if ($map[posx].numchildren > posy+1 and $map[posx][posy+1].type != "grass") { - var nt = $map[posy+1][posx]; + var nt = $map[posx][posy+1]; nt.comp = "m" + nt.comp.substring(1); nt.sync(); comp = comp + "m"; } else comp = comp + "_"; - if (posx > 0 and $map[posy][posx-1].type != "grass") + if (posx > 0 and $map[posx-1][posy].type != "grass") { - var nt = $map[posy][posx-1]; + var nt = $map[posx-1][posy]; nt.comp = nt.comp.substring(0, 1) + "m" + nt.comp.substring(2); nt.sync(); comp = comp + "m"; @@ -105,7 +105,7 @@ var dragStop = function(v) { surface.delMoveTrap(dragMove); - surface.Release2 --= dragStop; + surface._Release2 --= dragStop; dragging = false; cascade = v; active = true; @@ -123,7 +123,7 @@ vx = width - $map.width; vy = height - $map.height; surface.addMoveTrap(dragMove); - surface.Release2 ++= dragStop; + surface._Release2 ++= dragStop; cascade = v; } @@ -152,15 +152,16 @@ thisbox.Leave ++= function(v) { $cur.display = false; } - for (var i=0; 50>i; i++) + for (var i=0; 100>i; i++) { $map[i] = vexi.box; - for (var j=0; 50>j; j++) + $map[i].orient = "vertical"; + for (var j=0; 100>j; j++) { var t = .maptile(vexi.box); t.Enter ++= enterFunc; - t.posx = j; - t.posy = i; + t.posx = i; + t.posy = j; $map[i][j] = t; } } Modified: trunk/Prototype/src/net/sourceforge/fortress/minimap.t =================================================================== --- trunk/Prototype/src/net/sourceforge/fortress/minimap.t 2007-06-20 15:57:46 UTC (rev 10) +++ trunk/Prototype/src/net/sourceforge/fortress/minimap.t 2007-06-24 23:13:29 UTC (rev 11) @@ -1,17 +1,19 @@ <!-- Copyright 2007 licensed under GPL v3 --> <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <ui:box height="100" width="100"> - <ui:box shrink="true"> - <ui:box id="minimap" cols="1" shrink="true" /> - <ui:box id="viewbox" cols="1" align="topleft" packed="false"> - <ui:box fill="white" height="1" /> + <ui:box height="100" width="100" layout="absolute"> + <ui:box layout="absolute"> + $minimap.width ++= function(v) { cascade = v; width = v; } + $minimap.height ++= function(v) { cascade = v; height = v; } + <ui:box id="minimap" shrink="true" /> + <ui:box id="viewbox" orient="vertical" align="topleft"> + <ui:box fill="white" height="1" vshrink="true" /> <ui:box> - <ui:box fill="white" width="1" /> + <ui:box fill="white" width="1" hshrink="true" /> <ui:box /> - <ui:box fill="white" width="1" /> + <ui:box fill="white" width="1" hshrink="true" /> </ui:box> - <ui:box fill="white" height="1" /> + <ui:box fill="white" height="1" vshrink="true" /> </ui:box> </ui:box> @@ -62,6 +64,7 @@ for (var i=0; ni > i; i++) { $minimap[i] = vexi.box; + $minimap[i].orient = "vertical"; for (var j=0; nj > j; j++) { var t = .minimaptile(vexi.box); @@ -73,7 +76,7 @@ surface.setMapTile = function(t) { - $minimap[t.posy][t.posx].setType(t.type, t.seed); + $minimap[t.posx][t.posy].setType(t.type, t.seed); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |