MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / begin

Method begin

game/ui/general/ingameoptions.cpp:186–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186void InGameOptions::begin()
187{
188 /* Initialise all initial values */
189
190 menuform->findControlTyped<ScrollBar>("GLOBAL_GAIN_SLIDER")
191 ->setValue(config().getInt("Framework.Audio.GlobalGain"));
192
193 menuform->findControlTyped<ScrollBar>("MUSIC_GAIN_SLIDER")
194 ->setValue(config().getInt("Framework.Audio.MusicGain"));
195
196 menuform->findControlTyped<ScrollBar>("SAMPLE_GAIN_SLIDER")
197 ->setValue(config().getInt("Framework.Audio.SampleGain"));
198
199 menuform->findControlTyped<CheckBox>("AUTO_SCROLL")
200 ->setChecked(config().getBool("Options.Misc.AutoScroll"));
201 menuform->findControlTyped<CheckBox>("TOOL_TIPS")
202 ->setChecked(config().getInt("Options.Misc.ToolTipDelay") > 0);
203 menuform->findControlTyped<CheckBox>("ACTION_MUSIC")
204 ->setChecked(config().getBool("Options.Misc.ActionMusic"));
205 menuform->findControlTyped<CheckBox>("AUTO_EXECUTE_ORDERS")
206 ->setChecked(config().getBool("Options.Misc.AutoExecute"));
207
208 if (state->current_battle)
209 {
210 menuform->findControlTyped<TextButton>("BUTTON_EXIT_BATTLE")->setVisible(true);
211 menuform->findControlTyped<TextButton>("BUTTON_SKIRMISH")->setVisible(false);
212 }
213 else
214 {
215 menuform->findControlTyped<TextButton>("BUTTON_EXIT_BATTLE")->setVisible(false);
216 menuform->findControlTyped<TextButton>("BUTTON_SKIRMISH")->setVisible(true);
217 }
218
219 menuform->findControlTyped<Label>("TEXT_FUNDS")->setText(state->getPlayerBalance());
220
221 loadList(0);
222}
223
224void InGameOptions::pause() {}
225

Callers

nothing calls this directly

Calls 7

getIntMethod · 0.80
getBoolMethod · 0.80
getPlayerBalanceMethod · 0.80
setValueMethod · 0.45
setCheckedMethod · 0.45
setVisibleMethod · 0.45
setTextMethod · 0.45

Tested by

no test coverage detected