From: <cl...@us...> - 2007-07-11 00:06:26
|
Revision: 46 http://fortress.svn.sourceforge.net/fortress/?rev=46&view=rev Author: clrg Date: 2007-07-10 17:06:28 -0700 (Tue, 10 Jul 2007) Log Message: ----------- Rewrite the prototype to use isometric layout instead of a regular grid Modified Paths: -------------- trunk/client/src/main.t trunk/client/src/net/sourceforge/fortress/preloadimages.t Added Paths: ----------- trunk/client/src/net/sourceforge/fortress/game.t trunk/client/src/net/sourceforge/fortress/image/iso96/ trunk/client/src/net/sourceforge/fortress/image/iso96/grid.png trunk/client/src/net/sourceforge/fortress/image/iso96/highlight.png trunk/client/src/net/sourceforge/fortress/isogrid.t trunk/client/src/net/sourceforge/fortress/twoquarter.t Removed Paths: ------------- trunk/client/src/net/sourceforge/fortress/app.t trunk/client/src/net/sourceforge/fortress/image/mud/ trunk/client/src/net/sourceforge/fortress/map.t trunk/client/src/net/sourceforge/fortress/maptile.t Modified: trunk/client/src/main.t =================================================================== --- trunk/client/src/main.t 2007-07-10 22:37:09 UTC (rev 45) +++ trunk/client/src/main.t 2007-07-11 00:06:28 UTC (rev 46) @@ -1,5 +1,5 @@ <!-- Copyright 2007 licensed under GPL v3 --> <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <app /> + <game /> </vexi> Deleted: trunk/client/src/net/sourceforge/fortress/app.t =================================================================== --- trunk/client/src/net/sourceforge/fortress/app.t 2007-07-10 22:37:09 UTC (rev 45) +++ trunk/client/src/net/sourceforge/fortress/app.t 2007-07-11 00:06:28 UTC (rev 46) @@ -1,28 +0,0 @@ -<!-- Copyright 2007 licensed under GPL v3 --> - -<vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress" xmlns:widget="vexi.widget"> - <widget:surface /> - <preloadimages /> - <ui:box titlebar="Fortress Prototype"> - <ui:box orient="vertical" shrink="true"> - <minimap /> - <ui:box fill="#888888" height="1" /> - <ui:box height="5" /> - <ui:box id="tiletype" align="center" textcolor="white" /> - <ui:box height="5" /> - <ui:box id="position" align="center" textcolor="white" /> - </ui:box> - <ui:box fill="#888888" width="1" hshrink="true" /> - <map id="map" /> - - vexi.ui.frame = thisbox; - - $map.active ++= function(v) - { - $position.text = "( "+$map.activeTile.posx+", "+$map.activeTile.posy+" )"; - $tiletype.text = $map.activeTile.type; - cascade = v; - } - - </ui:box> -</vexi> \ No newline at end of file Copied: trunk/client/src/net/sourceforge/fortress/game.t (from rev 42, trunk/client/src/net/sourceforge/fortress/app.t) =================================================================== --- trunk/client/src/net/sourceforge/fortress/game.t (rev 0) +++ trunk/client/src/net/sourceforge/fortress/game.t 2007-07-11 00:06:28 UTC (rev 46) @@ -0,0 +1,12 @@ +<!-- Copyright 2007 licensed under GPL v3 --> + +<vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress" xmlns:widget="vexi.widget"> + <widget:surface /> + <preloadimages /> + <ui:box titlebar="Fortress Prototype"> + <isogrid id="map" /> + + vexi.ui.frame = thisbox; + + </ui:box> +</vexi> \ No newline at end of file Added: trunk/client/src/net/sourceforge/fortress/image/iso96/grid.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/image/iso96/grid.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/net/sourceforge/fortress/image/iso96/highlight.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/image/iso96/highlight.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/net/sourceforge/fortress/isogrid.t =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/isogrid.t ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Deleted: trunk/client/src/net/sourceforge/fortress/map.t =================================================================== --- trunk/client/src/net/sourceforge/fortress/map.t 2007-07-10 22:37:09 UTC (rev 45) +++ trunk/client/src/net/sourceforge/fortress/map.t 2007-07-11 00:06:28 UTC (rev 46) @@ -1,199 +0,0 @@ -<!-- Copyright 2007 licensed under GPL v3 --> - -<vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <ui:box layout="absolute"> - <ui:box id="map" shrink="true" /> - <ui:box id="cur" fill="#88ffffff" display="false" /> - - var drag1 = false; - var drag2 = false; - - //////// sample road creation ///////////////////////////////// - - var createMudTile = function(tile) - { - if (tile.type == "mud") return; - var posx = tile.posx; - var posy = tile.posy; - var comp = ""; - if (posy > 0 and $map[posx][posy-1].type == "mud") - { - 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.numchildren > posx+1 and $map[posx+1][posy].type == "mud") - { - var nt = $map[posx+1][posy]; - nt.comp = nt.comp.substring(0, 3) + "m"; - nt.sync(); - comp = comp + "m"; - } - else comp = comp + "_"; - if ($map[posx].numchildren > posy+1 and $map[posx][posy+1].type != "grass") - { - 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[posx-1][posy].type != "grass") - { - var nt = $map[posx-1][posy]; - nt.comp = nt.comp.substring(0, 1) + "m" + nt.comp.substring(2); - nt.sync(); - comp = comp + "m"; - } - else comp = comp + "_"; - tile.seed = ""; - tile.type = "mud"; - tile.comp = comp; - tile.sync(); - surface.setMapTile(tile); - } - - var sr1Func = function(v) - { - drag1 = false; - surface.Focused --= sr1Func; - surface._Release1 --= sr1Func; - } - - thisbox.Press1 ++= function(v) - { - if (!activeTile or drag2) return; - createMudTile(activeTile); - drag1 = true; - surface.Focused ++= sr1Func; - surface._Release1 ++= sr1Func; - } - - //////// minimap interaction ////////////////////////////////// - - var mapDim = function(v) - { - cascade = v; - surface.setMapDim($map.width, $map.height); - } - - $map.width ++= mapDim; - $map.height ++= mapDim; - - var mapBox = function(v) - { - cascade = v; - surface.setMapBox(width, height); - } - - thisbox.width ++= mapBox; - thisbox.height ++= mapBox; - - //////// map movement ///////////////////////////////////////// - - var mx; - var my; - var ox; - var oy; - var vx; - var vy; - - var dragMove = function(v) - { - var m = thisbox.mouse; - 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; - $map.y = ny; - surface.setMapPos(nx, ny); - cascade = v; - } - - var dragStop = function(v) - { - surface.delMoveTrap(dragMove); - surface._Release2 --= dragStop; - drag2 = false; - cascade = v; - active = true; - } - - var dragStart = function(v) - { - if (drag1) return; - drag2 = true; - $cur.display = false; - var m = thisbox.mouse; - mx = m.x; - my = m.y; - ox = $map.x; - oy = $map.y; - vx = width - $map.width; - vy = height - $map.height; - surface.addMoveTrap(dragMove); - surface._Release2 ++= dragStop; - cascade = v; - } - - thisbox.Press2 ++= dragStart; - - //////// tile tracking //////////////////////////////////////// - - thisbox.activeTile = null; - - thisbox.active ++= function(v) - { - var d = thisbox.distanceto(activeTile); - $cur.display = true; - $cur.width = activeTile.width; - $cur.height = activeTile.height; - $cur.x = d.x; - $cur.y = d.y; - } - - var enterFunc = function(v) - { - cascade = v; - activeTile = trapee; - if (drag1) createMudTile(trapee); - if (!drag2) active = true; - } - - thisbox.Leave ++= function(v) { $cur.display = false; } - - for (var i=0; 100>i; i++) - { - $map[i] = vexi.box; - $map[i].orient = "vertical"; - for (var j=0; 100>j; j++) - { - var t = .maptile(vexi.box); - t.Enter ++= enterFunc; - t.posx = i; - t.posy = j; - $map[i][j] = t; - } - } - - surface ++= function(v) - { - cascade = v; - surface.setMapContents($map); - - surface.moveMapTo = function(x, y) - { - var d = $map.distanceto($map[x][y]); - var dx = width/2 - d.x; - var dy = height/2 - d.y; - $map.x = 0 > dx ? (dx > width - $map.width ? dx : width - $map.width) : 0; - $map.y = 0 > dy ? (dy > height - $map.height ? dy : height - $map.height) : 0; - surface.setMapPos($map.x, $map.y); - } - } - - </ui:box> -</vexi> \ No newline at end of file Deleted: trunk/client/src/net/sourceforge/fortress/maptile.t =================================================================== --- trunk/client/src/net/sourceforge/fortress/maptile.t 2007-07-10 22:37:09 UTC (rev 45) +++ trunk/client/src/net/sourceforge/fortress/maptile.t 2007-07-11 00:06:28 UTC (rev 46) @@ -1,14 +0,0 @@ -<!-- Copyright 2007 licensed under GPL v3 --> - -<vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <ui:box shrink="true" width="20" height="20"> - - thisbox.sync = function() { fill = .image[type][type+comp+seed]; } - thisbox.type = "grass"; - thisbox.comp = ""; - thisbox.seed = vexi.math.floor(vexi.math.random()*10); - - sync(); - - </ui:box> -</vexi> \ No newline at end of file Modified: trunk/client/src/net/sourceforge/fortress/preloadimages.t =================================================================== (Binary files differ) Copied: trunk/client/src/net/sourceforge/fortress/twoquarter.t (from rev 42, trunk/client/src/net/sourceforge/fortress/maptile.t) =================================================================== --- trunk/client/src/net/sourceforge/fortress/twoquarter.t (rev 0) +++ trunk/client/src/net/sourceforge/fortress/twoquarter.t 2007-07-11 00:06:28 UTC (rev 46) @@ -0,0 +1,99 @@ +<!-- Copyright 2007 licensed under GPL v3 --> + +<vexi xmlns:ui="vexi://ui" xmlns:meta="vexi://meta" xmlns="net.sourceforge.fortress"> + <meta:doc> + <author>Charles Goodwin</author> + <about>An portion of an isometric tile on the map</about> + <usage> + A tile representing two quarters of an isometric tile on + the map (hence the name). The two quarters are either side + of a diagonal axis of the template box. + + There are two types of tile - top and bottom. This means + whether the tile to the right is a top piece or on the + bottom of an isometric tile. + </usage> + </meta:doc> + + <ui:box layout="absolute" shrink="true" width="48" height="24"> + + // top-left vs bottom-left + thisbox.top = true; + // used to give the graphics a non-repeating feel + thisbox.seed = vexi.math.floor(vexi.math.random()*10); + + thisbox.addPiece = function(type, left) + { + var z = static.zindex[type]; + if (z == null) throw "tried to add nonregistered type '"+type+"' from "+posx+", "+posy; + var i = 0; + while (numchildren > i) + { + if (thisbox[i].type == type and thisbox[i].left == left) + throw "tried to add a duplicate tile piece of type '"+type+"' from "+posx+", "+posy; + if (thisbox[i].z > z) break; + i++; + } + + var b = vexi.box; + b.fill = .image[static.tileset][type]; + b.left = left; + b.shrink = true; + b.type = type; + b.x = left ? 0 : -48; + b.y = top ? 0 : -24; + //vexi.log.info(posx+", "+posy+" -- "+top+", "+left); + b.z = z; + thisbox[i] = b; + } + + thisbox.delPiece = function(type, left) + { + for (var i=0; numchildren>i; i++) + { + if (thisbox[i].type == type and thisbox[i].left == left) + { + thisbox[i] = null; + return; + } + } + throw "tried to clear a non-existent piece of type '"+type+"' from "+posx+", "+posy; + } + + thisbox.posx ++= static.posFunc; + thisbox.posy ++= static.posFunc; + + </ui:box> + + static.posFunc = function(v) + { + cascade = v; + trapee.top = 0 == (trapee.posx + trapee.posy) % 2; + } + + static.tileset = "iso96"; + + static.varies = { }; + static.zindex = { }; + static.ztiles = [ ]; + static.z = 0; + + static.register = function(name, v) + { + if (zindex[name]) throw "duplicate entrie in zindex table"; + if (!v) v = 1; + varies[name] = v; + zindex[name] = static.z; + ztiles[static.z] = name; + static.z++; + } + + static.init = function() + { + register("highlight"); + register("grid"); + } + + { init(); } + +</vexi> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cl...@us...> - 2007-07-17 10:50:17
|
Revision: 56 http://fortress.svn.sourceforge.net/fortress/?rev=56&view=rev Author: clrg Date: 2007-07-17 03:50:19 -0700 (Tue, 17 Jul 2007) Log Message: ----------- Major UI updates - add menu for starting game - add loading screen / animation - move minimap + elements to bottom of game screen Modified Paths: -------------- trunk/client/src/main.t trunk/client/src/net/sourceforge/fortress/game.t trunk/client/src/net/sourceforge/fortress/isogrid.t trunk/client/src/net/sourceforge/fortress/minimap.t trunk/client/src/net/sourceforge/fortress/panel.t trunk/client/src/net/sourceforge/fortress/shadowtext.t trunk/client/src/net/sourceforge/fortress/twoquarter.t Added Paths: ----------- trunk/client/src/net/sourceforge/fortress/app.t trunk/client/src/net/sourceforge/fortress/appitem.t trunk/client/src/net/sourceforge/fortress/busy.t trunk/client/src/net/sourceforge/fortress/image/process.png Modified: trunk/client/src/main.t =================================================================== --- trunk/client/src/main.t 2007-07-16 00:30:20 UTC (rev 55) +++ trunk/client/src/main.t 2007-07-17 10:50:19 UTC (rev 56) @@ -1,5 +1,5 @@ <!-- Copyright 2007 licensed under GPL v3 --> <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <game /> + <app /> </vexi> Added: trunk/client/src/net/sourceforge/fortress/app.t =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/app.t ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/net/sourceforge/fortress/appitem.t =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/appitem.t ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/net/sourceforge/fortress/busy.t =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/busy.t ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/client/src/net/sourceforge/fortress/game.t =================================================================== --- trunk/client/src/net/sourceforge/fortress/game.t 2007-07-16 00:30:20 UTC (rev 55) +++ trunk/client/src/net/sourceforge/fortress/game.t 2007-07-17 10:50:19 UTC (rev 56) @@ -2,39 +2,40 @@ <vexi xmlns:ui="vexi://ui" xmlns:layout="vexi.layout" xmlns:widget="vexi.widget" xmlns="net.sourceforge.fortress"> - <widget:surface /> <preloadimages /> - <ui:box orient="vertical" titlebar="Fortress Prototype"> + <ui:box orient="vertical"> <panel id="top" padding="10" vshrink="true"> <shadowtext text="Fortress Prototype v2" /> <ui:box /> <shadowtext text="Map Size 100 x 100" shrink="true" /> </panel> <ui:box> - <panel id="left" hshrink="true" orient="vertical" padding="0 10"> - <layout:border border="#ffcc00" depth="1" shrink="true"> - <minimap id="minimap" /> - </layout:border> - <ui:box orient="vertical" vshrink="true"> - <ui:box height="10" /> - <widget:check id="gridon" cursor="hand" focusable="false" selected="true"> - <shadowtext text="Toggle Grid" /> - </widget:check> - <ui:box height="10" /> - <widget:check id="invert" cursor="hand" focusable="false" selected="false"> - <shadowtext text="Invert Mouse" /> - </widget:check> - </ui:box> - <ui:box /> - </panel> + <panel id="left" hshrink="true" orient="vertical" padding="5" /> <layout:border border="#ffcc00" depth="1"> <isogrid id="map" /> </layout:border> - <panel id="right" hshrink="true" padding="5" /> + <panel id="right" hshrink="true" orient="vertical" padding="5" /> </ui:box> - <panel id="bottom" vshrink="true" padding="5" /> + <panel id="bottom" vshrink="true" padding="10"> + <layout:border border="#ffcc00" depth="1" shrink="true"> + <minimap id="minimap" /> + </layout:border> + <ui:box orient="vertical" vshrink="true"> + <ui:box height="10" /> + <widget:check id="gridon" cursor="hand" focusable="false" selected="true"> + <shadowtext text="Toggle Grid" /> + </widget:check> + <ui:box height="10" /> + <widget:check id="invert" cursor="hand" focusable="false" selected="false"> + <shadowtext text="Invert Mouse" /> + </widget:check> + </ui:box> + <layout:border border="#ffcc00" depth="1" shrink="true"> + <ui:box width="100" height="100" /> + </layout:border> + </panel> - vexi.ui.frame = thisbox; + thisbox.init = $map.init; //// Map / Sidebar Interaction //////////////////////////////// @@ -46,6 +47,7 @@ $top.height ++= function(v) { cascade = v; + if (!display) return; $left.bgy = -v; $right.bgy = -v; } @@ -53,6 +55,7 @@ $map.height ++= function(v) { cascade = v; + if (!display) return; $bottom.bgy = -((v + $top.height)%256); surface.setMapView(vexi.math.floor($map.width / 48), vexi.math.floor(v / 24)); } @@ -60,6 +63,7 @@ $map.width ++= function(v) { cascade = v; + if (!display) return; $right.bgx = -((v + $left.width)%256); surface.setMapView(vexi.math.floor(v / 48), vexi.math.floor($map.height / 24)); } Added: trunk/client/src/net/sourceforge/fortress/image/process.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/net/sourceforge/fortress/image/process.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/client/src/net/sourceforge/fortress/isogrid.t =================================================================== (Binary files differ) Modified: trunk/client/src/net/sourceforge/fortress/minimap.t =================================================================== --- trunk/client/src/net/sourceforge/fortress/minimap.t 2007-07-16 00:30:20 UTC (rev 55) +++ trunk/client/src/net/sourceforge/fortress/minimap.t 2007-07-17 10:50:19 UTC (rev 56) @@ -1,8 +1,8 @@ <!-- Copyright 2007 licensed under GPL v3 --> <vexi xmlns:ui="vexi://ui" xmlns="net.sourceforge.fortress"> - <ui:box height="100" width="100" layout="absolute"> - <ui:box layout="absolute"> + <ui:box height="100" width="100" layout="place"> + <ui:box layout="place"> $minimap.width ++= function(v) { cascade = v; width = v; } $minimap.height ++= function(v) { cascade = v; height = v; } <ui:box id="minimap" shrink="true" /> @@ -27,10 +27,10 @@ /** synchronizes the viewbox with the map */ var syncView = function() { - $viewbox.width = $minimap.width * (view_w / map_w) + 1; - $viewbox.height = $minimap.height * (view_h / map_h) + 1; - $viewbox.x = $minimap.width * (-map_x / map_w); - $viewbox.y = $minimap.height * (-map_y / map_h); + $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; + $viewbox.y = $minimap.height * (-map_y / map_h) - 1; } var mx, my; Modified: trunk/client/src/net/sourceforge/fortress/panel.t =================================================================== (Binary files differ) Modified: trunk/client/src/net/sourceforge/fortress/shadowtext.t =================================================================== (Binary files differ) Modified: trunk/client/src/net/sourceforge/fortress/twoquarter.t =================================================================== --- trunk/client/src/net/sourceforge/fortress/twoquarter.t 2007-07-16 00:30:20 UTC (rev 55) +++ trunk/client/src/net/sourceforge/fortress/twoquarter.t 2007-07-17 10:50:19 UTC (rev 56) @@ -15,7 +15,7 @@ </usage> </meta:doc> - <ui:box layout="absolute" shrink="true" width="48" height="24"> + <ui:box layout="place" shrink="true" width="48" height="24"> // top-left vs bottom-left thisbox.forward; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <cl...@us...> - 2007-10-12 02:54:16
|
Revision: 95 http://fortress.svn.sourceforge.net/fortress/?rev=95&view=rev Author: clrg Date: 2007-10-11 19:54:10 -0700 (Thu, 11 Oct 2007) Log Message: ----------- Start renovating the prototype - going with a different structure (fewer folders) - implements a unit animation previewer Added Paths: ----------- trunk/client/src/fortress/ trunk/client/src/fortress/image/ trunk/client/src/fortress/image/misc/ trunk/client/src/fortress/image/misc/arrow1_fe.png trunk/client/src/fortress/image/misc/arrow1_fn.png trunk/client/src/fortress/image/misc/arrow1_fne.png trunk/client/src/fortress/image/misc/arrow1_fnw.png trunk/client/src/fortress/image/misc/arrow1_fs.png trunk/client/src/fortress/image/misc/arrow1_fse.png trunk/client/src/fortress/image/misc/arrow1_fsw.png trunk/client/src/fortress/image/misc/arrow1_fw.png trunk/client/src/fortress/image/misc/arrow2_fe.png trunk/client/src/fortress/image/misc/arrow2_fn.png trunk/client/src/fortress/image/misc/arrow2_fne.png trunk/client/src/fortress/image/misc/arrow2_fnw.png trunk/client/src/fortress/image/misc/arrow2_fs.png trunk/client/src/fortress/image/misc/arrow2_fse.png trunk/client/src/fortress/image/misc/arrow2_fsw.png trunk/client/src/fortress/image/misc/arrow2_fw.png trunk/client/src/fortress/image/unit/ trunk/client/src/fortress/unit/ trunk/client/src/fortress/unit/anim.t trunk/client/src/fortress/unit/archer.t trunk/client/src/fortress/unit/arrow.t trunk/client/src/fortress/unit/base.t trunk/client/src/fortress/unit/preview.t Added: trunk/client/src/fortress/image/misc/arrow1_fe.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fe.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fn.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fn.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fne.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fne.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fnw.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fnw.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fs.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fs.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fse.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fse.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fsw.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fsw.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow1_fw.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow1_fw.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fe.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fe.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fn.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fn.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fne.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fne.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fnw.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fnw.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fs.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fs.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fse.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fse.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fsw.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fsw.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/image/misc/arrow2_fw.png =================================================================== (Binary files differ) Property changes on: trunk/client/src/fortress/image/misc/arrow2_fw.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/client/src/fortress/unit/anim.t =================================================================== Added: trunk/client/src/fortress/unit/archer.t =================================================================== Added: trunk/client/src/fortress/unit/arrow.t =================================================================== --- trunk/client/src/fortress/unit/arrow.t (rev 0) +++ trunk/client/src/fortress/unit/arrow.t 2007-10-12 02:54:10 UTC (rev 95) @@ -0,0 +1,33 @@ +<vexi xmlns:ui="vexi://ui" xmlns="fortress.image"> + <ui:box cursor="hand" width="38" height="38" layout="layer" shrink="true"> + <ui:box id="arrow" display="false" shrink="true" /> + + thisbox.full = false; + + var syncArrow = function(v) { + cascade = v; + $arrow.fill = .misc["arrow"+(full?"1":"2")+"_"+face]; + $arrow.align = static.facealigns[face]; + } + + thisbox.full ++= syncArrow; + thisbox.face ++= syncArrow; + + thisbox.full ++= function(v) { cascade = v; if (!v) $arrow.display = false; } + + Enter ++= function(v) { + cascade = v; + $arrow.display = true; + } + + Leave ++= function(v) { + cascade = v; + if (!full) $arrow.display = false; + } + + </ui:box> + + static.facealigns = { fn: "bottom", fs: "top", fe:"left", fw:"right", + fne: "bottomleft", fnw: "bottomright", fse: "topleft", fsw: "topright" }; + +</vexi> \ No newline at end of file Added: trunk/client/src/fortress/unit/base.t =================================================================== --- trunk/client/src/fortress/unit/base.t (rev 0) +++ trunk/client/src/fortress/unit/base.t 2007-10-12 02:54:10 UTC (rev 95) @@ -0,0 +1,71 @@ +<vexi xmlns:ui="vexi://ui" xmlns="fortress.unit"> + <ui:box redirect="null" layout="layer" width="32" height="32"> + <ui:box id="image" align="topleft" shrink="true" /> + + var xoffset = 0; + var yoffset = 0; + var stop = false; + + thisbox.face = null; + thisbox.source = null; + thisbox.state = null; + + source ++= function(v) { + cascade = v; + for (var seq in v) { + if (seq.charAt(0) == '.') continue; + static.cache(v, seq); + } + state = null; + } + + var motion = function(v) { + while (!stop) { + $image.x = -xoffset; + $image.y = -yoffset; + xoffset += 32; + if (xoffset >= $image.width) xoffset = 0; + vexi.thread.sleep(100); + } + stop = false; + tip = false; + } + + var animate = function() { + if (tip) return; + tip = true; + vexi.thread = motion; + } + + state ++= function(v) { + cascade = v; + if (!state) { stop = true; return; } + $image.fill = source[state]; + xoffset = 0; + animate(); + } + + face ++= function(v) { + cascade = v; + yoffset = 32 * ((face and static.facepos[face]) ? static.facepos[face] : 0); + animate(); + } + + visible ++= function(v) { + cascade = v; + if (!v) stop = true; + } + + </ui:box> + + var imagecache = {}; + + static.cache = function(src, seq) { + var b = vexi.box; + try { b.fill = src[seq]; } catch (e) { vexi.log.info(e); } + imagecache[seq] = b; + } + + static.facepos = { fn: 2, fs: 3, fw: 1, fe: 0, fne: 4, fnw:6, fse:5, fsw:7 }; + +</vexi> \ No newline at end of file Added: trunk/client/src/fortress/unit/preview.t =================================================================== --- trunk/client/src/fortress/unit/preview.t (rev 0) +++ trunk/client/src/fortress/unit/preview.t 2007-10-12 02:54:10 UTC (rev 95) @@ -0,0 +1,95 @@ +<vexi xmlns:ui="vexi://ui" xmlns="vexi.widget" + xmlns:image="fortress.image" xmlns:unit="fortress.unit"> + <surface /> + <ui:box frameheight="200" framewidth="420"> + <pad orient="vertical" padding="10" hshrink="true"> + <ui:box vshrink="true" text="Unit" /> + <option id="units" /> + <ui:box vshrink="true" text="Animation" /> + <option id="anims" /> + <ui:box vshrink="true" text="Zoom Level" /> + <ui:box vshrink="true"> + <radio id="x1" text="x1" /> + <radio id="x2" text="x2" /> + <radio id="x4" text="x4" /> + </ui:box> + <ui:box /> + </pad> + <ui:box orient="vertical" hshrink="true"> + <ui:box shrink="true"> + <unit:arrow id="fnw" face="fnw" /> + <unit:arrow id="fn" face="fn" /> + <unit:arrow id="fne" face="fne" /> + </ui:box> + <ui:box shrink="true"> + <unit:arrow id="fw" face="fw" /> + <ui:box layout="layer" width="38" height="38"> + <unit:base id="base" /> + </ui:box> + <unit:arrow id="fe" face="fe" /> + </ui:box> + <ui:box shrink="true"> + <unit:arrow id="fsw" face="fsw" /> + <unit:arrow id="fs" face="fs" /> + <unit:arrow id="fse" face="fse" /> + </ui:box> + <ui:box /> + </ui:box> + <ui:box /> + + vexi.ui.frame = thisbox; + + var nowface = null; + + var pressEvent = function(v) { + cascade = v; + var t = trapee; + if (t == nowface) return; + if (nowface) { + nowface.full = false; + } + nowface = t; + $base.face = t.face; + t.full = true; + } + + $fnw.Press1 ++= pressEvent; + $fn.Press1 ++= pressEvent; + $fne.Press1 ++= pressEvent; + $fw.Press1 ++= pressEvent; + $fe.Press1 ++= pressEvent; + $fsw.Press1 ++= pressEvent; + $fs.Press1 ++= pressEvent; + $fse.Press1 ++= pressEvent; + + for (var u in image.unit) { + if (u.charAt(0) == '.') continue; + var b = .item(vexi.box); + b.text = u; + $units[$units.numchildren] = b; + } + + $anims.value ++= function(v) { + cascade = v; + $base.state = v; + } + + $units.value ++= function(v) { + cascade = v; + while ($anims[0]) $anims[0] = null; + var animbase = image.unit[v]; + for (var a in animbase) { + if (a.charAt(0) == '.') continue; + var b = .item(vexi.box); + b.text = a.substring(0, a.length-4); + b.value = a; + $anims[0] = b; + } + $base.source = animbase; + if ($anims[0]) $anims[0].selected = true; + } + + if ($units[0]) $units[0].selected = true; + + </ui:box> +</vexi> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |