Description:
Add difficulty.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -22,7 +22,6 | |||||
|
22 | { |
|
22 | { |
|
23 | startGame(); |
|
23 | startGame(); |
|
24 | } |
|
24 | } |
|
25 | // SendMessage(new ToggleWindowTypeMessage { Window = Window.MainMenu }); |
|
||
|
26 |
|
25 | ||
|
27 | foreach (var entity in ReadEntities<GameStateComponent>()) |
|
26 | foreach (var entity in ReadEntities<GameStateComponent>()) |
|
28 | { |
|
27 | { |
@@ -34,6 +34,7 | |||||
|
34 | { |
|
34 | { |
|
35 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true}); |
|
35 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true}); |
|
36 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.NewGame }); |
|
36 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.NewGame }); |
|
|
37 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); | ||
|
37 | } |
|
38 | } |
|
38 |
|
39 | ||
|
39 | if (ImGui.Button("Quit", button_size)) |
|
40 | if (ImGui.Button("Quit", button_size)) |
@@ -12,6 +12,14 | |||||
|
12 | namespace isometricparkfna.UI |
|
12 | namespace isometricparkfna.UI |
|
13 | { |
|
13 | { |
|
14 |
|
14 | ||
|
|
15 | enum DifficultyLevel | ||
|
|
16 | { | ||
|
|
17 | Easy, | ||
|
|
18 | Medium, | ||
|
|
19 | Hard | ||
|
|
20 | } | ||
|
|
21 | |||
|
|
22 | |||
|
15 | public static class NewGameWindow |
|
23 | public static class NewGameWindow |
|
16 | { |
|
24 | { |
|
17 |
|
25 | ||
@@ -26,6 +34,8 | |||||
|
26 |
|
34 | ||
|
27 | public static String selectedTitle; |
|
35 | public static String selectedTitle; |
|
28 |
|
36 | ||
|
|
37 | public static int choice; | ||
|
|
38 | |||
|
29 | public static void Initialize() |
|
39 | public static void Initialize() |
|
30 | { |
|
40 | { |
|
31 | parkNameBuffer = new byte[32]; |
|
41 | parkNameBuffer = new byte[32]; |
@@ -74,10 +84,23 | |||||
|
74 |
|
84 | ||
|
75 | ImGui.Text("Your Name: "); |
|
85 | ImGui.Text("Your Name: "); |
|
76 | ImGui.SameLine(); |
|
86 | ImGui.SameLine(); |
|
|
87 | |||
|
|
88 | |||
|
|
89 | |||
|
|
90 | |||
|
|
91 | ImGui.SetNextItemWidth(ImGui.CalcTextSize("<No Title>").X | ||
|
|
92 | + ImGui.CalcTextSize("XXXX").X); | ||
|
77 | if (ImGui.BeginCombo("##title", selectedTitle)) |
|
93 | if (ImGui.BeginCombo("##title", selectedTitle)) |
|
78 | { |
|
94 | { |
|
79 |
|
95 | ||
|
80 | foreach (var title in new String[] {"", "<No Title>", "Mr.", "Mrs.", "Ms.", "Mx.", "Dr."}) |
|
96 | ImGui.PushFont(italicFont); |
|
|
97 | if (ImGui.Selectable("<No Title>")) | ||
|
|
98 | { | ||
|
|
99 | selectedTitle = "<No Title>"; | ||
|
|
100 | } | ||
|
|
101 | ImGui.PopFont(); | ||
|
|
102 | |||
|
|
103 | foreach (var title in new String[] {"Mr.", "Mrs.", "Ms.", "Mx.", "Dr."}) | ||
|
81 | { |
|
104 | { |
|
82 | if (ImGui.Selectable(title)) |
|
105 | if (ImGui.Selectable(title)) |
|
83 | { |
|
106 | { |
@@ -88,9 +111,9 | |||||
|
88 | ImGui.EndCombo(); |
|
111 | ImGui.EndCombo(); |
|
89 | } |
|
112 | } |
|
90 |
|
113 | ||
|
|
114 | ImGui.SameLine(); | ||
|
91 | int newPlayerNamePos = NewGameWindow.playerNamePos; |
|
115 | int newPlayerNamePos = NewGameWindow.playerNamePos; |
|
92 |
|
116 | ||
|
93 | ImGui.SameLine(); |
|
||
|
94 | //God this sucks: |
|
117 | //God this sucks: |
|
95 | unsafe { |
|
118 | unsafe { |
|
96 | ImGui.InputText("##playerNameBuffer", playerNameBuffer, (uint)playerNameBuffer.Length, ImGuiInputTextFlags.AutoSelectAll, null, (IntPtr)(&newPlayerNamePos)); |
|
119 | ImGui.InputText("##playerNameBuffer", playerNameBuffer, (uint)playerNameBuffer.Length, ImGuiInputTextFlags.AutoSelectAll, null, (IntPtr)(&newPlayerNamePos)); |
@@ -98,11 +121,15 | |||||
|
98 |
|
121 | ||
|
99 | NewGameWindow.playerNamePos = newPlayerNamePos; |
|
122 | NewGameWindow.playerNamePos = newPlayerNamePos; |
|
100 |
|
123 | ||
|
|
124 | ImGui.RadioButton("Easy: Full Funding", ref choice, ((int)DifficultyLevel.Easy)); | ||
|
|
125 | ImGui.RadioButton("Medium: Austerity", ref choice, ((int)DifficultyLevel.Medium)); | ||
|
|
126 | ImGui.RadioButton("Hard: Unfunded", ref choice, ((int)DifficultyLevel.Hard)); | ||
|
|
127 | |||
|
|
128 | |||
|
101 | if (ImGui.Button("Okay")) |
|
129 | if (ImGui.Button("Okay")) |
|
102 | { |
|
130 | { |
|
103 | bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{}); |
|
131 | bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{}); |
|
104 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
132 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
105 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); |
|
||
|
106 | } |
|
133 | } |
|
107 |
|
134 | ||
|
108 | ImGui.SameLine(); |
|
135 | ImGui.SameLine(); |
@@ -111,6 +138,7 | |||||
|
111 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
138 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
112 |
|
139 | ||
|
113 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = false}); |
|
140 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = false}); |
|
|
141 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); | ||
|
114 | } |
|
142 | } |
|
115 |
|
143 | ||
|
116 | ImGui.End(); |
|
144 | ImGui.End(); |
You need to be logged in to leave comments.
Login now