565 |
581 |
566 static void ToolbarScenDateBackward(Window *w) |
582 static void ToolbarScenDateBackward(Window *w) |
567 { |
583 { |
568 /* don't allow too fast scrolling */ |
584 /* don't allow too fast scrolling */ |
569 if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
585 if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
570 w->HandleButtonClick(6); |
586 w->HandleButtonClick(TBSE_DATEBACKWARD); |
571 w->SetDirty(); |
587 w->SetDirty(); |
572 |
588 |
573 _settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year - 1, MIN_YEAR, MAX_YEAR); |
589 _settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year - 1, MIN_YEAR, MAX_YEAR); |
574 SetDate(ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); |
590 SetDate(ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); |
575 } |
591 } |
578 |
594 |
579 static void ToolbarScenDateForward(Window *w) |
595 static void ToolbarScenDateForward(Window *w) |
580 { |
596 { |
581 /* don't allow too fast scrolling */ |
597 /* don't allow too fast scrolling */ |
582 if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
598 if ((w->flags4 & WF_TIMEOUT_MASK) <= 2 << WF_TIMEOUT_SHL) { |
583 w->HandleButtonClick(7); |
599 w->HandleButtonClick(TBSE_DATEFORWARD); |
584 w->SetDirty(); |
600 w->SetDirty(); |
585 |
601 |
586 _settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + 1, MIN_YEAR, MAX_YEAR); |
602 _settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + 1, MIN_YEAR, MAX_YEAR); |
587 SetDate(ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); |
603 SetDate(ConvertYMDToDate(_settings_newgame.game_creation.starting_year, 0, 1)); |
588 } |
604 } |
596 } |
612 } |
597 |
613 |
598 static void ToolbarScenZoomIn(Window *w) |
614 static void ToolbarScenZoomIn(Window *w) |
599 { |
615 { |
600 if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) { |
616 if (DoZoomInOutWindow(ZOOM_IN, FindWindowById(WC_MAIN_WINDOW, 0))) { |
601 w->HandleButtonClick(9); |
617 w->HandleButtonClick(TBSE_ZOOMIN); |
602 SndPlayFx(SND_15_BEEP); |
618 SndPlayFx(SND_15_BEEP); |
603 } |
619 } |
604 } |
620 } |
605 |
621 |
606 static void ToolbarScenZoomOut(Window *w) |
622 static void ToolbarScenZoomOut(Window *w) |
607 { |
623 { |
608 if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) { |
624 if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) { |
609 w->HandleButtonClick(10); |
625 w->HandleButtonClick(TBSE_ZOOMOUT); |
610 SndPlayFx(SND_15_BEEP); |
626 SndPlayFx(SND_15_BEEP); |
611 } |
627 } |
612 } |
628 } |
613 |
629 |
614 static void ToolbarScenGenLand(Window *w) |
630 static void ToolbarScenGenLand(Window *w) |
615 { |
631 { |
616 w->HandleButtonClick(11); |
632 w->HandleButtonClick(TBSE_LANDGENERATE); |
617 SndPlayFx(SND_15_BEEP); |
633 SndPlayFx(SND_15_BEEP); |
618 |
634 |
619 ShowEditorTerraformToolbar(); |
635 ShowEditorTerraformToolbar(); |
620 } |
636 } |
621 |
637 |
622 |
638 |
623 static void ToolbarScenGenTown(Window *w) |
639 static void ToolbarScenGenTown(Window *w) |
624 { |
640 { |
625 w->HandleButtonClick(12); |
641 w->HandleButtonClick(TBSE_TOWNGENERATE); |
626 SndPlayFx(SND_15_BEEP); |
642 SndPlayFx(SND_15_BEEP); |
627 ShowBuildTownWindow(); |
643 ShowBuildTownWindow(); |
628 } |
644 } |
629 |
645 |
630 static void ToolbarScenGenIndustry(Window *w) |
646 static void ToolbarScenGenIndustry(Window *w) |
631 { |
647 { |
632 w->HandleButtonClick(13); |
648 w->HandleButtonClick(TBSE_INDUSTRYGENERATE); |
633 SndPlayFx(SND_15_BEEP); |
649 SndPlayFx(SND_15_BEEP); |
634 ShowBuildIndustryWindow(); |
650 ShowBuildIndustryWindow(); |
635 } |
651 } |
636 |
652 |
637 static void ToolbarScenBuildRoad(Window *w) |
653 static void ToolbarScenBuildRoad(Window *w) |
638 { |
654 { |
639 w->HandleButtonClick(14); |
655 w->HandleButtonClick(TBSE_BUILDROAD); |
640 SndPlayFx(SND_15_BEEP); |
656 SndPlayFx(SND_15_BEEP); |
641 ShowBuildRoadScenToolbar(); |
657 ShowBuildRoadScenToolbar(); |
642 } |
658 } |
643 |
659 |
644 static void ToolbarScenPlantTrees(Window *w) |
660 static void ToolbarScenPlantTrees(Window *w) |
645 { |
661 { |
646 w->HandleButtonClick(15); |
662 w->HandleButtonClick(TBSE_PLANTTREES); |
647 SndPlayFx(SND_15_BEEP); |
663 SndPlayFx(SND_15_BEEP); |
648 ShowBuildTreesToolbar(); |
664 ShowBuildTreesToolbar(); |
649 } |
665 } |
650 |
666 |
651 static void ToolbarScenPlaceSign(Window *w) |
667 static void ToolbarScenPlaceSign(Window *w) |
652 { |
668 { |
653 w->HandleButtonClick(16); |
669 w->HandleButtonClick(TBSE_PLACESIGNS); |
654 SndPlayFx(SND_15_BEEP); |
670 SndPlayFx(SND_15_BEEP); |
655 SelectSignTool(); |
671 SelectSignTool(); |
656 } |
672 } |
657 |
673 |
658 static void ToolbarBtn_NULL(Window *w) |
674 static void ToolbarBtn_NULL(Window *w) |