Show held item next to cursor (option). (#4658)

* Show held item next to cursor (option).

* UI scale

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Pieter-Jan Briers
2021-10-22 04:26:02 +02:00
committed by GitHub
parent 7b7562f75b
commit 3d19a991d8
7 changed files with 105 additions and 4 deletions

View File

@@ -73,6 +73,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
UpdateViewportScale();
};
ShowHeldItemCheckBox.OnToggled += OnCheckBoxToggled;
IntegerScalingCheckBox.OnToggled += OnCheckBoxToggled;
ViewportLowResCheckBox.OnToggled += OnCheckBoxToggled;
ApplyButton.OnPressed += OnApplyButtonPressed;
@@ -85,6 +86,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
ViewportStretchCheckBox.Pressed = _cfg.GetCVar(CCVars.ViewportStretch);
IntegerScalingCheckBox.Pressed = _cfg.GetCVar(CCVars.ViewportSnapToleranceMargin) != 0;
ViewportLowResCheckBox.Pressed = !_cfg.GetCVar(CCVars.ViewportScaleRender);
ShowHeldItemCheckBox.Pressed = _cfg.GetCVar(CCVars.HudHeldItemShow);
UpdateViewportScale();
UpdateApplyButton();
@@ -119,6 +121,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
_cfg.SetCVar(CCVars.ViewportSnapToleranceMargin,
IntegerScalingCheckBox.Pressed ? CCVars.ViewportSnapToleranceMargin.DefaultValue : 0);
_cfg.SetCVar(CCVars.ViewportScaleRender, !ViewportLowResCheckBox.Pressed);
_cfg.SetCVar(CCVars.HudHeldItemShow, ShowHeldItemCheckBox.Pressed);
_cfg.SaveToFile();
UpdateApplyButton();
}
@@ -145,6 +148,7 @@ namespace Content.Client.EscapeMenu.UI.Tabs
var isVPScaleSame = (int) ViewportScaleSlider.Value == _cfg.GetCVar(CCVars.ViewportFixedScaleFactor);
var isIntegerScalingSame = IntegerScalingCheckBox.Pressed == (_cfg.GetCVar(CCVars.ViewportSnapToleranceMargin) != 0);
var isVPResSame = ViewportLowResCheckBox.Pressed == !_cfg.GetCVar(CCVars.ViewportScaleRender);
var isShowHeldItemSame = ShowHeldItemCheckBox.Pressed == _cfg.GetCVar(CCVars.HudHeldItemShow);
ApplyButton.Disabled = isVSyncSame &&
isFullscreenSame &&
@@ -154,7 +158,8 @@ namespace Content.Client.EscapeMenu.UI.Tabs
isVPScaleSame &&
isIntegerScalingSame &&
isVPResSame &&
isHudThemeSame;
isHudThemeSame &&
isShowHeldItemSame;
}
private bool ConfigIsFullscreen =>