MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / execute

Method execute

src/bzflag/QuitMenu.cpp:143–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143void QuitMenu::execute() {
144 HUDuiElement* _focus = getNav().get();
145 std::vector<HUDuiElement*>& listHUD = getElements();
146 if (_focus == listHUD[0]) { // yes
147 const bool permanentSave = BZDB.isTrue("saveSettings");
148 const bool tempSave = (((HUDuiList*)listHUD[2])->getIndex() != 0);
149 if (tempSave && !permanentSave) {
150 // save this time, but not usually
151 dumpResources();
152 if (alternateConfig == "") {
153 CFGMGR.write(getCurrentConfigFileName());
154 }
155 else {
156 CFGMGR.write(alternateConfig);
157 }
158 }
159 else if (permanentSave && !tempSave) {
160 // save usually, but not this time
161 BZDB.setBool("saveSettings", false);
162 }
163 CommandsStandard::quit();
164 }
165 else if (_focus == listHUD[1]) { //no
166 HUDDialogStack::get()->pop();
167 }
168}
169
170
171// Local Variables: ***

Callers

nothing calls this directly

Calls 8

getCurrentConfigFileNameFunction · 0.85
isTrueMethod · 0.80
setBoolMethod · 0.80
popMethod · 0.80
dumpResourcesFunction · 0.70
getMethod · 0.45
getIndexMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected