MCPcopy Create free account
hub / github.com/OpenRCT2/OpenRCT2 / ScreenshotCheck

Function ScreenshotCheck

src/openrct2/interface/Screenshot.cpp:83–112  ·  view source on GitHub ↗

* * rct2: 0x006E3AEC */

Source from the content-addressed store, hash-verified

81 * rct2: 0x006E3AEC
82 */
83void ScreenshotCheck()
84{
85 if (gScreenshotCountdown != 0)
86 {
87 gScreenshotCountdown--;
88 if (gScreenshotCountdown == 0)
89 {
90 // update_weather_animation();
91 std::string screenshotPath = ScreenshotDump();
92
93 if (!screenshotPath.empty())
94 {
95 Audio::Play(Audio::SoundId::windowOpen, 100, ContextGetWidth() / 2);
96
97 // Show user that screenshot saved successfully
98 const auto filename = Path::GetFileName(screenshotPath);
99 Formatter ft;
100 ft.Add<StringId>(STR_STRING);
101 ft.Add<const utf8*>(filename.c_str());
102 ContextShowError(STR_SCREENSHOT_SAVED_AS, kStringIdNone, ft, true);
103 }
104 else
105 {
106 ContextShowError(STR_SCREENSHOT_FAILED, kStringIdNone, {}, true);
107 }
108
109 // redraw_weather();
110 }
111 }
112}
113
114static std::string ScreenshotGetParkName()
115{

Callers 2

gameStateTickFunction · 0.85
TickMethod · 0.85

Calls 6

ScreenshotDumpFunction · 0.85
PlayFunction · 0.85
ContextGetWidthFunction · 0.85
GetFileNameFunction · 0.85
ContextShowErrorFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected