X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_menu.pas;h=ff57a392880a97a2b1bdb2514b6272240288b007;hb=5929d2a7e4ac7aef4d49bdef3bef3ef506e4b9b0;hp=9d5193d29f7822c30f6a58c6dad73da8b8994dfa;hpb=1bddfaf7b6421f1659a6f211dfdb1dfaef5d5173;p=d2df-sdl.git diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 9d5193d..ff57a39 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -44,7 +44,7 @@ implementation uses g_gui, g_textures, e_graphics, g_main, g_window, g_game, g_map, g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons, - e_log, SysUtils, CONFIG, g_playermodel, DateUtils, + e_log, SysUtils, CONFIG, g_playermodel, DateUtils, sdl2, MAPDEF, Math, g_saveload, e_texture, GL, GLExt, g_language, g_net, g_netmsg, g_netmaster, g_items, e_input, @@ -106,6 +106,8 @@ procedure ProcApplyOptions(); var menu: TGUIMenu; i: Integer; + ovs: Boolean; + v: Byte; begin menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu')); @@ -113,7 +115,18 @@ begin gBPP := 16 else gBPP := 32; + + ovs := gVSync; gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0; + {$IF not DEFINED(HEADLESS)} + if (ovs <> gVSync) then + begin + if (gVSync) then v := 1 else v := 0; + if (SDL_GL_SetSwapInterval(v) <> 0) then writeln('oops; can''t change vsync option, restart required') + else writeln('vsync changed'); + end; + {$ENDIF} + gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0; glLegacyNPOT := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0); @@ -128,6 +141,7 @@ begin gMuteWhenInactive := TGUISwitch(menu.GetControl('swInactiveSounds')).ItemIndex = 1; gAnnouncer := TGUISwitch(menu.GetControl('swAnnouncer')).ItemIndex; gSoundEffectsDF := TGUISwitch(menu.GetControl('swSoundEffects')).ItemIndex = 1; + gUseChatSounds := TGUISwitch(menu.GetControl('swChatSpeech')).ItemIndex = 0; menu := TGUIMenu(g_GUI_GetWindow('OptionsGameMenu').GetControl('mOptionsGameMenu')); @@ -346,6 +360,12 @@ begin else ItemIndex := 0; + with TGUISwitch(menu.GetControl('swChatSpeech')) do + if gUseChatSounds then + ItemIndex := 0 + else + ItemIndex := 1; + menu := TGUIMenu(g_GUI_GetWindow('OptionsControlsP1Menu').GetControl('mOptionsControlsP1Menu')); with menu, gGameControls.P1Control do begin @@ -2544,6 +2564,13 @@ begin AddItem(_lc[I_MENU_COMPAT_DOOM2]); AddItem(_lc[I_MENU_COMPAT_DF]); end; + // Ïåðåêëþ÷àòåëü çâóêîâ ÷àòà + with AddSwitch (_lc[I_MENU_SOUND_CHAT]) do + begin; + Name := 'swChatSpeech'; + AddItem(_lc[I_MENU_YES]); + AddItem(_lc[I_MENU_NO]); + end; with AddSwitch(_lc[I_MENU_SOUND_INACTIVE_SOUNDS]) do begin Name := 'swInactiveSounds';