From: <cl...@us...> - 2009-03-23 03:23:23
|
Revision: 109 http://fortress.svn.sourceforge.net/fortress/?rev=109&view=rev Author: clrg Date: 2009-03-23 03:23:13 +0000 (Mon, 23 Mar 2009) Log Message: ----------- A few fixes, minor enhancements for the prototype - however, it is not a tenable approach Modified Paths: -------------- trunk/classic/src/net/sourceforge/fortress/app.t trunk/classic/src/net/sourceforge/fortress/game.t trunk/classic/src/net/sourceforge/fortress/isogrid.t trunk/classic/src/net/sourceforge/fortress/minimap.t trunk/classic/src/net/sourceforge/fortress/minimaptile.t trunk/classic/src/net/sourceforge/fortress/twoquarter.t Modified: trunk/classic/src/net/sourceforge/fortress/app.t =================================================================== (Binary files differ) Modified: trunk/classic/src/net/sourceforge/fortress/game.t =================================================================== --- trunk/classic/src/net/sourceforge/fortress/game.t 2009-03-23 02:26:32 UTC (rev 108) +++ trunk/classic/src/net/sourceforge/fortress/game.t 2009-03-23 03:23:13 UTC (rev 109) @@ -15,7 +15,7 @@ </panel> <ui:box> <panel id="left" hshrink="true" orient="vertical" padding="5" /> - <layout:border border="#ffcc00" depth="1"> + <layout:border border="#ffcc00" depth="1" layout="place"> <isogrid id="map" /> </layout:border> <panel id="right" hshrink="true" orient="vertical" padding="5" /> Modified: trunk/classic/src/net/sourceforge/fortress/isogrid.t =================================================================== (Binary files differ) Modified: trunk/classic/src/net/sourceforge/fortress/minimap.t =================================================================== --- trunk/classic/src/net/sourceforge/fortress/minimap.t 2009-03-23 02:26:32 UTC (rev 108) +++ trunk/classic/src/net/sourceforge/fortress/minimap.t 2009-03-23 03:23:13 UTC (rev 109) @@ -2,7 +2,7 @@ <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> <ui:box height="100" width="100" layout="place"> - <ui:box layout="place"> + <ui:box align="topleft" layout="place"> $minimap.width ++= function(v) { cascade = v; width = v; } $minimap.height ++= function(v) { cascade = v; height = v; } <ui:box id="minimap" shrink="true" /> @@ -25,8 +25,7 @@ var view_h = 1; /** synchronizes the viewbox with the map */ - var syncView = function() - { + var syncView = function() { $viewbox.width = $minimap.width * (view_w / map_w) + 2; $viewbox.height = $minimap.height * (view_h / map_h) + 2; $viewbox.x = $minimap.width * (-map_x / map_w) - 1; @@ -36,8 +35,7 @@ var mx, my; var ox, oy; - var moveMap = function() - { + var moveMap = function() { // assumes minimap tiles are 1px by 1px var m = surface.mouse; var nx = ox + m.x - mx; @@ -47,22 +45,19 @@ surface.moveMapTo(nx, ny); } - var moveMapFunc = function(v) - { + var moveMapFunc = function(v) { cascade = v; moveMap(); } - var releaseFunc = function(v) - { + var releaseFunc = function(v) { cascade = v; surface.delMoveTrap(moveMapFunc); surface.Focused --= releaseFunc; surface._Release1 --= releaseFunc; } - var pressFunc = function(v) - { + var pressFunc = function(v) { cascade = v; var m = surface.mouse; mx = m.x; @@ -77,41 +72,34 @@ thisbox.Press1 ++= pressFunc; - surface ++= function(v) - { + surface ++= function(v) { cascade = v; - surface.setMapView = function(vw, vh) - { + surface.setMapView = function(vw, vh) { view_w = vw; view_h = vh; syncView(); } - surface.setMapDim = function(mw, mh) - { + surface.setMapDim = function(mw, mh) { map_w = mw; map_h = mh; syncView(); } - surface.setMapPos = function(mx, my) - { + surface.setMapPos = function(mx, my) { map_x = mx; map_y = my; syncView(); } - surface.setMap = function(map) - { + surface.setMap = function(map) { var ni = map.numchildren; var nj = map[0].numchildren; - for (var i=0; ni > i; i++) - { + for (var i=0; ni > i; i++) { $minimap[i] = vexi.box; $minimap[i].orient = "vertical"; - for (var j=0; nj > j; j++) - { + for (var j=0; nj > j; j++) { var t = .minimaptile(vexi.box); t.Press1 ++= moveMapFunc; t.setType(map[i][j].type, map[i][j].seed); @@ -120,9 +108,8 @@ } } - surface.setMapTile = function(t) - { - $minimap[t.posx][t.posy].setType(t.type, t.seed); + surface.setMapTile = function(x, y, type, seed) { + $minimap[x][y].setType(type, seed); } } Modified: trunk/classic/src/net/sourceforge/fortress/minimaptile.t =================================================================== --- trunk/classic/src/net/sourceforge/fortress/minimaptile.t 2009-03-23 02:26:32 UTC (rev 108) +++ trunk/classic/src/net/sourceforge/fortress/minimaptile.t 2009-03-23 03:23:13 UTC (rev 109) @@ -3,6 +3,7 @@ <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> <ui:box width="1" height="1" shrink="true"> + /** returns a random tint to make the minimap look less bland */ var getFillHex = function(s) { switch (s) { case 0: return "50"; @@ -21,6 +22,9 @@ thisbox.setType = function(t, s) { switch (t) { + case "castle": + fill = "#8B4513"; + break; case "mud": fill = "#5f2a07"; break; Modified: trunk/classic/src/net/sourceforge/fortress/twoquarter.t =================================================================== --- trunk/classic/src/net/sourceforge/fortress/twoquarter.t 2009-03-23 02:26:32 UTC (rev 108) +++ trunk/classic/src/net/sourceforge/fortress/twoquarter.t 2009-03-23 03:23:13 UTC (rev 109) @@ -28,24 +28,24 @@ sync(); thisbox.addPiece = function(type, top, left, zoffset) { - type = type.split('.'); - var z = static.zindex[type[0]]; + var t = type.split('.'); + var z = static.zindex[t[0]]; if (z == null) throw "tried to add nonregistered type '"+type+"' from "+posx+", "+posy; - // static.z*zoffset allows us to place tiles untouchably infronts + // static.z*zoffset allows us to place tiles untouchably infront of others z += static.z * (zoffset ? zoffset : 0); var p; var i = 0; - while (numchildren > i) { + var n = numchildren; + while (n > i) { p = thisbox[i]; if (p.z == z and p.left == left and p.top == top) - throw "tried to add a duplicate piece '"+type[0]+"("+z+") ' from "+posx+", "+posy; + throw "tried to add a duplicate piece '"+t[0]+"("+z+") ' from "+posx+", "+posy; if (p.z > z) break; i++; } var r = .iso96; - for (var i=0; type.length>i; i++) - r = r[type[i]]; + for (var i=0; t.length>i; i++) r = r[t[i]]; var b = vexi.box; b.fill = r; b.left = left; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |