Skip to content

Commit

Permalink
Merge pull request #45 from Alexejhero/tri-inspector-AND-csc-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexejhero authored Nov 5, 2023
2 parents 190fdee + ec5c9fc commit acb41ac
Show file tree
Hide file tree
Showing 192 changed files with 1,116 additions and 1,638 deletions.
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

0 comments on commit acb41ac

Please sign in to comment.