Description:
Refactor out color literals.
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
@@ -0,0 +1,17 | |||||
|
|
1 | |||
|
|
2 | namespace isometricparkfna.UI { | ||
|
|
3 | |||
|
|
4 | enum ImGuiColor : uint { | ||
|
|
5 | BLACK = 0xFFFFFFFF, | ||
|
|
6 | RED = 0xFFFF0000, | ||
|
|
7 | GREEN = 0xFF00FF00, | ||
|
|
8 | BLUE = 0xFF0000FF, | ||
|
|
9 | DARKGREY = 0xFF999999, | ||
|
|
10 | LIGHTRED = 0xFFAA0000, | ||
|
|
11 | LIGHTGREEN = 0xFF00AA00, | ||
|
|
12 | LIGHTBLUE = 0xFF0000AA, | ||
|
|
13 | LIGHTGREY = 0xFFAAAAAA | ||
|
|
14 | |||
|
|
15 | } | ||
|
|
16 | |||
|
|
17 | } No newline at end of file |
@@ -44,8 +44,9 | |||||
|
44 |
|
44 | ||
|
45 |
|
45 | ||
|
46 |
|
46 | ||
|
47 | public static uint[] colors = {0xFF000000, 0xFFFF0000, 0xFF00FF00, 0xFF0000FF, |
|
47 | public static uint[] colors = { ImGuiColor.BLACK, ImGuiColor.RED, ImGuiColor.GREEN, |
|
48 | 0xFF999999, 0xFFAA0000, 0xFF00AA00, 0xFF0000AA, 0xFF000000}; |
|
48 | ImGuiColor.BLUE, ImGuiColor.DARKGREY, ImGuiColor.LIGHTRED, ImGuiColor.LIGHTGREEN, |
|
|
49 | ImGuiColor.LIGHTBLUE, ImGuiColor.BLACK }; | ||
|
49 |
|
50 | ||
|
50 | public static Dictionary<string, uint> data_sets_color = new List<string>() |
|
51 | public static Dictionary<string, uint> data_sets_color = new List<string>() |
|
51 | .Concat(money_series) |
|
52 | .Concat(money_series) |
@@ -62,7 +63,7 | |||||
|
62 | var tick_position = position; |
|
63 | var tick_position = position; |
|
63 |
|
64 | ||
|
64 | for(int i = 0; i < points; i++) { |
|
65 | for(int i = 0; i < points; i++) { |
|
65 |
draw_list.AddLine(tick_position, Num.Vector2.Add(tick_position, tick_adjust), |
|
66 | draw_list.AddLine(tick_position, Num.Vector2.Add(tick_position, tick_adjust), ImGuiColor.LIGHTGREY, 1.0f); |
|
66 |
|
67 | ||
|
67 | if (vertical) { |
|
68 | if (vertical) { |
|
68 | tick_position = new Num.Vector2(position.X, position.Y + ((i + 1) * tick_spacing)); |
|
69 | tick_position = new Num.Vector2(position.X, position.Y + ((i + 1) * tick_spacing)); |
@@ -88,7 +89,7 | |||||
|
88 | for(int i = 0; i < labels; i++) { |
|
89 | for(int i = 0; i < labels; i++) { |
|
89 | var value = Scale(range, domain, (int)(vertical ? tick_position.Y : tick_position.X)); |
|
90 | var value = Scale(range, domain, (int)(vertical ? tick_position.Y : tick_position.X)); |
|
90 | var label = String.Format("{0}", value); |
|
91 | var label = String.Format("{0}", value); |
|
91 |
draw_list.AddText(font, 11.0f, tick_absolute_position, |
|
92 | draw_list.AddText(font, 11.0f, tick_absolute_position, ImGuiColor.BLACK, label); |
|
92 | //Logging.Info(String.Format("Drawing {0:} at {1} ({2})", label, tick_absolute_position, tick_position)); |
|
93 | //Logging.Info(String.Format("Drawing {0:} at {1} ({2})", label, tick_absolute_position, tick_position)); |
|
93 |
|
94 | ||
|
94 | if (vertical) { |
|
95 | if (vertical) { |
@@ -264,12 +265,12 | |||||
|
264 | //Y Axis |
|
265 | //Y Axis |
|
265 | draw_list.AddLine(Num.Vector2.Add(new Num.Vector2(padding, padding), c), |
|
266 | draw_list.AddLine(Num.Vector2.Add(new Num.Vector2(padding, padding), c), |
|
266 | Num.Vector2.Add(new Num.Vector2(padding, 200), c), |
|
267 | Num.Vector2.Add(new Num.Vector2(padding, 200), c), |
|
267 |
|
|
268 | ImGuiColor.LIGHTGREY, 0.0f); |
|
268 |
|
269 | ||
|
269 | //X Axis |
|
270 | //X Axis |
|
270 | draw_list.AddLine(Num.Vector2.Add(new Num.Vector2(padding, 200 -padding), c), |
|
271 | draw_list.AddLine(Num.Vector2.Add(new Num.Vector2(padding, 200 -padding), c), |
|
271 | Num.Vector2.Add(new Num.Vector2(350, 200 - padding), c), |
|
272 | Num.Vector2.Add(new Num.Vector2(350, 200 - padding), c), |
|
272 |
|
|
273 | ImGuiColor.LIGHTGREY, 1.0f); |
|
273 |
|
274 | ||
|
274 | foreach (var key in keys) |
|
275 | foreach (var key in keys) |
|
275 | { |
|
276 | { |
You need to be logged in to leave comments.
Login now