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

Method setup

src/instancemanager.cpp:149–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149Instance::SetupResults Instance::setup(PluginContainer& plugins)
150{
151 // read initial values from the ini
152 if (!readFromIni()) {
153 return SetupResults::BadIni;
154 }
155
156 // getting game plugin
157 const auto r = getGamePlugin(plugins);
158 if (r != SetupResults::Okay) {
159 return r;
160 }
161
162 // error if the variant missing and required by the plugin
163 if (m_gameVariant.isEmpty() && m_plugin->gameVariants().size() > 1) {
164 return SetupResults::MissingVariant;
165 } else {
166 m_plugin->setGameVariant(m_gameVariant);
167 }
168
169 // update the ini in case anything was missing
170 updateIni();
171
172 // the game directory may be different than what the plugin detected, the user
173 // can change it in the settings and might have multiple versions of the game
174 // installed
175 m_plugin->setGamePath(m_gameDir);
176
177 return SetupResults::Okay;
178}
179
180void Instance::updateIni()
181{

Callers 1

setupInstanceFunction · 0.45

Calls 2

isEmptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected