diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 8331660c6107c21c00137101818cc3ce0aa28a37..fe650785d11a8b34baa3b623089b0788e1b37349 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
PromptIP: string;
PromptPort: Word;
TempScale: Integer = -1;
PromptIP: string;
PromptPort: Word;
TempScale: Integer = -1;
+ TempResScale: Integer = -1;
implementation
implementation
gcTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
gcRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
gcTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
gcRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
+ gcDeathmatchKeys := TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0;
gcAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gcWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gcMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
gcAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gcWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gcMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
Options := Options or GAME_OPTION_TEAMDAMAGE;
if gcRespawnItems then
Options := Options or GAME_OPTION_RESPAWNITEMS;
Options := Options or GAME_OPTION_TEAMDAMAGE;
if gcRespawnItems then
Options := Options or GAME_OPTION_RESPAWNITEMS;
+ if gcDeathmatchKeys then
+ Options := Options or GAME_OPTION_DMKEYS;
if gcAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gcWeaponStay then
if gcAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gcWeaponStay then
gnTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
gnRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
gnTeamDamage := TGUISwitch(GetControl('swTeamDamage')).ItemIndex = 0;
gnRespawnItems := TGUISwitch(GetControl('swRespawnItems')).ItemIndex = 0;
+ gnDeathmatchKeys := TGUISwitch(GetControl('swDeathmatchKeys')).ItemIndex = 0;
gnAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gnWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gnMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
gnAllowExit := TGUISwitch(GetControl('swEnableExits')).ItemIndex = 0;
gnWeaponStay := TGUISwitch(GetControl('swWeaponStay')).ItemIndex = 0;
gnMonsters := TGUISwitch(GetControl('swMonsters')).ItemIndex = 0;
Options := Options or GAME_OPTION_TEAMDAMAGE;
if gnRespawnItems then
Options := Options or GAME_OPTION_RESPAWNITEMS;
Options := Options or GAME_OPTION_TEAMDAMAGE;
if gnRespawnItems then
Options := Options or GAME_OPTION_RESPAWNITEMS;
+ if gnDeathmatchKeys then
+ Options := Options or GAME_OPTION_DMKEYS;
if gnAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gnWeaponStay then
if gnAllowExit then
Options := Options or GAME_OPTION_ALLOWEXIT;
if gnWeaponStay then
ItemIndex := 0
else
ItemIndex := 1;
ItemIndex := 0
else
ItemIndex := 1;
+ with TGUISwitch(menu.GetControl('swDeathmatchKeys')) do
+ if LongBool(Options and GAME_OPTION_DMKEYS) then
+ ItemIndex := 0
+ else
+ ItemIndex := 1;
TGUIEdit(menu.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit);
TGUIEdit(menu.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit);
TGUIEdit(menu.GetControl('edTimeLimit')).Text := IntToStr(TimeLimit);
TGUIEdit(menu.GetControl('edGoalLimit')).Text := IntToStr(GoalLimit);
if GameType in [GT_CUSTOM, GT_SERVER] then
begin
TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True;
if GameType in [GT_CUSTOM, GT_SERVER] then
begin
TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True;
+ TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := (GameMode in [GM_DM, GM_TDM, GM_CTF]);
TGUIEdit(menu.GetControl('edTimeLimit')).Enabled := True;
TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_ITEMSTEXT_COLOR;
TGUIEdit(menu.GetControl('edGoalLimit')).Enabled := True;
TGUIEdit(menu.GetControl('edTimeLimit')).Enabled := True;
TGUILabel(menu.GetControlsText('edTimeLimit')).Color := MENU_ITEMSTEXT_COLOR;
TGUIEdit(menu.GetControl('edGoalLimit')).Enabled := True;
else
begin
TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True;
else
begin
TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True;
+ TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := False;
with TGUIEdit(menu.GetControl('edTimeLimit')) do
begin
Enabled := False;
with TGUIEdit(menu.GetControl('edTimeLimit')) do
begin
Enabled := False;
Options := Options and (not GAME_OPTION_TEAMDAMAGE);
end;
Options := Options and (not GAME_OPTION_TEAMDAMAGE);
end;
+ if TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled then
+ begin
+ if TGUISwitch(menu.GetControl('swDeathmatchKeys')).ItemIndex = 0 then
+ Options := Options or GAME_OPTION_DMKEYS
+ else
+ Options := Options and (not GAME_OPTION_DMKEYS);
+ end;
+
if TGUIEdit(menu.GetControl('edTimeLimit')).Enabled then
begin
n := StrToIntDef(TGUIEdit(menu.GetControl('edTimeLimit')).Text, TimeLimit);
if TGUIEdit(menu.GetControl('edTimeLimit')).Enabled then
begin
n := StrToIntDef(TGUIEdit(menu.GetControl('edTimeLimit')).Text, TimeLimit);
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
TGUILabel(menu.GetControl('lbCurrentRes')).Text :=
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
TGUILabel(menu.GetControl('lbCurrentRes')).Text :=
- IntToStr(gScreenWidth) +
- ' x ' + IntToStr(gScreenHeight) +
+ IntToStr(gWinSizeX) +
+ ' x ' + IntToStr(gWinSizeY) +
', ' + IntToStr(gBPP) + ' bpp';
with TGUIListBox(menu.GetControl('lsResolution')) do
', ' + IntToStr(gBPP) + ' bpp';
with TGUIListBox(menu.GetControl('lsResolution')) do
ItemIndex := 0
else
ItemIndex := 1;
ItemIndex := 0
else
ItemIndex := 1;
+
+ TempResScale := Round(r_pixel_scale - 1);
+ TGUIScroll(menu.GetControl('scResFactor')).Value := TempResScale;
end;
procedure ProcApplyVideoOptions();
end;
procedure ProcApplyVideoOptions();
menu: TGUIMenu;
Fullscreen: Boolean;
SWidth, SHeight: Integer;
menu: TGUIMenu;
Fullscreen: Boolean;
SWidth, SHeight: Integer;
+ ScaleChanged: Boolean;
str: String;
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
str := TGUIListBox(menu.GetControl('lsResolution')).SelectedItem;
str: String;
begin
menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu'));
str := TGUIListBox(menu.GetControl('lsResolution')).SelectedItem;
- SScanf(str, '%dx%d', [@SWidth, @SHeight]);
+ if str <> '' then
+ SScanf(str, '%dx%d', [@SWidth, @SHeight])
+ else
+ begin
+ SWidth := gWinSizeX;
+ SHeight := gWinSizeY;
+ end;
Fullscreen := TGUISwitch(menu.GetControl('swFullScreen')).ItemIndex = 0;
Fullscreen := TGUISwitch(menu.GetControl('swFullScreen')).ItemIndex = 0;
- if (SWidth <> gScreenWidth) or
- (SHeight <> gScreenHeight) or
- (Fullscreen <> gFullscreen) then
+ ScaleChanged := False;
+ if TGUIScroll(menu.GetControl('scResFactor')).Value <> TempResScale then
+ begin
+ TempResScale := TGUIScroll(menu.GetControl('scResFactor')).Value;
+ r_pixel_scale := TempResScale + 1;
+ ScaleChanged := True;
+ end;
+
+ if (SWidth <> gWinSizeX) or
+ (SHeight <> gWinSizeY) or
+ (Fullscreen <> gFullscreen) or
+ ScaleChanged then
begin
gResolutionChange := True;
gRC_Width := SWidth;
begin
gResolutionChange := True;
gRC_Width := SWidth;
else
ItemIndex := 1;
end;
else
ItemIndex := 1;
end;
+ with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
+ begin
+ Name := 'swDeathmatchKeys';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ if gnDeathmatchKeys then
+ ItemIndex := 0
+ else
+ ItemIndex := 1;
+ end;
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
else
ItemIndex := 1;
end;
else
ItemIndex := 1;
end;
+ with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
+ begin
+ Name := 'swDeathmatchKeys';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ if gcDeathmatchKeys then
+ ItemIndex := 0
+ else
+ ItemIndex := 1;
+ end;
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
with AddSwitch(_lc[I_MENU_ENABLE_EXITS]) do
begin
Name := 'swEnableExits';
AddItem(_lc[I_MENU_YES]);
AddItem(_lc[I_MENU_NO]);
end;
AddItem(_lc[I_MENU_YES]);
AddItem(_lc[I_MENU_NO]);
end;
+ with AddScroll(_lc[I_MENU_GAME_SCALE_FACTOR]) do
+ begin
+ Name := 'scResFactor';
+ Max := 10;
+ end;
AddSpace();
AddButton(@ProcApplyVideoOptions, _lc[I_MENU_RESOLUTION_APPLY]);
UpdateIndex();
AddSpace();
AddButton(@ProcApplyVideoOptions, _lc[I_MENU_RESOLUTION_APPLY]);
UpdateIndex();
AddItem(_lc[I_MENU_NO]);
ItemIndex := 1;
end;
AddItem(_lc[I_MENU_NO]);
ItemIndex := 1;
end;
+ with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do
+ begin
+ Name := 'swDeathmatchKeys';
+ AddItem(_lc[I_MENU_YES]);
+ AddItem(_lc[I_MENU_NO]);
+ ItemIndex := 1;
+ end;
with AddEdit(_lc[I_MENU_TIME_LIMIT]) do
begin
Name := 'edTimeLimit';
with AddEdit(_lc[I_MENU_TIME_LIMIT]) do
begin
Name := 'edTimeLimit';