MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / update

Method update

3ds/source/ScriptScreen.cpp:194–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194void ScriptScreen::update(const InputState& input)
195{
196 (void)input;
197
198 if (auto result = ScriptRunner::get().takeResult()) {
199 // HOME was blocked for the whole run (picoc cannot be preempted).
200 aptSetHomeAllowed(true);
201 mOutcome = *result;
202 mFinished = true;
203 // The last log line is the run's verdict, so the pane reads as a
204 // transcript that ends where the script did.
205 ScriptConsole::get().log(mOutcome.cancelled ? i18n::t("scripts.aborted", {mOutcome.scriptName})
206 : mOutcome.exitValue == 0 ? i18n::t("scripts.success", {mOutcome.scriptName})
207 : i18n::t("scripts.failed", {mOutcome.scriptName}));
208 }
209
210 if (ScriptRunner::get().active()) {
211 // The hold-B kill switch and the log scrolling live in main.cpp:
212 // both must keep working while a script-raised overlay owns update().
213 pumpScriptRequests(ScriptRunner::get().bridge(), *this);
214 return;
215 }
216
217 if (mFinished && (hidKeysDown() & (KEY_A | KEY_B | KEY_START))) {
218 g_pendingScreen = mPrevious;
219 }
220}
221
222void ScriptScreen::showMessage(const std::string& prompt)
223{

Callers

nothing calls this directly

Calls 5

getFunction · 0.85
pumpScriptRequestsFunction · 0.85
takeResultMethod · 0.45
logMethod · 0.45
activeMethod · 0.45

Tested by

no test coverage detected