diff --git a/isometric-park-fna/Content/dialog.ink b/isometric-park-fna/Content/dialog.ink new file mode 100644 --- /dev/null +++ b/isometric-park-fna/Content/dialog.ink @@ -0,0 +1,40 @@ + +VAR GovernorOpinion = 0 + +-> IntroGovernor + + +=== Once === + +Once upon a time... + + * There were two choices. + * There were four lines of content. + +- They lived happily ever after. + -> END + + +=== IntroGovernor === + +Governor: Welcome to your new park, director! You can use the mouse or arrow keys to move around, and the plus and minus keys to zoom in and out. B opens the budget and F lets you adjust Forest Policy. + +* [Okay] + + Governor: Make sure that you keep visitors happy and the budget in the black! You're currently getting an annual grant out of my budget—it'd sure be nice if you park were self-sufficient so we could drop that expense! + + * * [And I need to keep the forest healthy, too, right?] + ~ GovernorOpinion = GovernorOpinion - 1 + + + Governor: Ummm, yeah + * * * \... + -> END + * * [Sounds good!] + + Governor: I'll check in soon. + + +-> END + + diff --git a/isometric-park-fna/Content/dialog.json b/isometric-park-fna/Content/dialog.json new file mode 100644 --- /dev/null +++ b/isometric-park-fna/Content/dialog.json @@ -0,0 +1,1 @@ +{"inkVersion":20,"root":[[{"->":"IntroGovernor"},["done",{"#f":5,"#n":"g-0"}],null],"done",{"Once":[["^Once upon a time...","\n",["ev",{"^->":"Once.0.2.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^There were two choices.",{"->":"$r","var":true},null]}],["ev",{"^->":"Once.0.3.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-1","flg":18},{"s":["^There were four lines of content.",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"Once.0.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.2.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"c-1":["ev",{"^->":"Once.0.c-1.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.3.s"},[{"#n":"$r2"}],"\n",{"->":".^.^.g-0"},{"#f":5}],"g-0":["^They lived happily ever after.","\n","end",{"#f":5}]}],{"#f":1}],"IntroGovernor":[["^Governor: Welcome to your new park, director! You can use the mouse or arrow keys to move around, and the plus and minus keys to zoom in and out. B opens the budget and F lets you adjust Forest Policy.","\n","ev","str","^Okay","/str","/ev",{"*":".^.c-0","flg":20},{"c-0":["\n","^Governor: Make sure that you keep visitors happy and the budget in the black! You're currently getting an annual grant out of my budget—it'd sure be nice if you park were self-sufficient so we could drop that expense!","\n",["ev","str","^And I need to keep the forest healthy, too, right?","/str","/ev",{"*":".^.c-0","flg":20},"ev","str","^Sounds good!","/str","/ev",{"*":".^.c-1","flg":20},{"c-0":["^ ","\n","ev",{"VAR?":"GovernorOpinion"},1,"-","/ev",{"VAR=":"GovernorOpinion","re":true},"^Governor: Ummm, yeah","\n",[["ev",{"^->":"IntroGovernor.0.c-0.3.c-0.10.0.$r1"},{"temp=":"$r"},"str",{"->":".^.s"},[{"#n":"$r1"}],"/str","/ev",{"*":".^.^.c-0","flg":18},{"s":["^...",{"->":"$r","var":true},null]}],{"c-0":["ev",{"^->":"IntroGovernor.0.c-0.3.c-0.10.c-0.$r2"},"/ev",{"temp=":"$r"},{"->":".^.^.0.s"},[{"#n":"$r2"}],"\n","end",{"#f":5}]}],{"#f":5}],"c-1":["\n","^Governor: I'll check in soon.","\n","end",{"#f":5}]}],{"#f":5}]}],{"#f":1}],"global decl":["ev",0,{"VAR=":"GovernorOpinion"},"/ev","end",null],"#f":1}],"listDefs":{}} \ No newline at end of file diff --git a/isometric-park-fna/FNAGame.cs b/isometric-park-fna/FNAGame.cs --- a/isometric-park-fna/FNAGame.cs +++ b/isometric-park-fna/FNAGame.cs @@ -12,8 +12,8 @@ using System.Collections.Generic; using System.Linq; using SpriteFontPlus; + using isometricparkfna; - using static isometricparkfna.CellMap; using isometricparkfna.Utils; using isometricparkfna.UI; @@ -28,6 +28,7 @@ using ImGuiNET; using TraceryNet; using Encompass; +using Ink.Runtime; //Let's let core builds be deterministic #if NETCOREAPP @@ -110,6 +111,8 @@ private ImGuiWindowBridgeEngine imGuiWindowBridgeEngine; + + private static void Main(string[] args) { #if NETCOREAPP @@ -239,6 +242,10 @@ //Has to happen after Grammar initialization. NewGameWindow.Initialize(this.grammar); + var _inkStory = new Story(File.ReadAllText(@"Content/dialog.json")); + + Logging.Debug(_inkStory.ContinueMaximally()); + WorldBuilder.AddEngine(new InputEngine(Menu.MENU_BAR_HEIGHT, this.camera, gdm)); WorldBuilder.AddEngine(new UIEngine()); diff --git a/isometric-park-fna/isometric-park-fna-core.csproj b/isometric-park-fna/isometric-park-fna-core.csproj --- a/isometric-park-fna/isometric-park-fna-core.csproj +++ b/isometric-park-fna/isometric-park-fna-core.csproj @@ -46,6 +46,7 @@ + diff --git a/isometric-park-fna/isometric-park-fna.csproj b/isometric-park-fna/isometric-park-fna.csproj --- a/isometric-park-fna/isometric-park-fna.csproj +++ b/isometric-park-fna/isometric-park-fna.csproj @@ -148,6 +148,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest @@ -228,6 +231,9 @@ + + +