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 - Add a create park dialog @milestone(4: Beginning)
117 - Add a create park dialog @milestone(4: Beginning)
118 - Procgen park names (that player can override)
118 - Procgen park names (that player can override)
119 - Button to generate new name?
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 Some possibilities: Mr., Ms., Mx., Director, Dr., Professor, Miss, Col., Herr Dr. Dr. nothing, custom
121 Some possibilities: Mr., Ms., Mx., Director, Dr., Professor, Miss, Col., Herr Dr. Dr. nothing, custom
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.)
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 - Allow player to choose difficulty
123 - Allow player to choose difficulty
@@ -32,6 +32,8
32 "Milton", "Coltrane", "Kim", "Lindgren", "Kerry", "Harris"],
32 "Milton", "Coltrane", "Kim", "Lindgren", "Kerry", "Harris"],
33 "greeting": [ "Hi", "Hello", "Greetings" ],
33 "greeting": [ "Hi", "Hello", "Greetings" ],
34 "addressGreeting": "#greeting#, #name#",
34 "addressGreeting": "#greeting#, #name#",
35 "addressGreetingFormal": "#greeting#, #playerTitle# #playerFormal#",
36 "addressGreetingCasual": "#greeting#, #playerCasual#",
35 "howdoing": [ "I'm good.", "Fine", "Alright, I guess." ],
37 "howdoing": [ "I'm good.", "Fine", "Alright, I guess." ],
36 "city": ["Milwaukee", "Chicago", "Washington", "Minneapolis", "Dallas",
38 "city": ["Milwaukee", "Chicago", "Washington", "Minneapolis", "Dallas",
37 "Oklahoma City", "Boston", "Los Angeles", "Portland", "Santa Fe",
39 "Oklahoma City", "Boston", "Los Angeles", "Portland", "Santa Fe",
@@ -20,7 +20,8
20 typeof(SetResolutionMessage),
20 typeof(SetResolutionMessage),
21 typeof(SetFontMessage),
21 typeof(SetFontMessage),
22 typeof(SetTrespassingPolicyMessage),
22 typeof(SetTrespassingPolicyMessage),
23 typeof(SpawnGameMessage))]
23 typeof(SpawnGameMessage),
24 typeof(SetTextVariableMessage))]
24 [Reads(typeof(VisibilityComponent),
25 [Reads(typeof(VisibilityComponent),
25 typeof(WindowTypeComponent),
26 typeof(WindowTypeComponent),
26 typeof(TrespassingPolicyComponent)
27 typeof(TrespassingPolicyComponent)
@@ -40,6 +41,7
40 public List<SetFontMessage> fontMessages;
41 public List<SetFontMessage> fontMessages;
41 public List<SetTrespassingPolicyMessage> trespassingPolicyMessages;
42 public List<SetTrespassingPolicyMessage> trespassingPolicyMessages;
42 public List<SpawnGameMessage> spawnGameMessages;
43 public List<SpawnGameMessage> spawnGameMessages;
44 public List<SetTextVariableMessage> setTextVariableMessages;
43
45
44 bool showBudget {get;}
46 bool showBudget {get;}
45 bool showForest {get;}
47 bool showForest {get;}
@@ -67,6 +69,7
67 this.fontMessages = new List<SetFontMessage>();
69 this.fontMessages = new List<SetFontMessage>();
68 this.trespassingPolicyMessages = new List<SetTrespassingPolicyMessage>();
70 this.trespassingPolicyMessages = new List<SetTrespassingPolicyMessage>();
69 this.spawnGameMessages = new List<SpawnGameMessage>();
71 this.spawnGameMessages = new List<SpawnGameMessage>();
72 this.setTextVariableMessages = new List<SetTextVariableMessage>();
70 this.windowStatuses = new Dictionary<Window, bool>();
73 this.windowStatuses = new Dictionary<Window, bool>();
71
74
72
75
@@ -140,6 +143,14
140 {
143 {
141 SendMessage(message);
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 this.fontMessages.Clear();
172 this.fontMessages.Clear();
162 this.trespassingPolicyMessages.Clear();
173 this.trespassingPolicyMessages.Clear();
163 this.spawnGameMessages.Clear();
174 this.spawnGameMessages.Clear();
175 this.setTextVariableMessages.Clear();
164 }
176 }
165 }
177 }
166 }
178 }
@@ -4,11 +4,12
4
4
5 using Microsoft.Xna.Framework;
5 using Microsoft.Xna.Framework;
6
6
7 using isometricparkfna.Messages;
8 using static isometricparkfna.CellMap;
9 using isometricparkfna.UI;
7
10
8 using Encompass;
11 using Encompass;
9
12 using TraceryNet;
10 using isometricparkfna.Messages;
11 using static isometricparkfna.CellMap;
12
13
13 namespace isometricparkfna.Spawners {
14 namespace isometricparkfna.Spawners {
14
15
@@ -20,11 +21,15
20 {
21 {
21 private Simulation simulation;
22 private Simulation simulation;
22 Random random_generator;
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 this.simulation = simulation;
29 this.simulation = simulation;
27 this.random_generator = new Random();
30 this.random_generator = new Random();
31 this.game = game;
32 this.grammar = grammar;
28 }
33 }
29
34
30 protected override void Spawn(in SpawnGameMessage message)
35 protected override void Spawn(in SpawnGameMessage message)
@@ -99,6 +104,10
99 description = "#coop_company_description#",
104 description = "#coop_company_description#",
100 type = OrganizationType.Cooperative });
105 type = OrganizationType.Cooperative });
101 #endregion
106 #endregion
107 #region dialog
108
109 this.game.enqueueDialog(DialogTrees.flatten(DialogTrees.testTree, this.grammar));
110 #endregion
102 Logging.Success("Spawned new game.");
111 Logging.Success("Spawned new game.");
103
112
104 }
113 }
@@ -252,9 +252,10
252 WorldBuilder.AddEngine(new ContractStatusEngine(this.simulation));
252 WorldBuilder.AddEngine(new ContractStatusEngine(this.simulation));
253
253
254 WorldBuilder.AddEngine(new ContractSpawner(simulation.map.MapWidth, simulation.map.MapHeight, this.simulation, this.grammar));
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 WorldBuilder.AddEngine(new OrganizationSpawner(this.simulation, this.grammar));
256 WorldBuilder.AddEngine(new OrganizationSpawner(this.simulation, this.grammar));
257 WorldBuilder.AddEngine(new PolicyEngine());
257 WorldBuilder.AddEngine(new PolicyEngine());
258 WorldBuilder.AddEngine(new TraceryBridgeEngine(this.grammar));
258
259
259 WorldBuilder.AddGeneralRenderer(new AreaRenderer(this.batch, this.monoFont), 1);
260 WorldBuilder.AddGeneralRenderer(new AreaRenderer(this.batch, this.monoFont), 1);
260 WorldBuilder.AddGeneralRenderer(new ImGuiWindowRenderer(this, debugWindow.monoFont, debugWindow.italicFont, this.imGuiWindowBridgeEngine, this.gdm) , 2);
261 WorldBuilder.AddGeneralRenderer(new ImGuiWindowRenderer(this, debugWindow.monoFont, debugWindow.italicFont, this.imGuiWindowBridgeEngine, this.gdm) , 2);
@@ -341,9 +342,9
341
342
342 this.remainingDialog = new Queue<Node<DialogOption>>();
343 this.remainingDialog = new Queue<Node<DialogOption>>();
343
344
344 #if DEBUG
345 // #if DEBUG
345 this.remainingDialog.Enqueue(DialogTrees.flatten(DialogTrees.testTree, this.grammar));
346 // this.remainingDialog.Enqueue(DialogTrees.flatten(DialogTrees.testTree, this.grammar));
346 #endif
347 // #endif
347
348
348 this.budgetWindow = new BudgetWindow(new Budget { }, this.monoFont, 0, 0);
349 this.budgetWindow = new BudgetWindow(new Budget { }, this.monoFont, 0, 0);
349
350
@@ -973,4 +974,9
973 this.gdm.IsFullScreen = fullscreen;
974 this.gdm.IsFullScreen = fullscreen;
974 this.gdm.ApplyChanges();
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 public static Node<DialogOption> testTree = new Node<DialogOption>(
43 public static Node<DialogOption> testTree = new Node<DialogOption>(
44 new DialogOption
44 new DialogOption
45 {
45 {
46 response = "#[name:player]addressGreeting#",
46 response = "#addressGreetingFormal#",
47 speaker = "#assistantName#"
47 speaker = "#assistantName#"
48 },
48 },
49
50 new Node<DialogOption>[]{
49 new Node<DialogOption>[]{
50 new Node<DialogOption>(new DialogOption {choice="Call me #playerCasual#", response="Sure",
51 speaker = "#assistantName#" }),
51 new Node<DialogOption>(new DialogOption {choice="Hi.", response="Bye!",
52 new Node<DialogOption>(new DialogOption {choice="Hi.", response="Bye!",
52 speaker = "#assistantName#" }),
53 speaker = "#assistantName#" }),
53 new Node<DialogOption>(new DialogOption {choice="How are you?", response="#howdoing#",
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 Hard
19 Hard
20 }
20 }
21
21
22
23 public static class NewGameWindow
22 public static class NewGameWindow
24 {
23 {
25
24
@@ -44,12 +43,14
44
43
45 public static bool showModal;
44 public static bool showModal;
46
45
46 public const int BUFFER_SIZE = 32;
47
47 public static void Initialize()
48 public static void Initialize()
48 {
49 {
49 parkNameBuffer = new byte[32];
50 parkNameBuffer = new byte[BUFFER_SIZE];
50 pos = 0;
51 pos = 0;
51
52
52 playerNameBuffer = new byte[32];
53 playerNameBuffer = new byte[BUFFER_SIZE];
53 playerNamePos = 0;
54 playerNamePos = 0;
54
55
55 selectedTitle = "";
56 selectedTitle = "";
@@ -57,7 +58,7
57 playerName2Buffer = "";
58 playerName2Buffer = "";
58 playerName2Pos = 0;
59 playerName2Pos = 0;
59
60
60 customTitleBuffer = new byte[32];
61 customTitleBuffer = new byte[BUFFER_SIZE];
61 customTitlePos = 0;
62 customTitlePos = 0;
62
63
63 showModal = true;
64 showModal = true;
@@ -179,7 +180,7
179
180
180 //God this sucks:
181 //God this sucks:
181 unsafe {
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 NewGameWindow.playerName2Pos = newPlayerName2Pos;
186 NewGameWindow.playerName2Pos = newPlayerName2Pos;
@@ -191,6 +192,11
191
192
192 if (ImGui.Button("Okay"))
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 bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{});
200 bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{});
195 bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame});
201 bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame});
196 bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true});
202 bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true});
You need to be logged in to leave comments. Login now