void DrawOrientation(float width) { QStyles.GetStyle(QStyles.GetStyleName(Style.GhostButton.Purple)).alignment = TextAnchor.MiddleRight; if (QUI.GhostButton("update orientation", QColors.Color.Purple, width, 32, 10)) { UpdateOrientationInEditMode(); } QStyles.GetStyle(QStyles.GetStyleName(Style.GhostButton.Purple)).alignment = TextAnchor.MiddleCenter; QUI.Space(-32); switch (orientationManager.CurrentOrientation) { case OrientationManager.Orientation.Landscape: QUI.DrawTexture(DUIResources.miniIconOrientationLandscape.texture, 160, 32); break; case OrientationManager.Orientation.Portrait: QUI.DrawTexture(DUIResources.miniIconOrientationPortrait.texture, 160, 32); break; case OrientationManager.Orientation.Unknown: QUI.DrawTexture(DUIResources.miniIconOrientationUnknown.texture, 160, 32); break; } QUI.Space(SPACE_2); QUI.SetGUIBackgroundColor(QUI.AccentColorPurple); QUI.PropertyField(onOrientationChange, true, new GUIContent("OnOrientationChange"), width); QUI.ResetColors(); }
private static List <GUIStyle> GeneralStyles() { List <GUIStyle> styles = new List <GUIStyle> { GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonCollapseSideBar), EZResources.sideButtonCollapseSideBar, QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(2, 28, 2, 2), new RectOffset(2, 32, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonExpandSideBar), EZResources.sideButtonExpandSideBar, QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(2, 28, 2, 2), new RectOffset(2, 32, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonControlPanel), EZResources.sideButtonControlPanel, QUI.IsProSkin ? QColors.BlueLight.Color : QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonDefineSymbols), EZResources.sideButtonDefineSymbols, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonDataManager), EZResources.sideButtonDataManager, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonDataBind), EZResources.sideButtonDataBind, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonPooly), EZResources.sideButtonPooly, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonAdsManager), EZResources.sideButtonAdsManager, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonHelpBtnHelp), EZResources.sideButtonHelp, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonAbout), EZResources.sideButtonAbout, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonTwitter), EZResources.sideButtonTwitter, ColorExtensions.ColorFrom256(128, 128, 128), ColorExtensions.ColorFrom256(242, 242, 242), ColorExtensions.ColorFrom256(0, 153, 209), new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4), 14), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonFacebook), EZResources.sideButtonFacebook, ColorExtensions.ColorFrom256(128, 128, 128), ColorExtensions.ColorFrom256(242, 242, 242), ColorExtensions.ColorFrom256(74, 112, 186), new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4), 14), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonYoutube), EZResources.sideButtonYoutube, ColorExtensions.ColorFrom256(128, 128, 128), ColorExtensions.ColorFrom256(242, 242, 242), ColorExtensions.ColorFrom256(255, 102, 102), new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4), 14), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedControlPanel), EZResources.sideButtonControlPanelSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedDefineSymbols), EZResources.sideButtonDefineSymbolsSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedDataManager), EZResources.sideButtonDataManagerSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedDataBind), EZResources.sideButtonDataBindSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedPooly), EZResources.sideButtonPoolySelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedAdsManager), EZResources.sideButtonAdsManagerSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedHelpBtnHelp), EZResources.sideButtonHelpSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelectedAbout), EZResources.sideButtonAboutSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), }; return(styles); }
private static List <GUIStyle> GeneralStyles() { List <GUIStyle> styles = new List <GUIStyle> { GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonCollapseSideBar), EZResources.sideButtonCollapseSideBar, QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(2, 28, 2, 2), new RectOffset(2, 32, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonExpandSideBar), EZResources.sideButtonExpandSideBar, QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(2, 28, 2, 2), new RectOffset(2, 32, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton1), EZResources.sideButtonControlPanel, QUI.IsProSkin ? QColors.BlueLight.Color : QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton2), EZResources.sideButtonDefineSymbols, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton3), EZResources.sideButtonDataManager, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton4), EZResources.sideButtonDataBind, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton5), EZResources.sideButtonPooly, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton6), EZResources.sideButtonAdsManager, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton7), EZResources.sideButtonHelp, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButton8), EZResources.sideButtonAbout, QUI.IsProSkin ? QColors.BlueLight.Color :QColors.BlueDark.Color, QColors.BlueDark.Color, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonTwitter), EZResources.sideButtonTwitter, MyColor.GetColor(128, 128, 128), MyColor.GetColor(242, 242, 242), MyColor.GetColor(0, 153, 209), new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4), 14), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonBlue), EZResources.sideButtonFacebook, MyColor.GetColor(128, 128, 128), MyColor.GetColor(242, 242, 242), MyColor.GetColor(74, 112, 186), new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4), 14), GetSideButtonStyle(QStyles.GetStyleName(General.SideButtonRed), EZResources.sideButtonYoutube, MyColor.GetColor(128, 128, 128), MyColor.GetColor(242, 242, 242), MyColor.GetColor(255, 102, 102), new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4), 14), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected1), EZResources.sideButtonControlPanelSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected2), EZResources.sideButtonDefineSymbolsSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected3), EZResources.sideButtonDataManagerSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected4), EZResources.sideButtonDataBindSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected5), EZResources.sideButtonPoolySelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected6), EZResources.sideButtonAdsManagerSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected7), EZResources.sideButtonHelpSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), GetSideButtonSelectedStyle(QStyles.GetStyleName(General.SideButtonSelected8), EZResources.sideButtonAboutSelected, QColors.GreenLight.Color, new RectOffset(28, 2, 2, 2), new RectOffset(32, 2, 2, 4)), }; return(styles); }
private static List <GUIStyle> SideButtonStyles() { RectOffset expandCollapseBorder = new RectOffset(2, 28, 2, 2); RectOffset expandCollapsePadding = new RectOffset(2, 32, 2, 4); RectOffset border = new RectOffset(28, 2, 2, 2); RectOffset padding = new RectOffset(32, 2, 2, 2); int fontSize = 16; RectOffset socialButtonBorder = new RectOffset(28, 2, 2, 2); RectOffset socialButtonPadding = new RectOffset(28, 2, 2, 2); int socialButtonFontSize = 12; Color normalGray = QUI.IsProSkin ? QColors.UnityMild.Color : QColors.UnityMild.Color; Color activeBlue = QUI.IsProSkin ? QColors.Blue.Color : QColors.BlueDark.Color; Color hoverBlue = QUI.IsProSkin ? QColors.BlueDark.Color : QColors.BlueDark.Color; Color selectedBlue = QUI.IsProSkin ? QColors.BlueLight.Color : QColors.BlueDark.Color; return(new List <GUIStyle>() { SideButtonStyle(QStyles.GetStyleName(SideButton.CollapseSideBar), DUIResources.sideButtonCollapseSideBar, normalGray, activeBlue, hoverBlue, expandCollapseBorder, expandCollapsePadding), SideButtonStyle(QStyles.GetStyleName(SideButton.ExpandSideBar), DUIResources.sideButtonExpandSideBar, normalGray, activeBlue, hoverBlue, expandCollapseBorder, expandCollapsePadding), SideButtonStyle(QStyles.GetStyleName(SideButton.ControlPanel), DUIResources.sideButtonControlPanel, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.ControlPanelSelected), DUIResources.sideButtonControlPanelSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.UIElements), DUIResources.sideButtonUIElements, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.UIElementsSelected), DUIResources.sideButtonUIElementsSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.UIButtons), DUIResources.sideButtonUIButtons, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.UIButtonsSelected), DUIResources.sideButtonUIButtonsSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.UISounds), DUIResources.sideButtonUISounds, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.UISoundsSelected), DUIResources.sideButtonUISoundsSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.UICanvases), DUIResources.sideButtonUICanvases, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.UICanvasesSelected), DUIResources.sideButtonUICanvasesSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.AnimatorPresets), DUIResources.sideButtonAnimatorPresets, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.AnimatorPresetsSelected), DUIResources.sideButtonAnimatorPresetsSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.EditorSettings), DUIResources.sideButtonEditorSettings, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.EditorSettingsSelected), DUIResources.sideButtonEditorSettingsSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.Help), DUIResources.sideButtonHelp, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.HelpSelected), DUIResources.sideButtonHelpSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.About), DUIResources.sideButtonAbout, normalGray, activeBlue, hoverBlue, border, padding, fontSize), SideButtonSelectedStyle(QStyles.GetStyleName(SideButton.AboutSelected), DUIResources.sideButtonAboutSelected, selectedBlue, border, padding, fontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.Twitter), DUIResources.sideButtonTwitter, ColorExtensions.ColorFrom256(128, 128, 128), ColorExtensions.ColorFrom256(242, 242, 242), ColorExtensions.ColorFrom256(0, 153, 209), socialButtonBorder, socialButtonPadding, socialButtonFontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.Facebook), DUIResources.sideButtonFacebook, ColorExtensions.ColorFrom256(128, 128, 128), ColorExtensions.ColorFrom256(242, 242, 242), ColorExtensions.ColorFrom256(74, 112, 186), socialButtonBorder, socialButtonPadding, socialButtonFontSize), SideButtonStyle(QStyles.GetStyleName(SideButton.Youtube), DUIResources.sideButtonYoutube, ColorExtensions.ColorFrom256(128, 128, 128), ColorExtensions.ColorFrom256(242, 242, 242), ColorExtensions.ColorFrom256(255, 102, 102), socialButtonBorder, socialButtonPadding, socialButtonFontSize), }); }
static void HierarchyCustomizer(int instanceID, Rect selectionRect) { if (DUI.DUISettings == null || !DUI.DUISettings.HierarchyManager_Enabled) { return; } QLabel = new QLabel("", Style.Text.Small); rect = new Rect(selectionRect); rect.x = rect.xMax - iconWidth; rect.width = iconWidth; rect.height = iconHeight; #if dUI_PlayMaker if (DUI.DUISettings.HierarchyManager_PlaymakerEventDispatcher_ShowIcon && playmakerEventDispatcherIDs.ContainsKey(instanceID) && playmakerEventDispatcherIDs[instanceID] != null) { GUI.Label(rect, DUIResources.iconPlayMakerEventDispatcher.texture); rect.x -= iconWidth; } #endif if (DUI.DUISettings.HierarchyManager_UITrigger_ShowIcon && uiTriggerIDs.ContainsKey(instanceID) && uiTriggerIDs[instanceID] != null) { GUI.Label(rect, DUIResources.iconUITrigger.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_UIManager_ShowIcon && UIManagerID == instanceID) { GUI.Label(rect, DUIResources.iconUIManager.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_Soundy_ShowIcon && SoundyID == instanceID) { GUI.Label(rect, DUIResources.iconSoundy.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_UINotificationManager_ShowIcon && UINotificationManagerID == instanceID) { GUI.Label(rect, DUIResources.iconUINotificationManager.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_OrientationManager_ShowIcon && OrientationManagerID == instanceID) { GUI.Label(rect, DUIResources.iconOrientationManager.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_SceneLoader_ShowIcon && SceneLoaderID == instanceID) { GUI.Label(rect, DUIResources.iconSceneLoader.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_UICanvas_Enabled && uiCanvasIDs.ContainsKey(instanceID) && uiCanvasIDs[instanceID] != null) { if (DUI.DUISettings.HierarchyManager_UICanvas_ShowIcon) { GUI.Label(rect, DUIResources.iconUICanvas.texture); } else { rect.x += iconWidth; } uic = uiCanvasIDs[instanceID]; QLabel.text = ""; QLabel.style = Style.Text.Small; QLabel.text = (DUI.DUISettings.HierarchyManager_UICanvas_ShowCanvasName ? "[ " + uic.canvasName + " ]" : "") + (DUI.DUISettings.HierarchyManager_UICanvas_ShowSortingLayerNameAndOrder ? " " + uic.Canvas.sortingLayerName + " " + uic.Canvas.sortingOrder : ""); if (!string.IsNullOrEmpty(QLabel.text)) { rect.x -= QLabel.x; rect.width = QLabel.x; GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style))); } } if (DUI.DUISettings.HierarchyManager_UIButton_Enabled && uiButtonIDs.ContainsKey(instanceID) && uiButtonIDs[instanceID] != null) { if (DUI.DUISettings.HierarchyManager_UIButton_ShowIcon) { GUI.Label(rect, DUIResources.iconUIButton.texture); } else { rect.x += iconWidth; } uib = uiButtonIDs[instanceID]; QLabel.text = ""; QLabel.style = Style.Text.Small; QLabel.text = (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonCategory ? "[ " + uib.buttonCategory + " ]" : "") + (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonName ? "[ " + uib.buttonName + " ]" : ""); if (!string.IsNullOrEmpty(QLabel.text)) { rect.x -= QLabel.x; rect.width = QLabel.x; GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style))); } } if (DUI.DUISettings.HierarchyManager_UINotification_ShowIcon && uiNotificationIDs.ContainsKey(instanceID)) { GUI.Label(rect, DUIResources.iconUINotification.texture); rect.x -= iconWidth; } if (DUI.DUISettings.HierarchyManager_UIElement_Enabled && uiElementIDs.ContainsKey(instanceID) && uiElementIDs[instanceID] != null) { if (DUI.DUISettings.HierarchyManager_UIElement_ShowIcon) { GUI.Label(rect, DUIResources.iconUIElement.texture); } else { rect.x += iconWidth; } uie = uiElementIDs[instanceID]; QLabel.text = ""; QLabel.style = Style.Text.Small; if (uie.linkedToNotification) { QLabel.text = "linked to notification"; } else { QLabel.text = (DUI.DUISettings.HierarchyManager_UIElement_ShowElementCategory ? "[ " + uie.elementCategory + " ]" : "") + (DUI.DUISettings.HierarchyManager_UIElement_ShowElementName ? "[ " + uie.elementName + " ]" : "") + (DUI.DUISettings.HierarchyManager_UIElement_ShowSortingLayerNameAndOrder ? " " + uie.Canvas.sortingLayerName + " " + uie.Canvas.sortingOrder : ""); } if (!string.IsNullOrEmpty(QLabel.text)) { rect.x -= QLabel.x; rect.width = QLabel.x; GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style))); } } if (DUI.DUISettings.HierarchyManager_UIEffect_Enabled && uiEffectIDs.ContainsKey(instanceID) && uiEffectIDs[instanceID] != null) { if (DUI.DUISettings.HierarchyManager_UIEffect_ShowIcon) { GUI.Label(rect, DUIResources.iconUIEffect.texture); } else { rect.x += iconWidth; } uief = uiEffectIDs[instanceID]; if (DUI.DUISettings.HierarchyManager_UIEffect_ShowSortingLayerNameAndOrder) { if (uief.targetUIElement != null) { if (uief.targetUIElement.linkedToNotification) { QLabel.text = "linked to notification"; } else { QLabel.text = (uief.useCustomSortingLayerName ? uief.customSortingLayerName : uief.targetUIElement.Canvas.overrideSorting ? uief.targetUIElement.Canvas.sortingLayerName : uief.targetUIElement.Canvas.rootCanvas.sortingLayerName) + " " + (uief.useCustomOrderInLayer ? uief.customOrderInLayer : uief.targetUIElement.Canvas.overrideSorting ? uief.targetUIElement.Canvas.sortingOrder : uief.targetUIElement.Canvas.rootCanvas.sortingOrder); } } else { QLabel.text = "DISABLED"; } rect.x -= QLabel.x; rect.width = QLabel.x; GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style))); } } }
/// <summary> /// Returns a style that has been added to the skin. /// This method is to be used paired with the enums in the Style class. /// </summary> public static GUIStyle GetStyle <T>(T styleName) { return(Skin.GetStyle(QStyles.GetStyleName(styleName))); }
void DrawModuleVersion(string moduleName, Page targetModule, EzModuleVersion emv, AnimBool show, float width) { if (QUI.GhostBar(moduleName + (emv == null ? " has not been installed!" : (" version " + emv.versionNumber)), emv == null ? QColors.Color.Gray : QColors.Color.Green, show, width, 24)) { if (emv == null) { show.target = false; WindowSettings.currentPage = targetModule; } else { show.target = !show.target; if (selectedModuleToEdit == targetModule) { selectedModuleToEdit = Page.None; editModuleAnimBool.target = false; } } } if (emv == null) { return; } if (QUI.BeginFadeGroup(show.faded)) { QUI.BeginVertical(width); { QUI.Space(-9); QUI.BeginHorizontal(width); { EditorGUILayout.LabelField(emv.releaseNotes, QStyles.GetInfoMessageMessageStyle(Style.InfoMessage.Help)); } QUI.EndHorizontal(); #if EZ_SOURCE #pragma warning disable CS0162 // Unreachable code detected QUI.Space(13); QUI.Space(8 * (selectedModuleToEdit == targetModule ? editModuleAnimBool.faded : 0)); QUI.BeginHorizontal(width); { QUI.FlexibleSpace(); if (QUI.GhostButton("Edit Version", QColors.Color.Gray, 100, 16, selectedModuleToEdit == targetModule) || QUI.DetectKeyUp(Event.current, KeyCode.Escape)) { if (selectedModuleToEdit == targetModule) { selectedModuleToEdit = Page.None; editModuleAnimBool.target = false; } else { selectedModuleToEdit = targetModule; editModuleAnimBool.target = true; } } if (selectedModuleToEdit == targetModule && editModuleAnimBool.faded > 0.4f) { QUI.Space(SPACE_4 * editModuleAnimBool.faded); if (QUI.GhostButton("Save Changes", QColors.Color.Green, 100 * editModuleAnimBool.faded, 16)) { QUI.SetDirty(emv); AssetDatabase.SaveAssets(); selectedModuleToEdit = Page.None; editModuleAnimBool.value = false; } } } QUI.EndHorizontal(); if (selectedModuleToEdit == targetModule) { if (QUI.BeginFadeGroup(editModuleAnimBool.faded)) { QUI.BeginVertical(width); { QUI.BeginHorizontal(width); { EditorGUILayout.LabelField("version", QStyles.GetStyle(QStyles.GetStyleName(Style.Text.Small)), GUILayout.Width(80)); QUI.Space(SPACE_2); EditorGUILayout.LabelField("release notes", QStyles.GetStyle(QStyles.GetStyleName(Style.Text.Small))); } QUI.EndHorizontal(); QUI.Space(-SPACE_4); QUI.BeginHorizontal(width); { emv.versionNumber = EditorGUILayout.TextField(emv.versionNumber, GUILayout.Width(80)); QUI.Space(SPACE_2); emv.releaseNotes = EditorGUILayout.TextArea(emv.releaseNotes); } QUI.EndHorizontal(); QUI.Space(SPACE_16); } QUI.EndVertical(); } QUI.EndFadeGroup(); } #endif QUI.Space(9 + 16); } QUI.EndVertical(); } QUI.EndFadeGroup(); #pragma warning restore CS0162 // Unreachable code detected }