Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using upsector.Tiles;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- using System;
- using System.Collections.Generic;
- using System.IO;
- using Terraria;
- using Terraria.GameContent.Dyes;
- using Terraria.GameContent.UI;
- using Terraria.Graphics.Effects;
- using Terraria.Graphics.Shaders;
- using Terraria.ID;
- using Terraria.Localization;
- using Terraria.ModLoader;
- using Terraria.UI;
- namespace upsector.UI
- {
- class atomicDestabilizerUI
- {
- public override void OnInitialize()
- {
- }
- internal abstract class VisibilityUI : UIState
- {
- public bool Visible;
- public virtual void ToggleUI(UserInterface theInterface, UIState uiStateInstance = null)
- {
- uiStateInstance = uiStateInstance ?? this;
- // If new state toggled but old visibility state present, that one needs to be toggled first
- if (theInterface.CurrentState is VisibilityUI ui
- && theInterface.CurrentState != uiStateInstance)
- {
- ui.ToggleUI(theInterface, ui);
- }
- // Toggle the state
- Visible = !Visible;
- theInterface.ResetLasts();
- theInterface.SetState(Visible ? uiStateInstance : null);
- Main.PlaySound(SoundID.MenuOpen);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement