(svn r17970) -Codechange: some coding style / improvement of constant usage

This commit is contained in:
rubidium 2009-11-04 15:50:14 +00:00
parent fd29b7b526
commit b2946819e4

View File

@ -1045,7 +1045,7 @@ struct MainToolbarWindow : Window {
* Since enabled state is the default, just disable when needed */ * Since enabled state is the default, just disable when needed */
this->SetWidgetsDisabledState(_local_company == COMPANY_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END); this->SetWidgetsDisabledState(_local_company == COMPANY_SPECTATOR, TBN_RAILS, TBN_ROADS, TBN_WATER, TBN_AIR, TBN_LANDSCAPE, WIDGET_LIST_END);
/* disable company list drop downs, if there are no companies */ /* disable company list drop downs, if there are no companies */
this->SetWidgetsDisabledState(Company::GetNumItems() == TBN_PAUSE, TBN_STATIONS, TBN_FINANCES, TBN_TRAINS, TBN_ROADVEHS, TBN_SHIPS, TBN_AIRCRAFTS, WIDGET_LIST_END); this->SetWidgetsDisabledState(Company::GetNumItems() == 0, TBN_STATIONS, TBN_FINANCES, TBN_TRAINS, TBN_ROADVEHS, TBN_SHIPS, TBN_AIRCRAFTS, WIDGET_LIST_END);
this->SetWidgetDisabledState(TBN_RAILS, !CanBuildVehicleInfrastructure(VEH_TRAIN)); this->SetWidgetDisabledState(TBN_RAILS, !CanBuildVehicleInfrastructure(VEH_TRAIN));
this->SetWidgetDisabledState(TBN_AIR, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT)); this->SetWidgetDisabledState(TBN_AIR, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT));
@ -1138,7 +1138,9 @@ struct MainToolbarWindow : Window {
virtual void OnTimeout() virtual void OnTimeout()
{ {
for (uint i = TBN_SETTINGS; i < this->widget_count - 1; i++) { /* We do not want to automatically raise the pause, fast forward and
* switchbar buttons; they have to stay down when pressed etc. */
for (uint i = TBN_SETTINGS; i < TBN_SWITCHBAR; i++) {
if (this->IsWidgetLowered(i)) { if (this->IsWidgetLowered(i)) {
this->RaiseWidget(i); this->RaiseWidget(i);
this->SetWidgetDirty(i); this->SetWidgetDirty(i);