]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Remove the network tab (#28231)
authorVasilis <vasilis@pikachu.systems>
Sat, 25 May 2024 20:09:52 +0000 (23:09 +0300)
committerGitHub <noreply@github.com>
Sat, 25 May 2024 20:09:52 +0000 (16:09 -0400)
It is useless and bloat, if a user needs to change these settings they are free to modify their cvars manually via the clientconfig.toml file or via the cvar command.

Content.Client/Options/UI/OptionsMenu.xaml
Content.Client/Options/UI/OptionsMenu.xaml.cs
Content.Client/Options/UI/Tabs/NetworkTab.xaml [deleted file]
Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs [deleted file]

index ab3b88ca4e6543ef8f98766058f6fe43c09fc9c2..4f624c1bb69a68da869825622a5bb9bb4cbf0e3e 100644 (file)
@@ -7,6 +7,5 @@
         <tabs:GraphicsTab Name="GraphicsTab" />
         <tabs:KeyRebindTab Name="KeyRebindTab" />
         <tabs:AudioTab Name="AudioTab" />
-        <tabs:NetworkTab Name="NetworkTab" />
     </TabContainer>
 </DefaultWindow>
index c3a8e664705ceee31106ce1a897a22711d9f237f..35a3f751bbfe6ee35f38fe29756b272769bc3fb5 100644 (file)
@@ -19,7 +19,6 @@ namespace Content.Client.Options.UI
             Tabs.SetTabTitle(1, Loc.GetString("ui-options-tab-graphics"));
             Tabs.SetTabTitle(2, Loc.GetString("ui-options-tab-controls"));
             Tabs.SetTabTitle(3, Loc.GetString("ui-options-tab-audio"));
-            Tabs.SetTabTitle(4, Loc.GetString("ui-options-tab-network"));
 
             UpdateTabs();
         }
