private void GUIModulesInstalation() { if (ModuleHandler.GetModules() == null) { return; } if (ModuleHandler.GetModules().Count > 0) { GUILayout.Label(Locale.editor.Get("header_modules"), EditorStyles.boldLabel); } bool disabled = false; foreach (Module module in ModuleHandler.GetModules()) { if (module.is_being_installed_or_removed) { disabled = true; } } EditorGUI.BeginDisabledGroup(disabled); foreach (Module module in ModuleHandler.GetModules()) { ModuleUI(module); } GUILayout.Label(Locale.editor.Get("header_thrird_party"), EditorStyles.boldLabel); foreach (Module module in ModuleHandler.GetThirdPartyModules()) { ModuleUI(module); } EditorGUI.EndDisabledGroup(); }
static OnCompileHandler() { VRCInterface.OnCompile(); Config.OnCompile(); ModuleHandler.OnCompile(); Helper.TashHandler.EmptyThryTrash(); }
private void GUIModulesInstalation() { if (ModuleHandler.GetFirstPartyModules() == null) { return; } if (ModuleHandler.GetFirstPartyModules().Count > 0) { EditorGUILayout.BeginHorizontal(); GUILayout.Label(Locale.editor.Get("header_modules"), EditorStyles.boldLabel); if (GUILayout.Button("Reload")) { ModuleHandler.ForceReloadModules(); } EditorGUILayout.EndHorizontal(); } bool disabled = ModuleHandler.GetFirstPartyModules().Any(m => m.is_being_installed_or_removed); disabled |= ModuleHandler.GetThirdPartyModules().Any(m => m.is_being_installed_or_removed); EditorGUI.BeginDisabledGroup(disabled); foreach (Module module in ModuleHandler.GetFirstPartyModules()) { ModuleUI(module); } GUILayout.Label(Locale.editor.Get("header_thrird_party"), EditorStyles.boldLabel); foreach (Module module in ModuleHandler.GetThirdPartyModules()) { ModuleUI(module); } EditorGUI.EndDisabledGroup(); }
static DRP_Main() { last_updated_file_name = FileHelper.ReadFileIntoString(DRP_LAST_UPDATED_FILE_PATH); clientID = Environment.GetEnvironmentVariable("DISCORD_CLIENT_ID"); if (clientID == null) { clientID = "619838876994764800"; } if (InitDiscord()) { EditorApplication.update += Update; } else { EditorApplication.update += TryInitDiscord; } ModuleHandler.RegisterPreModuleRemoveFunction(delegate() { if (isRunning) { EditorApplication.update -= Update; } else { EditorApplication.update -= TryInitDiscord; } discord.Dispose(); }); }
private static void AssetsDeleted(string[] assets) { ShaderHelper.AssetsDeleted(assets); UnityFixer.OnAssetDeleteCheckDrawingDLL(assets); if (CheckForEditorRemove(assets)) { Debug.Log("ShaderEditor is being deleted."); Config.Singleton.verion = "0"; Config.Singleton.Save(); ModuleHandler.OnEditorRemove(); } }
static OnCompileHandler() { //Init Editor Variables with paths ShaderEditor.GetShaderEditorDirectoryPath(); Config.OnCompile(); ModuleHandler.OnCompile(); TrashHandler.EmptyThryTrash(); UnityFixer.CheckAPICompatibility(); //check that Net_2.0 is ApiLevel UnityFixer.CheckDrawingDll(); //check that drawing.dll is imported }
private static void AssetsDeleted(string[] assets) { VRCInterface.SetVRCDefineSybolIfSDKDeleted(assets); ShaderHelper.AssetsDeleted(assets); UnityFixer.OnAssetDeleteCheckDrawingDLL(assets); if (CheckForEditorRemove(assets)) { Debug.Log("ThryEditor is being deleted."); Config.Get().verion = "0"; Config.Get().save(); ModuleHandler.OnEditorRemove(); } }
private void ModuleUI(Module module) { string text = " " + module.available_module.name; if (module.update_available) { text = " " + text; } module.ui_expanded = Foldout(text, module.ui_expanded); Rect rect = GUILayoutUtility.GetLastRect(); rect.x += 20; rect.y += 1; rect.width = 20; rect.height -= 4; bool is_installed = module.installed_module != null; EditorGUI.BeginDisabledGroup(!module.available_requirement_fullfilled); EditorGUI.BeginChangeCheck(); bool install = GUI.Toggle(rect, is_installed, ""); if (EditorGUI.EndChangeCheck()) { ModuleHandler.InstallRemoveModule(module, install); } if (module.update_available) { rect.x += 20; rect.width = 55; GUIStyle style = new GUIStyle(EditorStyles.miniButton); style.fixedHeight = 17; if (GUI.Button(rect, "Update", style)) { ModuleHandler.UpdateModule(module); } } //add update notification if (module.ui_expanded) { EditorGUI.indentLevel += 1; ModuleUIDetails(module); EditorGUI.indentLevel -= 1; } EditorGUI.EndDisabledGroup(); }
private void GUIModulesInstalation() { if (ModuleHandler.GetModules() == null) { return; } if (ModuleHandler.GetModules().Count > 0) { GUILayout.Label("Extra Modules", EditorStyles.boldLabel); } bool disabled = false; foreach (ModuleHeader module in ModuleHandler.GetModules()) { if (module.is_being_installed_or_removed) { disabled = true; } } EditorGUI.BeginDisabledGroup(disabled); foreach (ModuleHeader module in ModuleHandler.GetModules()) { EditorGUILayout.BeginHorizontal(); EditorGUI.BeginDisabledGroup(!module.available_requirement_fullfilled); EditorGUI.BeginChangeCheck(); bool is_installed = Helper.ClassExists(module.available_module.classname); bool update_available = is_installed; if (module.installed_module != null) { update_available = Helper.compareVersions(module.installed_module.version, module.available_module.version) == 1; } string displayName = module.available_module.name; if (module.installed_module != null) { displayName += " v" + module.installed_module.version; } bool install = GUILayout.Toggle(is_installed, new GUIContent(displayName, module.available_module.description), GUILayout.ExpandWidth(false)); if (EditorGUI.EndChangeCheck()) { ModuleHandler.InstallRemoveModule(module, install); } if (update_available) { if (GUILayout.Button("update to v" + module.available_module.version, GUILayout.ExpandWidth(false))) { ModuleHandler.UpdateModule(module); } } EditorGUI.EndDisabledGroup(); if (module.available_module.requirement != null && (update_available || !is_installed)) { GUIStyle requirementStyle = new GUIStyle(EditorStyles.label); requirementStyle.normal.textColor = greenStyle.normal.textColor; if (!module.available_requirement_fullfilled) { requirementStyle.normal.textColor = redInfostyle.normal.textColor; } GUILayout.Label("Requirements: " + module.available_module.requirement.ToString(), requirementStyle); } EditorGUILayout.EndHorizontal(); } EditorGUI.EndDisabledGroup(); }