1
- #include " ratings .h"
1
+ #include " advisor_ratings .h"
2
2
3
3
#include " city/ratings.h"
4
4
#include " graphics/boilerplate.h"
@@ -49,11 +49,7 @@ static void draw_rating_column(int x_offset, int y_offset, int value, int has_re
49
49
static void draw_rating (int id, int value, int open_play, int goal) {
50
50
// int value = city_rating_culture();
51
51
int enabled = !open_play && goal;
52
- button_border_draw (rating_buttons[id].x ,
53
- rating_buttons[id].y ,
54
- rating_buttons[id].width ,
55
- rating_buttons[id].height ,
56
- focus_button_id == SELECTED_RATING_CULTURE);
52
+ button_border_draw (rating_buttons[id].x , rating_buttons[id].y , rating_buttons[id].width , rating_buttons[id].height , focus_button_id == SELECTED_RATING_CULTURE);
57
53
lang_text_draw_centered (53 , 1 + id, rating_buttons[id].x , rating_buttons[id].y + 8 , rating_buttons[id].width , FONT_NORMAL_BLACK_ON_LIGHT);
58
54
text_draw_number_centered (value, rating_buttons[id].x , rating_buttons[id].y + 21 , rating_buttons[id].width , FONT_LARGE_BLACK_ON_LIGHT);
59
55
int width = text_draw_number (enabled ? goal : 0 , ' @' , " " , rating_buttons[id].x + 5 , rating_buttons[id].y + 45 , FONT_NORMAL_BLACK_ON_LIGHT);
@@ -126,26 +122,10 @@ static int draw_background() {
126
122
return ADVISOR_HEIGHT;
127
123
}
128
124
static void draw_foreground (void ) {
129
- button_border_draw (rating_buttons[0 ].x ,
130
- rating_buttons[0 ].y ,
131
- rating_buttons[0 ].width ,
132
- rating_buttons[0 ].height ,
133
- focus_button_id == SELECTED_RATING_CULTURE);
134
- button_border_draw (rating_buttons[1 ].x ,
135
- rating_buttons[1 ].y ,
136
- rating_buttons[1 ].width ,
137
- rating_buttons[1 ].height ,
138
- focus_button_id == SELECTED_RATING_PROSPERITY);
139
- button_border_draw (rating_buttons[2 ].x ,
140
- rating_buttons[2 ].y ,
141
- rating_buttons[2 ].width ,
142
- rating_buttons[2 ].height ,
143
- focus_button_id == SELECTED_RATING_MONUMENT);
144
- button_border_draw (rating_buttons[3 ].x ,
145
- rating_buttons[3 ].y ,
146
- rating_buttons[3 ].width ,
147
- rating_buttons[3 ].height ,
148
- focus_button_id == SELECTED_RATING_KINGDOM);
125
+ button_border_draw (rating_buttons[0 ].x , rating_buttons[0 ].y , rating_buttons[0 ].width , rating_buttons[0 ].height , focus_button_id == SELECTED_RATING_CULTURE);
126
+ button_border_draw (rating_buttons[1 ].x , rating_buttons[1 ].y , rating_buttons[1 ].width , rating_buttons[1 ].height , focus_button_id == SELECTED_RATING_PROSPERITY);
127
+ button_border_draw (rating_buttons[2 ].x , rating_buttons[2 ].y , rating_buttons[2 ].width , rating_buttons[2 ].height , focus_button_id == SELECTED_RATING_MONUMENT);
128
+ button_border_draw (rating_buttons[3 ].x , rating_buttons[3 ].y , rating_buttons[3 ].width , rating_buttons[3 ].height , focus_button_id == SELECTED_RATING_KINGDOM);
149
129
}
150
130
151
131
static int handle_mouse (const mouse* m) {
@@ -172,7 +152,12 @@ static int get_tooltip_text(void) {
172
152
}
173
153
}
174
154
175
- const advisor_window_type* window_advisor_ratings (void ) {
176
- static const advisor_window_type window = {draw_background, draw_foreground, handle_mouse, get_tooltip_text};
155
+ const advisor_window* window_advisor_ratings (void ) {
156
+ static const advisor_window window = {
157
+ draw_background,
158
+ draw_foreground,
159
+ handle_mouse,
160
+ get_tooltip_text
161
+ };
177
162
return &window;
178
163
}
0 commit comments