Description:
Tweak buttons.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
|
1 | NO CONTENT: modified file, binary diff hidden |
|
NO CONTENT: modified file, binary diff hidden |
@@ -13,12 +13,12 | |||||
|
13 |
|
13 | ||
|
14 | public const int MENU_BAR_HEIGHT = 20; |
|
14 | public const int MENU_BAR_HEIGHT = 20; |
|
15 |
|
15 | ||
|
16 | private static bool activeButton(string label, bool active, Num.Vector4 activeColor) { |
|
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, |
|
21 | ImGui.PushStyleColor(ImGuiCol.Text, activeTextColor); |
|
22 | } |
|
22 | } |
|
23 |
|
23 | ||
|
24 | var result = ImGui.Button(label); |
|
24 | var result = ImGui.Button(label); |
@@ -36,7 +36,7 | |||||
|
36 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; |
|
36 | ImGui.GetStyle().WindowMenuButtonPosition = ImGuiDir.None; |
|
37 |
|
37 | ||
|
38 |
|
38 | ||
|
39 |
|
|
39 | StyleSets.defaultSet.push(); |
|
40 | ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSets.grey); |
|
40 | ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSets.grey); |
|
41 |
|
41 | ||
|
42 | if (ImGui.BeginMainMenuBar()) |
|
42 | if (ImGui.BeginMainMenuBar()) |
@@ -46,56 +46,56 | |||||
|
46 |
|
46 | ||
|
47 | ImGui.SetCursorPosX(width - 520); |
|
47 | ImGui.SetCursorPosX(width - 520); |
|
48 |
|
48 | ||
|
49 | if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSets.selected)) |
|
49 | if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSets.selected, StyleSets.white)) |
|
50 | { |
|
50 | { |
|
51 | Logging.Trace("Contracts toggled."); |
|
51 | Logging.Trace("Contracts toggled."); |
|
52 | Logging.Spy(bridgeEngine.windowStatuses, "statuses"); |
|
52 | Logging.Spy(bridgeEngine.windowStatuses, "statuses"); |
|
53 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Contracts}); |
|
53 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Contracts}); |
|
54 | } |
|
54 | } |
|
55 | //Budget isn't connected to an entity yet: |
|
55 | //Budget isn't connected to an entity yet: |
|
56 | if (Menu.activeButton("$ Budget", showBudget, StyleSets.selected)) |
|
56 | if (Menu.activeButton("$ Budget", showBudget, StyleSets.selected, StyleSets.white)) |
|
57 | { |
|
57 | { |
|
58 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Budget}); |
|
58 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Budget}); |
|
59 |
|
59 | ||
|
60 | } |
|
60 | } |
|
61 | if (Menu.activeButton("\ue124 Forest", bridgeEngine.windowStatuses[Window.Forest], StyleSets.selected)) |
|
61 | if (Menu.activeButton("\ue124 Forest", bridgeEngine.windowStatuses[Window.Forest], StyleSets.selected, StyleSets.white)) |
|
62 | { |
|
62 | { |
|
63 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Forest}); |
|
63 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.Forest}); |
|
64 |
|
64 | ||
|
65 | } |
|
65 | } |
|
66 | if (Menu.activeButton("\ue0bf News", bridgeEngine.windowStatuses[Window.News], StyleSets.selected)) |
|
66 | if (Menu.activeButton("\ue0bf News", bridgeEngine.windowStatuses[Window.News], StyleSets.selected, StyleSets.white)) |
|
67 | { |
|
67 | { |
|
68 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.News}); |
|
68 | bridgeEngine.typeMessages.Add(new ToggleWindowTypeMessage{Window = Window.News}); |
|
69 | } |
|
69 | } |
|
70 |
|
70 | ||
|
71 | ImGui.Text("|"); |
|
71 | ImGui.Text("|"); |
|
72 |
|
72 | ||
|
73 | if (Menu.activeButton("\ue0ac Pause", paused, StyleSets.selected )) |
|
73 | if (Menu.activeButton("\ue0ac Pause", paused, StyleSets.selected, StyleSets.white )) |
|
74 | { |
|
74 | { |
|
75 | paused = !paused; |
|
75 | paused = !paused; |
|
76 | } |
|
76 | } |
|
77 | if (Menu.activeButton("1", (rate == 0), StyleSets.selected)) |
|
77 | if (Menu.activeButton("1", (rate == 0), StyleSets.selected, StyleSets.white)) |
|
78 | { |
|
78 | { |
|
79 | paused = false; |
|
79 | paused = false; |
|
80 | rate = 0; |
|
80 | rate = 0; |
|
81 | } |
|
81 | } |
|
82 | else if (Menu.activeButton("2", (rate == 1), StyleSets.selected)) |
|
82 | else if (Menu.activeButton("2", (rate == 1), StyleSets.selected, StyleSets.white)) |
|
83 | { |
|
83 | { |
|
84 | paused = false; |
|
84 | paused = false; |
|
85 | rate = 1; |
|
85 | rate = 1; |
|
86 | } |
|
86 | } |
|
87 | else if (Menu.activeButton("3", (rate == 2), StyleSets.selected)) |
|
87 | else if (Menu.activeButton("3", (rate == 2), StyleSets.selected, StyleSets.white)) |
|
88 | { |
|
88 | { |
|
89 | paused = false; |
|
89 | paused = false; |
|
90 | rate = 2; |
|
90 | rate = 2; |
|
91 | } |
|
91 | } |
|
92 | else if (Menu.activeButton("4", (rate == 3), StyleSets.selected)) |
|
92 | else if (Menu.activeButton("4", (rate == 3), StyleSets.selected, StyleSets.white)) |
|
93 | { |
|
93 | { |
|
94 | paused = false; |
|
94 | paused = false; |
|
95 | rate = 3; |
|
95 | rate = 3; |
|
96 | } |
|
96 | } |
|
97 | #if DEBUG |
|
97 | #if DEBUG |
|
98 | else if (Menu.activeButton("5", (rate == 4), StyleSets.selected)) |
|
98 | else if (Menu.activeButton("5", (rate == 4), StyleSets.selected, StyleSets.white)) |
|
99 | { |
|
99 | { |
|
100 | paused = false; |
|
100 | paused = false; |
|
101 | rate = 4; |
|
101 | rate = 4; |
You need to be logged in to leave comments.
Login now