Skip to content

Commit c097f70

Browse files
committed
looks good to me let's ship to prod
1 parent 92ef75b commit c097f70

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

mod.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@
4545
"type": "bool",
4646
"default": false
4747
},
48+
"screenshotOnDeathPreference": {
49+
"name": "(READ CAREFULLY!) Auto-Screenshot on Death, But...",
50+
"description": "Pick the kind of screenshot you want. No, you can't have all of the types of screenshots; pick wisely!\n\n<cy>\"But this could've been a setting in PRNTSCRN!\"</c> No.",
51+
"type": "string",
52+
"default": "Use PRNTSCRN Settings",
53+
"one-of": [
54+
"Keep UI",
55+
"Hide (~99% of) UI",
56+
"Use PRNTSCRN Settings"
57+
]
58+
},
4859
"changeDeathText": {
4960
"name": "Change \"New Best\" Texts",
5061
"description": "Leaving this enabled is semi-important, since it's kind of the original purpose of this mod. You can disable it though if you want, I guess.",

src/PlayLayer.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,18 @@ class $modify(MyPlayLayer, PlayLayer) {
157157
this->scheduleOnce(schedule_selector(MyPlayLayer::PRNTSCRNOnDeath), .275f);
158158
}
159159
void PRNTSCRNOnDeath(float) {
160-
(void) PRNTSCRN::screenshotNodeAdvanced(this, {FMODAudioEngine::get()}, {""_spr});
160+
const std::string& screenshotOnDeathPreference = getModString("screenshotOnDeathPreference");
161+
if (screenshotOnDeathPreference == "Keep UI") {
162+
(void) PRNTSCRN::screenshotNodeAdvanced(this, {FMODAudioEngine::get()}, {""_spr});
163+
} else if (screenshotOnDeathPreference == "Hide (~99% of) UI") {
164+
Mod* prntscrn = Loader::get()->getLoadedMod("ninxout.prntscrn");
165+
bool originalValue = prntscrn->getSettingValue<bool>("hide-ui");
166+
prntscrn->setSettingValue<bool>("hide-ui", true);
167+
(void) PRNTSCRN::screenshotNode(this);
168+
prntscrn->setSettingValue<bool>("hide-ui", originalValue);
169+
} else {
170+
(void) PRNTSCRN::screenshotNode(this);
171+
}
161172
(void) PRNTSCRN::screenshotNodeAdvanced(CCScene::get(), {FMODAudioEngine::get()}, {""_spr});
162173
}
163174
};

0 commit comments

Comments
 (0)