Beispiel #1
0
        public DynamicToggleService(ICoreButton button_if_true, ICoreButton button_if_false, Func <bool> check_game_state) : base(button_if_true)
        {
            _serviceType = Enum.GetName(typeof(TIH), button_if_true.Action) + Enum.GetName(typeof(TIH), button_if_false.Action) + "DynamicToggle";

            gameState = check_game_state;
            AltButton = button_if_false;
        }
Beispiel #2
0
        public DefaultClickService(ICoreButton client, bool right_click = false) : base(client)
        {
            rightClick = right_click;

            _serviceType = "Default" + Enum.GetName(typeof(TIH), client.Action)
                           + (right_click ? "RightClick" : "Click");
        }
Beispiel #3
0
        public ToggleService(ICoreButton client, ICoreButton altButton, KState.Special toggle_key = KState.Special.Shift) : base(client)
        {
            _serviceType = Enum.GetName(typeof(TIH), client.Action) + Enum.GetName(typeof(TIH), altButton.Action) + "Toggle";
            _altButton   = altButton;

            toggleKey = toggle_key;
        }
Beispiel #4
0
        public LockingService(ICoreButton client, Vector2?lock_offset = null, Color?lock_color = null, string locked_suffix = "[Locked]") : base(client)
        {
            _serviceType = Enum.GetName(typeof(TIH), client.Action) + "Lock";

            color  = lock_color ?? Color.Firebrick;
            offset = lock_offset ?? default(Vector2);

            // we're not doing the suffix thing right now.
            // initialLabel = client.Label;
            // lockedLabel  = (locked_suffix == "") ? client.Label : client.Label + " " + locked_suffix;
        }
Beispiel #5
0
 /// add Button to main mod-wide collection of all extant buttons
 public static void AddToButtonStore(ICoreButton btn)
 {
     IHBase.Instance.ButtonStore.Add(btn.ID, btn);
 }
Beispiel #6
0
 public SortingToggleService(ICoreButton forward, ICoreButton reverse, KState.Special toggle_key) : base(forward, reverse, toggle_key)
 {
     sortAction    = () => IHPlayer.Sort();
     revSortAction = () => IHPlayer.Sort(true);
 }
Beispiel #7
0
 public ButtonService(ICoreButton client)
 {
     this.Client = client;
 }
Beispiel #8
0
 // receive button from base //
 public void AddButton(ICoreButton b)
 {
     Buttons[b.ID] = b;
     //bubble up
     IHBase.Instance.ButtonStore.Add(b.ID, b);
 }