mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2026-07-25 08:22:17 +00:00
Codechange: Use EnumBitSet for WindowFlags.
This commit is contained in:
committed by
Peter Nelson
parent
248f369e86
commit
efb05396a7
@@ -726,7 +726,7 @@ struct GenerateLandscapeWindow : public Window {
|
||||
case WID_GL_HEIGHTMAP_HEIGHT_DOWN:
|
||||
case WID_GL_HEIGHTMAP_HEIGHT_UP: // Height level buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
|
||||
_settings_newgame.game_creation.heightmap_height = Clamp(_settings_newgame.game_creation.heightmap_height + widget - WID_GL_HEIGHTMAP_HEIGHT_TEXT, MIN_HEIGHTMAP_HEIGHT, GetMapHeightLimit());
|
||||
@@ -745,7 +745,7 @@ struct GenerateLandscapeWindow : public Window {
|
||||
case WID_GL_START_DATE_DOWN:
|
||||
case WID_GL_START_DATE_UP: // Year buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
|
||||
_settings_newgame.game_creation.starting_year = Clamp(_settings_newgame.game_creation.starting_year + widget - WID_GL_START_DATE_TEXT, CalendarTime::MIN_YEAR, CalendarTime::MAX_YEAR);
|
||||
@@ -763,7 +763,7 @@ struct GenerateLandscapeWindow : public Window {
|
||||
case WID_GL_SNOW_COVERAGE_DOWN:
|
||||
case WID_GL_SNOW_COVERAGE_UP: // Snow coverage buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
|
||||
_settings_newgame.game_creation.snow_coverage = Clamp(_settings_newgame.game_creation.snow_coverage + (widget - WID_GL_SNOW_COVERAGE_TEXT) * 10, 0, 100);
|
||||
@@ -781,7 +781,7 @@ struct GenerateLandscapeWindow : public Window {
|
||||
case WID_GL_DESERT_COVERAGE_DOWN:
|
||||
case WID_GL_DESERT_COVERAGE_UP: // Desert coverage buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
|
||||
_settings_newgame.game_creation.desert_coverage = Clamp(_settings_newgame.game_creation.desert_coverage + (widget - WID_GL_DESERT_COVERAGE_TEXT) * 10, 0, 100);
|
||||
@@ -1180,7 +1180,7 @@ struct CreateScenarioWindow : public Window
|
||||
case WID_CS_START_DATE_DOWN:
|
||||
case WID_CS_START_DATE_UP: // Year buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
this->SetDirty();
|
||||
|
||||
@@ -1198,7 +1198,7 @@ struct CreateScenarioWindow : public Window
|
||||
case WID_CS_FLAT_LAND_HEIGHT_DOWN:
|
||||
case WID_CS_FLAT_LAND_HEIGHT_UP: // Height level buttons
|
||||
/* Don't allow too fast scrolling */
|
||||
if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
|
||||
if (!this->flags.Test(WindowFlag::Timeout) || this->timeout_timer <= 1) {
|
||||
this->HandleButtonClick(widget);
|
||||
this->SetDirty();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user