summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 08e3dd1)
raw | patch | inline | side by side (parent: 08e3dd1)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 9 Feb 2020 03:09:38 +0000 (06:09 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 9 Feb 2020 03:09:38 +0000 (06:09 +0300) |
src/game/g_language.pas | patch | blob | history | |
src/game/g_menu.pas | patch | blob | history |
index 1aad7c6823c3cc7fcb061768556076f6b1de918d..09021f5cd3981736eeadc30dffde6d41465a216b 100644 (file)
--- a/src/game/g_language.pas
+++ b/src/game/g_language.pas
I_MENU_MAX_LIVES,
I_MENU_TEAM_DAMAGE,
I_MENU_RESPAWN_ITEMS,
+ I_MENU_DEATHMATCH_KEYS,
I_MENU_ENABLE_EXITS,
I_MENU_WEAPONS_STAY,
I_MENU_ENABLE_MONSTERS,
'Óðîí ñâîèõ:'),
('MENU RESPAWN ITEMS', 'Respawn Items:',
'Ðåñïàâíèòü ïðåäìåòû:'),
+ ('MENU DEATHMATCH KEYS', 'Give all keys in DM:',
+ 'Âñå êëþ÷è â DM:'),
('MENU ENABLE EXITS', 'Enable Exit:',
'Âêëþ÷èòü âûõîä:'),
('MENU WEAPONS STAY', 'Weapons stay:',
diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas
index 8331660c6107c21c00137101818cc3ce0aa28a37..3513439d44e4b2574f2e33b1b64c9351324a74e6 100644 (file)
--- a/src/game/g_menu.pas
+++ b/src/game/g_menu.pas
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;
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
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;
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
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);
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;
else
begin
TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True;
+ TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := False;
with TGUIEdit(menu.GetControl('edTimeLimit')) do
begin
Enabled := False;
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);
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';
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';
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';