//////////////// private void InitializeWidgetsForColor(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Hue:", false, ref yOffset); this.HueSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: 0f, maxRange: 1f, hideTextInput: false, innerBarShader: DelegateMethods.ColorLerp_HSL_H); this.HueSlider.Top.Set(yOffset, 0f); this.HueSlider.Left.Set(96f, 0f); this.HueSlider.Width.Set(-96f, 1f); this.HueSlider.SetValue(.53f); container.Append(this.HueSlider); yOffset += 28f; this.InitializeTitle(container, "Saturation:", false, ref yOffset); this.SaturationSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: 0f, maxRange: 1f, hideTextInput: false); this.SaturationSlider.Top.Set(yOffset, 0f); this.SaturationSlider.Left.Set(96f, 0f); this.SaturationSlider.Width.Set(-96f, 1f); this.SaturationSlider.SetValue(1f); container.Append(this.SaturationSlider); yOffset += 28f; this.InitializeTitle(container, "Lightness:", false, ref yOffset); this.LightnessSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: 0f, maxRange: 1f, hideTextInput: false); this.LightnessSlider.Top.Set(yOffset, 0f); this.LightnessSlider.Left.Set(96f, 0f); this.LightnessSlider.Width.Set(-96f, 1f); this.LightnessSlider.SetValue(0.5f); container.Append(this.LightnessSlider); yOffset += 28f; }
private void InitializeWidgetsForFrameEnd(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Frame End:", false, ref yOffset); this.FrameEndSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: true, ticks: 0, minRange: 0f, maxRange: (float)(Main.npcFrameCount[1] - 1)); this.FrameEndSlider.Top.Set(yOffset, 0f); this.FrameEndSlider.Left.Set(96f, 0f); this.FrameEndSlider.Width.Set(-96f, 1f); this.FrameEndSlider.SetValue(0f); this.FrameEndSlider.PreOnChange += (value) => { if (value < this.FrameStartSlider.RememberedInputValue) { value = this.FrameStartSlider.RememberedInputValue; } return(value); }; yOffset += 28f; container.Append((UIElement)this.FrameEndSlider); }
private void InitializeWidgetsForShaderMode(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Shader Mode:", false, ref yOffset); this.ShaderNoneChoice = new UICheckbox(UITheme.Vanilla, "None", ""); this.ShaderNoneChoice.Top.Set(yOffset, 0f); this.ShaderNoneChoice.Left.Set(128f, 0f); this.ShaderNoneChoice.Selected = true; this.ShaderNoneChoice.OnSelectedChanged += () => { this.SetHologramShaderMode(HologramShaderMode.None); this.ShaderTypeSlider.SetRange(0f, 0f); this.ShaderTypeSlider.SetValue(0f); this.ShadertTimeSlider.SetRange(0f, 1f); this.ShadertTimeSlider.SetValue(0f); }; this.ShaderVanillaChoice = new UICheckbox(UITheme.Vanilla, "Vanilla", ""); this.ShaderVanillaChoice.Top.Set(yOffset, 0f); this.ShaderVanillaChoice.Left.Set(228f, 0f); this.ShaderVanillaChoice.Selected = false; this.ShaderVanillaChoice.OnSelectedChanged += () => { this.SetHologramShaderMode(HologramShaderMode.Vanilla); this.ShaderTypeSlider.SetRange(0f, EmittersMod.Instance.MyArmorShaders.Count - 1); //ArmorShaders.Count? this.ShaderTypeSlider.SetValue(0f); this.ShadertTimeSlider.SetRange(-8f, 8f); this.ShadertTimeSlider.SetValue(1f); }; this.ShaderCustomChoice = new UICheckbox(UITheme.Vanilla, "Custom", ""); this.ShaderCustomChoice.Top.Set(yOffset, 0f); this.ShaderCustomChoice.Left.Set(328f, 0f); this.ShaderCustomChoice.OnSelectedChanged += () => { this.SetHologramShaderMode(HologramShaderMode.Custom); this.ShaderTypeSlider.SetRange(0f, 0f); this.ShaderTypeSlider.SetValue(0f); this.ShadertTimeSlider.SetRange(0.01f, 60f); this.ShadertTimeSlider.SetValue(1f); }; container.Append((UIElement)this.ShaderNoneChoice); container.Append((UIElement)this.ShaderVanillaChoice); container.Append((UIElement)this.ShaderCustomChoice); yOffset += 28f; }
private void InitializeWidgetsForWorldLighting(UIThemedPanel container, ref float yOffset) { this.WorldLightingFlag = new UICheckbox(UITheme.Vanilla, "World Lighting", ""); this.WorldLightingFlag.Top.Set(yOffset, 0f); this.WorldLightingFlag.Selected = true; yOffset += 28f; container.Append((UIElement)this.WorldLightingFlag); }
//////////////// private void InitializeWidgetsForMode(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Mode:", false, ref yOffset); this.ModeNpcChoice = new UICheckbox(UITheme.Vanilla, "NPC", ""); this.ModeNpcChoice.Top.Set(yOffset, 0f); this.ModeNpcChoice.Left.Set(64f, 0f); this.ModeNpcChoice.Selected = true; this.ModeNpcChoice.OnSelectedChanged += () => { this.SetHologramMode(HologramMode.NPC); }; this.ModeItemChoice = new UICheckbox(UITheme.Vanilla, "Item", ""); this.ModeItemChoice.Top.Set(yOffset, 0f); this.ModeItemChoice.Left.Set(128f, 0f); this.ModeItemChoice.OnSelectedChanged += () => { this.SetHologramMode(HologramMode.Item); }; this.ModeProjectileChoice = new UICheckbox(UITheme.Vanilla, "Projectile", ""); this.ModeProjectileChoice.Top.Set(yOffset, 0f); this.ModeProjectileChoice.Left.Set(192f, 0f); this.ModeProjectileChoice.OnSelectedChanged += () => { this.SetHologramMode(HologramMode.Projectile); }; this.ModeGoreChoice = new UICheckbox(UITheme.Vanilla, "Gore", ""); this.ModeGoreChoice.Top.Set(yOffset, 0f); this.ModeGoreChoice.Left.Set(288, 0f); this.ModeGoreChoice.OnSelectedChanged += () => { this.SetHologramMode(HologramMode.Gore); }; yOffset += 28f; container.Append((UIElement)this.ModeNpcChoice); container.Append((UIElement)this.ModeItemChoice); container.Append((UIElement)this.ModeProjectileChoice); container.Append((UIElement)this.ModeGoreChoice); }
private void InitializeWidgetsForScale(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Scale:", false, ref yOffset); this.ScaleSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: 0.01f, maxRange: 10f); this.ScaleSlider.Top.Set(yOffset, 0f); this.ScaleSlider.Left.Set(64f, 0f); this.ScaleSlider.Width.Set(-64f, 1f); this.ScaleSlider.SetValue(1f); yOffset += 28f; container.Append((UIElement)this.ScaleSlider); }
private void InitializeWidgetsForFrameRateTicks(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Frame Rate:", false, ref yOffset); this.FrameRateTicksSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: true, ticks: 0, minRange: 1f, maxRange: 60f * 5f); this.FrameRateTicksSlider.Top.Set(yOffset, 0f); this.FrameRateTicksSlider.Left.Set(96f, 0f); this.FrameRateTicksSlider.Width.Set(-96f, 1f); this.FrameRateTicksSlider.SetValue(8f); yOffset += 28f; container.Append((UIElement)this.FrameRateTicksSlider); }
private void InitializeWidgetsForOffsetY(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Y Offset:", false, ref yOffset); this.OffsetYSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: true, ticks: 0, minRange: -256f, //0f maxRange: 256f); //15f this.OffsetYSlider.Top.Set(yOffset, 0f); this.OffsetYSlider.Left.Set(96f, 0f); this.OffsetYSlider.Width.Set(-96f, 1f); this.OffsetYSlider.SetValue(0f); yOffset += 28f; container.Append((UIElement)this.OffsetYSlider); }
private void InitializeWidgetsForRotation(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Rotation:", false, ref yOffset); this.RotationSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: 0f, maxRange: 360f); this.RotationSlider.Top.Set(yOffset, 0f); this.RotationSlider.Left.Set(96f, 0f); this.RotationSlider.Width.Set(-96f, 1f); this.RotationSlider.SetValue(0f); yOffset += 28f; container.Append((UIElement)this.RotationSlider); }
private void InitializeWidgetsforShaderTime(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Cycle Seconds:", false, ref yOffset); this.ShadertTimeSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: 0.01f, maxRange: 60f, hideTextInput: false ); this.ShadertTimeSlider.Top.Set(yOffset, 0f); this.ShadertTimeSlider.Left.Set(128f, 0f); this.ShadertTimeSlider.Width.Set(-128f, 1f); this.ShadertTimeSlider.SetValue(1f); container.Append(this.ShadertTimeSlider); yOffset += 28f; }
//////////////// private void InitializeWidgetsforShaderType(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Shader Type:", false, ref yOffset); this.ShaderTypeSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: true, ticks: 0, minRange: 0f, maxRange: EmittersMod.Instance.MyArmorShaders.Count - 1, hideTextInput: false ); this.ShaderTypeSlider.Top.Set(yOffset, 0f); this.ShaderTypeSlider.Left.Set(128f, 0f); this.ShaderTypeSlider.Width.Set(-128f, 1f); this.ShaderTypeSlider.SetValue(0f); container.Append(this.ShaderTypeSlider); yOffset += 28f; }
private void InitializeWidgetsForAlpha(UIThemedPanel container, ref float yOffsetColorPanel) { this.InitializeTitle(container, "Alpha:", false, ref yOffsetColorPanel); this.AlphaSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: true, ticks: 0, minRange: 0f, maxRange: 255f); this.AlphaSlider.Top.Set(yOffsetColorPanel, 0f); this.AlphaSlider.Left.Set(64f, 0f); this.AlphaSlider.Width.Set(-64f, 1f); this.AlphaSlider.SetValue(255f); yOffsetColorPanel += 28f; container.Append(this.AlphaSlider); yOffsetColorPanel += 28f; }
private void InitializeWidgetsForType(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Type:", false, ref yOffset); this.TypeSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: true, ticks: 0, minRange: 1f, maxRange: Main.npcTexture.Length - 1); this.TypeSlider.Top.Set(yOffset, 0f); this.TypeSlider.Left.Set(64f, 0f); this.TypeSlider.Width.Set(-64f, 1f); this.TypeSlider.SetValue(1f); this.TypeSlider.PreOnChange += (value) => { var mode = (HologramMode)this.CurrentMode; this.FrameStartSlider.SetRange(0f, (float)(HologramDefinition.GetFrameCount(mode, (int)value) - 1)); this.FrameEndSlider.SetRange(0f, (float)(HologramDefinition.GetFrameCount(mode, (int)value) - 1)); return(value); }; yOffset += 28f; container.Append((UIElement)this.TypeSlider); }
private void InitializeWidgetsForDirection(UIThemedPanel container, ref float yOffset) { this.InitializeTitle(container, "Direction:", false, ref yOffset); this.DirectionSlider = new UISlider( theme: UITheme.Vanilla, hoverText: "", isInt: false, ticks: 0, minRange: -1f, maxRange: 1f); this.DirectionSlider.Top.Set(yOffset, 0f); this.DirectionSlider.Left.Set(96f, 0f); this.DirectionSlider.Width.Set(-96f, 1f); this.DirectionSlider.SetValue(1f); this.DirectionSlider.PreOnChange += (value) => { bool isRepeat = Timers.GetTimerTickDuration("HologramDirectionRepeat") >= 1; Timers.SetTimer("HologramDirectionRepeat", 2, true, () => false); if (isRepeat) { return(null); } if (this.DirectionSlider.RememberedInputValue < 0f && this.DirectionSlider.RememberedInputValue != value) { value = 1f; } else { value = -1f; } return(value); }; yOffset += 28f; container.Append((UIElement)this.DirectionSlider); }