making test run
This commit is contained in:
@@ -82,6 +82,8 @@
|
|||||||
<!--Enable this for Nape release builds for a serious peformance improvement-->
|
<!--Enable this for Nape release builds for a serious peformance improvement-->
|
||||||
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
|
<haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
|
||||||
|
|
||||||
|
<haxeflag name="-w" value="-WDeprecated" />
|
||||||
|
|
||||||
<!-- _________________________________ Custom _______________________________ -->
|
<!-- _________________________________ Custom _______________________________ -->
|
||||||
|
|
||||||
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
|
<!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
|
||||||
|
|||||||
15
src/test/source/MenuState.hx
Normal file
15
src/test/source/MenuState.hx
Normal 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 {}
|
||||||
53
src/test/source/MenuState.kiss
Normal file
53
src/test/source/MenuState.kiss
Normal 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)))
|
||||||
@@ -2,6 +2,7 @@ package;
|
|||||||
|
|
||||||
import kiss.Prelude;
|
import kiss.Prelude;
|
||||||
import kiss.List;
|
import kiss.List;
|
||||||
|
import hollywoo.StagePosition;
|
||||||
import hollywoo_flixel.FlxDirector;
|
import hollywoo_flixel.FlxDirector;
|
||||||
import hollywoo_flixel.FlxMovie;
|
import hollywoo_flixel.FlxMovie;
|
||||||
import hollywoo_flixel.MovieFlxState;
|
import hollywoo_flixel.MovieFlxState;
|
||||||
@@ -17,7 +18,7 @@ import flixel.FlxCamera;
|
|||||||
@:build(kiss.AsyncEmbeddedScript.build("hollywoo-flixel", "src/hollywoo_flixel/HollywooFlixelDSL.kiss", "Test.hollywoo"))
|
@:build(kiss.AsyncEmbeddedScript.build("hollywoo-flixel", "src/hollywoo_flixel/HollywooFlixelDSL.kiss", "Test.hollywoo"))
|
||||||
class Test extends FlxMovie {
|
class Test extends FlxMovie {
|
||||||
public function new(director:FlxDirector) {
|
public function new(director:FlxDirector) {
|
||||||
super(director);
|
super(director, "lightSources.json", "positions.json", "delayLengths.json", "voiceLineMatches.json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user