From 1551ec303f29e4133ac21fbad688a9fcfb5257ca Mon Sep 17 00:00:00 2001 From: vaisest <4550061+vaisest@users.noreply.github.com> Date: Fri, 20 Nov 2026 04:03:55 +0200 Subject: [PATCH] Fix error popup not working when the program crashes too early --- src/Export/Launch.lua | 10 ++++++++++ src/Launch.lua | 10 ++++++++++ src/Modules/Common.lua | 10 ---------- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/Export/Launch.lua b/src/Export/Launch.lua index 47878cc401e..24610de9a47 100644 --- a/src/Export/Launch.lua +++ b/src/Export/Launch.lua @@ -12,6 +12,16 @@ ConExecute("set vid_resizable 3") launch = { } SetMainObject(launch) +function GetVirtualScreenSize() + local width, height = GetScreenSize() + local scale = GetScreenScale and GetScreenScale() or 1.0 + if scale ~= 1.0 then + width = math.floor(width / scale) + height = math.floor(height / scale) + end + return width, height +end + function launch:OnInit() self.devMode = true self.subScripts = { } diff --git a/src/Launch.lua b/src/Launch.lua index e0f67db802d..12c8d1a4665 100644 --- a/src/Launch.lua +++ b/src/Launch.lua @@ -18,6 +18,16 @@ SetMainObject(launch) jit.opt.start('maxtrace=4000','maxmcode=8192') collectgarbage("setpause", 400) +function GetVirtualScreenSize() + local width, height = GetScreenSize() + local scale = GetScreenScale and GetScreenScale() or 1.0 + if scale ~= 1.0 then + width = math.floor(width / scale) + height = math.floor(height / scale) + end + return width, height +end + function launch:OnInit() self.devMode = false self.installedMode = false diff --git a/src/Modules/Common.lua b/src/Modules/Common.lua index 43d214e33a3..e8c7dfd03fb 100644 --- a/src/Modules/Common.lua +++ b/src/Modules/Common.lua @@ -1115,16 +1115,6 @@ function escapeGGGString(text) :gsub("%[[^|]+|([^|]+)%]", "%1") return line end --- Returns virtual screen size -function GetVirtualScreenSize() - local width, height = GetScreenSize() - local scale = GetScreenScale and GetScreenScale() or 1.0 - if scale ~= 1.0 then - width = math.floor(width / scale) - height = math.floor(height / scale) - end - return width, height -end -- used for calculating the hash field of a stat local GGG_STAT_HASH32_SEED = 0xC58F1A7B