public UI(Terraria.UI parentUI, Icon soundIcon, Icon musicIcon, ActivatableSlider soundSlider, ActivatableSlider musicSlider, float stepSize) { this.parentUI = parentUI; this.soundIcon = soundIcon; this.musicIcon = musicIcon; this.soundSlider = soundSlider; this.musicSlider = musicSlider; SelectSoundSlider(); this.stepSize = stepSize; }
public static UI Create(Terraria.UI parentUI) { int num = Assets.SLIDER_EMPTY_RECT.Height + 10; Vector2 value = new Vector2(300f, 300f); Vector2 position = value + new Vector2(50f, 0f); Slider active = new Slider(Assets.SLIDER, Assets.SLIDER_EMPTY_RECT, Assets.SLIDER_FULL_RECT, position); Slider inactive = new Slider(Assets.SLIDER, Assets.SLIDER_EMPTY_INACTIVE_RECT, Assets.SLIDER_FULL_INACTIVE_RECT, position); ActivatableSlider activatableSlider = new ActivatableSlider(active, inactive); position.Y += num; Slider active2 = new Slider(Assets.SLIDER, Assets.SLIDER_EMPTY_RECT, Assets.SLIDER_FULL_RECT, position); Slider inactive2 = new Slider(Assets.SLIDER, Assets.SLIDER_EMPTY_INACTIVE_RECT, Assets.SLIDER_FULL_INACTIVE_RECT, position); ActivatableSlider activatableSlider2 = new ActivatableSlider(active2, inactive2); Vector2 position2 = value + new Vector2(0f, Assets.SLIDER_EMPTY_RECT.Height - Assets.SOUND_ICON_RECT.Height); Icon icon = new Icon(Assets.SOUND_ICONS, position2, Assets.SOUND_ICON_RECT); position2.Y += num; Icon icon2 = new Icon(Assets.SOUND_ICONS, position2, Assets.MUSIC_ICON_RECT); return(new UI(parentUI, icon, icon2, activatableSlider, activatableSlider2, 0.05f)); }
private void SelectSoundSlider() { soundSlider.Active = true; musicSlider.Active = false; selected = soundSlider; }