Description:
Fix identation.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -10,45 +10,43 | |||||
|
10 | namespace isometricparkfna.UI |
|
10 | namespace isometricparkfna.UI |
|
11 | { |
|
11 | { |
|
12 |
|
12 | ||
|
13 |
|
|
13 | public static class MainMenu |
|
14 | { |
|
14 | { |
|
15 |
|
15 | ||
|
16 |
|
16 | ||
|
17 |
|
|
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 |
|
|
22 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; |
|
25 |
|
|
23 | bool newShow = true; |
|
26 |
|
24 | ||
|
27 |
|
|
25 | Num.Vector2 text_size = ImGui.CalcTextSize("Quit to Main Menu"); |
|
28 |
|
|
26 | Num.Vector2 button_size = new Num.Vector2((int)text_size.X*1.1f, |
|
29 |
|
|
27 | (int)text_size.Y*1.25f+5); |
|
30 |
|
28 | ||
|
31 |
|
29 | ||
|
32 |
|
|
30 | StyleSets.defaultSet.push(); |
|
33 |
|
31 | ||
|
34 |
|
|
32 | ImGui.Begin("##Toolbar", ref newShow, ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoTitleBar); |
|
35 |
|
33 | ||
|
36 |
|
|
34 | if (ImGui.Button("New Game", button_size)) |
|
37 | { |
|
35 | { |
|
38 |
|
|
36 | bridgeEngine.gameStateMessages.Add(new GameStateMessage { isPlaying = true}); |
|
39 | } |
|
37 | } |
|
40 |
|
38 | ||
|
41 |
|
|
39 | if (ImGui.Button("Quit", button_size)) |
|
42 | { |
|
40 | { |
|
43 |
|
|
41 | System.Console.WriteLine("Quitting"); |
|
44 |
|
|
42 | Environment.Exit(0); |
|
45 | } |
|
43 | } |
|
46 |
|
44 | ||
|
47 |
|
|
45 | ImGui.End(); |
|
48 |
|
46 | ||
|
49 |
|
|
47 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; |
|
50 |
|
|
48 | StyleSets.defaultSet.pop(); |
|
51 |
|
|
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 |
|
|
19 | ImGui.PushStyleColor(ImGuiCol.Button, activeColor); |
|
20 |
|
|
20 | ImGui.PushStyleColor(ImGuiCol.ButtonHovered, activeColor); |
|
21 |
|
|
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 |
|
|
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 |
|
|
49 | Logging.Trace("Contracts toggled."); |
|
52 |
|
|
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