682 w->SetWidgetsDisabledState(ActivePlayerCount() == 0, 7, 8, 13, 14, 15, 16, WIDGET_LIST_END); |
682 w->SetWidgetsDisabledState(ActivePlayerCount() == 0, 7, 8, 13, 14, 15, 16, WIDGET_LIST_END); |
683 |
683 |
684 w->SetWidgetDisabledState(19, !CanBuildVehicleInfrastructure(VEH_TRAIN)); |
684 w->SetWidgetDisabledState(19, !CanBuildVehicleInfrastructure(VEH_TRAIN)); |
685 w->SetWidgetDisabledState(22, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT)); |
685 w->SetWidgetDisabledState(22, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT)); |
686 |
686 |
687 DrawWindowWidgets(w); |
687 w->DrawWidgets(); |
688 break; |
688 break; |
689 |
689 |
690 case WE_CLICK: |
690 case WE_CLICK: |
691 if (_game_mode != GM_MENU && !w->IsWidgetDisabled(e->we.click.widget)) _toolbar_button_procs[e->we.click.widget](w); |
691 if (_game_mode != GM_MENU && !w->IsWidgetDisabled(e->we.click.widget)) _toolbar_button_procs[e->we.click.widget](w); |
692 break; |
692 break; |
885 |
885 |
886 /* Draw brown-red toolbar bg. */ |
886 /* Draw brown-red toolbar bg. */ |
887 GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2); |
887 GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2); |
888 GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT)); |
888 GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT)); |
889 |
889 |
890 DrawWindowWidgets(w); |
890 w->DrawWidgets(); |
891 |
891 |
892 SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1)); |
892 SetDParam(0, ConvertYMDToDate(_patches_newgame.starting_year, 0, 1)); |
893 DrawStringCenteredTruncated(w->widget[6].right, w->widget[7].left, 6, STR_00AF, TC_FROMSTRING); |
893 DrawStringCenteredTruncated(w->widget[6].right, w->widget[7].left, 6, STR_00AF, TC_FROMSTRING); |
894 |
894 |
895 /* We hide this panel when the toolbar space gets too small */ |
895 /* We hide this panel when the toolbar space gets too small */ |
1144 w->SetDirty(); |
1144 w->SetDirty(); |
1145 } |
1145 } |
1146 |
1146 |
1147 virtual void OnPaint() |
1147 virtual void OnPaint() |
1148 { |
1148 { |
1149 DrawWindowWidgets(this); |
1149 this->DrawWidgets(); |
1150 |
1150 |
1151 for (int i = 0, x = 1, y = 1; i != this->item_count; i++, y += 10) { |
1151 for (int i = 0, x = 1, y = 1; i != this->item_count; i++, y += 10) { |
1152 TextColour color = HasBit(this->disabled_items, i) ? TC_GREY : (this->sel_index == i) ? TC_WHITE : TC_BLACK; |
1152 TextColour color = HasBit(this->disabled_items, i) ? TC_GREY : (this->sel_index == i) ? TC_WHITE : TC_BLACK; |
1153 if (this->sel_index == i) GfxFillRect(x, y, x + this->width - 3, y + 9, 0); |
1153 if (this->sel_index == i) GfxFillRect(x, y, x + this->width - 3, y + 9, 0); |
1154 |
1154 |