Fix crash when jumping straight to WorldMapScene

This commit is contained in:
3wc
2024-02-14 14:25:04 -03:00
부모 010aa5323d
커밋 8921f231bd
2개의 변경된 파일7개의 추가작업 그리고 7개의 파일을 삭제

파일 보기

@ -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);

파일 보기

@ -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() {