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. |