Write screen resolution into SkyrimPrefs.ini

This commit is contained in:
Eddoursul 2024-07-20 01:21:28 +02:00
parent 6f56bddc14
commit 9da4ff09c7

View File

@ -161,6 +161,8 @@ Filename: "{app}\MO2\ModOrganizer.ini"; Section: "Plugins"; Key: "Skyrim%20Speci
Filename: "{app}\MO2\ModOrganizer.ini"; Section: "Plugins"; Key: "Skyrim%20VR%20Support%20Plugin\enderal_downloads"; String: "true" Filename: "{app}\MO2\ModOrganizer.ini"; Section: "Plugins"; Key: "Skyrim%20VR%20Support%20Plugin\enderal_downloads"; String: "true"
Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iShadowMaskQuarter"; String: "4" Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iShadowMaskQuarter"; String: "4"
Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iSize W"; String: "{code:GetScreenWidth}"
Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Display"; Key: "iSize H"; String: "{code:GetScreenHeight}"
Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Controls"; Key: "fMouseHeadingSensitivity"; String: "0.0320"; Flags: createkeyifdoesntexist Filename: "{app}\Data\profiles\Default\skyrimprefs.ini"; Section: "Controls"; Key: "fMouseHeadingSensitivity"; String: "0.0320"; Flags: createkeyifdoesntexist
[Icons] [Icons]
@ -327,3 +329,20 @@ begin
S := S + NewLine + Space + 'v' + sSkyrimVersion; S := S + NewLine + Space + 'v' + sSkyrimVersion;
Result := S; Result := S;
end; end;
function GetSystemMetrics(nIndex: Integer): Integer;
external 'GetSystemMetrics@User32.dll stdcall setuponly';
Const
SM_CXSCREEN = 0; // The enum-value for getting the width of the cient area for a full-screen window on the primary display monitor, in pixels.
SM_CYSCREEN = 1; // The enum-value for getting the height of the client area for a full-screen window on the primary display monitor, in pixels.
function GetScreenWidth(Param: String): String;
begin
Result := IntToStr(GetSystemMetrics(SM_CXSCREEN));
end;
function GetScreenHeight(Param: String): String;
begin
Result := IntToStr(GetSystemMetrics(SM_CYSCREEN));
end;