void DrawSideBarSystem() { QUI.DrawTexture(DUIResources.sideTitleSystem.texture, SIDE_BAR_WIDTH, SIDE_BAR_HEADER_HEIGHT); if (CurrentSection == Section.Settings) { QUI.DrawTexture(DUIResources.sideButtonSettingsSelected.texture, SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.SideButtonSettings), SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT)) { CurrentSection = Section.Settings; ResetPageView(); } } QUI.Space(VERTICAL_SPACE_DIVIDER); }
void DrawAbout() { QUI.DrawTexture(DUIResources.headerAbout.texture, 552, 64); float sectionWidth = PAGE_WIDTH - SIDE_BAR_SHADOW_WIDTH * 2; QUI.Space(SPACE_16); QUI.DrawTexture(DUIResources.pageAboutDoozyUIVersion.texture, 552, 256); QUI.Space(SPACE_16); DrawArticle("About DoozyUI", "DoozyUI is a complete UI management system for Unity. " + "It manipulates native Unity components and takes full advantage of their intended usage. " + "This assures maximum compatibility with uGUI, best performance and makes the entire system have a predictable behaviour. " + "Also, by working only with native components, the system will be compaible with any ohter asset that uses uGUI correctly. " + "\n\n" + "Easy to use and understand, given the user has some basic knowledge of how Unity's native UI solution (uGUI) works, DoozyUI has flexible components that can be configured in a lot of ways. " + "Functionality and design go hand in hand in order to offer a pleasant user experience (UX) while using the system." + "\n\n" + "Starting with version 2.8, DoozyUI is officialy VR READY, being capable of handling with ease multiple Canvases set to World Space render mode. " + "The system has been redesigned, from the core up, in order to accomodate a higher degree of flexibility that was needed in order for it to handle a lot of different use case scenarios." + "\n\n" + "The asset 'DoozyUI' has been released on the Unity Asset Store under the 'Doozy Entertainment' brand, owned by the Marlink Trading SRL company.", sectionWidth); }
bool CheckThatFolderExists(string relativePath) { if (!System.IO.Directory.Exists(relativePath)) { QUI.Space(SPACE_4); QLabel.text = "This folder does not exist. Click to create it."; QLabel.style = Style.Text.Help; QUI.BeginVertical(16, 16); { QUI.Space(2); QUI.DrawTexture(QResources.iconError.texture, 14, 14); } QUI.EndVertical(); QUI.Space(-SPACE_2); QUI.Label(QLabel); return(true); } return(false); }
void DrawBackground() { QUI.DrawTexture(DUIResources.upgradeManagerBackground.texture, position.width, position.height); QUI.Space(-position.height); }
void DrawPresetList(string category, AnimatorPreset presetType, List <string> list, float width, string emptyMessage = "List is empty...") { QUI.Space(2); if (list.Count == 0) { if (SearchPatternAnimBool.value) { QUI.Label("No matching names found in this category!", DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelSmallItalic)); } else { QUI.BeginHorizontal(width); { QUI.Space(22); QUI.Label(emptyMessage, DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelSmallItalic), width - 60); //if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonPlus), 20, 20)) //{ // list.Add(""); //} } QUI.EndHorizontal(); } return; } QUI.BeginVertical(width); { bool matchFoundInThisCategory = false; for (int i = 0; i < list.Count; i++) { QUI.BeginHorizontal(width); { if (SearchPatternAnimBool.target)//a search pattern has been entered in the search box { try { if (!Regex.IsMatch(list[i], SearchPattern, RegexOptions.IgnoreCase)) { QUI.EndHorizontal(); continue; //this does not match the search pattern --> we do not show this name it } } catch (Exception) { } matchFoundInThisCategory = true; } QUI.Space(20); if (!SearchPatternAnimBool.value) { if (list[i].Equals(selectedAnimatorPresetName)) { SaveColors(); QUI.SetGUIColor(DUIColors.BlueLight.Color); QUI.DrawTexture(DUIResources.backgroundGrey230.texture, (width - 55 - 100), 20); QUI.Space(-20); QUI.Label(list[i], DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelNormal), (width - 55 - 100) * (1 - SearchPatternAnimBool.faded)); QUI.Space(-7); QUI.DrawTexture(DUIResources.pageButtonSelect.active, 100, 20); QUI.Space(-20); QUI.Space(100); RestoreColors(); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.ButtonBar), (width - 55 - 100), 20)) { SelectedAnimatorPreset(list[i]); } QUI.Space(-(width - 55 - 100)); QUI.Label(list[i], DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelNormal), (width - 55 - 100) * (1 - SearchPatternAnimBool.faded)); QUI.Space(-7); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonSelect), 100 * (1 - SearchPatternAnimBool.faded), 20)) { SelectedAnimatorPreset(list[i]); } } QUI.Space(1); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonMinus), 20 * (1 - SearchPatternAnimBool.faded), 20)) { if (EditorUtility.DisplayDialog("Delete the '" + list[i] + "' preset?", "Are you sure you want to proceed?\nOperation cannot be undone!", "Yes", "Cancel")) { switch (presetType) { case AnimatorPreset.InAnimations: UIAnimatorUtil.DeleteInAnimPreset(openedAnimatorPresetCategory, list[i]); RefreshInAnimationsAnimatorPresets(true); break; case AnimatorPreset.OutAnimations: UIAnimatorUtil.DeleteOutAnimPreset(openedAnimatorPresetCategory, list[i]); RefreshOutAnimationsAnimatorPresets(true); break; case AnimatorPreset.Loops: UIAnimatorUtil.DeleteLoopPreset(openedAnimatorPresetCategory, list[i]); RefreshLoopsAnimatorPresets(true); break; case AnimatorPreset.Punches: UIAnimatorUtil.DeletePunchPreset(openedAnimatorPresetCategory, list[i]); RefreshPunchesAnimatorPresets(true); break; } openedAnimatorPresetCategory = category; } } } QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(2); } if (SearchPatternAnimBool.target) { if (!matchFoundInThisCategory) //if a search pattern is active and no valid names were found for this category we let the developer know { QUI.Label("No matching names found in this category!", DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelSmallItalic)); } } //else //because a search pattern is active, we do no give the developer the option to create a new name //{ // QUI.BeginHorizontal(width); // { // QUI.Space(width - 34); // if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonPlus), 20, 20)) // { // list.Add(""); // } // QUI.Space(2); // } // QUI.EndHorizontal(); //} } QUI.EndVertical(); }
bool ButtonBar(string text, GUIStyle textStyle, AnimBool aBool, float width) { QUI.BeginVertical(width); { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.ButtonBar), width, 20)) { return(true); //button clicked } QUI.Space(-20); QUI.BeginHorizontal(width); { if (aBool.faded == 0) { QUI.DrawTexture(DUIResources.caretRotate10.texture, 20, 20); } else if (aBool.faded <= 0.1f) { QUI.DrawTexture(DUIResources.caretRotate9.texture, 20, 20); } else if (aBool.faded <= 0.2f) { QUI.DrawTexture(DUIResources.caretRotate8.texture, 20, 20); } else if (aBool.faded <= 0.3f) { QUI.DrawTexture(DUIResources.caretRotate7.texture, 20, 20); } else if (aBool.faded <= 0.4f) { QUI.DrawTexture(DUIResources.caretRotate6.texture, 20, 20); } else if (aBool.faded <= 0.5f) { QUI.DrawTexture(DUIResources.caretRotate5.texture, 20, 20); } else if (aBool.faded <= 0.6f) { QUI.DrawTexture(DUIResources.caretRotate4.texture, 20, 20); } else if (aBool.faded <= 0.7f) { QUI.DrawTexture(DUIResources.caretRotate3.texture, 20, 20); } else if (aBool.faded <= 0.8f) { QUI.DrawTexture(DUIResources.caretRotate2.texture, 20, 20); } else if (aBool.faded <= 0.9f) { QUI.DrawTexture(DUIResources.caretRotate1.texture, 20, 20); } else { QUI.DrawTexture(DUIResources.caretRotate0.texture, 20, 20); } QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(-2); QUI.BeginHorizontal(width); { QUI.Space(20); QUI.Label(text, textStyle, width - 20, 20); QUI.FlexibleSpace(); } QUI.EndHorizontal(); } QUI.EndVertical(); return(false); //button not clicked }
void DrawCustomGameEvents() { QUI.DrawTexture(DUIResources.barCustomGameEvents.texture, WIDTH_420, 18); //DrawInfoMessage("ComponentInfo", WIDTH_420); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.PurpleLight.Color); QUI.Space(SPACE_2); QUI.Label("LoadLevel Async", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("by name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_LoadSceneAsync_SceneName, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_LoadSceneAsync_SceneName.stringValue = SceneLoader.DEFAULT_LOAD_SCENE_ASYNC_SCENE_NAME; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("by build index", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_LoadSceneAsync_SceneBuildIndex, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_LoadSceneAsync_SceneBuildIndex.stringValue = SceneLoader.DEFAULT_LOAD_SCENE_ASYNC_SCENE_BUILD_INDEX; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_8); QUI.Label("LoadLevel Additive Async", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("by name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_LoadSceneAdditiveAsync_SceneName, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_LoadSceneAdditiveAsync_SceneName.stringValue = SceneLoader.DEFAULT_LOAD_SCENE_ADDITIVE_ASYNC_SCENE_NAME; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("by build index", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_LoadSceneAdditiveAsync_SceneBuildIndex, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_LoadSceneAdditiveAsync_SceneBuildIndex.stringValue = SceneLoader.DEFAULT_LOAD_SCENE_ADDITIVE_ASYNC_SCENE_BUILD_INDEX; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_8); QUI.Label("Unload Scene", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("by name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_UnloadScene_SceneName, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_UnloadScene_SceneName.stringValue = SceneLoader.DEFAULT_UNLOAD_SCENE_SCENE_NAME; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("by build index", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_UnloadScene_SceneBuildIndex, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_UnloadScene_SceneBuildIndex.stringValue = SceneLoader.DEFAULT_UNLOAD_SCENE_SCENE_BUILD_INDEX; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_8); QUI.Label("Load / Unload Level", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("load level", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_LoadLevel, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_LoadLevel.stringValue = SceneLoader.DEFAULT_LOAD_LEVEL; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("unload level", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(command_UnloadLevel, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { command_UnloadLevel.stringValue = SceneLoader.DEFAULT_UNLOAD_LEVEL; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_2); QUI.Label("Level Scene Name (naming convention)", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("scene name", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(levelSceneName, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { levelSceneName.stringValue = SceneLoader.DEFAULT_LEVEL_SCENE_NAME; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_8); QUI.Label("Game Event sent after a scene was loaded", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelNormal), WIDTH_420); QUI.BeginHorizontal(WIDTH_420); { QUI.Space(SPACE_16); QUI.Label("game event", DUIStyles.GetStyle(DUIStyles.TextStyle.LabelSmall), 90); QUI.PropertyField(levelLoadedGameEvent, 280); QUI.BeginVertical(22); { QUI.Space(-1); if (QUI.ButtonReset()) { levelLoadedGameEvent.stringValue = SceneLoader.DEFAULT_LEVEL_LOADED; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_4); }
void DrawControlPanelNews(float width) { QUI.DrawTexture(DUIResources.pageControlPanelSeparatorNews.texture, 294, 16); DrawArticle("Hey lovely DoozyUI Users!", "We want to update you on a few things.", width - 16); QUI.Space(3); DrawArticle("Apologies", "First up, we’d like to apologize. " + "We’re a small team, and we’ve been trying to find the right balance between interacting with the community and getting work done. " + "If we spend too much time talking to folks, we don’t get as much done, and vice versa." + "\n\n" + "We fear we haven’t communicated enough, so we’ll be spending more time keeping you all informed and getting your thoughts. " + "Stay tuned.", width - 16); QUI.Space(3); DrawArticle("About DoozyUI", "We’ve been hard at work on this completely rewritten core for DoozyUI. " + "This means we should be able to crank out future releases much faster and with much less effort. " + "And the new code base is the best we’ve ever made — truly better design, better consistency, and better performance. " + "And honestly, DoozyUI is turning out better than we’d ever imagined." + "\n\n" + "The all-new features are crazy simple to use and they just work. " + "You get all the power of a complex UI management system with none of the hassle." + "\n\n" + "But we know it’s not perfect yet, and we’d love your feedback.", width - 16); QUI.Space(3); DrawArticle("The 2.8 Release", "This release is a huge milestone for us as it is the first big step towards the next major version." + "\n\n" + "The new custom editors were created with purpose in mind. " + "To this end, all the components went through several design iterations until we found a balance between functionality and ease of use." + "\n\n" + "New animation presets (over 400) were created for you so that you have a lot of 'out of the box' options." + "\n" + "All the components have new options and, for you coders out there, you will notice that new methods are available and that we added summaries to everything.", width - 16); QUI.Space(3); DrawArticle("Next Up", "We will be releasing minor versions 2.8.1, 2.8.2 and so on, where we will add some new options and components for the system. " + "Between them we will release quick patches for any issues that may arrise (so please tell us if you find any bugs)." + "\n\n" + "The next component will be the UIToggle. " + "Also, as soon as Font Awesome 5 is released to the general public, we'll add it as well (right now the alpha version looks incredible).", width - 16); QUI.Space(3); DrawArticle("The Future", "What we envision is installing DoozyUI, getting an UI pack (made for DoozyUI) from the Unity Asset Store and having a premade functional UI ready to go in your project in less than 5 minutes." + "\n\n" + "That is why we plan on giving you, all the UI designers out there, the option of creating premade UIs. " + "Right now we see a lot of UI graphic packs on the Unity Asset Store and we would love seeing those packs turned into 'out of the box' working UIs (not just static graphics). " + "This is one of the big features that we are working on for the 3.0 major version." + "\n\n" + "Another big feature will be a NodeGraph that will allow you create and visualize the UI flow.", width - 16); QUI.Space(3); DrawArticle("Thank You", "We would like to thank everyone that bought DoozyUI and helped us get this far." + "\n\n" + "We have even bigger plans for the system and we are glad to have your support. " + "Should you have any suggestions or find any bugs (or solutions) please let us know so that we can improve the system for you and anyone that uses it." + "\n\n" + "Thanks!" + "\n" + "Doozy Entertainment", width - 16); }
void DrawBackground() { QUI.DrawTexture(DUIResources.notificationWindowBackground.texture, position.width, position.height); QUI.Space(-position.height); }
void DrawConvertDUIDataToSourceFiles(string relativePath, string fileName, string fileExtension, float width) { QUI.BeginHorizontal(width); { QLabel.text = "Find"; QLabel.style = Style.Text.Button; if (QUI.GhostButton(QLabel.text, QColors.Color.Gray, QLabel.x + 16, 18)) { // Load object UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath(relativePath + fileName + fileExtension, typeof(UnityEngine.Object)); // Select the object in the project folder Selection.activeObject = obj; // Also flash the folder yellow to highlight it EditorGUIUtility.PingObject(obj); } QUI.Space(SPACE_2); QLabel.text = "Create Database Files from: " + fileName; QLabel.style = Style.Text.Button; if (QUI.GhostButton(QLabel.text, QColors.Color.Gray, QLabel.x + 24, 18)) { DUIData D = DUIData.Instance; //UIElements Database Files if (D.DatabaseUIElements != null && D.DatabaseUIElements.categories != null && D.DatabaseUIElements.categories.Count > 0) { for (int i = 0; i < D.DatabaseUIElements.categories.Count; i++) { if (D.DatabaseUIElements.categories[i].categoryName.Equals(DUI.UNCATEGORIZED_CATEGORY_NAME)) { continue; } D.CreateUIElementsDatabaseAssetFile(D.DatabaseUIElements.categories[i].categoryName, D.DatabaseUIElements.categories[i].itemNames); } } //UIButtons Database Files if (D.DatabaseUIButtons != null && D.DatabaseUIButtons.categories != null && D.DatabaseUIButtons.categories.Count > 0) { for (int i = 0; i < D.DatabaseUIButtons.categories.Count; i++) { if (D.DatabaseUIButtons.categories[i].categoryName.Equals(DUI.UNCATEGORIZED_CATEGORY_NAME)) { continue; } D.CreateUIButtonsDatabaseAssetFile(D.DatabaseUIButtons.categories[i].categoryName, D.DatabaseUIButtons.categories[i].itemNames); } } AssetDatabase.DeleteAsset(relativePath + fileName + fileExtension); //delete DUIData AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } if (CheckThatFileExists(relativePath, fileName, fileExtension)) { } else { QUI.Space(SPACE_4); QUI.BeginVertical(16, 16); { QUI.Space(2); QUI.DrawTexture(QResources.iconOk.texture, 14, 14); } QUI.EndVertical(); } QUI.FlexibleSpace(); } QUI.EndHorizontal(); }
/// <summary> /// Draws a special button used to enable/disable asset/module options by using scripting define symbols and custom made button styles. /// </summary> /// <param name="buttonTarget">Supported asset name (like 'PlayMaker') or the module name (like 'UINavigation').</param> /// <param name="buttonStyle">Custom button style that will be used to draw the button.</param> /// <param name="isEnabled">Bool that determines if the supplied symbol (the define symbol string) has been added to Player Settings or not.</param> /// <param name="symbol">The symbol that gets added/remoded to/from Scripting Define Symbols.</param> /// <param name="width">The width of the button.</param> /// <param name="inverseSymbol">This is a special bool that is used by the 'UINavigation', for example, as it needs to add a scripting define symbol to remove module options. /// It is used mostly by DoozyUI modules that are enabled by default and they can be disabled by adding a symbol to Player Settings and vice vresa.</param> void DrawControlPanelGeneralButton(string buttonTarget, GUIStyle buttonStyle, bool isEnabled, string symbol, float width, bool inverseSymbol = false) { QUI.BeginVertical(width); { if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.buttonEditorIsCompiling.texture, width, 48); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.buttonEditorInPlayMode.texture, width, 48); } else { if (QUI.Button(buttonStyle, width, 48)) { string title, message; if (isEnabled) { title = "Disable " + buttonTarget + " options?"; message = "This will " + (inverseSymbol ? "add" : "remove") + " '" + symbol + "' " + (inverseSymbol ? "to" : "from") + " " + "Scripting Define Symbols in Player Settings."; } else { title = "Enable " + buttonTarget + " options ?"; message = "This will " + (inverseSymbol ? "remove" : "add") + " '" + symbol + "' " + (inverseSymbol ? "from" : "to") + " " + "Scripting Define Symbols in Player Settings."; message += inverseSymbol ? "" : "\n\nEnable this only if you have " + buttonTarget + " already installed."; } NotificationWindow.YesNo(title, message, () => { if (isEnabled) { if (inverseSymbol) { QUtils.AddScriptingDefineSymbol(symbol); } else { QUtils.RemoveScriptingDefineSymbol(symbol); } } else { if (inverseSymbol) { QUtils.RemoveScriptingDefineSymbol(symbol); } else { QUtils.AddScriptingDefineSymbol(symbol); } } }, null); } } } QUI.EndVertical(); }
void DrawUIElementsDatabase() { QUI.DrawTexture(DUIResources.headerUIElementsDatabase.texture, 552, 64); float sectionWidth = PAGE_WIDTH - SIDE_BAR_SHADOW_WIDTH * 2; QUI.BeginHorizontal(sectionWidth); { #region New Category if (!NewCategoryAnimBool.value) { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonNewCategory), 100 * (1 - SearchPatternAnimBool.faded), 20)) { NewCategoryName = ""; NewCategoryAnimBool.target = true; SearchPatternAnimBool.target = false; foreach (string category in UIElementsDatabaseAnimBool.Keys) { UIElementsDatabaseAnimBool[category].target = false; } } } else { SearchPatternAnimBool.target = false; QUI.DrawTexture(DUIResources.pageButtonNewCategory.active, 100, 20); QUI.Space(80); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.GreenLight.Color); NewCategoryName = EditorGUILayout.TextField(NewCategoryName, GUILayout.Width((sectionWidth - 149) * NewCategoryAnimBool.faded)); RestoreColors(); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonOk), 20, 20)) { if (string.IsNullOrEmpty(NewCategoryName)) { EditorUtility.DisplayDialog("Info", "Cannot create an unnamed category. Try again.", "Ok"); } else if (DUI.UIElementCategoryExists(NewCategoryName)) { EditorUtility.DisplayDialog("Info", "A category named '" + NewCategoryName + "' already exists in the database. Try again.", "Ok"); } else { DUI.CreateUIElementsCategory(NewCategoryName); NewCategoryAnimBool.target = false; RefreshUIElementsDatabase(true); } } QUI.Space(1); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonCancel), 20, 20)) { NewCategoryName = ""; NewCategoryAnimBool.target = false; } } #endregion QUI.Space(342 * (1 - NewCategoryAnimBool.faded) * (1 - SearchPatternAnimBool.faded)); #region Search if (!SearchPatternAnimBool.value) { QUI.FlexibleSpace(); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonSearch), 100 * (1 - NewCategoryAnimBool.faded), 20)) { SearchPattern = string.Empty; SearchPatternAnimBool.target = true; NewCategoryAnimBool.target = false; foreach (string category in UIElementsDatabaseAnimBool.Keys) { UIElementsDatabaseAnimBool[category].target = true; } } } else { NewCategoryAnimBool.target = false; if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonClearSearch), 100 * SearchPatternAnimBool.faded, 20)) { SearchPattern = string.Empty; SearchPatternAnimBool.target = false; foreach (string category in UIElementsDatabaseAnimBool.Keys) { UIElementsDatabaseAnimBool[category].target = false; } } GUILayout.Space(1); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); SearchPattern = EditorGUILayout.TextField(SearchPattern, GUILayout.Width((sectionWidth - 210) * SearchPatternAnimBool.faded)); RestoreColors(); QUI.DrawTexture(DUIResources.pageButtonSearch.active, 100, 20); } #endregion } QUI.EndHorizontal(); QUI.Space(16); if (UIElementsDatabaseAnimBool.Keys.Count == 0) { QUI.DrawTexture(DUIResources.pageImageEmptyDatabase.texture, 552, 256); QUI.BeginHorizontal(sectionWidth); { QUI.FlexibleSpace(); QUI.Label("Add a new category to get started...", DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelNormalItalic)); QUI.FlexibleSpace(); } QUI.EndHorizontal(); return; } foreach (string category in DUI.UIElementsDatabase.Keys) { QUI.BeginHorizontal(sectionWidth); { #region Button Bar if (ButtonBar(category + (SearchPatternAnimBool.target ? "*" : ""), UIElementsDatabaseAnimBool[category], (sectionWidth - 203 * UIElementsDatabaseAnimBool[category].faded * (1 - SearchPatternAnimBool.faded)))) { UIElementsDatabaseAnimBool[category].target = !UIElementsDatabaseAnimBool[category].target; } QUI.Space(-7); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonSortAtoZ), 100 * UIElementsDatabaseAnimBool[category].faded * (1 - SearchPatternAnimBool.faded), 20)) { DUI.UIElementsDatabase[category].RemoveEmpty(); DUI.UIElementsDatabase[category].Sort(); } QUI.Space(1); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonDelete), 100 * UIElementsDatabaseAnimBool[category].faded * (1 - SearchPatternAnimBool.faded), 20)) { if (EditorUtility.DisplayDialog("Delete the '" + category + "' category?", "Are you sure you want to proceed?\nOperation cannot be undone!", "Yes", "Cancel")) { DUI.DeleteUIElementsCategory(category); RefreshUIElementsDatabase(true); QUI.EndHorizontal(); break; } } #endregion } QUI.EndHorizontal(); if (!UIElementsDatabaseAnimBool.ContainsKey(category)) { RefreshUIElementsDatabase(true); } else { if (QUI.BeginFadeGroup(UIElementsDatabaseAnimBool[category].faded)) { QUI.BeginChangeCheck(); { if (DUI.UIElementsDatabase[category] == null) { RefreshUIElementsDatabase(); } else { DrawNamesList(DUI.UIElementsDatabase[category].data, PAGE_WIDTH - 200, "Category is empty..."); } } if (QUI.EndChangeCheck()) { if (DUI.UIElementsDatabase[category] == null) { RefreshUIElementsDatabase(); } else { EditorUtility.SetDirty(DUI.UIElementsDatabase[category]); } } QUI.Space(8); } QUI.EndFadeGroup(); } QUI.Space(2); } }
void DrawEnergyBars() { #if dUI_EnergyBarToolkit QUI.DrawTexture(DUIResources.barEnergyBars.texture, WIDTH_420, 18); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.PurpleLight.Color); QUI.Space(SPACE_2); if (sceneLoader.energyBars == null || sceneLoader.energyBars.Count == 0) { QUI.BeginHorizontal(WIDTH_420); { QUI.Label("No Energy Bars referenced... Click [+] to start...", WIDTH_420 - 27); QUI.BeginVertical(18); { QUI.Space(-1); if (QUI.ButtonPlus()) { Undo.RecordObject(sceneLoader, "Added Energy Bar"); sceneLoader.energyBars = new List <EnergyBar> { null }; } } QUI.EndVertical(); } QUI.EndHorizontal(); QUI.Space(SPACE_8); return; } QUI.BeginVertical(WIDTH_420); { for (int i = 0; i < sceneLoader.energyBars.Count; i++) { QUI.BeginHorizontal(WIDTH_420); { QUI.Space(-4); QUI.Label(" " + i.ToString(), 22); QUI.ObjectField(sceneLoader.energyBars[i], typeof(EnergyBar), true, WIDTH_420 - 18 - 18 - 13); QUI.BeginVertical(18); { QUI.Space(-1); if (QUI.ButtonMinus()) { Undo.RecordObject(sceneLoader, "Removed Energy Bar"); sceneLoader.energyBars.RemoveAt(i); } } QUI.EndVertical(); } QUI.EndHorizontal(); } QUI.BeginHorizontal(WIDTH_420); { QUI.Space(WIDTH_420 - 23); QUI.BeginVertical(18); { QUI.Space(-1); if (QUI.ButtonPlus()) { Undo.RecordObject(sceneLoader, "Added Energy Bar"); sceneLoader.energyBars.Add(null); } } QUI.EndVertical(); QUI.Space(2); } QUI.EndHorizontal(); } QUI.EndVertical(); QUI.Space(SPACE_8); RestoreColors(); #endif }
void DrawPageAbout() { DrawPageHeader("About", QColors.Blue, "", QUI.IsProSkin ? QColors.UnityLight : QColors.UnityMild, DUIResources.pageIconAbout); QUI.Space(SPACE_16); QUI.DrawTexture(DUIResources.aboutVersion.texture, 400, 200); if (WindowSettings.CurrentPageContentWidth > WindowSettings.pageWidth - 230) { return; } QUI.Space(-56); QUI.BeginHorizontal(WindowSettings.CurrentPageContentWidth); { QUI.FlexibleSpace(); QLabel.text = DUIVersion.Instance.version; QLabel.style = Style.Text.Subtitle; QUI.SetGUIContentColor(QUI.AccentColorBlue); if (editVersion.target) { newVersion = QUI.TextField(newVersion, 104); } else { QUI.Label(QLabel); } QUI.ResetColors(); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(38); #if dUI_SOURCE QUI.BeginHorizontal(WindowSettings.CurrentPageContentWidth); { QUI.FlexibleSpace(); if (QUI.GhostButton(editVersion.target ? "Update Version" : "Edit Version", editVersion.target ? QColors.Color.Green : QColors.Color.Gray, 100)) { editVersion.target = !editVersion.target; if (editVersion.target) { newVersion = DUIVersion.Instance.version; } else { DUIVersion.Instance.version = newVersion; QUI.SetDirty(DUIVersion.Instance); AssetDatabase.SaveAssets(); } } if (editVersion.faded > 0.2f) { if (QUI.GhostButton("Cancel", QColors.Color.Red, 100)) { editVersion.target = false; newVersion = ""; } } QUI.FlexibleSpace(); } QUI.EndHorizontal(); #endif QUI.Space(SPACE_8); DrawNewsArticle("About DoozyUI", "DoozyUI is a complete UI management system for Unity. " + "It manipulates native Unity components and takes full advantage of their intended usage. " + "This assures maximum compatibility with uGUI, best performance and makes the entire system have a predictable behaviour. " + "Also, by working only with native components, the system will be compaible with any ohter asset that uses uGUI correctly. " + "\n\n" + "Easy to use and understand, given the user has some basic knowledge of how Unity's native UI solution (uGUI) works, DoozyUI has flexible components that can be configured in a lot of ways. " + "Functionality and design go hand in hand in order to offer a pleasant user experience (UX) while using the system." + "\n\n" + "Starting with version 2.8, DoozyUI is officialy VR READY, being capable of handling with ease multiple Canvases set to World Space render mode. " + "The system has been redesigned, from the core up, in order to accomodate a higher degree of flexibility that was needed in order for it to handle a lot of different use case scenarios." + "\n\n" + "The asset 'DoozyUI' has been released on the Unity Asset Store under the 'Doozy Entertainment' brand, owned by the Marlink Trading SRL company.", WindowSettings.CurrentPageContentWidth); }
void DrawSideBarLogo() { QUI.DrawTexture(DUIResources.sideLogoDoozyUI.texture, SIDE_BAR_WIDTH, SIDE_BAR_LOGO_HEIGHT); }
void DrawControlPanelDoozyModules(float width) { QUI.DrawTexture(DUIResources.pageControlPanelSeparatorDoozyModules.texture, 242, 16); QUI.Space(2); #region Orientation Manager if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_UseOrientationManager if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonOrientationManagerEnabled), 242, 40)) { NotificationWindow.YesNo("Disable the Orientation Manager?", "This will remove '" + DUI.SYMBOL_ORIENTATION_MANAGER + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_ORIENTATION_MANAGER); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonOrientationManagerDisabled), 242, 40)) { NotificationWindow.YesNo("Enable the Orientation Manager?", "Enable this only if you want to create different UI's for each orientation." + "\n\n" + "This will add '" + DUI.SYMBOL_ORIENTATION_MANAGER + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_ORIENTATION_MANAGER); }, null); } #endif } QUI.EndHorizontal(); } #endregion QUI.Space(2); #region Navigation System if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_NavigationDisabled if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonNavigationSystemDisabled), 242, 40)) { NotificationWindow.YesNo("Enable the Navigation Manager?", "This will remove '" + DUI.SYMBOL_NAVIGATION_SYSTEM + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_NAVIGATION_SYSTEM); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonNavigationSystemEnabled), 242, 40)) { NotificationWindow.YesNo("Disable the Navigation Manager?", "Do this if you intend to handle the navigation yourself (maybe by using Playmaker?)." + "\n\n" + "This will add '" + DUI.SYMBOL_NAVIGATION_SYSTEM + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_NAVIGATION_SYSTEM); }, null); } #endif } QUI.EndHorizontal(); } #endregion }
void DrawSideBarDatabases() { QUI.DrawTexture(DUIResources.sideTitleDatabases.texture, SIDE_BAR_WIDTH, SIDE_BAR_HEADER_HEIGHT); if (CurrentSection == Section.UIElements) { QUI.DrawTexture(DUIResources.sideButtonUIElementSelected.texture, SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.SideButtonUIElement), SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT)) { CurrentSection = Section.UIElements; ResetPageView(); } } if (CurrentSection == Section.UIButtons) { QUI.DrawTexture(DUIResources.sideButtonUIButtonSelected.texture, SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.SideButtonUIButton), SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT)) { CurrentSection = Section.UIButtons; ResetPageView(); } } if (CurrentSection == Section.UISounds) { QUI.DrawTexture(DUIResources.sideButtonUISoundsSelected.texture, SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.SideButtonUISounds), SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT)) { CurrentSection = Section.UISounds; ResetPageView(); } } if (CurrentSection == Section.CanvasNames) { QUI.DrawTexture(DUIResources.sideButtonUICanvasesSelected.texture, SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.SideButtonUICanvases), SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT)) { CurrentSection = Section.CanvasNames; ResetPageView(); } } if (CurrentSection == Section.AnimatorPresets) { QUI.DrawTexture(DUIResources.sideButtonAnimatorPresetsSelected.texture, SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.SideButtonAnimatorPresets), SIDE_BAR_WIDTH, SIDE_BAR_BUTTON_HEIGHT)) { CurrentSection = Section.AnimatorPresets; ResetPageView(); } } QUI.Space(VERTICAL_SPACE_DIVIDER); }
void DrawControlPanelSpportFor3RdPartyAssets(float width) { QUI.DrawTexture(DUIResources.pageControlPanelSeparatorSupport.texture, 242, 16); QUI.Space(2); #region Playmaker if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_PlayMaker if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonPlaymakerEnabled), 200, 40)) { NotificationWindow.YesNo("Disable support for PlayMaker?", "This will remove '" + DUI.SYMBOL_PLAYMAKER + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_PLAYMAKER); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonPlaymakerDisabled), 200, 40)) { NotificationWindow.YesNo("Enable support for PlayMaker?", "Enable this only if you have PlayMaker already installed." + "\n\n" + "This will add '" + DUI.SYMBOL_PLAYMAKER + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_PLAYMAKER); }, null); } #endif QUI.Space(2); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonExternalLink), 40, 40)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/368"); } } QUI.EndHorizontal(); #endregion } QUI.Space(2); #region Master Audio if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_MasterAudio if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonMasterAudioEnabled), 200, 40)) { NotificationWindow.YesNo("Disable support for Master Audio?", "This will remove '" + DUI.SYMBOL_MASTER_AUDIO + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_MASTER_AUDIO); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonMasterAudioDisabled), 200, 40)) { NotificationWindow.YesNo("Enable support for Master Audio?", "Enable this only if you have Master Audio already installed." + "\n\n" + "This will add '" + DUI.SYMBOL_MASTER_AUDIO + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_MASTER_AUDIO); }, null); } #endif QUI.Space(2); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonExternalLink), 40, 40)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/5607"); } } QUI.EndHorizontal(); } #endregion QUI.Space(2); #region Energy Bar Toolkit if (EditorApplication.isCompiling) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorIsCompiling.texture, 242, 40); } else if (EditorApplication.isPlayingOrWillChangePlaymode) { QUI.DrawTexture(DUIResources.pageControlPanelButtonMaskEditorInPlayMode.texture, 242, 40); } else { QUI.BeginHorizontal(width); { #if dUI_EnergyBarToolkit if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonEnergyBarToolkitEnabled), 200, 40)) { NotificationWindow.YesNo("Disable support for Energy Bar Toolkit?", "This will remove '" + DUI.SYMBOL_ENERGY_BAR_TOOLKIT + "' from Scripting Define Symbols in Player Settings.", () => { QUtils.RemoveScriptingDefineSymbol(DUI.SYMBOL_ENERGY_BAR_TOOLKIT); }, null); } #else if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonEnergyBarToolkitDisabled), 200, 40)) { NotificationWindow.YesNo("Enable support for Energy Bar Toolkit?", "Enable this only if you have Energy Bar Toolkit already installed." + "\n\n" + "This will add '" + DUI.SYMBOL_ENERGY_BAR_TOOLKIT + "' to Scripting Define Symbols in Player Settings.", () => { QUtils.AddScriptingDefineSymbol(DUI.SYMBOL_ENERGY_BAR_TOOLKIT); }, null); } #endif QUI.Space(2); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageControlPanelButtonExternalLink), 40, 40)) { Application.OpenURL("https://www.assetstore.unity3d.com/en/#!/content/7515"); } } QUI.EndHorizontal(); } #endregion }
void DrawUISounds() { QUI.DrawTexture(DUIResources.headerUISoundsDatabase.texture, 552, 64); float sectionWidth = PAGE_WIDTH - SIDE_BAR_SHADOW_WIDTH * 2; QUI.BeginHorizontal(sectionWidth); { #region New UISound if (!NewUISoundAnimBool.value) { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonNewUISound), 100 * (1 - SearchPatternAnimBool.faded), 20)) { NewUISoundName = ""; NewUISoundAnimBool.target = true; SearchPatternAnimBool.target = false; } } else { SearchPatternAnimBool.target = false; QUI.DrawTexture(DUIResources.pageButtonNewUISound.active, 100, 20); QUI.Space(80); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.GreenLight.Color); NewUISoundName = EditorGUILayout.TextField(NewUISoundName, GUILayout.Width((sectionWidth - 149) * NewUISoundAnimBool.faded)); RestoreColors(); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonOk), 20, 20)) { if (string.IsNullOrEmpty(NewUISoundName)) { EditorUtility.DisplayDialog("Info", "Cannot create an unnamed ui sound. Try again.", "Ok"); } else if (DUI.UISoundNameExists(NewUISoundName)) { EditorUtility.DisplayDialog("Info", "An ui sound named '" + NewUISoundName + "' already exists in the database. Try again.", "Ok"); } else { DUI.CreateUISound(NewUISoundName, soundTypeFilter); NewUISoundAnimBool.target = false; RefreshUISoundsDatabase(true); } } QUI.Space(1); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonCancel), 20, 20)) { NewUISoundName = ""; NewUISoundAnimBool.target = false; } } #endregion QUI.Space(342 * (1 - NewUISoundAnimBool.faded) * (1 - SearchPatternAnimBool.faded)); #region Search if (!SearchPatternAnimBool.value) { QUI.FlexibleSpace(); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonSearch), 100 * (1 - NewUISoundAnimBool.faded), 20)) { SearchPattern = string.Empty; SearchPatternAnimBool.target = true; NewUISoundAnimBool.target = false; } } else { NewUISoundAnimBool.target = false; if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonClearSearch), 100 * SearchPatternAnimBool.faded, 20)) { SearchPattern = string.Empty; SearchPatternAnimBool.target = false; } GUILayout.Space(1); SaveColors(); QUI.SetGUIBackgroundColor(DUIColors.BlueLight.Color); SearchPattern = EditorGUILayout.TextField(SearchPattern, GUILayout.Width((sectionWidth - 210) * SearchPatternAnimBool.faded)); RestoreColors(); QUI.DrawTexture(DUIResources.pageButtonSearch.active, 100, 20); } #endregion } QUI.EndHorizontal(); QUI.Space(16); #region Filter QUI.BeginHorizontal(sectionWidth); { QUI.Space(8); QUI.FlexibleSpace(); QUI.DrawTexture(DUIResources.pageButtonFilterHeader.texture, 302, 10); QUI.Space(302); QUI.FlexibleSpace(); } QUI.EndHorizontal(); QUI.Space(10); QUI.BeginHorizontal(sectionWidth); { QUI.Space(-2); QUI.FlexibleSpace(); if (soundTypeFilter == SoundType.All) { QUI.DrawTexture(DUIResources.pageButtonFilterAll.active, 100, 20); QUI.Space(80); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonFilterAll), 100, 20)) { soundTypeFilter = SoundType.All; } } QUI.Space(1); if (soundTypeFilter == SoundType.UIButtons) { QUI.DrawTexture(DUIResources.pageButtonFilterUIButton.active, 100, 20); QUI.Space(80); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonFilterUIButton), 100, 20)) { soundTypeFilter = SoundType.UIButtons; } } QUI.Space(1); if (soundTypeFilter == SoundType.UIElements) { QUI.DrawTexture(DUIResources.pageButtonFilterUIElement.active, 100, 20); QUI.Space(80); } else { if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonFilterUIElement), 100, 20)) { soundTypeFilter = SoundType.UIElements; } } QUI.FlexibleSpace(); } QUI.EndHorizontal(); #endregion QUI.Space(16); if (DUI.UISoundsDatabase.Count == 0) { QUI.DrawTexture(DUIResources.pageImageEmptyDatabase.texture, 552, 256); return; } QUI.DrawTexture(DUIResources.pageUISoundsTableTop.texture, 552, 12); for (int i = 0; i < DUI.UISoundsDatabase.Count; i++) { if (DUI.UISoundsDatabase[i] == null) { continue; } if (soundTypeFilter == SoundType.UIButtons && DUI.UISoundsDatabase[i].soundType == SoundType.UIElements) { continue; } if (soundTypeFilter == SoundType.UIElements && DUI.UISoundsDatabase[i].soundType == SoundType.UIButtons) { continue; } QUI.BeginHorizontal(sectionWidth); { if (SearchPatternAnimBool.target)//a search pattern has been entered in the search box { try { if (!Regex.IsMatch(DUI.UISoundsDatabase[i].soundName, SearchPattern, RegexOptions.IgnoreCase)) { QUI.EndHorizontal(); continue; //this does not match the search pattern --> we do not show this name it } } catch (Exception) { } } DUI.UISoundsDatabase[i].soundType = (SoundType)EditorGUILayout.EnumPopup(DUI.UISoundsDatabase[i].soundType, GUILayout.Width(80)); if (SearchPatternAnimBool.target) { QUI.Label(DUI.UISoundsDatabase[i].soundName, DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelNormalItalic), 174); } else { QUI.Label(DUI.UISoundsDatabase[i].soundName, DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelNormal), 174); } #if dUI_MasterAudio QUI.Label("Controlled by MasterAudio", DUIStyles.GetStyle(DUIStyles.BlackTextStyle.BlackLabelSmallItalic), 140); #else QUI.BeginChangeCheck(); { DUI.UISoundsDatabase[i].audioClip = (AudioClip)EditorGUILayout.ObjectField("", DUI.UISoundsDatabase[i].audioClip, typeof(AudioClip), false, GUILayout.Width(140)); } if (QUI.EndChangeCheck()) { Undo.RecordObject(DUI.DUISettings, "Updated UISound"); EditorUtility.SetDirty(DUI.UISoundsDatabase[i]); AssetDatabase.SaveAssets(); } #endif QUI.Space(50 * SearchPatternAnimBool.faded); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonPlay), 20, 20)) { DUIUtils.PreviewSound(DUI.UISoundsDatabase[i].soundName); } QUI.Space(1); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonStop), 20, 20)) { DUIUtils.StopSoundPreview(DUI.UISoundsDatabase[i].soundName); } QUI.Space(1); if (QUI.Button(DUIStyles.GetStyle(DUIStyles.ControlPanel.PageButtonDelete), 100 * (1 - SearchPatternAnimBool.faded), 20)) { if (EditorUtility.DisplayDialog("Delete the '" + DUI.UISoundsDatabase[i].soundName + "' ui sound?", "Are you sure you want to proceed?\nOperation cannot be undone!", "Yes", "Cancel")) { DUI.DeleteUISound(DUI.UISoundsDatabase[i].soundName); RefreshUISoundsDatabase(true); QUI.EndHorizontal(); continue; } } } QUI.EndHorizontal(); QUI.Space(2); } QUI.Space(-2); QUI.DrawTexture(DUIResources.pageUISoundsTableBottom.texture, 552, 12); }