making test run

This commit is contained in:
2023-04-30 14:36:32 -06:00
parent 4f26996c20
commit 1bce23b2fb
5 changed files with 73 additions and 2 deletions

View File

@@ -82,6 +82,8 @@
<!--Enable this for Nape release builds for a serious peformance improvement-->
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
<haxeflag name="-w" value="-WDeprecated" />
<!-- _________________________________ Custom _______________________________ -->
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->

View File

@@ -0,0 +1,15 @@
package;
import hollywoo_flixel.FlxDirector;
import hollywoo_flixel.FlxMovie;
import hollywoo_flixel.MovieFlxState;
import flixel.ui.FlxButton;
import flixel.FlxState;
import flixel.text.FlxText;
import flixel.FlxG;
import flixel.util.FlxColor;
import kiss_flixel.SimpleWindow;
import kiss.Prelude;
@:build(kiss.Kiss.build())
class MenuState extends FlxState {}

View File

@@ -0,0 +1,53 @@
(method &override :Void create []
(super.create)
(set SimpleWindow.defaultCamera FlxG.camera)
(prop &mut :SimpleWindow menu)
(set menu (new SimpleWindow
"HOLLYWOO-FLIXEL TEST"
FlxColor.BLACK
FlxColor.WHITE
0.8
0.8))
(menu.makeText
"RUN TESTS"
FlxColor.WHITE
->_ (FlxG.switchState (new TestState)))
(menu.makeText "Options" FlxColor.WHITE
->_ {
(menu.hide)
(optionsMenu ->:Void (menu.show))
})
(menu.makeText "Quit to Desktop" FlxColor.WHITE
->_ (Sys.exit 0))
(menu.show))
(function optionsMenu [:Void->Void back]
(let [menu (new SimpleWindow "OPTIONS"
FlxColor.BLACK
FlxColor.WHITE
0.8
0.8)
makeText ->[text :Void->Void action]
(menu.makeText text FlxColor.WHITE ->_ {(menu.hide)(action)} true)]
(defMacro soundTypeVolume [label property]
`(let [ticks (* 10 ,property)]
(makeText (+ ,label ": [" (* ticks "#") (* (- 10 ticks) "_") "]")
->:Void {
(if (= ,property 1.0)
(set ,property 0)
(+= ,property 0.1))
// Options buttons need to call optionsMenu recursively
(optionsMenu back)
})))
(soundTypeVolume "Sound Volume" FlxDirector.soundVolume)
(soundTypeVolume "Voice Volume" FlxDirector.voiceVolume)
(soundTypeVolume "Music Volume" FlxDirector.musicVolume)
// TODO read mode vs. watch mode option
(makeText "Back" back)
(menu.show)))

View File

@@ -2,6 +2,7 @@ package;
import kiss.Prelude;
import kiss.List;
import hollywoo.StagePosition;
import hollywoo_flixel.FlxDirector;
import hollywoo_flixel.FlxMovie;
import hollywoo_flixel.MovieFlxState;
@@ -17,7 +18,7 @@ import flixel.FlxCamera;
@:build(kiss.AsyncEmbeddedScript.build("hollywoo-flixel", "src/hollywoo_flixel/HollywooFlixelDSL.kiss", "Test.hollywoo"))
class Test extends FlxMovie {
public function new(director:FlxDirector) {
super(director);
super(director, "lightSources.json", "positions.json", "delayLengths.json", "voiceLineMatches.json");
}
}

View File

@@ -1,4 +1,4 @@
#! /bin/bash
lix dev hollywoo-flixel .
(cd src/test && lix run lime test cpp -debug)
(cd src/test && lix run lime test neko -debug)