Skip to content

Commit

Permalink
Tidy up for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
jamioflan committed Feb 19, 2024
1 parent f8a514c commit 22effa5
Show file tree
Hide file tree
Showing 204 changed files with 145,800 additions and 160 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes.
145,776 changes: 145,776 additions & 0 deletions Assets/Scenes/ContentToolScene.unity

Large diffs are not rendered by default.

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

122 changes: 15 additions & 107 deletions Assets/Scripts/Editor/FlansModToolbox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,21 @@ public static void ShowWindow ()
GetWindow(typeof(FlansModToolbox));
}

[MenuItem("Flan's Mod/Export .unitypackage")]
public static void ExportUnityPackage()
{
List<string> exportedAssetPaths = new List<string>();

exportedAssetPaths.Add("Assets/Content Packs/flansmod");
exportedAssetPaths.Add("Assets/Content Packs/forge");
exportedAssetPaths.Add("Assets/Editor");
exportedAssetPaths.Add("Assets/Gizmos");
exportedAssetPaths.Add("Assets/Scripts");
exportedAssetPaths.Add("Assets/Scenes/ContentToolScene.unity");

AssetDatabase.ExportPackage(exportedAssetPaths.ToArray(), "flans_content_tool.unitypackage", ExportPackageOptions.Recurse | ExportPackageOptions.IncludeDependencies);
}

public void OnEnable()
{
EditorApplication.update += Repaint;
Expand Down Expand Up @@ -60,113 +75,6 @@ void OnGUI()
}
GUILayout.EndVertical();
GUILayout.EndScrollView();

// Temp - For Flan if I need to iterate some things in editor quickly
if (GUILayout.Button("Do the thing"))
{


string[] guids = AssetDatabase.FindAssets("t:Definition");
foreach (string guid in guids)
{
string path = AssetDatabase.GUIDToAssetPath(guid);
if (path != null)
{
Definition def = AssetDatabase.LoadAssetAtPath<Definition>(path);
//FlanimationDefinition anim = AssetDatabase.LoadAssetAtPath<FlanimationDefinition>(path);
//foreach (KeyframeDefinition keyframe in anim.keyframes)
//{
// foreach (PoseDefinition pose in keyframe.poses)
// {
// pose.position = new VecWithOverride()
// {
// xValue = pose.position.zValue,
// yValue = pose.position.yValue,
// zValue = -pose.position.xValue,
// xOverride = pose.position.xOverride,
// yOverride = pose.position.yOverride,
// zOverride = pose.position.zOverride
// };
// pose.rotation = new VecWithOverride()
// {
// xValue = -pose.rotation.zValue,
// yValue = pose.rotation.yValue,
// zValue = pose.rotation.xValue,
// xOverride = pose.rotation.xOverride,
// yOverride = pose.rotation.yOverride,
// zOverride = pose.rotation.zOverride
// };
// }
//}
EditorUtility.SetDirty(def);
}
}


/*
string[] guids = AssetDatabase.FindAssets("t:TurboRig");
foreach (string guid in guids)
{
string path = AssetDatabase.GUIDToAssetPath(guid);
if (path != null)
{
TurboRig rig = AssetDatabase.LoadAssetAtPath<TurboRig>(path);
foreach (ItemTransform transform in rig.Transforms)
{
if(transform.Type == ItemTransformType.FIRST_PERSON_LEFT_HAND ||
transform.Type == ItemTransformType.FIRST_PERSON_RIGHT_HAND)
{
transform.Rotation = Quaternion.Euler(0f, -90f, 0f);
}
}
foreach(AttachPoint ap in rig.AttachPoints)
{
if(ap.name == "laser_origin" || ap.name == "shoot_origin" || ap.name == "eye_line"
|| ap.name.StartsWith("barrel")
|| ap.name.StartsWith("stock")
|| ap.name.StartsWith("grip")
|| ap.name.StartsWith("sights"))
{
if(Mathf.Approximately(ap.euler.y, 0f))
{
TurboModel section = rig.GetSection(ap.name);
if(section != null)
{
foreach(TurboPiece piece in section.Pieces)
{
piece.Pos += Quaternion.Euler(piece.Euler) * piece.Origin;
piece.Origin = Vector3.zero;
piece.Euler += new Vector3(0f, 90f, 0f);
}
}
}
ap.euler = new Vector3(0, -90f, 0f);
}
else if(ap.name == "barrel" || ap.name == "grip" || ap.name == "")
{
//ap.euler = new Vector3(0f, 90f, 0f);
}
}
EditorUtility.SetDirty(rig);
}
}
*/
/*
guids = AssetDatabase.FindAssets("t:MagazineDefinition");
foreach (string guid in guids)
{
string path = AssetDatabase.GUIDToAssetPath(guid);
if (path != null)
{
MagazineDefinition mag = AssetDatabase.LoadAssetAtPath<MagazineDefinition>(path);
foreach (ModifierDefinition modifier in mag.modifiers)
if (modifier.ApplyFilters.Length > 0 && modifier.ApplyFilters[0] == "primary_reload")
modifier.ApplyFilters[0] = "reload_primary";
EditorUtility.SetDirty(mag);
}
}
*/
}
}

