Beginnings of status API support, including WTFE and dedicated UI for selecting it
[potlatch2.git] / net / systemeD / halcyon / EntityUI.as
index d5fb8f4cf6fb7cbfde5cdc2a659b8d8981580c66..4a2c62d11adf1f61fdde7741ecf2eb82970b7c02 100644 (file)
@@ -55,6 +55,7 @@ package net.systemeD.halcyon {
                        this.entity=entity;
                        this.paint=paint;
             entity.addEventListener(Connection.TAG_CHANGED, tagChanged, false, 0, true);
+            entity.addEventListener(Connection.STATUS_CHANGED, statusChanged, false, 0, true);
                        entity.addEventListener(Connection.ADDED_TO_RELATION, relationAdded, false, 0, true);
                        entity.addEventListener(Connection.REMOVED_FROM_RELATION, relationRemoved, false, 0, true);
                        entity.addEventListener(Connection.SUSPEND_REDRAW, suspendRedraw, false, 0, true);
@@ -71,6 +72,7 @@ package net.systemeD.halcyon {
                /** Remove the default event listeners. */
                protected function removeGenericEventListeners():void {
             entity.removeEventListener(Connection.TAG_CHANGED, tagChanged);
+            entity.removeEventListener(Connection.STATUS_CHANGED, statusChanged);
                        entity.removeEventListener(Connection.ADDED_TO_RELATION, relationAdded);
                        entity.removeEventListener(Connection.REMOVED_FROM_RELATION, relationRemoved);
                        entity.removeEventListener(Connection.SUSPEND_REDRAW, suspendRedraw);
@@ -123,6 +125,11 @@ package net.systemeD.halcyon {
             redraw();
         }
                
+        protected function statusChanged(event:EntityEvent):void {
+                       invalidateStyleList();
+            redraw();
+        }
+
         protected function mouseEvent(event:MouseEvent):void {
                        paint.map.entityMouseEvent(event, entity);
         }