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