protected override void OnEnable()
        {
            base.OnEnable();
            requiresContantRepaint = true;

            headerTouchManager = new QTexture(HEADERS, "headerTouchManager" + QResources.IsProSkinTag);
        }
        protected override void OnEnable()
        {
            base.OnEnable();
            requiresContantRepaint = true;

            headerUIDrawer = new QTexture(IMAGES, "headerUIDrawer" + QResources.IsProSkinTag);
        }
Example #3
0
        protected override void OnEnable()
        {
            base.OnEnable();
            requiresContantRepaint = true;

            UpdateTarget();
            SyncData();

            headerGestureDetector = new QTexture(HEADERS, "headerGestureDetector" + QResources.IsProSkinTag);
        }
Example #4
0
 public QImage(QBehavior s, string textureName) : this(s)
 {
     foreach (var atlas in Script.World.Content.Atlases)
     {
         if (atlas.Rectangles.TryGetValue(textureName, out QRectangle rect))
         {
             Texture = atlas;
             Source  = rect;
         }
     }
 }
Example #5
0
 // PUBLIC
 public Texture2D getTexture(QTexture textureName)
 {
     if (!textures.ContainsKey(textureName))
     {
         Texture2D texture = new Texture2D(0, 0, TextureFormat.ARGB32, false, true);
         texture.hideFlags = HideFlags.HideAndDontSave;
         texture.LoadImage(Convert.FromBase64String(EditorGUIUtility.isProSkin ? resourcesDark[textureName] : resourcesLight[textureName]));
         textures.Add(textureName, texture);
     }
     return(textures[textureName]);
 }
Example #6
0
 GUIStyle GetSupportedAssetButtonStyle(QTexture qTexture)
 {
     return(new GUIStyle
     {
         normal = { background = qTexture.normal2D },
         onNormal = { background = qTexture.normal2D },
         hover = { background = qTexture.hover2D },
         onHover = { background = qTexture.hover2D },
         active = { background = qTexture.active2D },
         onActive = { background = qTexture.active2D },
     });
 }
Example #7
0
 private static GUIStyle GetButtonStyle(NotificationWindow styleName, QTexture qTexture)
 {
     return(new GUIStyle()
     {
         name = styleName.ToString(),
         normal = { background = qTexture.normal2D },
         onNormal = { background = qTexture.normal2D },
         hover = { background = qTexture.hover2D },
         onHover = { background = qTexture.hover2D },
         active = { background = qTexture.active2D },
         onActive = { background = qTexture.active2D }
     });
 }
Example #8
0
 private static GUIStyle GetSideButtonSelectedStyle(string styleName, QTexture qTexture, Color normalTextColor, RectOffset border, RectOffset padding)
 {
     return(new GUIStyle()
     {
         name = styleName.ToString(),
         normal = { background = qTexture.normal2D, textColor = normalTextColor },
         onNormal = { background = qTexture.normal2D, textColor = normalTextColor },
         border = border,
         padding = padding,
         fontSize = 20,
         alignment = TextAnchor.MiddleLeft,
         font = QResources.GetFont(FontName.Sansation.Regular)
     });
 }
Example #9
0
        public override void OnStart(QGetContent get)
        {
            Square = get.Texture("penis");
            font   = get.Font("arial");
            euro   = get.Texture("asdf");

            Arial  = new QLabel(font);
            sprite = new QSprite(this, "penis");
            Instantiate(new QDemoObject2());

            Console.Label = Arial;
            Console.Color = QColor.DarkGoldenrod;

            Coroutine.Start(Thing());
        }
Example #10
0
 private static GUIStyle GetSideButtonStyle(string styleName, QTexture qTexture, Color normalTextColor, Color hoverTextColor, Color activeTextColor, RectOffset border, RectOffset padding, int fontSize = 20)
 {
     return(new GUIStyle()
     {
         name = styleName,
         normal = { background = qTexture.normal2D, textColor = normalTextColor },
         onNormal = { background = qTexture.normal2D, textColor = normalTextColor },
         hover = { background = qTexture.hover2D, textColor = hoverTextColor },
         onHover = { background = qTexture.hover2D, textColor = hoverTextColor },
         active = { background = qTexture.active2D, textColor = activeTextColor },
         onActive = { background = qTexture.active2D, textColor = activeTextColor },
         border = border,
         padding = padding,
         fontSize = fontSize,
         alignment = TextAnchor.MiddleLeft,
         font = QResources.GetFont(FontName.Sansation.Regular)
     });
 }
