X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_menu.pas;h=265bade66424b2a0412cac54634581691f123a91;hb=d0936017ccb8a078d1b03f55478af284bb015bbc;hp=b29a5137c4ff173c7e67b41bac7359d980736c76;hpb=be2ad7bf5e09b4ee91a0c5ee741503ace8c7887c;p=d2df-sdl.git diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index b29a513..265bade 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -43,14 +43,13 @@ var implementation uses - {$INCLUDE ../nogl/noGLuses.inc} - 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, + g_gui, g_textures, r_graphics, g_window, g_game, g_map, + g_base, g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons, e_log, SysUtils, CONFIG, g_playermodel, DateUtils, MAPDEF, Math, g_saveload, - e_texture, g_language, e_res, + g_language, e_res, g_net, g_netmsg, g_netmaster, g_items, e_input, g_touch, - utils, wadreader, g_system; + utils, wadreader, g_system, r_game; type TYNCallback = procedure (yes:Boolean); @@ -124,6 +123,7 @@ begin gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0; glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0); + gLerpActors := TGUISwitch(menu.GetControl('swInterp')).ItemIndex = 0; menu := TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu')); @@ -400,6 +400,9 @@ begin with TGUISwitch(menu.GetControl('swLegacyNPOT')) do if not glNPOTOverride then ItemIndex := 0 else ItemIndex := 1; + with TGUISwitch(menu.GetControl('swInterp')) do + if gLerpActors then ItemIndex := 0 else ItemIndex := 1; + menu := TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu')); TGUIScroll(menu.GetControl('scSoundLevel')).Value := Round(gSoundLevel/16); @@ -677,13 +680,22 @@ begin if TGUISwitch(GetControl('swMonsters')).ItemIndex = 0 then gsGameFlags := gsGameFlags or GAME_OPTION_MONSTERS; + case TGUISwitch(GetControl('swTeamHit')).ItemIndex of + 1: gsGameFlags := gsGameFlags or GAME_OPTION_TEAMHITTRACE; + 2: gsGameFlags := gsGameFlags or GAME_OPTION_TEAMHITPROJECTILE; + 0: gsGameFlags := gsGameFlags or GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE; + end; + case TGUISwitch(GetControl('swBotsVS')).ItemIndex of 1: gsGameFlags := gsGameFlags or GAME_OPTION_BOTVSMONSTER; 2: gsGameFlags := gsGameFlags or GAME_OPTION_BOTVSPLAYER or GAME_OPTION_BOTVSMONSTER; else gsGameFlags := gsGameFlags or GAME_OPTION_BOTVSPLAYER; end; - gGameSettings.ItemRespawnTime := gsItemRespawnTime; // TODO: get this crap out of here + // TODO: get this crap out of here + gGameSettings.ItemRespawnTime := gsItemRespawnTime; + gGameSettings.WarmupTime := gsWarmupTime; + gGameSettings.SpawnInvul := gsSpawnInvul; end; end; @@ -772,7 +784,7 @@ begin slWaitStr := _lc[I_NET_SLIST_WAIT]; - g_Game_Draw; + r_Game_Draw; sys_Repaint; slReturnPressed := True; @@ -1628,6 +1640,15 @@ begin ItemIndex := 0 else ItemIndex := 1; + with TGUISwitch(menu.GetControl('swTeamHit')) do + if (Options and (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE)) = (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE) then + ItemIndex := 0 + else if LongBool(Options and GAME_OPTION_TEAMHITTRACE) then + ItemIndex := 1 + else if LongBool(Options and GAME_OPTION_TEAMHITPROJECTILE) then + ItemIndex := 2 + else + ItemIndex := 3; with TGUISwitch(menu.GetControl('swDeathmatchKeys')) do if LongBool(Options and GAME_OPTION_DMKEYS) then ItemIndex := 0 @@ -1651,6 +1672,7 @@ begin if GameType in [GT_CUSTOM, GT_SERVER] then begin TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True; + TGUISwitch(menu.GetControl('swTeamHit')).Enabled := True; if (GameMode in [GM_DM, GM_TDM, GM_CTF]) then begin TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := True; @@ -1672,6 +1694,7 @@ begin else begin TGUISwitch(menu.GetControl('swTeamDamage')).Enabled := True; + TGUISwitch(menu.GetControl('swTeamHit')).Enabled := True; TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled := False; TGUILabel(menu.GetControlsText('swDeathmatchKeys')).Color := MENU_UNACTIVEITEMS_COLOR; with TGUIEdit(menu.GetControl('edTimeLimit')) do @@ -1717,6 +1740,16 @@ begin Options := Options and (not GAME_OPTION_TEAMDAMAGE); end; + if TGUISwitch(menu.GetControl('swTeamHit')).Enabled then + begin + Options := Options and not (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE); + case TGUISwitch(menu.GetControl('swTeamHit')).ItemIndex of + 1: Options := Options or GAME_OPTION_TEAMHITTRACE; + 2: Options := Options or GAME_OPTION_TEAMHITPROJECTILE; + 0: Options := Options or GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE; + end; + end; + if TGUISwitch(menu.GetControl('swDeathmatchKeys')).Enabled then begin if TGUISwitch(menu.GetControl('swDeathmatchKeys')).ItemIndex = 0 then @@ -1847,7 +1880,8 @@ begin 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(); @@ -1867,14 +1901,15 @@ begin 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; @@ -2184,6 +2219,22 @@ begin else ItemIndex := 1; end; + with AddSwitch(_lc[I_MENU_TEAM_HIT]) do + begin + Name := 'swTeamHit'; + AddItem(_lc[I_MENU_TEAM_HIT_BOTH]); + AddItem(_lc[I_MENU_TEAM_HIT_TRACE]); + AddItem(_lc[I_MENU_TEAM_HIT_PROJECTILE]); + AddItem(_lc[I_MENU_TEAM_HIT_NOTHING]); + if (gsGameFlags and (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE)) = (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE) then + ItemIndex := 0 + else if LongBool(gsGameFlags and GAME_OPTION_TEAMHITTRACE) then + ItemIndex := 1 + else if LongBool(gsGameFlags and GAME_OPTION_TEAMHITPROJECTILE) then + ItemIndex := 2 + else + ItemIndex := 3; + end; with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do begin Name := 'swDeathmatchKeys'; @@ -2403,6 +2454,22 @@ begin else ItemIndex := 1; end; + with AddSwitch(_lc[I_MENU_TEAM_HIT]) do + begin + Name := 'swTeamHit'; + AddItem(_lc[I_MENU_TEAM_HIT_BOTH]); + AddItem(_lc[I_MENU_TEAM_HIT_TRACE]); + AddItem(_lc[I_MENU_TEAM_HIT_PROJECTILE]); + AddItem(_lc[I_MENU_TEAM_HIT_NOTHING]); + if (gsGameFlags and (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE)) = (GAME_OPTION_TEAMHITTRACE or GAME_OPTION_TEAMHITPROJECTILE) then + ItemIndex := 0 + else if LongBool(gsGameFlags and GAME_OPTION_TEAMHITTRACE) then + ItemIndex := 1 + else if LongBool(gsGameFlags and GAME_OPTION_TEAMHITPROJECTILE) then + ItemIndex := 2 + else + ItemIndex := 3; + end; with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do begin Name := 'swDeathmatchKeys'; @@ -2639,6 +2706,12 @@ begin AddItem(_lc[I_MENU_YES]); AddItem(_lc[I_MENU_NO]); end; + with AddSwitch(_lc[I_MENU_VIDEO_INTERPOLATION]) do + begin + Name := 'swInterp'; + AddItem(_lc[I_MENU_YES]); + AddItem(_lc[I_MENU_NO]); + end; with AddSwitch(_lc[I_MENU_VIDEO_LEGACY_COMPATIBLE]) do begin Name := 'swLegacyNPOT'; @@ -2673,10 +2746,12 @@ begin 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]); @@ -3278,6 +3353,15 @@ begin AddItem(_lc[I_MENU_NO]); ItemIndex := 1; end; + with AddSwitch(_lc[I_MENU_TEAM_HIT]) do + begin + Name := 'swTeamHit'; + AddItem(_lc[I_MENU_TEAM_HIT_BOTH]); + AddItem(_lc[I_MENU_TEAM_HIT_TRACE]); + AddItem(_lc[I_MENU_TEAM_HIT_PROJECTILE]); + AddItem(_lc[I_MENU_TEAM_HIT_NOTHING]); + ItemIndex := 0 + end; with AddSwitch(_lc[I_MENU_DEATHMATCH_KEYS]) do begin Name := 'swDeathmatchKeys';