Description:
Update variables based on game settings.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r365:6205f6d5b5e9 -

@@ -117,7 +117,7
117 117 - Add a create park dialog @milestone(4: Beginning)
118 118 - Procgen park names (that player can override)
119 119 - Button to generate new name?
120 - Allow player to choose title @maybe
120 - Allow player to choose title @maybe @done(2021-07-29)
121 121 Some possibilities: Mr., Ms., Mx., Director, Dr., Professor, Miss, Col., Herr Dr. Dr. nothing, custom
122 122 Might be fun to have tiny acknowledgement of choice — probably dialog only, no mechanical change. (E.g., a researcher might allude to you having a PhD. or an enby character might say something comiserating.)
123 123 - Allow player to choose difficulty
@@ -32,6 +32,8
32 32 "Milton", "Coltrane", "Kim", "Lindgren", "Kerry", "Harris"],
33 33 "greeting": [ "Hi", "Hello", "Greetings" ],
34 34 "addressGreeting": "#greeting#, #name#",
35 "addressGreetingFormal": "#greeting#, #playerTitle# #playerFormal#",
36 "addressGreetingCasual": "#greeting#, #playerCasual#",
35 37 "howdoing": [ "I'm good.", "Fine", "Alright, I guess." ],
36 38 "city": ["Milwaukee", "Chicago", "Washington", "Minneapolis", "Dallas",
37 39 "Oklahoma City", "Boston", "Los Angeles", "Portland", "Santa Fe",
@@ -20,7 +20,8
20 20 typeof(SetResolutionMessage),
21 21 typeof(SetFontMessage),
22 22 typeof(SetTrespassingPolicyMessage),
23 typeof(SpawnGameMessage))]
23 typeof(SpawnGameMessage),
24 typeof(SetTextVariableMessage))]
24 25 [Reads(typeof(VisibilityComponent),
25 26 typeof(WindowTypeComponent),
26 27 typeof(TrespassingPolicyComponent)
@@ -40,6 +41,7
40 41 public List<SetFontMessage> fontMessages;
41 42 public List<SetTrespassingPolicyMessage> trespassingPolicyMessages;
42 43 public List<SpawnGameMessage> spawnGameMessages;
44 public List<SetTextVariableMessage> setTextVariableMessages;
43 45
44 46 bool showBudget {get;}
45 47 bool showForest {get;}
@@ -67,6 +69,7
67 69 this.fontMessages = new List<SetFontMessage>();
68 70 this.trespassingPolicyMessages = new List<SetTrespassingPolicyMessage>();
69 71 this.spawnGameMessages = new List<SpawnGameMessage>();
72 this.setTextVariableMessages = new List<SetTextVariableMessage>();
70 73 this.windowStatuses = new Dictionary<Window, bool>();
71 74
72 75
@@ -140,6 +143,14
140 143 {
141 144 SendMessage(message);
142 145 }
146
147 //This may need to be moved up.
148 foreach (var message in this.setTextVariableMessages)
149 {
150 SendMessage(message);
151 }
152
153
143 154
144 155
145 156
@@ -161,6 +172,7
161 172 this.fontMessages.Clear();
162 173 this.trespassingPolicyMessages.Clear();
163 174 this.spawnGameMessages.Clear();
175 this.setTextVariableMessages.Clear();
164 176 }
165 177 }
166 178 }
@@ -4,11 +4,12
4 4
5 5 using Microsoft.Xna.Framework;
6 6
7 using isometricparkfna.Messages;
8 using static isometricparkfna.CellMap;
9 using isometricparkfna.UI;
7 10
8 11 using Encompass;
9
10 using isometricparkfna.Messages;
11 using static isometricparkfna.CellMap;
12 using TraceryNet;
12 13
13 14 namespace isometricparkfna.Spawners {
14 15
@@ -20,11 +21,15
20 21 {
21 22 private Simulation simulation;
22 23 Random random_generator;
24 FNAGame game;
25 Grammar grammar;
23 26
24 public GameSpawner(Simulation simulation)
27 public GameSpawner(Simulation simulation, FNAGame game, Grammar grammar)
25 28 {
26 29 this.simulation = simulation;
27 30 this.random_generator = new Random();
31 this.game = game;
32 this.grammar = grammar;
28 33 }
29 34
30 35 protected override void Spawn(in SpawnGameMessage message)
@@ -99,6 +104,10
99 104 description = "#coop_company_description#",
100 105 type = OrganizationType.Cooperative });
101 106 #endregion
107 #region dialog
108
109 this.game.enqueueDialog(DialogTrees.flatten(DialogTrees.testTree, this.grammar));
110 #endregion
102 111 Logging.Success("Spawned new game.");
103 112
104 113 }
@@ -252,9 +252,10
252 252 WorldBuilder.AddEngine(new ContractStatusEngine(this.simulation));
253 253
254 254 WorldBuilder.AddEngine(new ContractSpawner(simulation.map.MapWidth, simulation.map.MapHeight, this.simulation, this.grammar));
255 WorldBuilder.AddEngine(new GameSpawner(this.simulation));
255 WorldBuilder.AddEngine(new GameSpawner(this.simulation, this, this.grammar));
256 256 WorldBuilder.AddEngine(new OrganizationSpawner(this.simulation, this.grammar));
257 257 WorldBuilder.AddEngine(new PolicyEngine());
258 WorldBuilder.AddEngine(new TraceryBridgeEngine(this.grammar));
258 259
259 260 WorldBuilder.AddGeneralRenderer(new AreaRenderer(this.batch, this.monoFont), 1);
260 261 WorldBuilder.AddGeneralRenderer(new ImGuiWindowRenderer(this, debugWindow.monoFont, debugWindow.italicFont, this.imGuiWindowBridgeEngine, this.gdm) , 2);
@@ -341,9 +342,9
341 342
342 343 this.remainingDialog = new Queue<Node<DialogOption>>();
343 344
344 #if DEBUG
345 this.remainingDialog.Enqueue(DialogTrees.flatten(DialogTrees.testTree, this.grammar));
346 #endif
345 // #if DEBUG
346 // this.remainingDialog.Enqueue(DialogTrees.flatten(DialogTrees.testTree, this.grammar));
347 // #endif
347 348
348 349 this.budgetWindow = new BudgetWindow(new Budget { }, this.monoFont, 0, 0);
349 350
@@ -973,4 +974,9
973 974 this.gdm.IsFullScreen = fullscreen;
974 975 this.gdm.ApplyChanges();
975 976 }
977
978 public void enqueueDialog(Node<DialogOption> tree)
979 {
980 this.remainingDialog.Enqueue(tree);
981 }
976 982 }
@@ -43,11 +43,12
43 43 public static Node<DialogOption> testTree = new Node<DialogOption>(
44 44 new DialogOption
45 45 {
46 response = "#[name:player]addressGreeting#",
46 response = "#addressGreetingFormal#",
47 47 speaker = "#assistantName#"
48 48 },
49
50 49 new Node<DialogOption>[]{
50 new Node<DialogOption>(new DialogOption {choice="Call me #playerCasual#", response="Sure",
51 speaker = "#assistantName#" }),
51 52 new Node<DialogOption>(new DialogOption {choice="Hi.", response="Bye!",
52 53 speaker = "#assistantName#" }),
53 54 new Node<DialogOption>(new DialogOption {choice="How are you?", response="#howdoing#",
@@ -98,7 +99,6
98 99
99 100 }
100 101
101
102 102 }
103 103
104 104 }
@@ -19,7 +19,6
19 19 Hard
20 20 }
21 21
22
23 22 public static class NewGameWindow
24 23 {
25 24
@@ -44,12 +43,14
44 43
45 44 public static bool showModal;
46 45
46 public const int BUFFER_SIZE = 32;
47
47 48 public static void Initialize()
48 49 {
49 parkNameBuffer = new byte[32];
50 parkNameBuffer = new byte[BUFFER_SIZE];
50 51 pos = 0;
51 52
52 playerNameBuffer = new byte[32];
53 playerNameBuffer = new byte[BUFFER_SIZE];
53 54 playerNamePos = 0;
54 55
55 56 selectedTitle = "";
@@ -57,7 +58,7
57 58 playerName2Buffer = "";
58 59 playerName2Pos = 0;
59 60
60 customTitleBuffer = new byte[32];
61 customTitleBuffer = new byte[BUFFER_SIZE];
61 62 customTitlePos = 0;
62 63
63 64 showModal = true;
@@ -179,7 +180,7
179 180
180 181 //God this sucks:
181 182 unsafe {
182 ImGui.InputTextWithHint("##playerName2", "Leave blank to use full name", playerName2Buffer, 32, ImGuiInputTextFlags.AutoSelectAll, null, (IntPtr)(&newPlayerNamePos));
183 ImGui.InputTextWithHint("##playerName2", "Leave blank to use full name", ref playerName2Buffer, 32, ImGuiInputTextFlags.AutoSelectAll, null, (IntPtr)(&newPlayerName2Pos));
183 184 }
184 185
185 186 NewGameWindow.playerName2Pos = newPlayerName2Pos;
@@ -191,6 +192,11
191 192
192 193 if (ImGui.Button("Okay"))
193 194 {
195
196 bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerFormal", value = System.Text.Encoding.UTF8.GetString(playerNameBuffer) });
197 bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerCasual", value = playerName2Buffer });
198 bridgeEngine.setTextVariableMessages.Add(new SetTextVariableMessage { variable = "playerTitle", value = selectedTitle});
199
194 200 bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{});
195 201 bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame});
196 202 bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true});
You need to be logged in to leave comments. Login now