Fix crash when jumping straight to WorldMapScene
This commit is contained in:
parent
010aa5323d
commit
8921f231bd
@ -17,7 +17,7 @@ class DialogueBox extends h2d.Object {
|
||||
if (text == null)
|
||||
text = "NULL";
|
||||
game = Game.current;
|
||||
game.root.scene.getH2dObject().getScene().add(this, 1);
|
||||
cast(game.root, h2d.Object).getScene().add(this, 1);
|
||||
bg = new h2d.ScaleGrid(Res.ui.toTile(), 5, 5, this);
|
||||
bg.colorKey = 0xFF00FF;
|
||||
tf = new h2d.Text(game.font, this);
|
||||
|
12
src/Game.hx
12
src/Game.hx
@ -63,12 +63,6 @@ class Game extends hxd.App {
|
||||
globalEventBus = new EventBus(console);
|
||||
globalEventBus.subscribe(ChangeSceneEvent, onChangeScene);
|
||||
|
||||
#if debug
|
||||
setGameScene(new WorldMapScene(root));
|
||||
#else
|
||||
setGameScene(new TitleScene(root));
|
||||
#end
|
||||
|
||||
font = Res.font.minecraftia_regular_6.toFont();
|
||||
font.resizeTo(24);
|
||||
|
||||
@ -81,6 +75,12 @@ class Game extends hxd.App {
|
||||
hxd.Res.text.intro.entry.name,
|
||||
];
|
||||
dialogueManager.load(yarnText, yarnFileNames);
|
||||
|
||||
#if debug
|
||||
setGameScene(new WorldMapScene(root));
|
||||
#else
|
||||
setGameScene(new TitleScene(root));
|
||||
#end
|
||||
}
|
||||
|
||||
public function new() {
|
||||
|
Loading…
Reference in New Issue
Block a user