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 | 23 | startGame(); |
|
24 | 24 | } |
|
25 | // SendMessage(new ToggleWindowTypeMessage { Window = Window.MainMenu }); | |
|
26 | 25 | |
|
27 | 26 | foreach (var entity in ReadEntities<GameStateComponent>()) |
|
28 | 27 | { |
@@ -34,6 +34,7 | |||
|
34 | 34 | { |
|
35 | 35 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true}); |
|
36 | 36 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.NewGame }); |
|
37 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); | |
|
37 | 38 | } |
|
38 | 39 | |
|
39 | 40 | if (ImGui.Button("Quit", button_size)) |
@@ -12,6 +12,14 | |||
|
12 | 12 | namespace isometricparkfna.UI |
|
13 | 13 | { |
|
14 | 14 | |
|
15 | enum DifficultyLevel | |
|
16 | { | |
|
17 | Easy, | |
|
18 | Medium, | |
|
19 | Hard | |
|
20 | } | |
|
21 | ||
|
22 | ||
|
15 | 23 | public static class NewGameWindow |
|
16 | 24 | { |
|
17 | 25 | |
@@ -26,6 +34,8 | |||
|
26 | 34 | |
|
27 | 35 | public static String selectedTitle; |
|
28 | 36 | |
|
37 | public static int choice; | |
|
38 | ||
|
29 | 39 | public static void Initialize() |
|
30 | 40 | { |
|
31 | 41 | parkNameBuffer = new byte[32]; |
@@ -74,10 +84,23 | |||
|
74 | 84 | |
|
75 | 85 | ImGui.Text("Your Name: "); |
|
76 | 86 | ImGui.SameLine(); |
|
87 | ||
|
88 | ||
|
89 | ||
|
90 | ||
|
91 | ImGui.SetNextItemWidth(ImGui.CalcTextSize("<No Title>").X | |
|
92 | + ImGui.CalcTextSize("XXXX").X); | |
|
77 | 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 | 105 | if (ImGui.Selectable(title)) |
|
83 | 106 | { |
@@ -88,9 +111,9 | |||
|
88 | 111 | ImGui.EndCombo(); |
|
89 | 112 | } |
|
90 | 113 | |
|
114 | ImGui.SameLine(); | |
|
91 | 115 | int newPlayerNamePos = NewGameWindow.playerNamePos; |
|
92 | 116 | |
|
93 | ImGui.SameLine(); | |
|
94 | 117 | //God this sucks: |
|
95 | 118 | unsafe { |
|
96 | 119 | ImGui.InputText("##playerNameBuffer", playerNameBuffer, (uint)playerNameBuffer.Length, ImGuiInputTextFlags.AutoSelectAll, null, (IntPtr)(&newPlayerNamePos)); |
@@ -98,11 +121,15 | |||
|
98 | 121 | |
|
99 | 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 | 129 | if (ImGui.Button("Okay")) |
|
102 | 130 | { |
|
103 | 131 | bridgeEngine.spawnGameMessages.Add(new SpawnGameMessage{}); |
|
104 | 132 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
105 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); | |
|
106 | 133 | } |
|
107 | 134 | |
|
108 | 135 | ImGui.SameLine(); |
@@ -111,6 +138,7 | |||
|
111 | 138 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage {Window = Window.NewGame}); |
|
112 | 139 | |
|
113 | 140 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = false}); |
|
141 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage { Window = Window.MainMenu }); | |
|
114 | 142 | } |
|
115 | 143 | |
|
116 | 144 | ImGui.End(); |
You need to be logged in to leave comments.
Login now