Description:
Fix identation.
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r347:4c810f7d6a30 -

@@ -10,45 +10,43
10 namespace isometricparkfna.UI
10 namespace isometricparkfna.UI
11 {
11 {
12
12
13 public static class MainMenu
13 public static class MainMenu
14 {
14 {
15
15
16
16
17 public static void Render(ImFontPtr font, ImGuiWindowBridgeEngine bridgeEngine
17 public static void Render(ImFontPtr font, ImGuiWindowBridgeEngine bridgeEngine)
18 /*ImFontPtr smallFont, GameBridgeEngine bridgeEngine */ //, ref bool quit, ref bool paused, ref int rate, ref bool showBudget, string header
18 {
19 )
19 //Has to go first so the measurement is correct:
20 {
20 ImGui.PushFont(font);
21 //Has to go first so the measurement is correct:
22 ImGui.PushFont(font);
23
21
24 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
22 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
25 bool newShow = true;
23 bool newShow = true;
26
24
27 Num.Vector2 text_size = ImGui.CalcTextSize("Quit to Main Menu");
25 Num.Vector2 text_size = ImGui.CalcTextSize("Quit to Main Menu");
28 Num.Vector2 button_size = new Num.Vector2((int)text_size.X*1.1f,
26 Num.Vector2 button_size = new Num.Vector2((int)text_size.X*1.1f,
29 (int)text_size.Y*1.25f+5);
27 (int)text_size.Y*1.25f+5);
30
28
31
29
32 StyleSets.defaultSet.push();
30 StyleSets.defaultSet.push();
33
31
34 ImGui.Begin("##Toolbar", ref newShow, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar);
32 ImGui.Begin("##Toolbar", ref newShow, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar);
35
33
36 if (ImGui.Button("New Game", button_size))
34 if (ImGui.Button("New Game", button_size))
37 {
35 {
38 bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true});
36 bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true});
39 }
37 }
40
38
41 if (ImGui.Button("Quit", button_size))
39 if (ImGui.Button("Quit", button_size))
42 {
40 {
43 System.Console.WriteLine("Quitting");
41 System.Console.WriteLine("Quitting");
44 Environment.Exit(0);
42 Environment.Exit(0);
45 }
43 }
46
44
47 ImGui.End();
45 ImGui.End();
48
46
49 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
47 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
50 StyleSets.defaultSet.pop();
48 StyleSets.defaultSet.pop();
51 ImGui.PopFont();
49 ImGui.PopFont();
52 }
50 }
53 }
51 }
54 }
52 }
@@ -16,15 +16,15
16 private static bool activeButton(string label, bool active, Num.Vector4 activeColor, Num.Vector4 activeTextColor) {
16 private static bool activeButton(string label, bool active, Num.Vector4 activeColor, Num.Vector4 activeTextColor) {
17
17
18 if (active) {
18 if (active) {
19 ImGui.PushStyleColor(ImGuiCol.Button, activeColor);
19 ImGui.PushStyleColor(ImGuiCol.Button, activeColor);
20 ImGui.PushStyleColor(ImGuiCol.ButtonHovered, activeColor);
20 ImGui.PushStyleColor(ImGuiCol.ButtonHovered, activeColor);
21 ImGui.PushStyleColor(ImGuiCol.Text, activeTextColor);
21 ImGui.PushStyleColor(ImGuiCol.Text, activeTextColor);
22 }
22 }
23
23
24 var result = ImGui.Button(label);
24 var result = ImGui.Button(label);
25
25
26 if (active) {
26 if (active) {
27 ImGui.PopStyleColor(3);
27 ImGui.PopStyleColor(3);
28 }
28 }
29
29
30 return result;
30 return result;
@@ -35,21 +35,19
35
35
36 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
36 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None;
37
37
38
39 StyleSets.defaultSet.push();
38 StyleSets.defaultSet.push();
40 ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSets.grey);
39 ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSets.grey);
41
40
42 if (ImGui.BeginMainMenuBar())
41 if (ImGui.BeginMainMenuBar())
43 {
42 {
44
45 ImGui.Text(header);
43 ImGui.Text(header);
46
44
47 ImGui.SetCursorPosX(width - 520);
45 ImGui.SetCursorPosX(width - 520);
48
46
49 if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSets.selected, StyleSets.white))
47 if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSets.selected, StyleSets.white))
50 {
48 {
51 Logging.Trace("Contracts toggled.");
49 Logging.Trace("Contracts toggled.");
52 Logging.Spy(bridgeEngine.windowStatuses, "statuses");
50 Logging.Spy(bridgeEngine.windowStatuses, "statuses");
53 bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Contracts});
51 bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Contracts});
54 }
52 }
55 //Budget isn't connected to an entity yet:
53 //Budget isn't connected to an entity yet:
@@ -102,7 +100,6
102 }
100 }
103 #endif
101 #endif
104
102
105
106 ImGui.EndMainMenuBar();
103 ImGui.EndMainMenuBar();
107
104
108 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
105 ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left;
You need to be logged in to leave comments. Login now