Skip to content

Commit

Permalink
Thanks to forum user @ozraven for this:
Browse files Browse the repository at this point in the history
  Fixed a null ref which occurred when clicking in a debug window
  • Loading branch information
linuxgurugamer committed Apr 9, 2023
1 parent 86eebcd commit 5a60584
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 14 deletions.
4 changes: 4 additions & 0 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
ChangeLog

3.4.3.6
Thanks to forum user @ozraven for this:
Fixed a null ref which occurred when clicking in a debug window

3.4.3.5
Added AssemblyFileVersion
Updated version file for 1.12
Expand Down
4 changes: 2 additions & 2 deletions EditorExtensionsRedux.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
"MAJOR": 3,
"MINOR": 4,
"PATCH": 3,
"BUILD": 5
"BUILD": 6
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 12,
"PATCH": 0
"PATCH": 5
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
Expand Down
4 changes: 2 additions & 2 deletions EditorExtensionsRedux/AssemblyVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@

using System.Reflection;

[assembly: AssemblyVersion("3.4.3.4")]
[assembly: AssemblyFileVersion("3.4.3.4")]
[assembly: AssemblyVersion("3.4.3.6")]
[assembly: AssemblyFileVersion("3.4.3.6")]
2 changes: 1 addition & 1 deletion EditorExtensionsRedux/EditorExtensionsRedux.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1479,7 +1479,7 @@ public class Config
//var gizmosRotate = HighLogic.FindObjectsOfType<EditorGizmos.GizmoRotate> ();
// if (gizmoRotateHandle == null)
// gizmoRotateHandle = HighLogic.FindObjectOfType<EditorGizmos.GizmoRotateHandle> ();
float rotation = FineAdjustWindow.Instance.rotation;
float rotation = FineAdjustWindow.Instance.rotationZZ;

if (Input.GetKey(cfg.KeyMap.Down))
{
Expand Down
12 changes: 6 additions & 6 deletions EditorExtensionsRedux/FineAdjustWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ enum AdjustmentType
AdjustmentType adjType = AdjustmentType.translation;
string adjTypeStr = "Translation";
public float offset = 0.01f;
public float rotation = 1.0f;
public float rotationZZ = 1.0f;
public int offsetDeltaIndex = 2;
public int rotationdeltaIndex = 0;

Expand Down Expand Up @@ -205,9 +205,9 @@ void WindowContent (int windowID)
if (GUILayout.Button ("-", GUILayout.Width (20))) {
switch (adjType) {
case AdjustmentType.rotation:
rotation -= getDelta (rotationdeltaIndex);
if (rotation <= 0.0f)
rotation = getDelta (rotationdeltaIndex);
rotationZZ -= getDelta (rotationdeltaIndex);
if (rotationZZ <= 0.0f)
rotationZZ = getDelta (rotationdeltaIndex);

break;
case AdjustmentType.translation:
Expand All @@ -220,7 +220,7 @@ void WindowContent (int windowID)
}
switch (adjType) {
case AdjustmentType.rotation:
GUILayout.Label (rotation.ToString (), "TextField");
GUILayout.Label (rotationZZ.ToString (), "TextField");
break;
case AdjustmentType.translation:
GUILayout.Label (offset.ToString (), "TextField");
Expand All @@ -230,7 +230,7 @@ void WindowContent (int windowID)
if (GUILayout.Button ("+", GUILayout.Width (20))) {
switch (adjType) {
case AdjustmentType.rotation:
rotation += getDelta (rotationdeltaIndex);
rotationZZ += getDelta (rotationdeltaIndex);
break;
case AdjustmentType.translation:
offset += getDelta (offsetDeltaIndex);
Expand Down
2 changes: 1 addition & 1 deletion EditorExtensionsRedux/StockSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public override bool Enabled(MemberInfo member, GameParameters parameters)
return true;
}

bool unread = false;
//bool unread = false;
public override bool Interactible(MemberInfo member, GameParameters parameters)
{

Expand Down
2 changes: 1 addition & 1 deletion EditorExtensionsRedux/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static Part GetPartUnderCursor()
EditorLogic ed = EditorLogic.fetch;
if (ed != null && Physics.Raycast(ray, out hit))
{
return ed.ship.Parts.Find(p => p.gameObject == hit.transform.gameObject);
return ed.ship.Parts.Find(p => p != null && p.gameObject == hit.transform.gameObject);
}
return null;
}
Expand Down
7 changes: 6 additions & 1 deletion GameData/EditorExtensionsRedux/EditorExtensionsRedux.version
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"MAJOR": 3,
"MINOR": 4,
"PATCH": 3,
"BUILD": 4
"BUILD": 6
},
"KSP_VERSION": {
"MAJOR": 1,
"MINOR": 12,
"PATCH": 5
},
"KSP_VERSION_MIN": {
"MAJOR": 1,
Expand Down

0 comments on commit 5a60584

Please sign in to comment.