Skip to content

Commit

Permalink
add water-transit menus
Browse files Browse the repository at this point in the history
  • Loading branch information
memo33 committed Apr 17, 2024
1 parent 8fe87e5 commit cdd50d1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
23 changes: 21 additions & 2 deletions src/Categorization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const std::unordered_set<uint32_t> Categorization::autoPrefilledSubmenus = {
iaSubmenuId, idSubmenuId, imSubmenuId, ihtSubmenuId,
freightRailSubmenuId, passengerRailSubmenuId, monorailSubmenuId, hybridRailwaySubmenuId, yardsSubmenuId,
busSubmenuId, subwaySubmenuId, elRailSubmenuId, glrSubmenuId, multiModalStationsSubmenuId,
portFerrySubmenuId, canalSubmenuId, waterfrontSubmenuId,
energyDirtySubmenuId, energyCleanSubmenuId, miscPowerSubmenuId,
policeSmallSubmenuId, policeLargeSubmenuId, policeDeluxeSubmenuId,
elementarySchoolSubmenuId, highSchoolSubmenuId, collegeSubmenuId, libraryMuseumSubmenuId,
Expand Down Expand Up @@ -98,7 +99,12 @@ bool Categorization::belongsToSubmenu(cISCPropertyHolder* propHolder, uint32_t s
case elRailSubmenuId: return hasOg(OgMiscTransit) && hasOg(OgLightrail) && !hasOg(OgPassengerRail) && !hasOg(OgMonorail) && !hasOg(OgAirport) && !hasOg(OgSeaport) && !isHeightBelow(propHolder, 15.5);
case glrSubmenuId: return hasOg(OgMiscTransit) && hasOg(OgLightrail) && !hasOg(OgPassengerRail) && !hasOg(OgMonorail) && !hasOg(OgAirport) && !hasOg(OgSeaport) && isHeightBelow(propHolder, 15.5);
case multiModalStationsSubmenuId: return (hasOg(OgRail) || hasOg(OgMiscTransit)) && hasOg(OgLightrail) && (hasOg(OgPassengerRail) || hasOg(OgMonorail)) && !hasOg(OgAirport) && !hasOg(OgSeaport);
// case parkingSubmenuId:
// case parkingSubmenuId: // no auto-categorization

case portFerrySubmenuId: return hasOg(OgWaterTransit) && (hasOg(OgPassengerFerry) || hasOg(OgCarFerry) || hasOg(OgSeaport)) && !hasOg(OgAirport);
case canalSubmenuId: return (hasOg(OgWaterTransit) || hasOg(OgPark)) && hasOg(OgBteInlandWaterways);
// case seawallSubmenuId: // no auto-categorization
case waterfrontSubmenuId: return hasOg(OgWaterTransit) && hasOg(OgBteWaterfront) && !hasOg(OgBteInlandWaterways) && !(hasOg(OgPassengerFerry) || hasOg(OgCarFerry) || hasOg(OgSeaport));

case energyDirtySubmenuId:
return hasOg(OgPower) && (
Expand Down Expand Up @@ -196,8 +202,16 @@ Categorization::TriState Categorization::belongsToMenu(cISCPropertyHolder* propH
// && !belongsToSubmenu(propHolder, parkingSubmenuId)
);

case seaportButtonId:
return bool2tri(hasOg(OgWaterTransit)
&& !belongsToSubmenu(propHolder, portFerrySubmenuId)
&& !belongsToSubmenu(propHolder, canalSubmenuId)
// && !belongsToSubmenu(propHolder, seawallSubmenuId)
&& !belongsToSubmenu(propHolder, waterfrontSubmenuId)
);

case powerButtonId:
return bool2tri(hasOg(OgPower)
return bool2tri(hasOg(OgPower) // originally also excludes OgLandfill
&& !belongsToSubmenu(propHolder, energyDirtySubmenuId)
&& !belongsToSubmenu(propHolder, energyCleanSubmenuId)
&& !belongsToSubmenu(propHolder, miscPowerSubmenuId)
Expand Down Expand Up @@ -226,6 +240,11 @@ Categorization::TriState Categorization::belongsToMenu(cISCPropertyHolder* propH
&& !belongsToSubmenu(propHolder, healthLargeSubmenuId)
);

case parkButtonId:
return bool2tri(hasOg(OgPark)
&& !belongsToSubmenu(propHolder, canalSubmenuId)
);

default:
return Categorization::TriState::Maybe; // other top level menus require evaluating the original inclusion/exclusion rules of their occupant groups
}
Expand Down
17 changes: 16 additions & 1 deletion src/MenuIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ enum PowerPlantType : uint32_t { Coal = 1, Hydrogen = 2, NaturalGas = 3, Nuclear

static constexpr uint32_t railButtonId = RAIL_BUTTON_ID;
static constexpr uint32_t miscTransitButtonId = MISCTRANSP_BUTTON_ID;
static constexpr uint32_t seaportButtonId = SEAPORT_BUTTON_ID;

static constexpr uint32_t powerButtonId = POWER_BUTTON_ID;

static constexpr uint32_t policeButtonId = POLICE_BUTTON_ID;
static constexpr uint32_t educationButtonId = EDUCATION_BUTTON_ID;
static constexpr uint32_t healthButtonId = HEALTH_BUTTON_ID;
static constexpr uint32_t landmarkButtonId = LANDMARK_BUTTON_ID;
static constexpr uint32_t parkButtonId = PARK_BUTTON_ID;

static constexpr uint32_t OgRail = 0x1300;
static constexpr uint32_t OgBus = 0x1301;
Expand All @@ -52,9 +54,15 @@ static constexpr uint32_t OgLightrail = 0x1303;
static constexpr uint32_t OgPassengerRail = 0x1305;
static constexpr uint32_t OgFreightRail = 0x1306;
static constexpr uint32_t OgMonorail = 0x1307;
static constexpr uint32_t OgCarFerry = 0x1308;
static constexpr uint32_t OgPassengerFerry = 0x1309;
static constexpr uint32_t OgMiscTransit = 0x130A;
static constexpr uint32_t OgAirport = 0x1508;
static constexpr uint32_t OgSeaport = 0x1509;
static constexpr uint32_t OgMiscTransit = 0x130A;
static constexpr uint32_t OgWaterTransit = 0x1519;

static constexpr uint32_t OgBteWaterfront = 0xB5C00DD6;
static constexpr uint32_t OgBteInlandWaterways = 0xB5C00DD8;

static constexpr uint32_t OgPower = 0x1400;

Expand Down Expand Up @@ -92,6 +100,8 @@ static constexpr uint32_t OgId = 0x14200;
static constexpr uint32_t OgIm = 0x14300;
static constexpr uint32_t OgIht = 0x14400;

static constexpr uint32_t OgPark = 0x1006;

static constexpr uint32_t passengerRailSubmenuId = 0x35380C75;
static constexpr uint32_t freightRailSubmenuId = 0x3557F0A1;
static constexpr uint32_t yardsSubmenuId = 0x39BA25C7;
Expand All @@ -105,6 +115,11 @@ static constexpr uint32_t subwaySubmenuId = 0x231A97D3;
static constexpr uint32_t multiModalStationsSubmenuId = 0x322C7959;
static constexpr uint32_t parkingSubmenuId = 0x217B6C35;

static constexpr uint32_t portFerrySubmenuId = 0x07047B22;
static constexpr uint32_t canalSubmenuId = 0x03C6629C;
static constexpr uint32_t seawallSubmenuId = 0x1CD18678;
static constexpr uint32_t waterfrontSubmenuId = 0x84D42CD6;

static constexpr uint32_t energyDirtySubmenuId = 0x4B465151;
static constexpr uint32_t energyCleanSubmenuId =0xCDE0316B;
static constexpr uint32_t miscPowerSubmenuId = 0xD013F32D;
Expand Down

0 comments on commit cdd50d1

Please sign in to comment.