// -------------------------------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Editor/SceneViewTools/BoxBoundsTool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class BoxBoundsTool : MinecraftModelEditorTool<BoxGeometryNode>

public void OnEnable()
{
FlanCustomButtons.BoxBoundsTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/shapebox_bounds.png");
FlanCustomButtons.BoxBoundsTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/shapebox_bounds.png");
}
public void OnDisable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ColourPaintingTool : MinecraftModelPaintingTool
public override void OnEnable()
{
base.OnEnable();
BrushTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/paint_color.png");
BrushTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/paint_color.png");
}
public override void OnDisable()
{
Expand All @@ -34,7 +34,7 @@ public abstract class MinecraftModelPaintingTool : EditorTool
protected Texture2D BrushTexture = null;
public virtual void OnEnable()
{
ToolbarIcon = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/model_painting.png");
ToolbarIcon = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/model_painting.png");
}
public virtual void OnDisable()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public class ShapeboxCornersTool : MinecraftModelEditorTool<ShapeboxGeometryNode

public void OnEnable()
{
FlanCustomButtons.ShapeboxCornersTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/shapebox_corners.png");
FlanCustomButtons.ShapeboxCornersTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/shapebox_corners.png");
}
public void OnDisable()
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Assets/EditorAssets.meta → Assets/Scripts/Import.meta

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

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions Assets/Scripts/ImportExport/ImportExportTools.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/Scripts/ImportExport/ImportExportTools.cs.meta

This file was deleted.

File renamed without changes.
File renamed without changes.
8 changes: 0 additions & 8 deletions Assets/Scripts/Sounds.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/UnityModels/Editor.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/Scripts/UnityModels/ImportExport.meta

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Assets/Scripts/Util/Verification.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,9 +166,9 @@ public static class GUIVerify
private static bool ShowNeutral = true;
private static bool ShowFail = true;

public static Texture2D TickTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/tick.png");
public static Texture2D NeutralTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/neutral.png");
public static Texture2D CrossTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/EditorAssets/cross.png");
public static Texture2D TickTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/tick.png");
public static Texture2D NeutralTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/neutral.png");
public static Texture2D CrossTexture = AssetDatabase.LoadAssetAtPath<Texture2D>("Assets/Editor/Resources/cross.png");

public static GUILayoutOption[] OBJECT_FIELD_OPTIONS = new GUILayoutOption[] { GUILayout.Width(128) };
public static GUILayoutOption[] STATUS_ICON_OPTIONS = new GUILayoutOption[] { GUILayout.Width(24) };
Expand Down

0 comments on commit 22effa5

Please sign in to comment.