From e0d3ca80214b24c7819dad073a8ad51cd931fe33 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Fri, 16 Feb 2024 02:38:52 -0300 Subject: [PATCH] Add RoomOpen command / event --- res/.tmp/cache.dat | 1 + res/.tmp/font/minecraftia_regular_6.bfnt | Bin 0 -> 4284 bytes .../font/pixel_unicode/Pixel-UniCode.bfnt | Bin 0 -> 41534 bytes res/.tmp/minecraftia_regular_6.bfnt | Bin 0 -> 4284 bytes res/rewild.tiled-project | 14 ++++++ res/rewild.tiled-session | 45 ++++++++++++++++++ res/text/intro.yarn | 10 +++- src/Game.hx | 3 ++ src/dialogue/DialogueManager.hx | 21 ++++++++ src/dialogue/command/ICommandHandler.hx | 6 +++ src/dialogue/command/OpenRoomCommand.hx | 19 ++++++++ src/event/OpenRoomEvent.hx | 9 ++++ src/scene/WorldMapScene.hx | 26 +++++++++- 13 files changed, 152 insertions(+), 2 deletions(-) create mode 100644 res/.tmp/cache.dat create mode 100644 res/.tmp/font/minecraftia_regular_6.bfnt create mode 100644 res/.tmp/font/pixel_unicode/Pixel-UniCode.bfnt create mode 100644 res/.tmp/minecraftia_regular_6.bfnt create mode 100644 res/rewild.tiled-project create mode 100644 res/rewild.tiled-session create mode 100644 src/dialogue/command/ICommandHandler.hx create mode 100644 src/dialogue/command/OpenRoomCommand.hx create mode 100644 src/event/OpenRoomEvent.hx diff --git a/res/.tmp/cache.dat b/res/.tmp/cache.dat new file mode 100644 index 0000000..89cf132 --- /dev/null +++ b/res/.tmp/cache.dat @@ -0,0 +1 @@ +by25:minecraftia_regular_6.fntaoy3:veri1y4:timei1707771858y4:hashy40:985b62563507866445c3c81a04f7e6645d90dad5y3:outy33:.tmp%2Fminecraftia_regular_6.bfntghy40:font%2Fpixel_unicode%2FPixel-UniCode.fntaoR1i1R2i1707784556R3y40:bc4073da70385f93ae70e391a786e346daac2b1fR5y48:.tmp%2Ffont%2Fpixel_unicode%2FPixel-UniCode.bfntghy32:font%2Fminecraftia_regular_6.fntaoR1i1R2i1707771858R3R4R5y40:.tmp%2Ffont%2Fminecraftia_regular_6.bfntghh \ No newline at end of file diff --git a/res/.tmp/font/minecraftia_regular_6.bfnt b/res/.tmp/font/minecraftia_regular_6.bfnt new file mode 100644 index 0000000000000000000000000000000000000000..f459af789bae2a08f3015fd15f8477cd8338d80a GIT binary patch literal 4284 zcmZXYhgTF=6vpo?;EEhHIh!00F%g0o1#AR?2pUBr8zZX*M8$@PD0XmE}Ioc)A^*9Gn4kDR_!;jE_ z+{&U^g!x_y-Dr(g3b*Lpte3b$9DahP#o;pOAUPy6TMg|Lho7O9;&3^1*cxzfIg~_| z>?6*K!!OW`IP8Z8)?Ads8fZ=&euY+v!xhjp4#`Tch4zZWZ_sMnQZ(9?&~nLP9kgE@ zeuqxAt!{*B`vcl24p&1nIHaR~aQ*5!#4Ilke?pt2 z4%a{@`5at-r059u+Q1c9jqlV$^eoFJCa24*Bzo84n;Q+Lb z4leaOBJ51FP0$L-;UDM{S&Plk34S!USL40;FYz)zS~*b=RsA~Rda2m}^hldVz5!8r zr2UV0r60{zHuk-qxCw_)8`CY&NmL@mKR24o#OxqfpI4+A5><;t<#l9KyMU4!5H1X64I#z2oX^ht4O5(rC1BU)%=mkva@R zJN;;d^}QXsjtaYdWq60@0~MKAa9+=^YCD;ZEo# zspJl5AKK(B?t%__t;;uFp`FC*(WasqhrM$*G%q`A7j%=<_a11#-D_;*;5y!HH`kD8 z?}d&NZ4ETwv<_e6qnh2v$Bbyt@Y+TyS=gz^LQ{AoYj!{MXdIGN-vdo^q9s?p7Fx>p zOZ@0@bsm7$a&DBdI_?$ji!+HT#bF9`EDp)h9)wO8hf!$8I~2~M4mw^O9)ivihqItn z;_xtZu4wl{t2uex-T%E)M&kQ)IN`phtYBUhf@D6VG#COvti8qSF`Or?up%L1|`XsyhDd<*lxB!}^mdP2+7mhyoa8HP7sGV(5z^mhh{|E1kH)|1?WUuP7dL|aPP)l z#bs8U!;8?#_$Dja4DA=~OVB#e&V>$$_GM^;Xj`Cp(Y^wmBidGIz`2n;cV30Iina}! z7VT@$`Jz1mS}EGsp^I7j+v6XDx;<677f3jA)lYyF~jDv`VxmLAynJpvLX) zk)k#J7;UvUEQR)n!za+GGUG1jI?;X#ZDj3}yD$sgEZWbYO}3VEtBk0W-yQCCGS@cI zeh%$G8+K~k56hqdCq(kT`31C7=5`9SOrCtcgl0v%99kjTub?^6c0&&r?bpy=saXy> dQMBJc`|)*uQ*eJLaA&hSz1?mpe%5pU^FMjM*j)es literal 0 HcmV?d00001 diff --git a/res/.tmp/font/pixel_unicode/Pixel-UniCode.bfnt b/res/.tmp/font/pixel_unicode/Pixel-UniCode.bfnt new file mode 100644 index 0000000000000000000000000000000000000000..df2898e92f2642cbd49e26b636dd25ba2ae970ef GIT binary patch literal 41534 zcmcJYdAv{6*Z9vdT{B6giO)4q&b=Kbdob%b==lMO)AHUPt8Pa8h re^x0^6*_`v!nO&mY6d{8D>S|bRq2!mi@aC?v!lnlb4a8M$UYhuwL zC=@;w6gAMi2s&<65NrwW3yJ{^7^~2FKo11VbD*6I1wr3nD)@A);%&@~U4yrQ%I~3> ztsDOy6fVx8p=>4yJ`8#VMS@a%UxXjI9%HsvLFJ%0^b5U$JqS*Miv?k`pb$`@tZ)P! zR5b{$HI&I%rMJoPLC`GRV}37eFt4o=1WUkD%HS0|LGT%fz7N(#ya|Tl5wsH+UJd@? z&Z5vzl>g-F4rP_X+afLk?$Ftu<(r|wIOtUQ3NJx$J{WEb{{}-5FcdQwF3beMH*j1S zDzaJ2@ouQP!*LuKncW0sFNKr&&B}KvkZg8E^m#+{xib2^Ir>~1eKG-K_y{h9-}&JH zX43mh3oy7BsPI@SCb&)eag41-Z6&EO@&FKOrfRtCiTwOc2a5_9U86=?=ik zb~36cT!?(t_MSwJnV=r`tBt5GPlmD!!Z#UPf{{YCTo*B0$KZN?D~Y_UE_X9_S-1`T z=vdYJSwJUYdxcZB_b#)|PiRf;^jvs*GhD-LDoLH~M=<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D;ZEo# zspJl5AKK(B?t%__t;;uFp`FC*(WasqhrM$*G%q`A7j%=<_a11#-D_;*;5y!HH`kD8 z?}d&NZ4ETwv<_e6qnh2v$Bbyt@Y+TyS=gz^LQ{AoYj!{MXdIGN-vdo^q9s?p7Fx>p zOZ@0@bsm7$a&DBdI_?$ji!+HT#bF9`EDp)h9)wO8hf!$8I~2~M4mw^O9)ivihqItn z;_xtZu4wl{t2uex-T%E)M&kQ)IN`phtYBUhf@D6VG#COvti8qSF`Or?up%L1|`XsyhDd<*lxB!}^mdP2+7mhyoa8HP7sGV(5z^mhh{|E1kH)|1?WUuP7dL|aPP)l z#bs8U!;8?#_$Dja4DA=~OVB#e&V>$$_GM^;Xj`Cp(Y^wmBidGIz`2n;cV30Iina}! z7VT@$`Jz1mS}EGsp^I7j+v6XDx;<677f3jA)lYyF~jDv`VxmLAynJpvLX) zk)k#J7;UvUEQR)n!za+GGUG1jI?;X#ZDj3}yD$sgEZWbYO}3VEtBk0W-yQCCGS@cI zeh%$G8+K~k56hqdCq(kT`31C7=5`9SOrCtcgl0v%99kjTub?^6c0&&r?bpy=saXy> dQMBJc`|)*uQ*eJLaA&hSz1?mpe%5pU^FMjM*j)es literal 0 HcmV?d00001 diff --git a/res/rewild.tiled-project b/res/rewild.tiled-project new file mode 100644 index 0000000..d0eb592 --- /dev/null +++ b/res/rewild.tiled-project @@ -0,0 +1,14 @@ +{ + "automappingRulesFile": "", + "commands": [ + ], + "compatibilityVersion": 1100, + "extensionsPath": "extensions", + "folders": [ + "." + ], + "properties": [ + ], + "propertyTypes": [ + ] +} diff --git a/res/rewild.tiled-session b/res/rewild.tiled-session new file mode 100644 index 0000000..56530ce --- /dev/null +++ b/res/rewild.tiled-session @@ -0,0 +1,45 @@ +{ + "activeFile": "map.tmx", + "expandedProjectPaths": [ + ], + "fileStates": { + "/home/f/Projects/Rewild/references/ld28/res/map.tmx": { + "scale": 1.5684895833333334, + "selectedLayer": 6, + "viewCenter": { + "x": 191.90436659472022, + "y": 144.08766395483977 + } + }, + "/home/f/Projects/Rewild/references/ld28/res/map.tmx#tiles": { + "scaleInDock": 1 + }, + "/home/f/Projects/Rewild/references/ld28/res/spaaace.tsx": { + "scaleInEditor": 1 + }, + "map.tmx": { + "expandedObjectLayers": [ + 3 + ], + "scale": 0.75, + "selectedLayer": 1, + "viewCenter": { + "x": 479.3333333333333, + "y": 320 + } + }, + "map.tmx#tiles": { + "scaleInDock": 1 + } + }, + "openFiles": [ + "map.tmx", + "/home/f/Projects/Rewild/references/ld28/res/map.tmx" + ], + "project": "rewild.tiled-project", + "recentFiles": [ + "/home/f/Projects/Rewild/references/ld28/res/map.tmx", + "map.tmx", + "/home/f/Projects/Rewild/references/ld28/res/spaaace.tsx" + ] +} diff --git a/res/text/intro.yarn b/res/text/intro.yarn index 817712b..7fa78bb 100644 --- a/res/text/intro.yarn +++ b/res/text/intro.yarn @@ -11,5 +11,13 @@ You: Let's have another look around... === title: Room:quarters --- -It's the crew quarters +You: It's the crew quarters +=== +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 f9ab794..5d72652 100644 --- a/src/Game.hx +++ b/src/Game.hx @@ -17,6 +17,8 @@ import dialogue.event.OptionSelected; import dialogue.event.DialogueComplete; import dialogue.event.NextLine; +import dialogue.command.OpenRoomCommand; + @:uiComp("game-container") class GameContainer extends h2d.Flow implements h2d.domkit.Object { static var SRC = @@ -95,6 +97,7 @@ class Game extends hxd.App { globalEventBus.subscribe(OptionsShown, renderOptions); globalEventBus.subscribe(OptionSelected, onOptionSelected); globalEventBus.subscribe(DialogueComplete, onDialogueComplete); + dialogueManager.addCommandHandler(new OpenRoomCommand(globalEventBus)); #if debug setGameScene(new WorldMapScene(root)); diff --git a/src/dialogue/DialogueManager.hx b/src/dialogue/DialogueManager.hx index db1c5f6..203c048 100644 --- a/src/dialogue/DialogueManager.hx +++ b/src/dialogue/DialogueManager.hx @@ -12,6 +12,7 @@ import hxyarn.compiler.Compiler; import hxyarn.compiler.CompilationJob; import event.EventBus; +import dialogue.command.ICommandHandler; import dialogue.event.LineShown; import dialogue.event.OptionsShown; import dialogue.event.OptionsShown.OptionChoice; @@ -26,6 +27,7 @@ class DialogueManager { var storage = new MemoryVariableStore(); var dialogue:Dialogue; var stringTable:Map; + var commandHandlers = new Map(); public var waitingForOption:Bool = false; @@ -118,6 +120,25 @@ class DialogueManager { } public function commandHandler(command:Command) { + var parts = command.text.split(' '); + var key = parts.shift(); + if (commandHandlers.exists(key)) { + if (commandHandlers.get(key).handleCommand(parts)) { + resume(); + return; + } + } + + resume(); + } + + public function addCommandHandler(handler:ICommandHandler) { + if (handler.commandName == null || handler.commandName == "") { + trace("Command handler has no command name"); + return; + } + + commandHandlers.set(handler.commandName, handler); } public function nodeCompleteHandler(nodeName:String) {} diff --git a/src/dialogue/command/ICommandHandler.hx b/src/dialogue/command/ICommandHandler.hx new file mode 100644 index 0000000..3e533b3 --- /dev/null +++ b/src/dialogue/command/ICommandHandler.hx @@ -0,0 +1,6 @@ +package dialogue.command; + +interface ICommandHandler { + var commandName:String; + function handleCommand(args:Array):Bool; +} diff --git a/src/dialogue/command/OpenRoomCommand.hx b/src/dialogue/command/OpenRoomCommand.hx new file mode 100644 index 0000000..3f7d091 --- /dev/null +++ b/src/dialogue/command/OpenRoomCommand.hx @@ -0,0 +1,19 @@ +package dialogue.command; + +import event.EventBus; +import event.OpenRoomEvent; + +class OpenRoomCommand implements ICommandHandler { + public var commandName:String = "room"; + + var eventBus:EventBus; + + public function new(eventBus:EventBus) { + this.eventBus = eventBus; + } + + public function handleCommand(args:Array):Bool { + eventBus.publishEvent(new OpenRoomEvent(args[0])); + return true; + } +} diff --git a/src/event/OpenRoomEvent.hx b/src/event/OpenRoomEvent.hx new file mode 100644 index 0000000..91273c5 --- /dev/null +++ b/src/event/OpenRoomEvent.hx @@ -0,0 +1,9 @@ +package event; + +class OpenRoomEvent implements IEvent { + public var roomName:String; + + public function new(rn:String) { + this.roomName = rn; + } +} diff --git a/src/scene/WorldMapScene.hx b/src/scene/WorldMapScene.hx index 64c5e12..c8cb6df 100644 --- a/src/scene/WorldMapScene.hx +++ b/src/scene/WorldMapScene.hx @@ -1,13 +1,22 @@ package scene; import dialogue.event.StartDialogueNode; +import event.OpenRoomEvent; import TilemapLayer; +typedef Room = { + rect:h2d.Graphics, + area:h2d.Interactive, + isOpen:Bool +} + @:uiComp("world-map-scene") class WorldMapScene extends h2d.Flow implements GameScene implements h2d.domkit.Object { public var width:Int; public var height:Int; + var rooms:Map = new Map(); + public function new(?parent) { super(parent); initComponent(); @@ -16,6 +25,8 @@ class WorldMapScene extends h2d.Flow implements GameScene implements h2d.domkit. var map = Game.loader.loadTMX("map.tmx"); + Game.current.globalEventBus.subscribe(OpenRoomEvent, openRoom); + for (layer in (map.layers)) { switch(layer.kind) { case TTileLayer: @@ -32,8 +43,14 @@ class WorldMapScene extends h2d.Flow implements GameScene implements h2d.domkit. area.y = obj.y; area.onClick = function(_) { trace("Room:" + obj.name); - Game.current.globalEventBus.publishEvent(new StartDialogueNode("Room:" + obj.name)); + var room = rooms.get(obj.name); + if (room.isOpen) { + Game.current.globalEventBus.publishEvent(new StartDialogueNode("Room:" + obj.name)); + } else { + Game.current.globalEventBus.publishEvent(new StartDialogueNode("Room not open")); + } }; + rooms.set(obj.name, {rect: rect, area: area, isOpen: false}); } case TImageLayer: case TGroup: @@ -42,10 +59,17 @@ class WorldMapScene extends h2d.Flow implements GameScene implements h2d.domkit. #if debug trace('skipping intro dialogue'); + Game.current.globalEventBus.publishEvent(new OpenRoomEvent("hangar")); #else Game.current.globalEventBus.publishEvent(new StartDialogueNode("Intro")); #end } + + public function openRoom(event:OpenRoomEvent) { + var room = rooms.get(event.roomName); + room.isOpen = true; + room.area.alpha = 0; + } public function getH2dObject() { return this;