void OnGUI() { if (cursorShow && (!KISAddonPointer.isRunning || !Input.GetKey(KISAddonConfig.hideHintKey))) { _mousePosition = new Vector2(Input.mousePosition.x, Screen.height - Input.mousePosition.y); using (new GuiMatrixScope()) { _guiMainScale.UpdateMatrix(); GUI.DrawTexture( new Rect( _mousePosition.x - ActionIconSize / 2, _mousePosition.y - ActionIconSize / 2, ActionIconSize, ActionIconSize), cursorTexture, ScaleMode.ScaleToFit); } if (KISAddonConfig.showHintText) { // Compile the whole hint text. var allLines = new List <String> { cursorText }; if (cursorAdditionalTexts != null && cursorAdditionalTexts.Any()) { allLines.Add(""); // A linefeed between status and hint text. allLines.AddRange(cursorAdditionalTexts); } var hintText = String.Join("\n", allLines.ToArray()); hintOverlay.text = hintText; hintOverlay.ShowAtCursor(); } } }
/// <inheritdoc/> public void OnGUI() { using (new GuiMatrixScope()) { _guiScale.UpdateMatrix(); guiMainWindowPos = GUILayout.Window( GetInstanceID(), guiMainWindowPos, GuiMain, "KIS spawn item dialog", GUILayout.Height(0)); } }