Description:
Remove menus.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -865,7 +865,7 | |||||
|
865 |
|
865 | ||
|
866 | bool quit = false; |
|
866 | bool quit = false; |
|
867 | Menu.Render(debugWindow.monoFont, FNAGame.width, ref quit, ref this.simulation.paused, ref this.simulation.currentRate, |
|
867 | Menu.Render(debugWindow.monoFont, FNAGame.width, ref quit, ref this.simulation.paused, ref this.simulation.currentRate, |
|
868 | ref this.showBudget, ref this.showForest); |
|
868 | ref this.showBudget, ref this.showForest, header_left); |
|
869 |
|
869 | ||
|
870 | if (quit) { |
|
870 | if (quit) { |
|
871 | System.Environment.Exit(0); |
|
871 | System.Environment.Exit(0); |
@@ -128,25 +128,6 | |||||
|
128 | ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS", 1000f / ImGui.GetIO().Framerate, ImGui.GetIO().Framerate)); |
|
128 | ImGui.Text(string.Format("Application average {0:F3} ms/frame ({1:F1} FPS", 1000f / ImGui.GetIO().Framerate, ImGui.GetIO().Framerate)); |
|
129 |
|
129 | ||
|
130 |
|
130 | ||
|
131 | if (ImGui.BeginMainMenuBar()) |
|
||
|
132 | { |
|
||
|
133 | if (ImGui.BeginMenu("File")) |
|
||
|
134 | { |
|
||
|
135 | if (ImGui.MenuItem("New")) |
|
||
|
136 | { |
|
||
|
137 | //Do something |
|
||
|
138 | } |
|
||
|
139 | ImGui.EndMenu(); |
|
||
|
140 | } |
|
||
|
141 |
|
|||
|
142 | ImGui.EndMainMenuBar(); |
|
||
|
143 | } |
|
||
|
144 | if (ImGui.BeginMainMenuBar()) |
|
||
|
145 | { |
|
||
|
146 | ImGui.EndMainMenuBar(); |
|
||
|
147 | } |
|
||
|
148 |
|
|||
|
149 |
|
|||
|
150 |
|
131 | ||
|
151 | if (ImGui.Button("Test Window")) |
|
132 | if (ImGui.Button("Test Window")) |
|
152 | { |
|
133 | { |
@@ -15,11 +15,6 | |||||
|
15 | } |
|
15 | } |
|
16 |
|
16 | ||
|
17 | var result = ImGui.Button(label); |
|
17 | var result = ImGui.Button(label); |
|
18 | // if (ImGui.IsItemHovered()) { |
|
||
|
19 | // ImGui.SetTooltip("Test"); |
|
||
|
20 |
|
|||
|
21 | // ImGui.EndTooltip(); |
|
||
|
22 | // } |
|
||
|
23 |
|
18 | ||
|
24 | if (active) { |
|
19 | if (active) { |
|
25 | ImGui.PopStyleColor(); |
|
20 | ImGui.PopStyleColor(); |
@@ -27,90 +22,38 | |||||
|
27 |
|
22 | ||
|
28 | return result; |
|
23 | return result; |
|
29 | } |
|
24 | } |
|
30 | public static void Render(ImFontPtr font, int width, ref bool quit, ref bool paused, ref int rate, ref bool show_budget, ref bool show_forest) |
|
25 | public static void Render(ImFontPtr font, int width, ref bool quit, ref bool paused, ref int rate, ref bool show_budget, ref bool show_forest, string header) |
|
31 | { |
|
26 | { |
|
32 |
|
|
27 | ImGui.PushFont(font); |
|
33 |
|
28 | ||
|
34 |
|
|
29 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; |
|
35 |
|
|
30 | ImGui.PushStyleVar(ImGuiStyleVar.FrameRounding, 0.0f); |
|
36 |
|
|
31 | ImGui.PushStyleVar(ImGuiStyleVar.WindowRounding, 0.0f); |
|
37 |
|
|
32 | ImGui.PushStyleVar(ImGuiStyleVar.FrameBorderSize, 1.0f); |
|
38 |
|
|
33 | ImGui.PushStyleColor(ImGuiCol.WindowBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); |
|
39 |
|
|
34 | ImGui.PushStyleColor(ImGuiCol.MenuBarBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); |
|
40 |
|
|
35 | ImGui.PushStyleColor(ImGuiCol.PopupBg, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); |
|
41 |
|
36 | ||
|
42 |
|
|
37 | var title_bar = new Num.Vector4(0.65f, 0.65f, 0.65f, 1f); |
|
43 |
|
|
38 | ImGui.PushStyleColor(ImGuiCol.TitleBg, title_bar); |
|
44 |
|
|
39 | ImGui.PushStyleColor(ImGuiCol.TitleBgActive, title_bar); |
|
45 |
|
|
40 | ImGui.PushStyleColor(ImGuiCol.TitleBgCollapsed, title_bar); |
|
46 |
|
41 | ||
|
47 |
|
|
42 | ImGui.PushStyleColor(ImGuiCol.Border, new Num.Vector4(0f, 0f, 0f, 1f)); |
|
48 |
|
|
43 | ImGui.PushStyleColor(ImGuiCol.BorderShadow, new Num.Vector4(0f, 0f, 0f, 0.5f)); |
|
49 |
|
44 | ||
|
50 |
|
45 | ||
|
51 |
|
46 | ||
|
52 |
|
|
47 | ImGui.PushStyleColor(ImGuiCol.Button, new Num.Vector4(0.75f, 0.75f, 0.75f, 1f)); |
|
53 |
|
|
48 | ImGui.PushStyleColor(ImGuiCol.Text, new Num.Vector4(0f, 0f, 0f, 1f)); |
|
54 |
|
|||
|
55 | if (ImGui.BeginMainMenuBar()) { |
|
||
|
56 | if (ImGui.BeginMenu("File")) { |
|
||
|
57 |
|
|||
|
58 | if (ImGui.MenuItem("Exit (Q)")) |
|
||
|
59 | { |
|
||
|
60 | quit = true; |
|
||
|
61 | } |
|
||
|
62 | ImGui.EndMenu(); |
|
||
|
63 | } |
|
||
|
64 | if (ImGui.BeginMenu("Speed")) { |
|
||
|
65 |
|
|||
|
66 | if (ImGui.MenuItem("Pause", "", paused)) { |
|
||
|
67 | paused = !paused; |
|
||
|
68 | } |
|
||
|
69 |
|
|||
|
70 | ImGui.Separator(); |
|
||
|
71 |
|
49 | ||
|
72 | if (ImGui.MenuItem("1 - Slow", "1", (rate == 0))) { |
|
50 | if (ImGui.BeginMainMenuBar()) |
|
73 | paused = false; |
|
51 | { |
|
74 | rate = 0; |
|
||
|
75 | } |
|
||
|
76 | else if (ImGui.MenuItem("2 - Normal", "2", (rate == 1))) { |
|
||
|
77 | paused = false; |
|
||
|
78 | rate = 1; |
|
||
|
79 | } |
|
||
|
80 | else if (ImGui.MenuItem("3 - Fast", "3", (rate == 2))) { |
|
||
|
81 | paused = false; |
|
||
|
82 | rate = 2; |
|
||
|
83 | } |
|
||
|
84 | else if (ImGui.MenuItem("4 - Fastest", "4", (rate == 3))) { |
|
||
|
85 | paused = false; |
|
||
|
86 | rate = 3; |
|
||
|
87 | } |
|
||
|
88 | #if DEBUG |
|
||
|
89 | else if (ImGui.MenuItem("5 - Warp", "5", (rate == 4))) { |
|
||
|
90 | paused = false; |
|
||
|
91 | rate = 4; |
|
||
|
92 | } |
|
||
|
93 | #endif |
|
||
|
94 |
|
|||
|
95 |
|
52 | ||
|
96 |
|
|
53 | ImGui.Text(header); |
|
97 | } |
|
||
|
98 |
|
|||
|
99 | if (ImGui.BeginMenu("Window")) { |
|
||
|
100 |
|
|||
|
101 | if (ImGui.MenuItem("(B)udget", "", show_budget)) { |
|
||
|
102 | show_budget = !show_budget; |
|
||
|
103 |
|
54 | ||
|
104 | } |
|
55 | ImGui.SetCursorPosX(width - 350); |
|
105 | else if (ImGui.MenuItem("(F)orest Policy", "", show_forest)) { |
|
||
|
106 | show_forest = !show_forest; |
|
||
|
107 |
|
56 | ||
|
108 | } |
|
||
|
109 | ImGui.EndMenu(); |
|
||
|
110 | } |
|
||
|
111 | ImGui.SetCursorPosX(width - 400); |
|
||
|
112 |
|
|||
|
113 | Menu.activeButton("Test", true, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f)); |
|
||
|
114 | if (Menu.activeButton("&Budget", show_budget, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
57 | if (Menu.activeButton("&Budget", show_budget, new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
115 | { |
|
58 | { |
|
116 | show_budget = !show_budget; |
|
59 | show_budget = !show_budget; |
@@ -128,7 +71,7 | |||||
|
128 | { |
|
71 | { |
|
129 | paused = !paused; |
|
72 | paused = !paused; |
|
130 | } |
|
73 | } |
|
131 | if (Menu.activeButton("1", (rate == 0), new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
74 | if (Menu.activeButton("1 ①", (rate == 0), new Num.Vector4(0.060f, 0.590f, 0.980f, 1f))) |
|
132 | { |
|
75 | { |
|
133 | paused = false; |
|
76 | paused = false; |
|
134 | rate = 0; |
|
77 | rate = 0; |
@@ -161,12 +104,12 | |||||
|
161 | // ImGui.Button("Toolbar goes here", new Num.Vector2(0, 37)); |
|
104 | // ImGui.Button("Toolbar goes here", new Num.Vector2(0, 37)); |
|
162 |
|
105 | ||
|
163 |
|
106 | ||
|
164 |
|
|
107 | // ImGui.End(); |
|
165 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; |
|
108 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.Left; |
|
166 |
|
|
109 | ImGui.PopStyleVar(3); |
|
167 |
|
|
110 | ImGui.PopStyleColor(9); |
|
168 |
|
|
111 | ImGui.PopFont(); |
|
169 | } |
|
112 | } |
|
170 | } |
|
113 | } |
|
171 | } |
|
114 | } |
|
172 | } No newline at end of file |
|
115 | } |
You need to be logged in to leave comments.
Login now