summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-04 15:50:14 +0000
committerrubidium <rubidium@openttd.org>2009-11-04 15:50:14 +0000
commitb2946819e470a79bac3d3cc2ccdc5b5771d7954c (patch)
treed7e1b0296e9021eae4e7467df4af5c7cacd69f6d /src
parentfd29b7b5260d76bbc1e4dad1aae826bd595dad74 (diff)
downloadopenttd-b2946819e470a79bac3d3cc2ccdc5b5771d7954c.tar.xz
(svn r17970) -Codechange: some coding style / improvement of constant usage
Diffstat (limited to 'src')
-rw-r--r--src/toolbar_gui.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp
index 6c09c3a71..c5d415be0 100644
--- a/src/toolbar_gui.cpp
+++ b/src/toolbar_gui.cpp
@@ -1045,7 +1045,7 @@ struct MainToolbarWindow : Window {
* 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);
/* 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_AIR, !CanBuildVehicleInfrastructure(VEH_AIRCRAFT));
@@ -1138,7 +1138,9 @@ struct MainToolbarWindow : Window {
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)) {
this->RaiseWidget(i);
this->SetWidgetDirty(i);