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

Method update

3ds/source/TransferOverlay.cpp:103–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103void ReceiveOverlay::update(const InputState& input)
104{
105 (void)input;
106
107 // While an upload is in flight, B means "cancel the transfer", never "close
108 // the overlay": the receiver must stay registered until the server thread
109 // has abandoned the request, so closing waits for the transfer to end.
110 TransferSnapshot ts = TransferStatus::snapshot();
111 if (ts.active && ts.kind == TransferKind::Network) {
112 if (hidKeysHeld() & KEY_B) {
113 if (++mCancelHoldFrames >= 45 && !TransferStatus::cancelRequested()) {
114 TransferStatus::requestCancel();
115 }
116 }
117 else {
118 mCancelHoldFrames = 0;
119 }
120 return;
121 }
122 mCancelHoldFrames = 0;
123
124 if (Transfer::receiverHasCompleted() && (hidKeysDown() & KEY_A)) {
125 Transfer::stopReceiver();
126 Transfer::clearReceiverCompletion();
127 Transfer::clearReceiverNotice();
128 screen.removeOverlay();
129 return;
130 }
131 if (hidKeysDown() & KEY_B) {
132 Transfer::stopReceiver();
133 Transfer::clearReceiverCompletion();
134 Transfer::clearReceiverNotice();
135 screen.removeOverlay();
136 }
137}

Callers

nothing calls this directly

Calls 4

removeOverlayMethod · 0.80
snapshotFunction · 0.70
cancelRequestedFunction · 0.70
requestCancelFunction · 0.70

Tested by

no test coverage detected