Example #11
0
 public QImage(QBehavior script)
 {
     Script  = script;
     Texture = null;
 }
        void DrawPageHeader(string title, QColor titleColor, string subtitle, QColor subtitleColor, QTexture iconQTexture)
        {
            QUI.Space(SPACE_2);
            QUI.Box(QStyles.GetBackgroundStyle(Style.BackgroundType.Low, QColors.Color.Gray), WindowSettings.CurrentPageContentWidth + WindowSettings.pageShadowWidth, WindowSettings.pageHeaderHeight);
            QUI.Space(-WindowSettings.pageHeaderHeight + (WindowSettings.pageHeaderHeight - WindowSettings.pageHeaderHeight * 0.8f) / 2);
            QUI.BeginHorizontal(WindowSettings.CurrentPageContentWidth + WindowSettings.pageShadowWidth, WindowSettings.pageHeaderHeight * 0.8f);
            {
                QUI.Space((WindowSettings.pageHeaderHeight - WindowSettings.pageHeaderHeight * 0.8f));
                QUI.BeginVertical((WindowSettings.CurrentPageContentWidth + WindowSettings.pageShadowWidth) / 2, WindowSettings.pageHeaderHeight * 0.8f);
                {
                    QUI.FlexibleSpace();
                    if (!title.IsNullOrEmpty())
                    {
                        QUI.Space(-SPACE_2);
                        QUI.SetGUIColor(titleColor.Color);
                        QUI.Label(title, PageHeaderTitleStyle, (WindowSettings.CurrentPageContentWidth + WindowSettings.pageShadowWidth) / 2, 26);
                        QUI.ResetColors();
                    }

                    if (!subtitle.IsNullOrEmpty())
                    {
                        QUI.Space(-SPACE_2);
                        QUI.SetGUIColor(subtitleColor.Color);
                        QUI.Label(subtitle, PageHeaderSubtitleStyle, (WindowSettings.CurrentPageContentWidth + WindowSettings.pageShadowWidth) / 2, 18);
                        QUI.ResetColors();
                    }
                    QUI.FlexibleSpace();
                }
                QUI.EndVertical();
                QUI.FlexibleSpace();
                QUI.DrawTexture(iconQTexture.texture, WindowSettings.pageHeaderHeight * 0.8f, WindowSettings.pageHeaderHeight * 0.8f);
                QUI.Space((WindowSettings.pageHeaderHeight - WindowSettings.pageHeaderHeight * 0.8f) / 2);
            }
            QUI.EndHorizontal();
        }
Example #13
0
 // PUBLIC
 public Texture2D getTexture(QTexture textureName)
 {
     return(textures[textureName]);
 }
        void DrawHelpModule(string moduleName, Page targetModule, QTexture moduleIcon, List <LinkButtonData> list, float width)
        {
            QUI.DrawIconBar(moduleName, moduleIcon, QColors.Color.Gray, IconPosition.Right, width + 16, 24);
            QUI.Space(SPACE_4);
            QUI.DrawLinkButtonsList(list, SPACE_8, width);

#if EZ_SOURCE
            QUI.Space(SPACE_2);

            QUI.Space(6 * (selectedHelpModuleToEdit == targetModule ? editHelpAnimBool.faded : 0));
            QUI.BeginHorizontal(width + 16);
            {
                QUI.FlexibleSpace();
                if (QUI.GhostButton("Edit Links", QColors.Color.Gray, 100, 16, selectedHelpModuleToEdit == targetModule) ||
                    QUI.DetectKeyUp(Event.current, KeyCode.Escape))
                {
                    if (selectedHelpModuleToEdit == targetModule)
                    {
                        selectedHelpModuleToEdit = Page.None;
                        editHelpAnimBool.target  = false;
                    }
                    else
                    {
                        selectedHelpModuleToEdit = targetModule;
                        editHelpAnimBool.target  = true;
                    }
                }

                if (selectedHelpModuleToEdit == targetModule && editHelpAnimBool.faded > 0.4f)
                {
                    QUI.Space(SPACE_4 * editHelpAnimBool.faded);

                    if (QUI.GhostButton("Save Changes", QColors.Color.Green, 100 * editHelpAnimBool.faded, 16))
                    {
                        QUI.SetDirty(EzSourceData.Instance);
                        AssetDatabase.SaveAssets();
                        selectedHelpModuleToEdit = Page.None;
                        editHelpAnimBool.value   = false;
                    }
                }
            }
            QUI.EndHorizontal();


            if (selectedHelpModuleToEdit == targetModule)
            {
                if (QUI.BeginFadeGroup(editHelpAnimBool.faded))
                {
                    QUI.BeginVertical(width);
                    {
                        DrawEditableLinkButtons(list, width + 16);

                        QUI.Space(SPACE_16 * (selectedHelpModuleToEdit == targetModule ? editHelpAnimBool.faded : 0));
                    }
                    QUI.EndVertical();
                }
                QUI.EndFadeGroup();
            }

            QUI.Space(SPACE_8);
#endif
            QUI.Space(SPACE_8);
        }