X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_menu.pas;h=ccc0a556af4ec8cb8c1ec0c6cb46605777fe850f;hb=7f50d798c193f8a57a3c736c81615ef932915e9a;hp=4b6e6f2e022f8bac7ee074aa15b134ed3103760e;hpb=987c4a835a103345b59937e8e1be8524a6228712;p=d2df-sdl.git diff --git a/src/game/g_menu.pas b/src/game/g_menu.pas index 4b6e6f2..ccc0a55 100644 --- a/src/game/g_menu.pas +++ b/src/game/g_menu.pas @@ -45,11 +45,11 @@ 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, - e_log, SysUtils, CONFIG, g_playermodel, DateUtils, sdl2, + e_log, SysUtils, CONFIG, g_playermodel, DateUtils, MAPDEF, Math, g_saveload, e_texture, g_language, g_net, g_netmsg, g_netmaster, g_items, e_input, g_touch, - utils, wadreader; + utils, wadreader, g_system; type TYNCallback = procedure (yes:Boolean); @@ -118,10 +118,11 @@ begin ovs := gVSync; gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0; - if (ovs <> gVSync) then g_SetVSync(gVSync); + if (ovs <> gVSync) then + sys_EnableVSync(gVSync); gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0; - glLegacyNPOT := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0); + glNPOTOverride := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0); menu := TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu')); @@ -160,7 +161,8 @@ begin gShowMessages := TGUISwitch(menu.GetControl('swMessages')).ItemIndex = 0; gRevertPlayers := TGUISwitch(menu.GetControl('swRevertPlayers')).ItemIndex = 0; gChatBubble := TGUISwitch(menu.GetControl('swChatBubble')).ItemIndex; - gPlayerIndicator := TGUISwitch(menu.GetControl('swPlayerIndicator')).ItemIndex = 0; + gPlayerIndicator := TGUISwitch(menu.GetControl('swPlayerIndicator')).ItemIndex; + gPlayerIndicatorStyle := TGUISwitch(menu.GetControl('swPlayerIndicatorStyle')).ItemIndex; if TGUIScroll(menu.GetControl('scScaleFactor')).Value <> TempScale then begin TempScale := TGUIScroll(menu.GetControl('scScaleFactor')).Value; @@ -396,7 +398,7 @@ begin if gVSync then ItemIndex := 0 else ItemIndex := 1; with TGUISwitch(menu.GetControl('swLegacyNPOT')) do - if not glLegacyNPOT then ItemIndex := 0 else ItemIndex := 1; + if not glNPOTOverride then ItemIndex := 0 else ItemIndex := 1; menu := TGUIMenu(g_GUI_GetWindow('OptionsSoundMenu').GetControl('mOptionsSoundMenu')); @@ -569,7 +571,10 @@ begin ItemIndex := gChatBubble; with TGUISwitch(menu.GetControl('swPlayerIndicator')) do - if gPlayerIndicator then ItemIndex := 0 else ItemIndex := 1; + ItemIndex := gPlayerIndicator; + + with TGUISwitch(menu.GetControl('swPlayerIndicatorStyle')) do + ItemIndex := gPlayerIndicatorStyle; TempScale := Round(g_dbg_scale - 1); TGUIScroll(menu.GetControl('scScaleFactor')).Value := TempScale; @@ -806,7 +811,7 @@ begin NetInitDone := True; end; - g_Net_Slist_Set(NetSlistIP, NetSlistPort); + g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList); gState := STATE_SLIST; g_ActiveWindow := nil; @@ -814,7 +819,7 @@ begin slWaitStr := _lc[I_NET_SLIST_WAIT]; g_Game_Draw; - ReDrawWindow; + sys_Repaint; slReturnPressed := True; if g_Net_Slist_Fetch(slCurrent) then @@ -1820,7 +1825,6 @@ procedure ProcVideoOptionsRes(); var menu: TGUIMenu; list: SSArray; - SR: DWORD; begin menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoResMenu').GetControl('mOptionsVideoResMenu')); @@ -1831,15 +1835,16 @@ begin with TGUIListBox(menu.GetControl('lsResolution')) do begin - list := GetDisplayModes(gBPP, SR); - + list := sys_GetDispalyModes(gBPP); if list <> nil then - begin - Items := list; - ItemIndex := SR; - end + begin + Items := list; + ItemIndex := Length(list) + end else - Clear(); + begin + Clear + end end; with TGUISwitch(menu.GetControl('swFullScreen')) do @@ -2780,8 +2785,15 @@ begin with AddSwitch(_lc[I_MENU_GAME_PLAYER_INDICATOR]) do begin Name := 'swPlayerIndicator'; - AddItem(_lc[I_MENU_YES]); - AddItem(_lc[I_MENU_NO]); + AddItem(_lc[I_MENU_GAME_INDICATOR_NONE]); + AddItem(_lc[I_MENU_GAME_INDICATOR_OWN]); + AddItem(_lc[I_MENU_GAME_INDICATOR_ALL]); + end; + with AddSwitch(_lc[I_MENU_GAME_INDICATOR_STYLE]) do + begin + Name := 'swPlayerIndicatorStyle'; + AddItem(_lc[I_MENU_GAME_INDICATOR_ARROW]); + AddItem(_lc[I_MENU_GAME_INDICATOR_NAME]); end; with AddScroll(_lc[I_MENU_GAME_SCALE_FACTOR]) do begin @@ -2887,12 +2899,11 @@ begin begin Name := 'mOptionsControlsJoystickMenu'; for i := 0 to e_MaxJoys - 1 do - if e_JoystickAvailable[i] then - with AddScroll(Format(_lc[I_MENU_CONTROL_DEADZONE], [i + 1])) do - begin - Name := 'scDeadzone' + IntToStr(i); - Max := 20 - end + with AddScroll(Format(_lc[I_MENU_CONTROL_DEADZONE], [i + 1])) do + begin + Name := 'scDeadzone' + IntToStr(i); + Max := 20 + end end; Menu.DefControl := 'mOptionsControlsJoystickMenu'; g_GUI_AddWindow(Menu);