-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to show/hide keycode in flight
- Loading branch information
Showing
4 changed files
with
144 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.IO; | ||
|
||
using UnityEngine; | ||
|
||
|
||
namespace ActionGroupsExtended | ||
{ | ||
|
||
public class AGXMethods : PartModule | ||
{ | ||
|
||
|
||
//public static void SettingsWindow(int WindowID) | ||
//{ | ||
// if(GUI.Button(new Rect(10, 25, 130, 40), "Show KeyCodes in\nFlight Window")) | ||
// { | ||
// AGXFlight.FlightWinShowKeycodes = !AGXFlight.FlightWinShowKeycodes; | ||
// } | ||
|
||
|
||
// GUI.DragWindow(); | ||
//} | ||
}//AGXMethods closing bracket | ||
|
||
public class SettingsWindow : MonoBehaviour, IDrawable | ||
{ | ||
public Rect SettingsWin = new Rect(0, 0, 150, 75); | ||
public Vector2 Draw(Vector2 position) | ||
{ | ||
var oldSkin = GUI.skin; | ||
GUI.skin = HighLogic.Skin; | ||
|
||
SettingsWin.x = position.x; | ||
SettingsWin.y = position.y; | ||
|
||
GUI.Window(2233452, SettingsWin, DrawSettingsWin, "AGX Settings", AGXFlight.AGXWinStyle); | ||
//RCSlaWin = GUILayout.Window(42334567, RCSlaWin, DrawWin, (string)null, GUI.skin.box); | ||
//GUI.skin = oldSkin; | ||
|
||
return new Vector2(SettingsWin.width, SettingsWin.height); | ||
} | ||
|
||
public void DrawSettingsWin(int WindowID) | ||
{ | ||
|
||
if (GUI.Button(new Rect(10, 25, 130, 40), "Show KeyCodes in\nFlight Window")) | ||
{ | ||
AGXFlight.FlightWinShowKeycodes = !AGXFlight.FlightWinShowKeycodes; | ||
if (AGXFlight.FlightWinShowKeycodes) | ||
{ | ||
AGXFlight.AGExtNode.SetValue("FlightWinShowKeys", "1"); | ||
} | ||
else | ||
{ | ||
AGXFlight.AGExtNode.SetValue("FlightWinShowKeys", "0"); | ||
} | ||
AGXFlight.AGExtNode.Save(KSPUtil.ApplicationRootPath + "GameData/Diazo/AGExt/AGExt.cfg"); | ||
} | ||
|
||
|
||
//GUI.DragWindow(); | ||
|
||
} | ||
|
||
public void Update() | ||
{ | ||
//print("Test"); | ||
} | ||
} | ||
}//name space closing bracket |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters