MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / selectGame

Function selectGame

src/instancemanager.cpp:745–767  ·  view source on GitHub ↗

shows the game selection page of the create instance dialog so the user can pick which game is managed by this instance this is used below in setupInstance() when the game directory is gone or no plugins can recognize it

Source from the content-addressed store, hash-verified

743// no plugins can recognize it
744//
745SetupInstanceResults selectGame(Instance& instance, PluginContainer& pc)
746{
747 CreateInstanceDialog dlg(pc, nullptr);
748
749 // only show the game page
750 dlg.setSinglePage<cid::GamePage>(instance.displayName());
751
752 dlg.show();
753 dlg.activateWindow();
754 dlg.raise();
755
756 if (dlg.exec() != QDialog::Accepted) {
757 // cancelled
758 return SetupInstanceResults::SelectAnother;
759 }
760
761 // this info will be used instead of the ini, which should fix this
762 // particular problem
763 instance.setGame(dlg.creationInfo().game->gameName(),
764 dlg.creationInfo().gameLocation);
765
766 return SetupInstanceResults::TryAgain;
767}
768
769// shows the game variant page of the create instance dialog so the user can
770// pick which game variant is installed

Callers 1

setupInstanceFunction · 0.85

Calls 5

setGameMethod · 0.80
creationInfoMethod · 0.80
displayNameMethod · 0.45
execMethod · 0.45
gameNameMethod · 0.45

Tested by

no test coverage detected