diff --git a/Bundles/swconsoleui.bundle b/Bundles/swconsoleui.bundle new file mode 100644 index 00000000..70a34b4a Binary files /dev/null and b/Bundles/swconsoleui.bundle differ diff --git a/SpaceWarp/UI/SpaceWarpConsole.cs b/SpaceWarp/UI/SpaceWarpConsole.cs index ab3b102c..e2f8d61d 100644 --- a/SpaceWarp/UI/SpaceWarpConsole.cs +++ b/SpaceWarp/UI/SpaceWarpConsole.cs @@ -3,8 +3,13 @@ using KSP.Game; using KSP.Sim.impl; using UnityEngine; - +using SpaceWarp.API.AssetBundles; using KSP.Logging; +using static KSP.Map.impl.Targeting.Sample; +using static RTG.Object2ObjectSnap; +using UnityEngine.UI; +using BepInEx.Logging; + namespace SpaceWarp.UI { public class SpaceWarpConsole : KerbalBehavior @@ -20,6 +25,9 @@ public class SpaceWarpConsole : KerbalBehavior private static GUIStyle _boxStyle; private static Vector2 _scrollPosition; + public GUISkin _spaceWarpUISkin; + + private readonly List _debugMessages = new List(); public void Start() { @@ -36,19 +44,21 @@ private void Awake() _windowWidth = (int)(Screen.width * 0.5f); _windowHeight = (int)(Screen.height * 0.5f); - _windowRect = new Rect((Screen.width * 0.15f), (Screen.height * 0.15f), - 0, 0); + _windowRect = new Rect((Screen.width * 0.15f), (Screen.height * 0.15f),0, 0); + + ResourceManager.TryGetAsset($"space_warp/swconsoleui/spacewarpConsole.guiskin", out _spaceWarpUISkin); } private void OnGUI() { + GUI.skin = _spaceWarpUISkin; if (!_drawUI) { return; } int controlID = GUIUtility.GetControlID(FocusType.Passive); - string header = $"Space Warp Console"; + string header = $"spacewarp.console"; GUILayoutOption width = GUILayout.Width((float)(_windowWidth * 0.8)); GUILayoutOption height = GUILayout.Height((float)(_windowHeight * 0.8)); @@ -73,10 +83,10 @@ private void DrawConsole(int windowID) { GUILayout.Label(debugMessage); } - + GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); - + if (GUILayout.Button("Close")) { _drawUI = false; @@ -91,7 +101,7 @@ private void DrawConsole(int windowID) { GameManager.Instance.Game.ViewController.inputLockManager.ClearControlLocks(); } - + GUILayout.EndHorizontal(); GUILayout.EndVertical(); GUI.DragWindow(new Rect(0, 0, 10000, 500));