Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch to Tri-Inspector #45

Merged
merged 21 commits into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
7beeee4
Add tri inspector fork
Alexejhero Nov 5, 2023
389ccd9
Replace naugthyattributes with local clone (to delete stuff slowly)
Alexejhero Nov 5, 2023
6461d03
Remove ValidateType attribute
Alexejhero Nov 5, 2023
e288c44
Add TriMonoBehaviour and update Plugins files to TriInspector
Alexejhero Nov 5, 2023
ba45f23
more tri inspector stuff
Alexejhero Nov 5, 2023
4f0011c
start updating classes
Alexejhero Nov 5, 2023
66646e7
update all of the base-game scripts to tri-inspector
Alexejhero Nov 5, 2023
de4e770
Mark NA stuff as obsolete so i can keep track of it
Alexejhero Nov 5, 2023
39fe7d5
Update everything to Tri-Inspector on the unity side
Alexejhero Nov 5, 2023
5104f08
fix mod side
Alexejhero Nov 5, 2023
8e5394c
Rebuild asset bundles
Alexejhero Nov 5, 2023
3e62989
Merge remote-tracking branch 'origin/csc-settings' into tri-inspector…
Alexejhero Nov 5, 2023
0248267
Create patch to disable annoying csc settings log
Alexejhero Nov 5, 2023
7035b58
Create patch to disable annoying csc settings log
Alexejhero Nov 5, 2023
a819490
Remove old unused attributes
Alexejhero Nov 5, 2023
ebf1633
Update usages of removed attributes
Alexejhero Nov 5, 2023
0e6171c
Merge branch 'changes-on-top-of-everything' into tri-inspector-AND-cs…
Alexejhero Nov 5, 2023
84a7941
tiny tiny thing
Govorunb Nov 5, 2023
82bf144
take NaughtyAttributes out to grandpa's farm where it can live a happ…
Govorunb Nov 5, 2023
690e986
Govorunb Nov 5, 2023
ec5c9fc
Update SCHIZO/Helpers/StaticHelpers.cs
Alexejhero Nov 5, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- uses: actions/setup-dotnet@v3
with:
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Unity/Packages/Tri-Inspector"]
path = Unity/Packages/Tri-Inspector
url = https://github.com/Alexejhero/Tri-Inspector/
15 changes: 9 additions & 6 deletions SCHIZO/Helpers/StaticHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using HarmonyLib;
using NaughtyAttributes;
using TriInspector;

namespace SCHIZO.Helpers;

Expand All @@ -13,11 +14,13 @@ partial class CacheAttribute
{
public static void CacheAll()
{
PLUGIN_ASSEMBLY.GetTypes().SelectMany(t => t.GetFields(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))
.Where(f => f.GetCustomAttribute<CacheAttribute>() != null)
.Select(f => (IDropdownList) f.GetValue(null))
.Select(d => d.Select(kvp => (string) kvp.Value))
.ForEach(CacheValues);
IEnumerable<string> names = PLUGIN_ASSEMBLY.GetTypes()
.SelectMany(t => t.GetMethods(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic))
.Where(m => m.GetCustomAttribute<CacheAttribute>() != null)
.SelectMany(m => (IEnumerable<ITriDropdownItem>) m.Invoke(null, Array.Empty<object>()))
.Select(i => i.Value.ToString());

CacheValues(names);
}
}

Expand Down
112 changes: 0 additions & 112 deletions SCHIZO/Interop/NaughtyAttributes/NaughtyAttributesInterop.cs

This file was deleted.

2 changes: 1 addition & 1 deletion SCHIZO/Resources/AssetBundles/Assets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace SCHIZO.Resources;

public static class Assets
{
private const int _rnd = 228879590;
private const int _rnd = -684662253;

private static readonly UnityEngine.AssetBundle _a = ResourceManager.GetAssetBundle("assets");

Expand Down
Binary file modified SCHIZO/Resources/AssetBundles/assets
Binary file not shown.
2 changes: 2 additions & 0 deletions SCHIZO/SCHIZO.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
<DependentUpon>%(FileName).cs</DependentUpon>
</Compile>
<Compile Remove="$(SolutionDir)/Unity/Assets/Scripts/SCHIZO/**/*.Unity.cs" />

<Compile Include="$(SolutionDir)/Unity/Packages/Tri-Inspector/Runtime/**/*.cs" LinkBase="TriInspector/Linked" />

<Folder Include="Attributes" />
<Folder Include="Attributes/Typing" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using NaughtyAttributes.Editor;
using SCHIZO.Registering;
using SCHIZO.Registering;
using TriInspector.Editors;
using UnityEditor;
using UnityEngine;

namespace Editor.Scripts.Inspectors
{
[CustomEditor(typeof(ModRegistryItem), true)]
public class ModRegistryItemInspector : NaughtyInspector
public class ModRegistryItemInspector : TriEditor
{
private GUIStyle _toggle;

Expand Down
10 changes: 4 additions & 6 deletions Unity/Assets/Editor/Scripts/Inspectors/RecipeInspector.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Editor.Scripts.PropertyDrawers;
using NaughtyAttributes.Editor;
using SCHIZO.Items.Data.Crafting;
using TriInspector.Editors;
using UnityEditor;

namespace Editor.Scripts.Inspectors
{
[CustomEditor(typeof(Recipe))]
public sealed class RecipeInspector : NaughtyInspector
public sealed class RecipeInspector : TriEditor
{
public override void OnInspectorGUI()
{
Expand All @@ -16,16 +16,14 @@ public override void OnInspectorGUI()
TechType_AllDrawer.TargetGame = recipe.game;
}

private new void OnEnable()
private void OnEnable()
{
base.OnEnable();
Recipe recipe = (Recipe) target;
TechType_AllDrawer.TargetGame = recipe.game;
}

private new void OnDisable()
private void OnDisable()
{
base.OnDisable();
TechType_AllDrawer.TargetGame = 0;
}
}
Expand Down
3 changes: 0 additions & 3 deletions Unity/Assets/Editor/Scripts/NaughtyExtensions.meta

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions Unity/Assets/Editor/Scripts/NaughtyExtensions/Validators.meta

This file was deleted.

Loading