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; }
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"); }
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; }
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; }
/// add Button to main mod-wide collection of all extant buttons public static void AddToButtonStore(ICoreButton btn) { IHBase.Instance.ButtonStore.Add(btn.ID, btn); }
public SortingToggleService(ICoreButton forward, ICoreButton reverse, KState.Special toggle_key) : base(forward, reverse, toggle_key) { sortAction = () => IHPlayer.Sort(); revSortAction = () => IHPlayer.Sort(true); }
public ButtonService(ICoreButton client) { this.Client = client; }
// receive button from base // public void AddButton(ICoreButton b) { Buttons[b.ID] = b; //bubble up IHBase.Instance.ButtonStore.Add(b.ID, b); }