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

Function ConsoleCommandOpen

src/openrct2/interface/InteractiveConsole.cpp:1184–1236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1182}
1183
1184static void ConsoleCommandOpen(InteractiveConsole& console, const arguments_t& argv)
1185{
1186 if (!argv.empty())
1187 {
1188 bool title = gLegacyScene == LegacyScene::titleSequence;
1189 bool invalidTitle = false;
1190 if (argv[0] == "object_selection" && InvalidArguments(&invalidTitle, !title))
1191 {
1192 if (Network::GetMode() != Network::Mode::none)
1193 {
1194 console.WriteLineError("Cannot open this window in multiplayer mode.");
1195 }
1196 else
1197 {
1198 // Only this window should be open for safety reasons
1199 auto* windowMgr = Ui::GetWindowManager();
1200 windowMgr->CloseAll();
1201 ContextOpenWindow(WindowClass::editorObjectSelection);
1202 }
1203 }
1204 else if (argv[0] == "inventions_list" && InvalidArguments(&invalidTitle, !title))
1205 {
1206 if (Network::GetMode() != Network::Mode::none)
1207 {
1208 console.WriteLineError("Cannot open this window in multiplayer mode.");
1209 }
1210 else
1211 {
1212 ContextOpenWindow(WindowClass::editorInventionList);
1213 }
1214 }
1215 else if (argv[0] == "scenario_options" && InvalidArguments(&invalidTitle, !title))
1216 {
1217 ContextOpenWindow(WindowClass::editorScenarioOptions);
1218 }
1219 else if (argv[0] == "options")
1220 {
1221 ContextOpenWindow(WindowClass::options);
1222 }
1223 else if (argv[0] == "themes")
1224 {
1225 ContextOpenWindow(WindowClass::themes);
1226 }
1227 else if (invalidTitle)
1228 {
1229 console.WriteLineError("Cannot open this window in the title screen.");
1230 }
1231 else
1232 {
1233 console.WriteLineError("Invalid window.");
1234 }
1235 }
1236}
1237
1238static void ConsoleCommandRemoveUnusedObjects(InteractiveConsole& console, [[maybe_unused]] const arguments_t& argv)
1239{

Callers

nothing calls this directly

Calls 7

InvalidArgumentsFunction · 0.85
GetModeFunction · 0.85
GetWindowManagerFunction · 0.85
ContextOpenWindowFunction · 0.85
WriteLineErrorMethod · 0.80
CloseAllMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected