Remove outdated Color component and migration system
This commit is contained in:
@@ -215,7 +215,6 @@
|
|||||||
(archive.addAndProcessSystem (new KeyShortcutSystem this) ui)
|
(archive.addAndProcessSystem (new KeyShortcutSystem this) ui)
|
||||||
(archive.addSystem (new DLSystem))
|
(archive.addSystem (new DLSystem))
|
||||||
(archive.addSystem (new AutoStepperSystem))
|
(archive.addSystem (new AutoStepperSystem))
|
||||||
(archive.addSystem (new ColorSystem))
|
|
||||||
|
|
||||||
(localFunction colorEqual [:nat.components.ColorI c1 :nat.components.ColorI c2]
|
(localFunction colorEqual [:nat.components.ColorI c1 :nat.components.ColorI c2]
|
||||||
(and (= c1.r c2.r) (= c1.g c2.g) (= c1.b c2.b) (= c1.a c2.a)))
|
(and (= c1.r c2.r) (= c1.g c2.g) (= c1.b c2.b) (= c1.a c2.a)))
|
||||||
@@ -231,8 +230,11 @@
|
|||||||
(when (or !(hasComponent e ColorI) (colorsContain colors (readComponent e ColorI)))
|
(when (or !(hasComponent e ColorI) (colorsContain colors (readComponent e ColorI)))
|
||||||
(AddColorIRGBA [e] color.r color.g color.b color.a)))))))
|
(AddColorIRGBA [e] color.r color.g color.b color.a)))))))
|
||||||
(addColorTagSystems [
|
(addColorTagSystems [
|
||||||
|
// Active: green
|
||||||
=>"(or active enabled)" (object r 0 g 255 b 0 a 255)
|
=>"(or active enabled)" (object r 0 g 255 b 0 a 255)
|
||||||
|
// Inactive: gray
|
||||||
=>"(or inactive disabled)" (object r 128 g 128 b 128 a 255)
|
=>"(or inactive disabled)" (object r 128 g 128 b 128 a 255)
|
||||||
|
// todo: orange
|
||||||
=>"todo" (object r 255 g 128 b 0 a 255)])
|
=>"todo" (object r 255 g 128 b 0 a 255)])
|
||||||
|
|
||||||
(whenLet [ps (ui.playgroundSystem)]
|
(whenLet [ps (ui.playgroundSystem)]
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
package nat.components;
|
|
||||||
|
|
||||||
typedef Color = {
|
|
||||||
r:Float,
|
|
||||||
g:Float,
|
|
||||||
b:Float,
|
|
||||||
a:Float
|
|
||||||
};
|
|
@@ -1,8 +0,0 @@
|
|||||||
package nat.systems;
|
|
||||||
|
|
||||||
import kiss.Prelude;
|
|
||||||
import kiss.List;
|
|
||||||
import nat.System;
|
|
||||||
|
|
||||||
@:build(kiss.Kiss.build())
|
|
||||||
class ColorSystem extends System {}
|
|
@@ -1,14 +0,0 @@
|
|||||||
(load "../Lib.kiss")
|
|
||||||
|
|
||||||
// Converts outdated Color component into a ColorF component and a ColorI component
|
|
||||||
|
|
||||||
(defNew []
|
|
||||||
(super
|
|
||||||
->[archive e]
|
|
||||||
(hasComponent e Color)
|
|
||||||
->[archive e &opt ui]
|
|
||||||
(let [c (readComponent e Color)]
|
|
||||||
(addComponent archive e ColorF c)
|
|
||||||
(addComponent archive e ColorI (colorIFromF c))
|
|
||||||
(removeComponent archive e Color))))
|
|
||||||
|
|
@@ -32,8 +32,8 @@
|
|||||||
(let [c (readComponent e Circle)
|
(let [c (readComponent e Circle)
|
||||||
diam (Std.int (* 2 c.radius))
|
diam (Std.int (* 2 c.radius))
|
||||||
squareSize (+ diam CIRCLE_THICKNESS)
|
squareSize (+ diam CIRCLE_THICKNESS)
|
||||||
color (if (hasComponent e Color)
|
color (if (hasComponent e ColorF)
|
||||||
(let [c (readComponent e Color)]
|
(let [c (readComponent e ColorF)]
|
||||||
(FlxColor.fromRGBFloat c.r c.g c.b c.a))
|
(FlxColor.fromRGBFloat c.r c.g c.b c.a))
|
||||||
CIRCLE_COLOR)]
|
CIRCLE_COLOR)]
|
||||||
(makeGraphic squareSize squareSize FlxColor.TRANSPARENT true)
|
(makeGraphic squareSize squareSize FlxColor.TRANSPARENT true)
|
||||||
|
Reference in New Issue
Block a user