|
@@ -1978,6 +1978,8 @@ enum MainToolbarHotkeys {
|
|
|
|
|
|
/** Main toolbar. */
|
|
|
struct MainToolbarWindow : Window {
|
|
|
int timer;
|
|
|
|
|
|
MainToolbarWindow(WindowDesc *desc) : Window(desc)
|
|
|
{
|
|
|
this->InitNested(0);
|
|
@@ -1988,6 +1990,8 @@ struct MainToolbarWindow : Window {
|
|
|
this->SetWidgetDisabledState(WID_TN_FAST_FORWARD, _networking); // if networking, disable fast-forward button
|
|
|
PositionMainToolbar(this);
|
|
|
DoZoomInOutWindow(ZOOM_NONE, this);
|
|
|
|
|
|
this->timer = MILLISECONDS_PER_TICK;
|
|
|
}
|
|
|
|
|
|
virtual void FindWindowPlacementAndResize(int def_width, int def_height)
|
|
@@ -2092,8 +2096,11 @@ struct MainToolbarWindow : Window {
|
|
|
_last_started_action = CBF_NONE;
|
|
|
}
|
|
|
|
|
|
virtual void OnTick()
|
|
|
virtual void OnRealtimeTick(uint delta_ms)
|
|
|
{
|
|
|
if (!TimerElapsed(this->timer, delta_ms)) return;
|
|
|
this->timer = MILLISECONDS_PER_TICK;
|
|
|
|
|
|
if (this->IsWidgetLowered(WID_TN_PAUSE) != !!_pause_mode) {
|
|
|
this->ToggleWidgetLoweredState(WID_TN_PAUSE);
|
|
|
this->SetWidgetDirty(WID_TN_PAUSE);
|
|
@@ -2310,6 +2317,8 @@ enum MainToolbarEditorHotkeys {
|
|
|
};
|
|
|
|
|
|
struct ScenarioEditorToolbarWindow : Window {
|
|
|
int timer;
|
|
|
|
|
|
ScenarioEditorToolbarWindow(WindowDesc *desc) : Window(desc)
|
|
|
{
|
|
|
this->InitNested(0);
|
|
@@ -2318,6 +2327,8 @@ struct ScenarioEditorToolbarWindow : Win
|
|
|
CLRBITS(this->flags, WF_WHITE_BORDER);
|
|
|
PositionMainToolbar(this);
|
|
|
DoZoomInOutWindow(ZOOM_NONE, this);
|
|
|
|
|
|
this->timer = MILLISECONDS_PER_TICK;
|
|
|
}
|
|
|
|
|
|
virtual void FindWindowPlacementAndResize(int def_width, int def_height)
|
|
@@ -2445,8 +2456,11 @@ struct ScenarioEditorToolbarWindow : Win
|
|
|
this->SetWidgetDirty(WID_TE_DATE_FORWARD);
|
|
|
}
|
|
|
|
|
|
virtual void OnTick()
|
|
|
virtual void OnRealtimeTick(uint delta_ms)
|
|
|
{
|
|
|
if (!TimerElapsed(this->timer, delta_ms)) return;
|
|
|
this->timer = MILLISECONDS_PER_TICK;
|
|
|
|
|
|
if (this->IsWidgetLowered(WID_TE_PAUSE) != !!_pause_mode) {
|
|
|
this->ToggleWidgetLoweredState(WID_TE_PAUSE);
|
|
|
this->SetDirty();
|