private void OnSceneLoaded(Scene scene, LoadSceneMode sceneMode) { currentScene = scene.name; UpdateHiddenButtons(); try { GUIExt.repositionButtons(config.MaxButtonsPerLine, config.RemoveButtons ? hiddenButtonsList : null); fixTooltips(); } catch (Exception e) { WriteLine(e.ToString(), true); } }
public void Update() { try { children = GameMain.Instance.SysShortcut.transform.Find("Base").gameObject.transform.Find("Grid").gameObject.GetComponent <UIGrid>().GetChildList(); if (children.Count != numButtons) { numButtons = children.Count; GUIExt.repositionButtons(config.MaxButtonsPerLine, hiddenButtonsList); fixTooltips(); } } catch (Exception e) { WriteLine(e.ToString(), true); } }
private void WriteLine(string message, bool error = false) { GUIExt.WriteLine("[GUIExt] ", ConsoleColor.Cyan, message, ConsoleColor.White, error); }
public void fixTooltips() { foreach (Transform child in children) { if (!DefaultUIButtons.Contains(child.name)) { UIEventTrigger _UIEventTrigger = child.GetComponent <UIEventTrigger>(); if (_UIEventTrigger != null) { if (_UIEventTrigger.onHoverOver != null) { foreach (EventDelegate _event in _UIEventTrigger.onHoverOver) { _event.Execute(); } if (getTooltip() == "") { EventDelegate.Set(_UIEventTrigger.onHoverOver, () => { GUIExt.VisibleExplanationRaw(child.name, GameMain.Instance.SysShortcut); }); WriteLine("[" + currentScene + "] Resolved empty tooltip for: " + child.name); } GameMain.Instance.SysShortcut.VisibleExplanation(null, false); } } } } }