Skip to content

Commit

Permalink
Moved initialization of GUIStyles into Start
Browse files Browse the repository at this point in the history
 Made window 70 pixels higher
  • Loading branch information
linuxgurugamer committed Feb 19, 2020
1 parent eb6b356 commit 88a0a3a
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 16 deletions.
Binary file modified .vs/KRnD/v16/Server/sqlite3/storage.ide
Binary file not shown.
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Changelog

1.16.0.2
Moved initialization of GUIStyles into Start
Made window 70 pixels higher, thanks to @leatherneck6017 for the change

1.16.0.1
Fixed index out of range

Expand Down
2 changes: 1 addition & 1 deletion GameData/KRnD/KRnD.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"MAJOR": 1,
"MINOR": 16,
"PATCH": 0,
"BUILD": 1
"BUILD": 2
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
Expand Down
2 changes: 1 addition & 1 deletion KRnD.version
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"MAJOR": 1,
"MINOR": 16,
"PATCH": 0,
"BUILD": 1
"BUILD": 2
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
Expand Down
2 changes: 1 addition & 1 deletion Source/AssemblyVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@

using System.Reflection;

[assembly: AssemblyVersion("1.16.0.1")]
[assembly: AssemblyVersion("1.16.0.2")]
29 changes: 16 additions & 13 deletions Source/KRnDGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,12 @@ namespace KRnD
[KSPAddon(KSPAddon.Startup.EditorAny, false)]
public class KRnDGUI : UnityEngine.MonoBehaviour
{
// TODO: The Application-Button shows up during the flight scene ...
//private static ApplicationLauncherButton button = null;
public static Rect windowPosition = new Rect(300, 60, 450, 400);
private static GUIStyle windowStyle = new GUIStyle(HighLogic.Skin.window) { fixedWidth = 500f, fixedHeight = 300f };
private static GUIStyle labelStyle = new GUIStyle(HighLogic.Skin.label);
private static GUIStyle labelStyleSmall = new GUIStyle(HighLogic.Skin.label) { fontSize = 10 };
private static GUIStyle buttonStyle = new GUIStyle(HighLogic.Skin.button);
private static GUIStyle scrollStyle = new GUIStyle(HighLogic.Skin.scrollView);
private static GUIStyle windowStyle;
private static GUIStyle labelStyle;
private static GUIStyle labelStyleSmall;
private static GUIStyle buttonStyle;
private static GUIStyle scrollStyle;
private static Vector2 scrollPos = Vector2.zero;
// private static Texture2D texture = null;
private static bool showGui = false;
Expand All @@ -40,13 +38,18 @@ public class KRnDGUI : UnityEngine.MonoBehaviour

void Awake()
{

windowPosition = new Rect(300, 60, 450, 400);
windowStyle = new GUIStyle(HighLogic.Skin.window) { fixedWidth = 500f, fixedHeight = 370 };
labelStyle = new GUIStyle(HighLogic.Skin.label);
labelStyleSmall = new GUIStyle(HighLogic.Skin.label) { fontSize = 10 };
buttonStyle = new GUIStyle(HighLogic.Skin.button);
scrollStyle = new GUIStyle(HighLogic.Skin.scrollView);
scrollPos = Vector2.zero;

ReadyEvent();

}

// Fires when a scene is ready so we can install our button.
public void ReadyEvent()
{
if (toolbarControl != null)
Expand Down Expand Up @@ -407,7 +410,7 @@ private String getPartInfo(Part part, KRnDUpgrade upgradesToApply = null)
for (int i = 0; i < fuelResources.Count; i++)
{
PartResource fuelResource = fuelResources[i];

// Reformat resource-names like "ElectricCharge" to "Electric Charge":
String fuelName = fuelResource.resourceName.ToString();
fuelName = Regex.Replace(fuelName, @"([a-z])([A-Z])", "$1 $2");
Expand All @@ -422,7 +425,7 @@ private String getPartInfo(Part part, KRnDUpgrade upgradesToApply = null)
for (int i = 0; i < engineModules.Count; i++)
{
ModuleEngines engineModule = engineModules[i];

info += "<color=#99FF00><b>Engine";
if (engineModules.Count > 1) info += " (" + engineModule.engineID.ToString() + ")";
info += ":</b></color>\n" + engineModule.GetInfo();
Expand All @@ -439,7 +442,7 @@ private String getPartInfo(Part part, KRnDUpgrade upgradesToApply = null)
for (int i = 0; i < converterModules.Count; i++)
{
ModuleResourceConverter converterModule = converterModules[i];

info += "<color=#99FF00><b>Converter " + converterModule.ConverterName + ":</b></color>\n" + converterModule.GetInfo() + "\n";
}
}
Expand Down Expand Up @@ -855,7 +858,7 @@ private void OnWindow(int windowId)
if (m.moduleName == "R&D")
{
AvailablePart.ModuleInfo info = m;
m.info = KRnDModule.GetInfo(part) ;
m.info = KRnDModule.GetInfo(part);
break;
}
}
Expand Down

0 comments on commit 88a0a3a

Please sign in to comment.