Skip to content

Commit

Permalink
Initial Commit for 0.1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cheese3660 committed Oct 28, 2023
1 parent fb91efd commit 91f3bcd
Show file tree
Hide file tree
Showing 31 changed files with 1,581 additions and 1,381 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ crashlytics-build.properties
# IDEA
.idea/

# Settings
Assets/KSP2UTSettings.asset
Assets/KSP2UTSettings.meta
Assets/Thunderkit*
Assets/StreamingAssets


# Copyrighted Packages
Packages/KSP2_x64
Assets/engine_0v_xenon_dawn*
Expand Down
2 changes: 1 addition & 1 deletion Assets/Gizmos.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Assets/KSP2UTSettings.asset.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/KSP2UnityTools.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/KSP2UnityTools/Editor/AssetLocalizationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using UnityEditor;
using Cheese.Extensions;
[CustomEditor(typeof(LanguageSourceAsset))]
public class AssetLocalizationEditor : Editor
public class AssetLocalizationEditor : UnityEditor.Editor
{
private Dictionary<string, bool> termFoldouts = new Dictionary<string, bool>();
private Dictionary<string, bool> titleFoldouts = new Dictionary<string, bool>();
Expand Down
2 changes: 1 addition & 1 deletion Assets/KSP2UnityTools/Editor/EngineDataEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using UnityEngine;

[CustomEditor(typeof(Module_Engine))]
public class EngineDataEditor : Editor
public class EngineDataEditor : UnityEditor.Editor
{
// [DrawGizmo(GizmoType.Active | GizmoType.Selected)]
// public static void DrawGizmoForEngineData(Module_Engine engine, GizmoType gizmoType)
Expand Down
27 changes: 27 additions & 0 deletions Assets/KSP2UnityTools/Editor/KSP2UnityToolsManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using KSP2UT.KSP2UnityTools;
using UnityEditor;
using UnityEngine;
using UnityEngine.Windows;

namespace Editor.KSP2UnityTools.Editor
{

public static class KSP2UnityToolsManager
{
public static readonly KSP2UnityToolsSettings Settings;

static KSP2UnityToolsManager()
{
if (!File.Exists("Assets/KSP2UTSettings.asset"))
{
Settings = ScriptableObject.CreateInstance<KSP2UnityToolsSettings>();
AssetDatabase.CreateAsset(Settings, "Assets/KSP2UTSettings.asset");
AssetDatabase.SaveAssets();
}
else
{
Settings = AssetDatabase.LoadAssetAtPath<KSP2UnityToolsSettings>("Assets/KSP2UTSettings.asset");
}
}
}
}
11 changes: 11 additions & 0 deletions Assets/KSP2UnityTools/Editor/KSP2UnityToolsManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/KSP2UnityTools/Editor/LocalizationEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using UnityEditor;

[CustomEditor(typeof(LanguageSource))]
public class LocalizationEditor : Editor
public class LocalizationEditor : UnityEditor.Editor
{
private SerializedProperty _onMissingTranslation;
private Dictionary<string, bool> termFoldouts = new Dictionary<string, bool>();
Expand Down
2 changes: 1 addition & 1 deletion Assets/KSP2UnityTools/Editor/ModuleDragEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using UnityEngine;

[CustomEditor(typeof(Module_Drag))]
public class ModuleDragEditor : Editor
public class ModuleDragEditor : UnityEditor.Editor
{
[DrawGizmo(GizmoType.Active | GizmoType.Selected)]
public static void DrawGizmosForDrag(Module_Drag moduleDrag, GizmoType gizmoType)
Expand Down
14 changes: 11 additions & 3 deletions Assets/KSP2UnityTools/Editor/PartEditor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.IO;
using System.Reflection;
using Editor.KSP2UnityTools.Editor;
using KSP;
using UnityEditor;
using KSP.IO;
Expand All @@ -9,13 +10,13 @@
using UnityEngine;

[CustomEditor(typeof(CorePartData))]
public class PartEditor : Editor
public class PartEditor : UnityEditor.Editor
{

private static bool _initialized = false;
private static readonly Color ComColor = new Color(Color.yellow.r, Color.yellow.g, Color.yellow.b, 0.5f);

private static string _jsonPath = "%NAME%.json";
// private static string _jsonPath = "%NAME%.json";

private static bool _centerOfMassGizmos = true;
private static bool _centerOfLiftGizmos = true;
Expand Down Expand Up @@ -87,7 +88,14 @@ public override void OnInspectorGUI()
EditorUtility.SetDirty(target);
}
GUILayout.Label("Part Saving", EditorStyles.boldLabel);
_jsonPath = EditorGUILayout.TextField("JSON Path",_jsonPath);
string _jsonPath = "%NAME%.json";
if (KSP2UnityToolsManager.Settings.gameObjectPaths.ContainsKey(TargetObject.name))
{
_jsonPath = KSP2UnityToolsManager.Settings.gameObjectPaths[TargetObject.name];
}
// _jsonPath = EditorGUILayout.TextField("JSON Path",_jsonPath);
KSP2UnityToolsManager.Settings.gameObjectPaths[TargetObject.name] =
_jsonPath = EditorGUILayout.TextField("JSON Path", _jsonPath);
if (!GUILayout.Button("Save Part JSON")) return;
if (!_initialized) Initialize();
if (TargetCore == null) return;
Expand Down
11 changes: 11 additions & 0 deletions Assets/KSP2UnityTools/KSP2UnityToolsSettings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System.Collections.Generic;
using UnityEngine;

namespace KSP2UT.KSP2UnityTools
{

public class KSP2UnityToolsSettings : ScriptableObject
{
public Dictionary<string, string> gameObjectPaths = new();
}
}
11 changes: 11 additions & 0 deletions Assets/KSP2UnityTools/KSP2UnityToolsSettings.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Assets/Scenes.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 91f3bcd

Please sign in to comment.