/// <summary>Make this panel use dark gray generic background and opacity from the GUI Options.</summary> internal void GenericBackgroundAndOpacity() { // the GenericPanel sprite is silver, make it dark this.backgroundSprite = "GenericPanel"; this.color = new Color32(64, 64, 64, 240); SetOpacity(UOpacityValue.FromOpacity(0.01f * GlobalConfig.Instance.Main.GuiOpacity)); }
public static void SetGuiTransparency(byte val) { bool isChanged = val != GlobalConfig.Instance.Main.GuiOpacity; GlobalConfig.Instance.Main.GuiOpacity = val; if (isChanged && _guiOpacitySlider != null) { _guiOpacitySlider.value = val; U.UOpacityValue opacity = UOpacityValue.FromOpacity(0.01f * val); ModUI.Instance.uiOpacityObservable.NotifyObservers( new ModUI.UIOpacityNotification { Opacity = opacity, }); } }