src/toolbar_gui.cpp
changeset 9301 3b20dfb6c4e8
parent 9273 35e0224ea8f1
child 9305 d6694e58c36b
equal deleted inserted replaced
9300:460e2e65388d 9301:3b20dfb6c4e8
  1123 	StringID base_string;
  1123 	StringID base_string;
  1124 
  1124 
  1125 	ToolbarMenuWindow(int x, int y, int width, int height, const Widget *widgets, int item_count,
  1125 	ToolbarMenuWindow(int x, int y, int width, int height, const Widget *widgets, int item_count,
  1126 										int sel_index, int parent_button, StringID base_string, int checked_items,
  1126 										int sel_index, int parent_button, StringID base_string, int checked_items,
  1127 										int disabled_mask) :
  1127 										int disabled_mask) :
  1128 			Window(x, y, width, height, NULL, WC_TOOLBAR_MENU, widgets),
  1128 			Window(x, y, width, height, WC_TOOLBAR_MENU, widgets),
  1129 			item_count(item_count), sel_index(sel_index), main_button(GB(parent_button, 0, 8)),
  1129 			item_count(item_count), sel_index(sel_index), main_button(GB(parent_button, 0, 8)),
  1130 			action_id((GB(parent_button, 8, 8) != 0) ? GB(parent_button, 8, 8) : parent_button),
  1130 			action_id((GB(parent_button, 8, 8) != 0) ? GB(parent_button, 8, 8) : parent_button),
  1131 			checked_items(checked_items), disabled_items(disabled_items), base_string(base_string)
  1131 			checked_items(checked_items), disabled_items(disabled_items), base_string(base_string)
  1132 	{
  1132 	{
  1133 		this->widget[0].bottom = item_count * 10 + 1;
  1133 		this->widget[0].bottom = item_count * 10 + 1;
  1278 	int main_button;
  1278 	int main_button;
  1279 	int action_id;
  1279 	int action_id;
  1280 	int gray_items;
  1280 	int gray_items;
  1281 
  1281 
  1282 	ToolbarPlayerMenuWindow(int x, int y, int width, int height, const Widget *widgets, int main_button, int gray) :
  1282 	ToolbarPlayerMenuWindow(int x, int y, int width, int height, const Widget *widgets, int main_button, int gray) :
  1283 			Window(x, y, width, height, NULL, WC_TOOLBAR_MENU, widgets),
  1283 			Window(x, y, width, height, WC_TOOLBAR_MENU, widgets),
  1284 			item_count(0), main_button(main_button), action_id(main_button), gray_items(gray)
  1284 			item_count(0), main_button(main_button), action_id(main_button), gray_items(gray)
  1285 	{
  1285 	{
  1286 		this->flags4 &= ~WF_WHITE_BORDER_MASK;
  1286 		this->flags4 &= ~WF_WHITE_BORDER_MASK;
  1287 		this->sel_index = (_local_player != PLAYER_SPECTATOR) ? _local_player : GetPlayerIndexFromMenu(0);
  1287 		this->sel_index = (_local_player != PLAYER_SPECTATOR) ? _local_player : GetPlayerIndexFromMenu(0);
  1288 		if (_networking && main_button == 9) {
  1288 		if (_networking && main_button == 9) {