Description:
Add cancel button.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -46,8 +46,6 | |||
|
46 | 46 | showModal = true; |
|
47 | 47 | |
|
48 | 48 | NewGameWindow.Reset(); |
|
49 | ||
|
50 | ||
|
51 | 49 | } |
|
52 | 50 | |
|
53 | 51 | public static void Reset() { |
@@ -197,7 +195,6 | |||
|
197 | 195 | ImGui.RadioButton("Medium: Austerity", ref choice, ((int)DifficultyLevel.Medium)); |
|
198 | 196 | ImGui.RadioButton("Hard: Libertarianism", ref choice, ((int)DifficultyLevel.Hard)); |
|
199 | 197 | |
|
200 | ||
|
201 | 198 | if (ImGui.Button("Okay")) |
|
202 | 199 | { |
|
203 | 200 | |
@@ -220,13 +217,10 | |||
|
220 | 217 | NewGameWindow.Reset(); |
|
221 | 218 | } |
|
222 | 219 | |
|
223 | ||
|
224 | 220 | ImGui.End(); |
|
225 | 221 | |
|
226 | ||
|
227 | 222 | StyleSets.defaultSet.pop(); |
|
228 | 223 | ImGui.PopFont(); |
|
229 | ||
|
230 | 224 | } |
|
231 | 225 | } |
|
232 | 226 | } |
@@ -16,6 +16,7 | |||
|
16 | 16 | { |
|
17 | 17 | |
|
18 | 18 | public static bool hadFocus = false; |
|
19 | ||
|
19 | 20 | public static bool newFullscreen; |
|
20 | 21 | public static Vector2 newResolution; |
|
21 | 22 | |
@@ -23,6 +24,14 | |||
|
23 | 24 | private static int fontSize = 15; |
|
24 | 25 | private static ProfanityLevel profanityLevel = default; |
|
25 | 26 | |
|
27 | ||
|
28 | private static bool origFullscreen = OptionsWindow.newFullscreen; | |
|
29 | private static Vector2 origResolution = OptionsWindow.newResolution; | |
|
30 | ||
|
31 | private static string origFontName = OptionsWindow.fontName; | |
|
32 | private static int origFontSize = OptionsWindow.fontSize; | |
|
33 | private static ProfanityLevel origProfanityLevel = OptionsWindow.profanityLevel; | |
|
34 | ||
|
26 | 35 | public static void Initialize(Vector2 resolution, bool fullscreen, ProfanityLevel profanityLevel) |
|
27 | 36 | { |
|
28 | 37 | |
@@ -165,6 +174,13 | |||
|
165 | 174 | fontName = OptionsWindow.fontName |
|
166 | 175 | }); |
|
167 | 176 | |
|
177 | origFullscreen = OptionsWindow.newFullscreen; | |
|
178 | origResolution = OptionsWindow.newResolution; | |
|
179 | ||
|
180 | origFontName = OptionsWindow.fontName; | |
|
181 | origFontSize = OptionsWindow.fontSize; | |
|
182 | origProfanityLevel = OptionsWindow.profanityLevel; | |
|
183 | ||
|
168 | 184 | } |
|
169 | 185 | ImGui.SameLine(); |
|
170 | 186 | if (ImGui.Button("Apply")) |
@@ -177,8 +193,28 | |||
|
177 | 193 | fontSize = OptionsWindow.fontSize, |
|
178 | 194 | fontName = OptionsWindow.fontName |
|
179 | 195 | }); |
|
196 | ||
|
197 | origFullscreen = OptionsWindow.newFullscreen; | |
|
198 | origResolution = OptionsWindow.newResolution; | |
|
199 | ||
|
200 | origFontName = OptionsWindow.fontName; | |
|
201 | origFontSize = OptionsWindow.fontSize; | |
|
202 | origProfanityLevel = OptionsWindow.profanityLevel; | |
|
203 | ||
|
180 | 204 | } |
|
181 | 205 | |
|
206 | ImGui.SameLine(); | |
|
207 | if (ImGui.Button("Cancel")) { | |
|
208 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.Options}); | |
|
209 | ||
|
210 | OptionsWindow.newFullscreen = origFullscreen; | |
|
211 | OptionsWindow.newResolution = origResolution; | |
|
212 | ||
|
213 | OptionsWindow.fontName = origFontName; | |
|
214 | OptionsWindow.fontSize = origFontSize; | |
|
215 | OptionsWindow.profanityLevel = origProfanityLevel; | |
|
216 | } | |
|
217 | ||
|
182 | 218 | |
|
183 | 219 | ImGui.End(); |
|
184 | 220 |
You need to be logged in to leave comments.
Login now