summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 26c0265)
raw | patch | inline | side by side (parent: 26c0265)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sat, 21 Mar 2020 14:26:36 +0000 (17:26 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sat, 21 Mar 2020 14:26:36 +0000 (17:26 +0300) |
src/game/g_menu.pas | patch | blob | history |
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index c56d6e821bd6d7224387c6ae68a434b4b0b2cce9..484b513c208e50a63f9175c540fbd6c53fb45fb3 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
ItemIndex := 1;
TempResScale := Round(r_pixel_scale - 1);
- TGUIScroll(menu.GetControl('scResFactor')).Value := TempResScale;
+ with TGUISwitch(menu.GetControl('swResFactor')) do
+ ItemIndex := Min(TempResScale, gRC_Width div 640 - 1);
end;
procedure ProcApplyVideoOptions();
begin
SWidth := gWinSizeX;
SHeight := gWinSizeY;
+ TempResScale := Min(TempResScale, SWidth div 640 - 1);
end;
Fullscreen := TGUISwitch(menu.GetControl('swFullScreen')).ItemIndex = 0;
ScaleChanged := False;
- if TGUIScroll(menu.GetControl('scResFactor')).Value <> TempResScale then
+ if TGUISwitch(menu.GetControl('swResFactor')).ItemIndex <> TempResScale then
begin
- TempResScale := TGUIScroll(menu.GetControl('scResFactor')).Value;
+ TempResScale := Min(TGUISwitch(menu.GetControl('swResFactor')).ItemIndex, SWidth div 640 - 1);
r_pixel_scale := TempResScale + 1;
ScaleChanged := True;
end;
AddItem(_lc[I_MENU_YES]);
AddItem(_lc[I_MENU_NO]);
end;
- with AddScroll(_lc[I_MENU_GAME_SCALE_FACTOR]) do
+ with AddSwitch(_lc[I_MENU_GAME_SCALE_FACTOR]) do
begin
- Name := 'scResFactor';
- Max := 10;
+ Name := 'swResFactor';
+ AddItem('1x');
+ for i := 2 to gRC_Width div 640 do
+ AddItem(IntToStr(i) + 'x');
end;
AddSpace();
AddButton(@ProcApplyVideoOptions, _lc[I_MENU_RESOLUTION_APPLY]);