X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_menu.pas;h=ed6d3ef3261cb8bb9e655389d5e29dddadcae2cd;hb=251b8e917e5ec31d8fc2d0f0f98a427d37eb6946;hp=2f6ce09122ea1f2daa5bb42d879b57949bd9fe90;hpb=88999196d89648a7ba4f6367e2a882e0d56bc5b5;p=d2df-sdl.git diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 2f6ce09..ed6d3ef 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -355,8 +355,10 @@ begin end; menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1WeaponMenu').GetControl('mOptionsPlayersP1WeaponMenu')); - gPlayer1Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex; - + gPlayer1Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex; + gPlayer1Settings.SwitchToEmpty := TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex; + gPlayer1Settings.SkipFist := TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex; + menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP1WeaponMenu').GetControl('mOptionsPreferencesP1WeaponMenu')); with menu do begin @@ -367,8 +369,9 @@ begin end; menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2WeaponMenu').GetControl('mOptionsPlayersP2WeaponMenu')); - gPlayer2Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex; - + gPlayer2Settings.WeaponSwitch := TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex; + gPlayer2Settings.SwitchToEmpty := TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex; + gPlayer2Settings.SkipFist := TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex; menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP2WeaponMenu').GetControl('mOptionsPreferencesP2WeaponMenu')); with menu do begin @@ -403,7 +406,10 @@ begin else if gPlayer1.Team <> gPlayer1Settings.Team then gPlayer1.SwitchTeam; - + gPlayer1.WeapSwitchMode := gPlayer1Settings.WeaponSwitch; + gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences); + gPlayer1.SwitchToEmpty := gPlayer1Settings.SwitchToEmpty; + gPlayer1.SkipFist := gPlayer1Settings.SkipFist; if g_Game_IsNet then MH_SEND_PlayerSettings(gPlayer1.UID); end; @@ -416,10 +422,18 @@ begin else if gPlayer2.Team <> gPlayer2Settings.Team then gPlayer2.SwitchTeam; + gPlayer2.WeapSwitchMode := gPlayer2Settings.WeaponSwitch; + gPlayer2.setWeaponPrefs(gPlayer2Settings.WeaponPreferences); + gPlayer2.SwitchToEmpty := gPlayer2Settings.SwitchToEmpty; + gPlayer2.SkipFist := gPlayer2Settings.SkipFist; end; end; - if g_Game_IsClient then MC_SEND_PlayerSettings; + if g_Game_IsClient then + begin + MC_SEND_PlayerSettings; + gPlayer1.setWeaponPrefs(gPlayer1Settings.WeaponPreferences); + end; g_Console_WriteGameConfig; end; @@ -427,7 +441,7 @@ end; procedure ReadOptions(); var menu: TGUIMenu; - i, a: Integer; + i: Integer; begin menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu')); @@ -646,7 +660,8 @@ begin menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP1WeaponMenu').GetControl('mOptionsPlayersP1WeaponMenu')); TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex := gPlayer1Settings.WeaponSwitch; - + TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex := gPlayer1Settings.SwitchToEmpty; + TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex := gPlayer1Settings.SkipFist; menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP1WeaponMenu').GetControl('mOptionsPreferencesP1WeaponMenu')); for i := WP_FIRST to WP_LAST+1 do begin @@ -656,7 +671,8 @@ begin menu := TGUIMenu(g_GUI_GetWindow('OptionsPlayersP2WeaponMenu').GetControl('mOptionsPlayersP2WeaponMenu')); TGUISwitch(menu.GetControl('swWeaponAutoswitch')).ItemIndex := gPlayer2Settings.WeaponSwitch; - + TGUISwitch(menu.GetControl('swWeaponAllowEmpty')).ItemIndex := gPlayer2Settings.SwitchToEmpty; + TGUISwitch(menu.GetControl('swWeaponAllowFist')).ItemIndex := gPlayer2Settings.SkipFist; menu := TGUIMenu(g_GUI_GetWindow('OptionsPreferencesP2WeaponMenu').GetControl('mOptionsPreferencesP2WeaponMenu')); for i := WP_FIRST to WP_LAST+1 do begin @@ -2171,7 +2187,7 @@ procedure CreateAllMenus(); var Menu: TGUIWindow; //SR: TSearchRec; - a, cx, _y, i, x: Integer; + a, cx, _y, i: Integer; //list: SSArray; begin Menu := TGUIWindow.Create('MainMenu'); @@ -3272,6 +3288,18 @@ begin AddItem(_lc[I_MENU_WEAPON_SWITCH_LINEAR]); AddItem(_lc[I_MENU_WEAPON_SWITCH_PREFERENCE]); end; + with AddSwitch(_lc[I_MENU_WEAPON_ALLOW_EMPTY]) do + begin + Name := 'swWeaponAllowEmpty'; + AddItem(_lc[I_MENU_YES]); + AddItem(_lc[I_MENU_NO]); + end; + with AddSwitch(_lc[I_MENU_KASTET_ALLOW]) do + begin + Name := 'swWeaponAllowFist'; + AddItem(_lc[I_MENU_KASTET_ALLOW_ALWAYS]); + AddItem(_lc[I_MENU_KASTET_ALLOW_BERSERK]); + end; AddButton(@ProcOptionsPlayerP1WeaponPreferencesMenu, _lc[I_MENU_WEAPON_SWITCH_PRIORITY]); ReAlign(); end; @@ -3319,6 +3347,18 @@ begin AddItem(_lc[I_MENU_WEAPON_SWITCH_LINEAR]); AddItem(_lc[I_MENU_WEAPON_SWITCH_PREFERENCE]); end; + with AddSwitch(_lc[I_MENU_WEAPON_ALLOW_EMPTY]) do + begin + Name := 'swWeaponAllowEmpty'; + AddItem(_lc[I_MENU_YES]); + AddItem(_lc[I_MENU_NO]); + end; + with AddSwitch(_lc[I_MENU_KASTET_ALLOW]) do + begin + Name := 'swWeaponAllowFist'; + AddItem(_lc[I_MENU_KASTET_ALLOW_ALWAYS]); + AddItem(_lc[I_MENU_KASTET_ALLOW_BERSERK]); + end; AddButton(@ProcOptionsPlayerP2WeaponPreferencesMenu, _lc[I_MENU_WEAPON_SWITCH_PRIORITY]); ReAlign(); end;