Description:
Finish refactoring.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -52,7 +52,7 | |||||
|
52 | if (ContractWindow.hadFocus.ContainsKey(title) && |
|
52 | if (ContractWindow.hadFocus.ContainsKey(title) && |
|
53 | ContractWindow.hadFocus[title]) |
|
53 | ContractWindow.hadFocus[title]) |
|
54 | { |
|
54 | { |
|
55 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); |
|
55 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); |
|
56 | } |
|
56 | } |
|
57 |
|
57 | ||
|
58 | ImGui.Begin(name, ref newShow, |
|
58 | ImGui.Begin(name, ref newShow, |
@@ -39,7 +39,7 | |||||
|
39 | ImGui.SetNextWindowSize(new Num.Vector2(320, 340)); |
|
39 | ImGui.SetNextWindowSize(new Num.Vector2(320, 340)); |
|
40 | if(ContractsWindow.had_focus) |
|
40 | if(ContractsWindow.had_focus) |
|
41 | { |
|
41 | { |
|
42 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); |
|
42 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); |
|
43 | } |
|
43 | } |
|
44 | ImGui.Begin("Contracts", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); |
|
44 | ImGui.Begin("Contracts", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); |
|
45 | if (ContractsWindow.had_focus) |
|
45 | if (ContractsWindow.had_focus) |
@@ -120,7 +120,7 | |||||
|
120 | ImGui.SetNextWindowSize(new Num.Vector2(400, 200)); |
|
120 | ImGui.SetNextWindowSize(new Num.Vector2(400, 200)); |
|
121 | if(DialogInterface.hadFocus) |
|
121 | if(DialogInterface.hadFocus) |
|
122 | { |
|
122 | { |
|
123 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); |
|
123 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); |
|
124 | } |
|
124 | } |
|
125 | ImGui.Begin(currentNode.data.speaker, ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); |
|
125 | ImGui.Begin(currentNode.data.speaker, ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); |
|
126 | if (DialogInterface.hadFocus) |
|
126 | if (DialogInterface.hadFocus) |
@@ -24,7 +24,7 | |||||
|
24 |
|
24 | ||
|
25 | if(ForestWindow.hadFocus) |
|
25 | if(ForestWindow.hadFocus) |
|
26 | { |
|
26 | { |
|
27 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); |
|
27 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); |
|
28 | } |
|
28 | } |
|
29 |
|
29 | ||
|
30 | ImGui.Begin("Forest Policy", ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); |
|
30 | ImGui.Begin("Forest Policy", ref show, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoSavedSettings); |
@@ -18,7 +18,7 | |||||
|
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, StyleSet. |
|
21 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.grey); |
|
22 | } |
|
22 | } |
|
23 |
|
23 | ||
|
24 | var result = ImGui.Button(label); |
|
24 | var result = ImGui.Button(label); |
@@ -37,7 +37,7 | |||||
|
37 |
|
37 | ||
|
38 |
|
38 | ||
|
39 | StyleSets.defaultSet.push(); |
|
39 | StyleSets.defaultSet.push(); |
|
40 | ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSet.grey); |
|
40 | ImGui.PushStyleColor(ImGuiCol.MenuBarBg, StyleSets.grey); |
|
41 |
|
41 | ||
|
42 | if (ImGui.BeginMainMenuBar()) |
|
42 | if (ImGui.BeginMainMenuBar()) |
|
43 | { |
|
43 | { |
@@ -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], StyleSet.selected)) |
|
49 | if (Menu.activeButton("\ue0c2 Contracts", bridgeEngine.windowStatuses[Window.Contracts], StyleSets.selected)) |
|
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, StyleSet.selected)) |
|
56 | if (Menu.activeButton("$ Budget", showBudget, StyleSets.selected)) |
|
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], StyleSet.selected)) |
|
61 | if (Menu.activeButton("\ue124 Forest", bridgeEngine.windowStatuses[Window.Forest], StyleSets.selected)) |
|
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], StyleSet.selected)) |
|
66 | if (Menu.activeButton("\ue0bf News", bridgeEngine.windowStatuses[Window.News], StyleSets.selected)) |
|
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, StyleSet.selected )) |
|
73 | if (Menu.activeButton("\ue0ac Pause", paused, StyleSets.selected )) |
|
74 | { |
|
74 | { |
|
75 | paused = !paused; |
|
75 | paused = !paused; |
|
76 | } |
|
76 | } |
|
77 | if (Menu.activeButton("1", (rate == 0), StyleSet.selected)) |
|
77 | if (Menu.activeButton("1", (rate == 0), StyleSets.selected)) |
|
78 | { |
|
78 | { |
|
79 | paused = false; |
|
79 | paused = false; |
|
80 | rate = 0; |
|
80 | rate = 0; |
|
81 | } |
|
81 | } |
|
82 | else if (Menu.activeButton("2", (rate == 1), StyleSet.selected)) |
|
82 | else if (Menu.activeButton("2", (rate == 1), StyleSets.selected)) |
|
83 | { |
|
83 | { |
|
84 | paused = false; |
|
84 | paused = false; |
|
85 | rate = 1; |
|
85 | rate = 1; |
|
86 | } |
|
86 | } |
|
87 | else if (Menu.activeButton("3", (rate == 2), StyleSet.selected)) |
|
87 | else if (Menu.activeButton("3", (rate == 2), StyleSets.selected)) |
|
88 | { |
|
88 | { |
|
89 | paused = false; |
|
89 | paused = false; |
|
90 | rate = 2; |
|
90 | rate = 2; |
|
91 | } |
|
91 | } |
|
92 | else if (Menu.activeButton("4", (rate == 3), StyleSet.selected)) |
|
92 | else if (Menu.activeButton("4", (rate == 3), StyleSets.selected)) |
|
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), StyleSet.selected)) |
|
98 | else if (Menu.activeButton("5", (rate == 4), StyleSets.selected)) |
|
99 | { |
|
99 | { |
|
100 | paused = false; |
|
100 | paused = false; |
|
101 | rate = 4; |
|
101 | rate = 4; |
@@ -77,7 +77,7 | |||||
|
77 |
|
77 | ||
|
78 | if(NewsWindow.had_focus) |
|
78 | if(NewsWindow.had_focus) |
|
79 | { |
|
79 | { |
|
80 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); |
|
80 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); |
|
81 | } |
|
81 | } |
|
82 | ImGui.Begin("NEWS", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); |
|
82 | ImGui.Begin("NEWS", ref newShow, ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings); |
|
83 |
|
83 |
@@ -48,7 +48,7 | |||||
|
48 | // ImGui.SetNextWindowSize(new Num.Vector2(320, 320)); |
|
48 | // ImGui.SetNextWindowSize(new Num.Vector2(320, 320)); |
|
49 | if(OptionsWindow.hadFocus) |
|
49 | if(OptionsWindow.hadFocus) |
|
50 | { |
|
50 | { |
|
51 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSet.white); |
|
51 | ImGui.PushStyleColor(ImGuiCol.Text, StyleSets.white); |
|
52 | } |
|
52 | } |
|
53 | ImGui.Begin("Options", ref newShow, ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse); |
|
53 | ImGui.Begin("Options", ref newShow, ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoCollapse); |
|
54 |
|
54 |
@@ -8,52 +8,6 | |||||
|
8 | { |
|
8 | { |
|
9 | public class StyleSet |
|
9 | public class StyleSet |
|
10 | { |
|
10 | { |
|
11 | public static Num.Vector4 grey = new Num.Vector4(0.75f, 0.75f, 0.75f, 1f); |
|
||
|
12 | public static Num.Vector4 darkgrey = new Num.Vector4(0.45f, 0.45f, 0.45f, 1f); |
|
||
|
13 | public static Num.Vector4 black = new Num.Vector4(0f, 0f, 0f, 1f); |
|
||
|
14 | public static Num.Vector4 white = new Num.Vector4(1f, 1f, 1f, 1f); |
|
||
|
15 | public static Num.Vector4 title_bar = new Num.Vector4(0.65f, 0.65f, 0.65f, 1f); |
|
||
|
16 |
|
|||
|
17 | // public static Num.Vector4 selected = new Num.Vector4(0.0f, 0.0f, 0.75f, 1f); |
|
||
|
18 | public static Num.Vector4 selected = new Num.Vector4(0.0f, 0.0f, 0.55f, 1f); |
|
||
|
19 | public static Dictionary<ImGuiStyleVar, float> defaultWindowVars = new Dictionary<ImGuiStyleVar, float>{ |
|
||
|
20 | { ImGuiStyleVar.FrameRounding, 0.0f }, |
|
||
|
21 | {ImGuiStyleVar.WindowRounding, 0.0f}, |
|
||
|
22 | {ImGuiStyleVar.FrameBorderSize, 1.0f}, |
|
||
|
23 | {ImGuiStyleVar.TabRounding, 0.0f}, |
|
||
|
24 | }; |
|
||
|
25 | public static Dictionary<ImGuiCol, Num.Vector4> defaultWindowColors = new Dictionary<ImGuiCol, Num.Vector4>{ |
|
||
|
26 |
|
|||
|
27 | {ImGuiCol.WindowBg, grey}, |
|
||
|
28 | {ImGuiCol.FrameBg, grey}, |
|
||
|
29 | {ImGuiCol.FrameBgHovered, grey}, |
|
||
|
30 | {ImGuiCol.Header, darkgrey}, |
|
||
|
31 | {ImGuiCol.HeaderHovered, darkgrey}, |
|
||
|
32 | {ImGuiCol.HeaderActive, darkgrey}, |
|
||
|
33 | {ImGuiCol.ButtonHovered, grey}, |
|
||
|
34 | {ImGuiCol.ButtonActive, darkgrey}, |
|
||
|
35 | {ImGuiCol.SliderGrab, darkgrey}, |
|
||
|
36 | {ImGuiCol.SliderGrabActive, darkgrey}, |
|
||
|
37 |
|
|||
|
38 |
|
|||
|
39 | {ImGuiCol.Tab, darkgrey}, |
|
||
|
40 | {ImGuiCol.TabHovered, darkgrey}, |
|
||
|
41 | {ImGuiCol.TabActive, selected}, |
|
||
|
42 |
|
|||
|
43 | {ImGuiCol.CheckMark, black}, |
|
||
|
44 |
|
|||
|
45 | {ImGuiCol.TitleBg, title_bar}, |
|
||
|
46 | {ImGuiCol.TitleBgActive, selected}, |
|
||
|
47 | {ImGuiCol.TitleBgCollapsed, title_bar}, |
|
||
|
48 |
|
|||
|
49 | {ImGuiCol.Border, black}, |
|
||
|
50 | {ImGuiCol.BorderShadow, black}, |
|
||
|
51 |
|
|||
|
52 | {ImGuiCol.PopupBg, white}, |
|
||
|
53 |
|
|||
|
54 | {ImGuiCol.Button, grey}, |
|
||
|
55 | {ImGuiCol.Text, black} |
|
||
|
56 | }; |
|
||
|
57 |
|
11 | ||
|
58 | // public static IMFont |
|
12 | // public static IMFont |
|
59 | public static void pushStyleVarSet(Dictionary<ImGuiStyleVar, float> style_set) |
|
13 | public static void pushStyleVarSet(Dictionary<ImGuiStyleVar, float> style_set) |
You need to be logged in to leave comments.
Login now