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

Method onTextInputPrice

src/openrct2-ui/windows/Park.cpp:1028–1043  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026 }
1027
1028 void onTextInputPrice(WidgetIndex widgetIndex, std::string_view text)
1029 {
1030 if (widgetIndex == WIDX_PRICE && !text.empty())
1031 {
1032 std::string strText(text);
1033 auto money = StringToMoney(strText.c_str());
1034 if (money == kMoney64Undefined)
1035 {
1036 return;
1037 }
1038
1039 money = std::clamp(money, 0.00_GBP, kMaxEntranceFee);
1040 auto gameAction = GameActions::ParkSetEntranceFeeAction(money);
1041 GameActions::Execute(&gameAction, getGameState());
1042 }
1043 }
1044
1045 void onPrepareDrawObjective()
1046 {

Callers

nothing calls this directly

Calls 4

StringToMoneyFunction · 0.85
ExecuteFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected