├── VRCExtended ├── ExtendedServer.cs ├── GameScripts │ ├── LocalCollider.cs │ └── PauseDetection.cs ├── Properties │ └── AssemblyInfo.cs ├── VolumeControl.cs ├── Patches │ ├── PortalInternal.cs │ └── PageUserInfo.cs ├── VRChat │ ├── UI │ │ ├── VRCEUiText.cs │ │ ├── VRCEUiButton.cs │ │ ├── VRCEUiVolumeControl.cs │ │ └── VRCEUi.cs │ ├── Obfuscation │ │ └── OBFUnityActionInternal.cs │ ├── VRCEPlayer.cs │ └── VRCPlayerManager.cs ├── AntiCrasherConfig.cs ├── ExtendedLogger.cs ├── VRCExtended.csproj ├── ExtendedUser.cs └── VRCExtended.cs ├── LICENSE ├── VRCExtended.sln ├── ShaderBlacklist.txt ├── README.md └── .gitignore /VRCExtended/ExtendedServer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace VRCExtended 7 | { 8 | internal static class ExtendedServer 9 | { 10 | public static List Users = new List(); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /VRCExtended/GameScripts/LocalCollider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using VRChat; 7 | 8 | using UnityEngine; 9 | 10 | namespace VRCExtended.GameScripts 11 | { 12 | public class LocalCollider : MonoBehaviour 13 | { 14 | void OnTriggerEnter(Collider collider) 15 | { 16 | if (collider.tag != "handCollider") 17 | return; 18 | /*if (VRCEPlayer.Instance.Avatar == collider.gameObject) 19 | return;*/ 20 | 21 | ExtendedLogger.Log("Entered collider!"); 22 | } 23 | void OnTriggerExit(Collider collider) 24 | { 25 | if (collider.tag != "handCollider") 26 | return; 27 | /*if (VRCEPlayer.Instance.Avatar == collider.gameObject) 28 | return;*/ 29 | 30 | ExtendedLogger.Log("Exited collider!"); 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /VRCExtended/GameScripts/PauseDetection.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | 8 | using VRCTools; 9 | 10 | namespace VRCExtended.GameScripts 11 | { 12 | public class PauseDetection : MonoBehaviour 13 | { 14 | void OnApplicationFocus(bool hasFocus) 15 | { 16 | if (!ModPrefs.GetBool("vrcextended", "fpsManagement")) 17 | return; 18 | 19 | if (!hasFocus) 20 | { 21 | Application.targetFrameRate = 5; 22 | ExtendedLogger.Log("Game out of focus, setting FPS to " + Application.targetFrameRate); 23 | } 24 | else 25 | { 26 | if (ModPrefs.GetBool("vrcextended", "unlimitedFPS")) 27 | Application.targetFrameRate = 0; 28 | else 29 | Application.targetFrameRate = VRCExtended.FrameRate; 30 | ExtendedLogger.Log("Game in focus, setting FPS to " + Application.targetFrameRate); 31 | } 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 AtiLion 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /VRCExtended.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.29009.5 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VRCExtended", "VRCExtended\VRCExtended.csproj", "{7DF0802E-DB23-417B-A5CD-949B0471D3C4}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {7DF0802E-DB23-417B-A5CD-949B0471D3C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {7DF0802E-DB23-417B-A5CD-949B0471D3C4}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {7DF0802E-DB23-417B-A5CD-949B0471D3C4}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {7DF0802E-DB23-417B-A5CD-949B0471D3C4}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {E8021B1F-1141-4C18-99AC-C52B4A136F9F} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /ShaderBlacklist.txt: -------------------------------------------------------------------------------- 1 | pretty 2 | bluescreen 3 | tesselation 4 | tesselated 5 | crasher 6 | instant crash paralyzer 7 | worldkill 8 | tessellation 9 | tessellated 10 | oofer 11 | xxx 12 | dbtc 13 | kyuzu 14 | distancebased 15 | waifuserp 16 | loops 17 | diebitch 18 | thotdestroyer 19 | niggathishurts 20 | izzyrfc 21 | izzyfrag 22 | izzycdf 23 | flat lite toon 24 | shadowschoolbully 25 | school shooter 26 | okbuddy 27 | basically private 28 | no sharing please 29 | hdjegbhuaj276312378632785678324547354t2egdy 30 | custom/oof 31 | custom/lag 32 | custom/killer 33 | custom/kyscotty 34 | kysautismoñoño 35 | .star/bacon 36 | god's children/holy water shader 37 | stonapse/worldkill 38 | stonapse/worldhit 39 | worldkill 40 | 9874654876468d46as5d46as5d7a98we7a84d65as468w7e9q6as8d6s4d5as4d5as6da4s6546a8ew76a8w4e687eq89e7 41 | lorplefoncondominiumlistile14141414 42 | be careful 43 | 7345687/6482375wer 44 | swisscheeseistasty99999999999/swisscheeseistasty99999999999 45 | undertaker/will ban you 46 | g͓̽l͓̽o͓̽m͓̽e͓̽e͓̽/ 47 | yikersdudeǧ͂̒o̓ͧ̅o͆͆̃d͋ͪ̌ ̃ͨ̉l̀̔̚u̅̅̽c̾̾͊k͗ͤ͌ ̉͒̔ṡ͗̽t̔͋ͬeͣͪͨå̊ͧl̈̅̆҉̣̰͡iͦ̔͛nͬ̈ͤĝͨ͋ ̈́̒̍tͨͣ̇h͋ͭ̋i̒̽̑s̆ͦͫ ͫͮͨ҉̫͈̠b͗ͩͣu̐ͮ̏d̓́̓d̂̎̇y͐ͬ͗ 48 | 卍アイアンウィルが最高卍 49 | randomname 1eg4ww 50 | custo5455245m 51 | 565416541651 52 | üõõüõaseio1 53 | duäöü 54 | ggo login body 55 | u go home 56 | no this is mine now 57 | poiyomi/imeatingmymic 58 | instant yeeet 59 | niggie 60 | ebola 61 | undetected 62 | got em 63 | retard 64 | retrd 65 | 11h2hh3hjej3 66 | ????????0????/???????/???? 67 | standard on cylnder 68 | almgp/nuke 69 | hello <3 70 | -------------------------------------------------------------------------------- /VRCExtended/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("VRCExtended")] 9 | [assembly: AssemblyDescription("Adds extra features to VRChat as well as some useful API functions")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("AtiLion")] 12 | [assembly: AssemblyProduct("VRCExtended")] 13 | [assembly: AssemblyCopyright("Copyright © AtiLion 2019")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("7df0802e-db23-417b-a5cd-949b0471d3c4")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("0.0.4.3")] 36 | [assembly: AssemblyFileVersion("0.0.4.3")] 37 | -------------------------------------------------------------------------------- /VRCExtended/VolumeControl.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | using Newtonsoft.Json; 8 | using Newtonsoft.Json.Linq; 9 | 10 | namespace VRCExtended 11 | { 12 | internal static class VolumeControl 13 | { 14 | #region VolumeControl Variables 15 | private static JObject _volumes; 16 | #endregion 17 | 18 | #region VolumeControl Properties 19 | public static Dictionary Volumes { get; private set; } = new Dictionary(); 20 | #endregion 21 | 22 | public static void Setup() 23 | { 24 | if (!File.Exists("volumes.json")) 25 | return; 26 | 27 | try 28 | { 29 | _volumes = JObject.Parse(File.ReadAllText("volumes.json")); 30 | 31 | foreach(JProperty property in _volumes.Properties()) 32 | { 33 | float[] volumes = new float[2] { 1f, 1f }; // 0 = User, 1 = Avatar 34 | JArray jaVol = property.Value as JArray; 35 | 36 | Volumes.Add(property.Name, volumes); 37 | volumes[0] = (float)jaVol[0]; 38 | volumes[1] = (float)jaVol[1]; 39 | } 40 | ExtendedLogger.Log("Successfully parsed volumes.json!"); 41 | } 42 | catch(Exception ex) 43 | { 44 | ExtendedLogger.LogError("Failed to parse JSON volumes.json!", ex); 45 | return; 46 | } 47 | } 48 | 49 | #region VolumeControl Properties 50 | #endregion 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /VRCExtended/Patches/PortalInternal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | using Harmony; 8 | 9 | using VRCTools; 10 | 11 | namespace VRCExtended.Patches 12 | { 13 | internal class Patch_PortalInternal 14 | { 15 | #region Continuation Variables 16 | private static PortalInternal portalEnter = null; 17 | #endregion 18 | 19 | public static void Setup() 20 | { 21 | // Setup harmony instances 22 | HarmonyInstance iEnter = HarmonyInstance.Create("vrcextended.portalinternal.enter"); 23 | 24 | // Patch 25 | try 26 | { 27 | iEnter.Patch(typeof(PortalInternal).GetMethod("Enter", BindingFlags.Public | BindingFlags.Instance), 28 | new HarmonyMethod(typeof(Patch_PortalInternal).GetMethod("Enter", BindingFlags.Static | BindingFlags.NonPublic))); 29 | ExtendedLogger.Log("Patched PortalInternal.Enter"); 30 | } 31 | catch (Exception ex) 32 | { 33 | ExtendedLogger.LogError("Failed to patch PortalInternal: " + ex); 34 | return; 35 | } 36 | } 37 | 38 | private static bool Enter(PortalInternal __instance, MethodInfo __originalMethod) 39 | { 40 | if (ModPrefs.GetBool("vrcextended", "disablePortal")) 41 | return false; 42 | if (portalEnter == __instance) 43 | return true; 44 | 45 | if (ModPrefs.GetBool("vrcextended", "askUsePortal")) 46 | { 47 | VRCUiPopupManagerUtils.ShowPopup("Enter Portal", "Do you really want to enter the portal?", "No", delegate () 48 | { 49 | VRCUiPopupManagerUtils.GetVRCUiPopupManager().HideCurrentPopup(); 50 | }, "Yes", delegate () 51 | { 52 | portalEnter = __instance; 53 | VRCUiPopupManagerUtils.GetVRCUiPopupManager().HideCurrentPopup(); 54 | __originalMethod.Invoke(__instance, new object[] { }); 55 | }); 56 | return false; 57 | } 58 | return true; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /VRCExtended/VRChat/UI/VRCEUiText.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | using VRCExtended; 10 | 11 | namespace VRChat.UI 12 | { 13 | public class VRCEUiText 14 | { 15 | #region VRChatExtended Properties 16 | public bool Success { get; private set; } 17 | #endregion 18 | 19 | #region UI Properties 20 | public Transform Control { get; private set; } 21 | public Transform TextControl { get; private set; } 22 | 23 | public RectTransform Position { get; private set; } 24 | #endregion 25 | 26 | #region Control Properties 27 | public Text Text { get; private set; } 28 | #endregion 29 | 30 | public VRCEUiText(string name, Vector2 position, string text, Transform parent = null) 31 | { 32 | // Get required information 33 | Transform orgControl = VRCEUi.InternalUserInfoScreen.UsernameText; 34 | if (orgControl == null) 35 | { 36 | ExtendedLogger.LogError("Could not find Username text!"); 37 | Success = false; 38 | return; 39 | } 40 | 41 | // Duplicate object 42 | GameObject goControl = GameObject.Instantiate(orgControl.gameObject); 43 | if (goControl == null) 44 | { 45 | ExtendedLogger.LogError("Could not duplicate Favorite button!"); 46 | Success = false; 47 | return; 48 | } 49 | 50 | // Set UI properties 51 | Control = goControl.transform; 52 | TextControl = Control.GetComponent().transform; 53 | 54 | // Remove components that may cause issues 55 | GameObject.DestroyImmediate(Control.GetComponent()); 56 | 57 | // Set control properties 58 | Text = TextControl.GetComponent(); 59 | 60 | // Set required parts 61 | if (parent != null) 62 | Control.SetParent(parent); 63 | goControl.name = name; 64 | 65 | // Modify RectTransform 66 | Position = Control.GetComponent(); 67 | RectTransform tmpRT = orgControl.GetComponent(); 68 | 69 | Position.localScale = tmpRT.localScale; 70 | Position.anchoredPosition = tmpRT.anchoredPosition; 71 | Position.sizeDelta = tmpRT.sizeDelta; 72 | Position.localPosition = new Vector3(position.x, position.y, 0f); 73 | Position.localRotation = tmpRT.localRotation; 74 | 75 | // Change UI properties 76 | Text.text = text; 77 | 78 | // Finish 79 | Success = true; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /VRCExtended/VRChat/Obfuscation/OBFUnityActionInternal.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | using UnityEngine.Events; 8 | 9 | using VRCExtended; 10 | 11 | namespace VRChat.Obfuscation 12 | { 13 | public class OBFUnityActionInternal 14 | { 15 | #region OBFUnityActionInternal Properties 16 | public MethodInfo MethodAdd { get; private set; } 17 | public MethodInfo MethodExecute { get; private set; } 18 | public MethodInfo MethodRemove { get; private set; } 19 | 20 | public object Instance { get; private set; } 21 | #endregion 22 | 23 | public OBFUnityActionInternal(Type type, object instance) 24 | { 25 | MethodInfo[] addRemoveMethods = type.GetMethods().Where(a => a.GetParameters().Length > 0 && a.GetParameters()[0].ParameterType == typeof(UnityAction)).ToArray(); 26 | if(addRemoveMethods.Length < 2) 27 | { 28 | ExtendedLogger.LogError("Failed to find required UnityActionInternal functions for type: " + type.Name + "!"); 29 | return; 30 | } 31 | 32 | if(addRemoveMethods[0].GetMethodBody().GetILAsByteArray().Length > addRemoveMethods[1].GetMethodBody().GetILAsByteArray().Length) 33 | { 34 | MethodAdd = addRemoveMethods[0]; 35 | MethodRemove = addRemoveMethods[1]; 36 | } 37 | else 38 | { 39 | MethodAdd = addRemoveMethods[1]; 40 | MethodRemove = addRemoveMethods[0]; 41 | } 42 | MethodExecute = type.GetMethods().First(a => a.GetParameters()[0].ParameterType == typeof(T)); 43 | 44 | ExtendedLogger.Log("Found Execute method in " + type.Name + " with name: " + MethodExecute.Name + "!"); 45 | ExtendedLogger.Log("Found Add method in " + type.Name + " with name: " + MethodAdd.Name + "!"); 46 | ExtendedLogger.Log("Found Remove method in " + type.Name + " with name: " + MethodRemove.Name + "!"); 47 | 48 | Instance = instance; 49 | } 50 | 51 | #region UnityActionInternal Functions 52 | public void Add(UnityAction action) 53 | { 54 | if (Instance == null) 55 | return; 56 | 57 | MethodAdd.Invoke(Instance, new object[] { action }); 58 | } 59 | public void Remove(UnityAction action) 60 | { 61 | if (Instance == null) 62 | return; 63 | 64 | MethodRemove.Invoke(Instance, new object[] { action }); 65 | } 66 | 67 | public void Execute(T val) 68 | { 69 | if (Instance == null) 70 | return; 71 | 72 | MethodExecute.Invoke(Instance, new object[] { val }); 73 | } 74 | #endregion 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /VRCExtended/VRChat/VRCEPlayer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | using VRC; 8 | using VRC.Core; 9 | 10 | using VRCExtended; 11 | 12 | using UnityEngine; 13 | 14 | namespace VRChat 15 | { 16 | public class VRCEPlayer 17 | { 18 | #region Reflection Variables 19 | private static MethodInfo _player_get_user; 20 | private static MethodInfo _player_get_Instance; 21 | 22 | private static MethodInfo _vrcplayer_get_AvatarManager; 23 | #if DEBUG 24 | private static MethodInfo _vrcplayer_get_uSpeaker; 25 | 26 | private static FieldInfo _uspeaker_AudioSource; 27 | #endif 28 | #endregion 29 | 30 | #region VRCEPlayer Properties 31 | public Player Player { get; private set; } 32 | public VRCPlayer VRCPlayer => Player.vrcPlayer; 33 | public APIUser APIUser => _player_get_user.Invoke(Player, new object[0]) as APIUser; 34 | 35 | public VRCAvatarManager AvatarManager => _vrcplayer_get_AvatarManager.Invoke(VRCPlayer, new object[0]) as VRCAvatarManager; 36 | #if DEBUG 37 | public USpeaker uSpeaker => _vrcplayer_get_uSpeaker.Invoke(VRCPlayer, new object[0]) as USpeaker; 38 | #endif 39 | 40 | public bool IsSelf => APIUser.id == APIUser.CurrentUser.id; 41 | public static VRCEPlayer Instance => new VRCEPlayer(_player_get_Instance.Invoke(null, new object[] { }) as Player); 42 | #endregion 43 | 44 | #region Avatar Properties 45 | public GameObject Avatar => AvatarManager.currentAvatarObject; 46 | public Animator Animator => VRCPlayer.avatarAnimator; 47 | 48 | #if DEBUG 49 | public AudioSource Voice => _uspeaker_AudioSource.GetValue(uSpeaker) as AudioSource; 50 | public AudioSource[] Sounds => Avatar.GetComponentsInChildren().Where(a => a != Voice).ToArray(); 51 | #endif 52 | #endregion 53 | 54 | #region User Properties 55 | public string UniqueID => APIUser.id; 56 | #endregion 57 | 58 | public VRCEPlayer(Player player) 59 | { 60 | Player = player; 61 | } 62 | public VRCEPlayer() 63 | { 64 | Player = _player_get_Instance.Invoke(null, new object[] { }) as Player; 65 | } 66 | 67 | internal static void Setup() 68 | { 69 | _player_get_user = typeof(Player).GetMethod("get_user", BindingFlags.Public | BindingFlags.Instance); 70 | _player_get_Instance = typeof(Player).GetMethod("get_Instance", BindingFlags.Public | BindingFlags.Static); 71 | 72 | _vrcplayer_get_AvatarManager = typeof(VRCPlayer).GetMethod("get_AvatarManager", BindingFlags.Public | BindingFlags.Instance); 73 | #if DEBUG 74 | _vrcplayer_get_uSpeaker = typeof(VRCPlayer).GetMethod("get_uSpeaker", BindingFlags.Public | BindingFlags.Instance); 75 | 76 | _uspeaker_AudioSource = typeof(USpeaker).GetFields(BindingFlags.NonPublic | BindingFlags.Instance).First(a => a.FieldType == typeof(AudioSource)); 77 | ExtendedLogger.Log("Found user voice AudioSource: " + _uspeaker_AudioSource.Name); 78 | #endif 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /VRCExtended/AntiCrasherConfig.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Reflection; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Text; 6 | 7 | namespace VRCExtended 8 | { 9 | internal class AntiCrasherConfig 10 | { 11 | #region AntiCrasherConfig Properties 12 | public static AntiCrasherConfig Instance { get; private set; } 13 | #endregion 14 | 15 | #region Polygon Crasher 16 | public bool? PolyLimit { get; set; } 17 | public int? MaxPolygons { get; set; } 18 | #endregion 19 | 20 | #region Particle Crasher 21 | public bool? ParticleLimit { get; set; } 22 | //public bool DetectPotentialCrasher { get; set; } 23 | public int? MaxParticles { get; set; } 24 | #endregion 25 | 26 | #region Shader Crasher 27 | public bool? ShaderBlacklist { get; set; } 28 | public bool? UseOnlineBlacklist { get; set; } 29 | public bool? RemoveUnsupportedShaders { get; set; } 30 | public string[] BlacklistedShaders { get; set; } 31 | #endregion 32 | 33 | public AntiCrasherConfig() => 34 | Instance = this; 35 | 36 | public bool CheckBackwardsCompatibility() 37 | { 38 | bool rebuilt = false; 39 | foreach(PropertyInfo property in typeof(AntiCrasherConfig).GetProperties(BindingFlags.Public | BindingFlags.Instance)) 40 | if(property.GetValue(this, null) == null) 41 | rebuilt = true; 42 | 43 | if (PolyLimit == null) 44 | PolyLimit = true; 45 | if (MaxPolygons == null) 46 | MaxPolygons = 150000; 47 | 48 | if (ParticleLimit == null) 49 | ParticleLimit = true; 50 | if (MaxParticles == null) 51 | MaxParticles = 200; 52 | 53 | if (ShaderBlacklist == null) 54 | ShaderBlacklist = true; 55 | if (UseOnlineBlacklist == null) 56 | UseOnlineBlacklist = true; 57 | if (RemoveUnsupportedShaders == null) 58 | RemoveUnsupportedShaders = false; 59 | if(BlacklistedShaders == null) 60 | { 61 | BlacklistedShaders = new string[] 62 | { 63 | "pretty", 64 | "bluescreen", 65 | "tesselation", 66 | "tesselated", 67 | "crasher", 68 | "instant crash paralyzer", 69 | "worldkill", 70 | "tessellation", 71 | "tessellated", 72 | "oofer", 73 | "xxx", 74 | "dbtc", 75 | "kyuzu", 76 | "distancebased", 77 | "waifuserp", 78 | "loops", 79 | "diebitch", 80 | "thotdestroyer" // Thanks Herp Derpinstine 81 | }; 82 | } 83 | 84 | if (rebuilt) 85 | ExtendedLogger.LogWarning("Anti-crasher configuration has been updated!"); 86 | return rebuilt; 87 | } 88 | public static void CreateDefault() 89 | { 90 | AntiCrasherConfig acc = new AntiCrasherConfig(); 91 | 92 | acc.CheckBackwardsCompatibility(); 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /VRCExtended/VRChat/UI/VRCEUiButton.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | using VRCExtended; 10 | 11 | namespace VRChat.UI 12 | { 13 | public class VRCEUiButton 14 | { 15 | #region VRChatExtended Properties 16 | public bool Success { get; private set; } 17 | #endregion 18 | 19 | #region UI Properties 20 | public Transform Control { get; private set; } 21 | public Transform ButtonControl { get; private set; } 22 | public Transform ImageControl { get; private set; } 23 | public Transform TextControl { get; private set; } 24 | 25 | public RectTransform Position { get; private set; } 26 | #endregion 27 | 28 | #region Control Properties 29 | public Button Button { get; private set; } 30 | public Text Text { get; private set; } 31 | #endregion 32 | 33 | public VRCEUiButton(string name, Vector2 position, string text, Transform parent = null) 34 | { 35 | // Get required information 36 | Transform orgControl = VRCEUi.InternalUserInfoScreen.FavoriteButton; 37 | if(orgControl == null) 38 | { 39 | ExtendedLogger.LogError("Could not find Favorite button!"); 40 | Success = false; 41 | return; 42 | } 43 | 44 | // Duplicate object 45 | GameObject goControl = GameObject.Instantiate(orgControl.gameObject); 46 | if(goControl == null) 47 | { 48 | ExtendedLogger.LogError("Could not duplicate Favorite button!"); 49 | Success = false; 50 | return; 51 | } 52 | 53 | // Set UI properties 54 | Control = goControl.transform; 55 | ButtonControl = Control.Find("FavoriteButton"); 56 | ImageControl = ButtonControl.Find("Image"); 57 | TextControl = Control.GetComponentInChildren().transform; 58 | 59 | // Remove components that may cause issues 60 | GameObject.DestroyImmediate(Control.GetComponent()); 61 | GameObject.DestroyImmediate(ButtonControl.GetComponent()); 62 | 63 | // Set control properties 64 | Button = ButtonControl.GetComponent