Initial Commit
This commit is contained in:
commit
13767d3f40
160 changed files with 51070 additions and 0 deletions
8
MenuIconRemover/Editor.meta
Normal file
8
MenuIconRemover/Editor.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 948f289759c351a47b3c71826e0965f0
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
20
MenuIconRemover/Editor/MenuIconRemoverEditor.asmdef
Normal file
20
MenuIconRemover/Editor/MenuIconRemoverEditor.asmdef
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"name": "MenuIconRemoverEditor",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:4713dd3cf2e7fa34cbc6bbb6fef3c7d0",
|
||||
"GUID:62ced99b048af7f4d8dfe4bed8373d76",
|
||||
"GUID:5718fb738711cd34ea54e9553040911d"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
7
MenuIconRemover/Editor/MenuIconRemoverEditor.asmdef.meta
Normal file
7
MenuIconRemover/Editor/MenuIconRemoverEditor.asmdef.meta
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 1102caa0eff2ce34cab49e5f13743772
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
80
MenuIconRemover/Editor/MenuIconRemoverPlugin.cs
Normal file
80
MenuIconRemover/Editor/MenuIconRemoverPlugin.cs
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
using System.Collections.Generic;
|
||||
using gay.lilyy.MenuIconRemover;
|
||||
using nadena.dev.ndmf;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using VRC.SDK3.Avatars.ScriptableObjects;
|
||||
using static VRC.SDK3.Avatars.ScriptableObjects.VRCExpressionsMenu;
|
||||
|
||||
[assembly: ExportsPlugin(typeof(MenuIconRemoverPlugin))]
|
||||
|
||||
namespace gay.lilyy.MenuIconRemover
|
||||
{
|
||||
public class MenuIconRemoverPlugin : Plugin<MenuIconRemoverPlugin>
|
||||
{
|
||||
public override string DisplayName => "MenuIconRemover";
|
||||
public override string QualifiedName => "gay.lilyy.MenuIconRemover";
|
||||
|
||||
protected override void Configure()
|
||||
{
|
||||
InPhase(BuildPhase.Optimizing).BeforePlugin("gay.lilyy.MenuStyling").Run("RemoveMenuIcons", ctx =>
|
||||
{
|
||||
var obj = ctx.AvatarRootObject.GetComponent<MenuIconRemoverConfig>();
|
||||
if (obj != null)
|
||||
{
|
||||
var shouldRemove = false;
|
||||
if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.Android)
|
||||
{
|
||||
shouldRemove = obj.removeOnQuest;
|
||||
}
|
||||
else if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows ||
|
||||
EditorUserBuildSettings.activeBuildTarget == BuildTarget.StandaloneWindows64)
|
||||
{
|
||||
shouldRemove = obj.removeOnPc;
|
||||
}
|
||||
if (shouldRemove)
|
||||
{
|
||||
ctx.AvatarDescriptor.expressionsMenu = DuplicateMenu(obj, ctx.AvatarDescriptor.expressionsMenu);
|
||||
Object.DestroyImmediate(obj);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private VRCExpressionsMenu DuplicateMenu(MenuIconRemoverConfig cfg, VRCExpressionsMenu menu)
|
||||
{
|
||||
if (menu == null) return null;
|
||||
|
||||
var newMenu = ScriptableObject.CreateInstance<VRCExpressionsMenu>();
|
||||
newMenu.controls = new List<Control>();
|
||||
|
||||
foreach (var control in menu.controls)
|
||||
{
|
||||
var shouldEdit = true;
|
||||
foreach (var exclude in cfg.exclude)
|
||||
{
|
||||
if (control.name == exclude)
|
||||
{
|
||||
shouldEdit = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
var newControl = new Control
|
||||
{
|
||||
name = control.name,
|
||||
type = control.type,
|
||||
icon = shouldEdit ? null : control.icon,
|
||||
parameter = control.parameter,
|
||||
subMenu = shouldEdit ? DuplicateMenu(cfg, control.subMenu) : control.subMenu,
|
||||
value = control.value,
|
||||
style = control.style,
|
||||
labels = control.labels,
|
||||
subParameters = control.subParameters
|
||||
};
|
||||
newMenu.controls.Add(newControl);
|
||||
}
|
||||
|
||||
return newMenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
MenuIconRemover/Editor/MenuIconRemoverPlugin.cs.meta
Normal file
11
MenuIconRemover/Editor/MenuIconRemoverPlugin.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: bdcb9327b8ffa8d468f9e8d7bbcb78dc
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
MenuIconRemover/Runtime.meta
Normal file
8
MenuIconRemover/Runtime.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f17d8cf70c0b89e45aa4117f30fcfd11
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
12
MenuIconRemover/Runtime/MenuIconRemover.cs
Normal file
12
MenuIconRemover/Runtime/MenuIconRemover.cs
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
|
||||
using UnityEngine;
|
||||
|
||||
namespace gay.lilyy.MenuIconRemover
|
||||
{
|
||||
public class MenuIconRemoverConfig : MonoBehaviour, VRC.SDKBase.IEditorOnly
|
||||
{
|
||||
public string[] exclude = new string[0];
|
||||
public bool removeOnPc = false;
|
||||
public bool removeOnQuest = true;
|
||||
}
|
||||
}
|
||||
11
MenuIconRemover/Runtime/MenuIconRemover.cs.meta
Normal file
11
MenuIconRemover/Runtime/MenuIconRemover.cs.meta
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ea0737bf428fc824ebd1a12ae92b06f6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
14
MenuIconRemover/Runtime/MenuIconRemoverRuntime.asmdef
Normal file
14
MenuIconRemover/Runtime/MenuIconRemoverRuntime.asmdef
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
{
|
||||
"name": "MenuIconRemoverRuntime",
|
||||
"rootNamespace": "",
|
||||
"references": [],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": false,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [],
|
||||
"autoReferenced": true,
|
||||
"defineConstraints": [],
|
||||
"versionDefines": [],
|
||||
"noEngineReferences": false
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4713dd3cf2e7fa34cbc6bbb6fef3c7d0
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Loading…
Add table
Add a link
Reference in a new issue