Replace pylon icon with a simple cross
authorRichard Fairhurst <richard@systemeD.net>
Sat, 7 Jul 2012 09:13:35 +0000 (10:13 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Sat, 7 Jul 2012 09:13:35 +0000 (10:13 +0100)
(less obtrusive when there are zillions marching across the landscape)

net/systemeD/halcyon/NodeUI.as
net/systemeD/halcyon/styleparser/RuleSet.as
resources/stylesheets/core_pois.css

index c25ea3d..ca53ebc 100644 (file)
@@ -122,6 +122,13 @@ package net.systemeD.halcyon {
                                                        icon.graphics.drawCircle(w/2,w/2,w/2);
                                                        if (s.interactive) { maxwidth=Math.max(w,maxwidth); }
 
+                                               } else if (s.icon_image=='cross') {
+                                                       // draw circle
+                                                       w=styleIconAsStroke(icon,subpart);
+                                                       icon.graphics.moveTo(0,0); icon.graphics.lineTo(w,w);
+                                                       icon.graphics.moveTo(0,w); icon.graphics.lineTo(w,0);
+                                                       if (s.interactive) { maxwidth=Math.max(w,maxwidth); }
+
                                                } else if (FileBank.getInstance().hasFile(s.icon_image)) {
                                                        // load icon from library
                                                        icon.addChild(FileBank.getInstance().getAsDisplayObject(s.icon_image));
@@ -172,6 +179,19 @@ package net.systemeD.halcyon {
                        // return width
                        return styleList.pointStyles[subpart].icon_width;
                }
+               
+               private function styleIconAsStroke(icon:Sprite, subpart:String):Number {
+                       loaded=true;
+                       if (styleList.shapeStyles[subpart]) {
+                               var s:ShapeStyle=styleList.shapeStyles[subpart];
+                               if (!isNaN(s.color) || s.width) {
+                                       icon.graphics.lineStyle(s.width ? s.width : 1,
+                                                                                       s.color ? s.color : 0,
+                                                                                       s.opacity ? s.opacity : 1);
+                               }
+                       }
+                       return styleList.pointStyles[subpart].icon_width;
+               }
 
                private function addHitSprite(w:uint):void {
             hitzone = new Sprite();
index be59b8d..09230d1 100644 (file)
@@ -299,7 +299,7 @@ package net.systemeD.halcyon.styleparser {
                                        else if (style is ShieldStyle && ShieldStyle(style).shield_image) { filename=ShieldStyle(style).shield_image; }
                                        else { continue; }
 
-                                       if (filename!='square' && filename!='circle')
+                                       if (filename!='square' && filename!='circle' && filename!='cross')
                                                FileBank.getInstance().addFromFile(filename);
                                }
                        }
index a2aa316..5f451cf 100644 (file)
@@ -122,8 +122,8 @@ node[man_made=tower] { icon-image: icons/manmade_tower.png; z-index: 20; }
 /* Yes these power stations seem a little backward - but that's seemingly what the side menu uses ATM */
 node[power=station] { icon-image: icons/power_substation.n.16.png; z-index: 20; }
 node[power=generator] { icon-image: icons/power_station.png; z-index: 20; text-offset:15; text: name; font-size: 10; z-index: 20; }
-node[power=tower] { icon-image: icons/power_tower_high2.n.16.png; z-index: 20; }
-node[power=pole] { icon-image: icons/power_tower_low.n.16.png; z-index: 20; }
+node[power=tower] { icon-image: cross; icon-width: 7; width: 3; color: #F44; z-index: 20; }
+node[power=pole] { icon-image: cross; icon-width: 7; width: 3; color: #444; z-index: 20; }
 node[waterway=weir] { icon-image: icons/transport_weir.n.16.png; z-index: 20; }
 
 /* Addressing */