diff --git a/Content.Client/Options/UI/Tabs/NetworkTab.xaml b/Content.Client/Options/UI/Tabs/NetworkTab.xaml
deleted file mode 100644 (file)
index d010f0b..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-<Control xmlns="https://spacestation14.io"
-         xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls"
-         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-         x:Class="Content.Client.Options.UI.Tabs.NetworkTab">
-    <BoxContainer Orientation="Vertical" >
-        <BoxContainer Orientation="Vertical" Margin="8 8 8 8" VerticalExpand="True">
-            <BoxContainer Orientation="Horizontal" Margin="4 10 4 0">
-                <CheckBox Name="NetPredictCheckbox" Text="{Loc 'ui-options-net-predict'}" />
-            </BoxContainer>
-            <BoxContainer Orientation="Horizontal" Margin="4 10 4 0">
-                <Label Text="{Loc 'ui-options-net-interp-ratio'}" />
-                <Control MinSize="8 0" />
-                <Slider Name="NetInterpRatioSlider"
-                            ToolTip="{Loc 'ui-options-net-interp-ratio-tooltip'}"
-                            MaxValue="8"
-                            HorizontalExpand="True"
-                            MinSize="80 0"
-                            Rounded="True" />
-                <Control MinSize="8 0" />
-                <Label Name="NetInterpRatioLabel" MinSize="48 0" Align="Right" />
-                <Control MinSize="4 0"/>
-            </BoxContainer>
-            <BoxContainer Orientation="Horizontal" Margin="4 10 4 0">
-                <Label Text="{Loc 'ui-options-net-predict-tick-bias'}" />
-                <Control MinSize="8 0" />
-                <Slider Name="NetPredictTickBiasSlider"
-                            ToolTip="{Loc 'ui-options-net-predict-tick-bias-tooltip'}"
-                            MaxValue="6"
-                            MinValue="0"
-                            HorizontalExpand="True"
-                            MinSize="80 0"
-                            Rounded="True" />
-                <Control MinSize="8 0" />
-                <Label Name="NetPredictTickBiasLabel" MinSize="48 0" Align="Right" />
-                <Control MinSize="4 0"/>
-            </BoxContainer>
-            <BoxContainer Orientation="Horizontal" Margin="4 10 4 0">
-                <Label Text="{Loc 'ui-options-net-pvs-spawn'}" />
-                <Control MinSize="8 0" />
-                <Slider Name="NetPvsSpawnSlider"
-                            ToolTip="{Loc 'ui-options-net-pvs-spawn-tooltip'}"
-                            MaxValue="150"
-                            MinValue="20"
-                            HorizontalExpand="True"
-                            MinSize="80 0"
-                            Rounded="True" />
-                <Control MinSize="8 0" />
-                <Label Name="NetPvsSpawnLabel" MinSize="48 0" Align="Right" />
-                <Control MinSize="4 0"/>
-            </BoxContainer>
-            <BoxContainer Orientation="Horizontal" Margin="4 10 4 0">
-                <Label Text="{Loc 'ui-options-net-pvs-entry'}" />
-                <Control MinSize="8 0" />
-                <Slider Name="NetPvsEntrySlider"
-                            ToolTip="{Loc 'ui-options-net-pvs-entry-tooltip'}"
-                            MaxValue="500"
-                            MinValue="20"
-                            HorizontalExpand="True"
-                            MinSize="80 0"
-                            Rounded="True" />
-                <Control MinSize="8 0" />
-                <Label Name="NetPvsEntryLabel" MinSize="48 0" Align="Right" />
-                <Control MinSize="4 0"/>
-            </BoxContainer>
-            <BoxContainer Orientation="Horizontal" Margin="4 10 4 10">
-                <Label Text="{Loc 'ui-options-net-pvs-leave'}" />
-                <Control MinSize="8 0" />
-                <Slider Name="NetPvsLeaveSlider"
-                            ToolTip="{Loc 'ui-options-net-pvs-leave-tooltip'}"
-                            MaxValue="300"
-                            MinValue="20"
-                            HorizontalExpand="True"
-                            MinSize="80 0"
-                            Rounded="True" />
-                <Control MinSize="8 0" />
-                <Label Name="NetPvsLeaveLabel" MinSize="48 0" Align="Right" />
-                <Control MinSize="4 0"/>
-            </BoxContainer>
-        </BoxContainer>
-        <controls:StripeBack HasBottomEdge="False" HasMargins="False">
-            <BoxContainer Orientation="Horizontal"
-                          Align="End"
-                          HorizontalExpand="True"
-                          VerticalExpand="True">
-                <Button Name="ResetButton"
-                        Text="{Loc 'ui-options-reset-all'}"
-                        StyleClasses="Caution"
-                        HorizontalExpand="True"
-                        HorizontalAlignment="Right" />
-                <Button Name="DefaultButton"
-                        Text="{Loc 'ui-options-default'}"
-                        TextAlign="Center"
-                        HorizontalAlignment="Right" />
-                <Control MinSize="2 0" />
-                <Button Name="ApplyButton"
-                        Text="{Loc 'ui-options-apply'}"
-                        TextAlign="Center"
-                        HorizontalAlignment="Right" />
-            </BoxContainer>
-        </controls:StripeBack>
-    </BoxContainer>
-</Control>
diff --git a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs
deleted file mode 100644 (file)
index 0cdc3b5..0000000
+++ /dev/null
@@ -1,125 +0,0 @@
-using System.Globalization;
-using Robust.Client.AutoGenerated;
-using Robust.Client.UserInterface;
-using Robust.Client.UserInterface.Controls;
-using Robust.Client.UserInterface.XAML;
-using Robust.Shared;
-using Robust.Shared.Configuration;
-using Robust.Client.GameStates;
-using Content.Client.Entry;
-
-namespace Content.Client.Options.UI.Tabs
-{
-    [GenerateTypedNameReferences]
-    public sealed partial class NetworkTab : Control
-    {
-        [Dependency] private readonly IConfigurationManager _cfg = default!;
-        [Dependency] private readonly IClientGameStateManager _stateMan = default!;
-
-        public NetworkTab()
-        {
-
-            RobustXamlLoader.Load(this);
-            IoCManager.InjectDependencies(this);
-
-            ApplyButton.OnPressed += OnApplyButtonPressed;
-            ResetButton.OnPressed += OnResetButtonPressed;
-            DefaultButton.OnPressed += OnDefaultButtonPressed;
-            NetPredictCheckbox.OnToggled += OnPredictToggled;
-            NetInterpRatioSlider.OnValueChanged += OnSliderChanged;
-            NetInterpRatioSlider.MinValue = _stateMan.MinBufferSize;
-            NetPredictTickBiasSlider.OnValueChanged += OnSliderChanged;
-            NetPvsSpawnSlider.OnValueChanged += OnSliderChanged;
-            NetPvsEntrySlider.OnValueChanged += OnSliderChanged;
-            NetPvsLeaveSlider.OnValueChanged += OnSliderChanged;
-
-            Reset();
-        }
-
-        protected override void Dispose(bool disposing)
-        {
-            ApplyButton.OnPressed -= OnApplyButtonPressed;
-            ResetButton.OnPressed -= OnResetButtonPressed;
-            DefaultButton.OnPressed -= OnDefaultButtonPressed;
-            NetPredictCheckbox.OnToggled -= OnPredictToggled;
-            NetInterpRatioSlider.OnValueChanged -= OnSliderChanged;
-            NetPredictTickBiasSlider.OnValueChanged -= OnSliderChanged;
-            NetPvsSpawnSlider.OnValueChanged -= OnSliderChanged;
-            NetPvsEntrySlider.OnValueChanged -= OnSliderChanged;
-            NetPvsLeaveSlider.OnValueChanged -= OnSliderChanged;
-            base.Dispose(disposing);
-        }
-
-        private void OnPredictToggled(BaseButton.ButtonToggledEventArgs obj)
-        {
-            UpdateChanges();
-        }
-
-        private void OnSliderChanged(Robust.Client.UserInterface.Controls.Range range)
-        {
-            UpdateChanges();
-        }
-
-        private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args)
-        {
-            _cfg.SetCVar(CVars.NetBufferSize, (int) NetInterpRatioSlider.Value - _stateMan.MinBufferSize);
-            _cfg.SetCVar(CVars.NetPredictTickBias, (int) NetPredictTickBiasSlider.Value);
-            _cfg.SetCVar(CVars.NetPVSEntityBudget, (int) NetPvsSpawnSlider.Value);
-            _cfg.SetCVar(CVars.NetPVSEntityEnterBudget, (int) NetPvsEntrySlider.Value);
-            _cfg.SetCVar(CVars.NetPVSEntityExitBudget, (int) NetPvsLeaveSlider.Value);
-            _cfg.SetCVar(CVars.NetPredict, NetPredictCheckbox.Pressed);
-
-            _cfg.SaveToFile();
-            UpdateChanges();
-        }
-
-        private void OnResetButtonPressed(BaseButton.ButtonEventArgs args)
-        {
-            Reset();
-        }
-
-        private void OnDefaultButtonPressed(BaseButton.ButtonEventArgs obj)
-        {
-            NetPredictTickBiasSlider.Value = CVars.NetPredictTickBias.DefaultValue;
-            NetPvsSpawnSlider.Value = CVars.NetPVSEntityBudget.DefaultValue;
-            NetPvsEntrySlider.Value = CVars.NetPVSEntityEnterBudget.DefaultValue;
-            NetPvsLeaveSlider.Value = CVars.NetPVSEntityExitBudget.DefaultValue;
-            NetInterpRatioSlider.Value = CVars.NetBufferSize.DefaultValue + _stateMan.MinBufferSize;
-
-            UpdateChanges();
-        }
-
-        private void Reset()
-        {
-            NetInterpRatioSlider.Value = _cfg.GetCVar(CVars.NetBufferSize) + _stateMan.MinBufferSize;
-            NetPredictTickBiasSlider.Value = _cfg.GetCVar(CVars.NetPredictTickBias);
-            NetPvsSpawnSlider.Value = _cfg.GetCVar(CVars.NetPVSEntityBudget);
-            NetPvsEntrySlider.Value = _cfg.GetCVar(CVars.NetPVSEntityEnterBudget);
-            NetPvsLeaveSlider.Value = _cfg.GetCVar(CVars.NetPVSEntityExitBudget);
-            NetPredictCheckbox.Pressed = _cfg.GetCVar(CVars.NetPredict);
-            UpdateChanges();
-        }
-
-        private void UpdateChanges()
-        {
-            var isEverythingSame =
-                NetInterpRatioSlider.Value == _cfg.GetCVar(CVars.NetBufferSize) + _stateMan.MinBufferSize &&
-                NetPredictTickBiasSlider.Value == _cfg.GetCVar(CVars.NetPredictTickBias) &&
-                NetPredictCheckbox.Pressed == _cfg.GetCVar(CVars.NetPredict) &&
-                NetPvsSpawnSlider.Value == _cfg.GetCVar(CVars.NetPVSEntityBudget) &&
-                NetPvsEntrySlider.Value == _cfg.GetCVar(CVars.NetPVSEntityEnterBudget) &&
-                NetPvsLeaveSlider.Value == _cfg.GetCVar(CVars.NetPVSEntityExitBudget);
-
-            ApplyButton.Disabled = isEverythingSame;
-            ResetButton.Disabled = isEverythingSame;
-            NetInterpRatioLabel.Text = NetInterpRatioSlider.Value.ToString(CultureInfo.InvariantCulture);
-            NetPredictTickBiasLabel.Text = NetPredictTickBiasSlider.Value.ToString(CultureInfo.InvariantCulture);
-            NetPvsSpawnLabel.Text = NetPvsSpawnSlider.Value.ToString(CultureInfo.InvariantCulture);
-            NetPvsEntryLabel.Text = NetPvsEntrySlider.Value.ToString(CultureInfo.InvariantCulture);
-            NetPvsLeaveLabel.Text = NetPvsLeaveSlider.Value.ToString(CultureInfo.InvariantCulture);
-
-            // TODO disable / grey-out the predict and interp sliders if prediction is disabled.
-            // Currently no option to do this, but should be added to the slider control in general
-        }
-    }
-}