diff --git a/MenuIconReplacer.meta b/MenuIconReplacer.meta deleted file mode 100644 index 85c3931..0000000 --- a/MenuIconReplacer.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 4a654954dc6cec1489d07ed6e2948696 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Editor.meta b/MenuIconReplacer/Editor.meta deleted file mode 100644 index 5828efb..0000000 --- a/MenuIconReplacer/Editor.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 242e6d8788815f146a868fa94fce66ea -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Editor/MenuIconReplacerEditor.asmdef b/MenuIconReplacer/Editor/MenuIconReplacerEditor.asmdef deleted file mode 100644 index d3b8f12..0000000 --- a/MenuIconReplacer/Editor/MenuIconReplacerEditor.asmdef +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "MenuIconReplacerEditor", - "rootNamespace": "", - "references": [ - "GUID:108c6ed81f83e074fa168f7087c2a246", - "GUID:62ced99b048af7f4d8dfe4bed8373d76", - "GUID:5718fb738711cd34ea54e9553040911d" - ], - "includePlatforms": [ - "Editor" - ], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/MenuIconReplacer/Editor/MenuIconReplacerEditor.asmdef.meta b/MenuIconReplacer/Editor/MenuIconReplacerEditor.asmdef.meta deleted file mode 100644 index 7f4af44..0000000 --- a/MenuIconReplacer/Editor/MenuIconReplacerEditor.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 80b77092c9bbd5b48b726b52e8b9c308 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Editor/MenuIconReplacerInspector.cs b/MenuIconReplacer/Editor/MenuIconReplacerInspector.cs deleted file mode 100644 index a607548..0000000 --- a/MenuIconReplacer/Editor/MenuIconReplacerInspector.cs +++ /dev/null @@ -1,111 +0,0 @@ -using System.Collections.Generic; -using UnityEngine; -using UnityEditor; -using gay.lilyy.MenuIconReplacer; - -namespace gay.lilyy.MenuIconReplacer.Editor -{ - [CustomEditor(typeof(MenuIconReplacerConfig))] - public class MenuIconReplacerInspector : UnityEditor.Editor - { - private SerializedProperty replacementsProperty; - private bool showReplacements = true; - - private void OnEnable() - { - replacementsProperty = serializedObject.FindProperty("replacements"); - } - - public override void OnInspectorGUI() - { - serializedObject.Update(); - - EditorGUILayout.Space(); - EditorGUILayout.LabelField("Menu Icon Replacer", EditorStyles.boldLabel); - EditorGUILayout.HelpBox("Configure texture replacements for menu icons. The left texture will be replaced with the right texture in the expressions menu.", MessageType.Info); - - EditorGUILayout.Space(); - - showReplacements = EditorGUILayout.Foldout(showReplacements, $"Replacements ({replacementsProperty.arraySize})", true); - - if (showReplacements) - { - EditorGUI.indentLevel++; - - // Add new replacement button - EditorGUILayout.BeginHorizontal(); - if (GUILayout.Button("Add Replacement")) - { - replacementsProperty.InsertArrayElementAtIndex(replacementsProperty.arraySize); - } - - if (GUILayout.Button("Clear All") && replacementsProperty.arraySize > 0) - { - if (EditorUtility.DisplayDialog("Clear All Replacements", - "Are you sure you want to clear all replacements?", "Yes", "Cancel")) - { - replacementsProperty.ClearArray(); - } - } - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.Space(); - - // Display replacements - for (int i = 0; i < replacementsProperty.arraySize; i++) - { - var element = replacementsProperty.GetArrayElementAtIndex(i); - var fromProperty = element.FindPropertyRelative("from"); - var toProperty = element.FindPropertyRelative("to"); - - EditorGUILayout.BeginVertical("box"); - - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField($"Replacement {i + 1}", EditorStyles.boldLabel, GUILayout.Width(100)); - - if (GUILayout.Button("Remove", GUILayout.Width(60))) - { - replacementsProperty.DeleteArrayElementAtIndex(i); - break; - } - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("From:", GUILayout.Width(40)); - EditorGUILayout.PropertyField(fromProperty, GUIContent.none); - EditorGUILayout.EndHorizontal(); - - EditorGUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("To:", GUILayout.Width(40)); - EditorGUILayout.PropertyField(toProperty, GUIContent.none); - EditorGUILayout.EndHorizontal(); - - // Validation - var fromTexture = fromProperty.objectReferenceValue as Texture2D; - var toTexture = toProperty.objectReferenceValue as Texture2D; - - if (fromTexture != null && toTexture != null && fromTexture == toTexture) - { - EditorGUILayout.HelpBox("Warning: Source and target textures are the same.", MessageType.Warning); - } - else if (fromTexture != null && toTexture == null) - { - EditorGUILayout.HelpBox("Target texture is not set.", MessageType.Warning); - } - else if (fromTexture == null && toTexture != null) - { - EditorGUILayout.HelpBox("Source texture is not set.", MessageType.Warning); - } - - EditorGUILayout.EndVertical(); - EditorGUILayout.Space(); - } - - EditorGUI.indentLevel--; - } - - serializedObject.ApplyModifiedProperties(); - } - - } -} diff --git a/MenuIconReplacer/Editor/MenuIconReplacerInspector.cs.meta b/MenuIconReplacer/Editor/MenuIconReplacerInspector.cs.meta deleted file mode 100644 index 35a226e..0000000 --- a/MenuIconReplacer/Editor/MenuIconReplacerInspector.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 43cc613e338942941a9a549788e36afc -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Editor/MenuIconReplacerPlugin.cs b/MenuIconReplacer/Editor/MenuIconReplacerPlugin.cs deleted file mode 100644 index c90609b..0000000 --- a/MenuIconReplacer/Editor/MenuIconReplacerPlugin.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Collections.Generic; -using gay.lilyy.MenuIconReplacer; -using nadena.dev.ndmf; -using NUnit.Framework.Constraints; -using UnityEditor; -using UnityEngine; -using VRC.SDK3.Avatars.ScriptableObjects; -using static VRC.SDK3.Avatars.ScriptableObjects.VRCExpressionsMenu; - -[assembly: ExportsPlugin(typeof(MenuIconReplacerPlugin))] - -namespace gay.lilyy.MenuIconReplacer -{ - public class MenuIconReplacerPlugin : Plugin - { - public override string DisplayName => "MenuIconReplacer"; - public override string QualifiedName => "gay.lilyy.MenuIconReplacer"; - - protected override void Configure() - { - InPhase(BuildPhase.Optimizing).BeforePlugin("gay.lilyy.MenuIconRemover").Run("ReplaceMenuIcons", ctx => - { - var obj = ctx.AvatarRootObject.GetComponent(); - if (obj != null) - { - ctx.AvatarDescriptor.expressionsMenu = RecurseMenu(obj, ctx.AvatarDescriptor.expressionsMenu); - Object.DestroyImmediate(obj); - } - }); - } - - private VRCExpressionsMenu RecurseMenu(MenuIconReplacerConfig cfg, VRCExpressionsMenu menu) - { - if (menu == null) return null; - - var newMenu = ScriptableObject.CreateInstance(); - newMenu.controls = new List(); - - foreach (var control in menu.controls) - { - var icon = control.icon; - foreach (var entry in cfg.replacements) - { - if (entry.from == icon) { - icon = entry.to; - } - } - var newControl = new Control - { - name = control.name, - type = control.type, - icon = icon, - parameter = control.parameter, - subMenu = RecurseMenu(cfg, control.subMenu), - value = control.value, - style = control.style, - labels = control.labels, - subParameters = control.subParameters - }; - newMenu.controls.Add(newControl); - } - - return newMenu; - } - } -} diff --git a/MenuIconReplacer/Editor/MenuIconReplacerPlugin.cs.meta b/MenuIconReplacer/Editor/MenuIconReplacerPlugin.cs.meta deleted file mode 100644 index 66926d7..0000000 --- a/MenuIconReplacer/Editor/MenuIconReplacerPlugin.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 5b9fdfa35ac20a541848fa1c355dda23 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Runtime.meta b/MenuIconReplacer/Runtime.meta deleted file mode 100644 index 55dd68b..0000000 --- a/MenuIconReplacer/Runtime.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: dbba2be0d4a22f24abf8cf72fcc0ae76 -folderAsset: yes -DefaultImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Runtime/MenuIconReplacerConfig.cs b/MenuIconReplacer/Runtime/MenuIconReplacerConfig.cs deleted file mode 100644 index 4c4024d..0000000 --- a/MenuIconReplacer/Runtime/MenuIconReplacerConfig.cs +++ /dev/null @@ -1,19 +0,0 @@ - -using System.Collections.Generic; -using UnityEngine; - -namespace gay.lilyy.MenuIconReplacer -{ - [System.Serializable] - public class TextureReplacement - { - public Texture2D from; - public Texture2D to; - } - - public class MenuIconReplacerConfig : MonoBehaviour, VRC.SDKBase.IEditorOnly - { - [HideInInspector] - public List replacements = new List(); - } -} \ No newline at end of file diff --git a/MenuIconReplacer/Runtime/MenuIconReplacerConfig.cs.meta b/MenuIconReplacer/Runtime/MenuIconReplacerConfig.cs.meta deleted file mode 100644 index 9a2af11..0000000 --- a/MenuIconReplacer/Runtime/MenuIconReplacerConfig.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: a6d76942481598d4b8d9c823b1f809c0 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuIconReplacer/Runtime/MenuIconReplacerRuntime.asmdef b/MenuIconReplacer/Runtime/MenuIconReplacerRuntime.asmdef deleted file mode 100644 index 80b3b3a..0000000 --- a/MenuIconReplacer/Runtime/MenuIconReplacerRuntime.asmdef +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "MenuIconReplacerRuntime", - "rootNamespace": "", - "references": [], - "includePlatforms": [], - "excludePlatforms": [], - "allowUnsafeCode": false, - "overrideReferences": false, - "precompiledReferences": [], - "autoReferenced": true, - "defineConstraints": [], - "versionDefines": [], - "noEngineReferences": false -} \ No newline at end of file diff --git a/MenuIconReplacer/Runtime/MenuIconReplacerRuntime.asmdef.meta b/MenuIconReplacer/Runtime/MenuIconReplacerRuntime.asmdef.meta deleted file mode 100644 index 774a310..0000000 --- a/MenuIconReplacer/Runtime/MenuIconReplacerRuntime.asmdef.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: 108c6ed81f83e074fa168f7087c2a246 -AssemblyDefinitionImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/MenuStyling/Editor/MenuStylingPlugin.cs b/MenuStyling/Editor/MenuStylingPlugin.cs index ce462ee..4b39d56 100644 --- a/MenuStyling/Editor/MenuStylingPlugin.cs +++ b/MenuStyling/Editor/MenuStylingPlugin.cs @@ -58,7 +58,6 @@ namespace gay.lilyy.MenuStyling { foreach (var child in menu.controls) { - if (child.name != " " && child.name != "" && child.name != null) { if (!child.name.StartsWith(config.Prefix)) { child.name = config.Prefix + child.name; @@ -67,8 +66,6 @@ namespace gay.lilyy.MenuStyling { child.name += config.Suffix; } - - } if (child.type == Control.ControlType.SubMenu && child.subMenu != null) { WalkMenu(config, child.subMenu);