MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / OperatingTweakTextInput

Method OperatingTweakTextInput

src/openrct2-ui/windows/Ride.cpp:3378–3409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3376 }
3377
3378 void OperatingTweakTextInput(const Ride& ride)
3379 {
3380 switch (ride.mode)
3381 {
3382 case RideMode::poweredLaunchPasstrough:
3383 case RideMode::poweredLaunch:
3384 case RideMode::upwardLaunch:
3385 case RideMode::poweredLaunchBlockSectioned:
3386 case RideMode::stationToStation:
3387 case RideMode::dodgems:
3388 return;
3389 default:
3390 break;
3391 }
3392
3393 const auto& operatingSettings = ride.getRideTypeDescriptor().OperatingSettings;
3394 const auto& gameState = getGameState();
3395 int16_t maxValue = gameState.cheats.unlockOperatingLimits ? Limits::kCheatsMaxOperatingLimit
3396 : operatingSettings.MaxValue;
3397 int16_t minValue = gameState.cheats.unlockOperatingLimits ? 0 : operatingSettings.MinValue;
3398
3399 const auto& title = widgets[WIDX_MODE_TWEAK_LABEL].text;
3400 Formatter ft;
3401 ft.Add<int16_t>(minValue * operatingSettings.OperatingSettingMultiplier);
3402 ft.Add<int16_t>(maxValue * operatingSettings.OperatingSettingMultiplier);
3403
3404 uint16_t currentValue = static_cast<uint16_t>(ride.operationOption) * operatingSettings.OperatingSettingMultiplier;
3405 char buffer[6]{};
3406 snprintf(buffer, std::size(buffer), "%u", currentValue);
3407
3408 WindowTextInputRawOpen(this, WIDX_MODE_TWEAK, title, STR_ENTER_VALUE, ft, buffer, 4);
3409 }
3410
3411 void OperatingOnDropdown(WidgetIndex widgetIndex, int32_t dropdownIndex)
3412 {

Callers

nothing calls this directly

Calls 1

WindowTextInputRawOpenFunction · 0.85

Tested by

no test coverage detected