diff --git a/res/text/intro.yarn b/res/text/intro.yarn index 9f07a29..5f0ee55 100644 --- a/res/text/intro.yarn +++ b/res/text/intro.yarn @@ -10,35 +10,3 @@ You: What happened to the updates from mission control? You: Let's have another look around... <> === -title: Room:quarters ---- -<> -// You: It's the crew quarters. -// You: Well, it will be. Set-up hasn't started yet. -// You: That was meant to be one of my first jobs after defrost... -// You: ...but it doesn't exactly seem like a priority now. -You: Maybe there's something useful here? --> Search the lockers [perception] - <> - < 2>> - You: Aha! A small piece of paper with the **hangar access code**. - <> - <> - You: Just some dust bunnies. Guess they stowed away from Earth. - <> --> Set up a sleeping mat [ingenuity] - <> - < 2>> - You: Nice, at least I have somewhere to crash now. - <> - You: Hmm, I was never good at this camping stuff. Maybe I can find somewhere else to rest. - <> -=== -title: Room:hangar ---- -You: The **hangar** seems eerily deserted -=== -title: Room not open ---- -You: Hmm, that part of the ship is still inaccessible. I wonder how to get in? -=== diff --git a/res/text/rooms.yarn b/res/text/rooms.yarn new file mode 100644 index 0000000..70221ad --- /dev/null +++ b/res/text/rooms.yarn @@ -0,0 +1,34 @@ +title: Room:quarters +--- +<> +<> +// You: It's the crew quarters. +// You: Well, it will be. Set-up hasn't started yet. +// You: That was meant to be one of my first jobs after defrost... +// You: ...but it doesn't exactly seem like a priority now. +You: Maybe there's something useful here? +-> Search the lockers [perception] <> + <> + < 2>> + You: Aha! A small piece of paper with the **hangar access code**. + <> + <> + <> + You: Just some dust bunnies. Guess they stowed away from Earth. + <> +-> Set up a sleeping mat [ingenuity] + <> + < 2>> + You: Nice, at least I have somewhere to crash now. + <> + You: Hmm, I was never good at this camping stuff. Maybe I can find somewhere else to rest. + <> +=== +title: Room:hangar +--- +You: The **hangar** seems eerily deserted +=== +title: Room not open +--- +You: Hmm, that part of the ship is still inaccessible. I wonder how to get in? +=== diff --git a/src/Game.hx b/src/Game.hx index f444c4b..74e5c8b 100644 --- a/src/Game.hx +++ b/src/Game.hx @@ -1,5 +1,6 @@ import h2d.Layers; import h2d.Console; +import h3d.Vector4; import scene.TitleScene; import scene.WorldMapScene; @@ -87,9 +88,11 @@ class Game extends hxd.App { var yarnText = [ hxd.Res.text.intro.entry.getText(), + hxd.Res.text.rooms.entry.getText(), ]; var yarnFileNames = [ hxd.Res.text.intro.entry.name, + hxd.Res.text.rooms.entry.name, ]; dialogueManager.load(yarnText, yarnFileNames); @@ -135,8 +138,10 @@ class Game extends hxd.App { function renderOptions(event:OptionsShown) { for (option in event.options) { - addOption(option.text, function() { - globalEventBus.publishEvent(new OptionSelected(option.index)); + addOption(option.text, option.enabled, function() { + if (option.enabled) { + globalEventBus.publishEvent(new OptionSelected(option.index)); + } }); } } @@ -150,10 +155,13 @@ class Game extends hxd.App { return g; } - function addOption(o: String, callback: () -> Void) { + function addOption(o: String, enabled : Bool, callback: () -> Void) { var spr = newPanel(Const.W, 60); curDialogue.addChild(spr); var tf = new h2d.Text(font, spr); + if (!enabled) { + tf.color = new Vector4(0.5, 0.5, 0.5, 1); + } tf.text = o; tf.x = 10; tf.y = 10; diff --git a/src/scene/WorldMapScene.hx b/src/scene/WorldMapScene.hx index 387f67e..6b2abde 100644 --- a/src/scene/WorldMapScene.hx +++ b/src/scene/WorldMapScene.hx @@ -42,7 +42,6 @@ class WorldMapScene extends h2d.Flow implements GameScene implements h2d.domkit. area.x = obj.x; area.y = obj.y; area.onClick = function(_) { - trace("Room:" + obj.name); var room = rooms.get(obj.name); if (room.isOpen) { Game.current.globalEventBus.publishEvent(new StartDialogueNode("Room:" + obj.name));