public static void write(this string text, string toolTip, int width, PEGI_Styles.PegiGuiStyle style)
        {
            textAndTip.text    = text;
            textAndTip.tooltip = toolTip;

#if UNITY_EDITOR
            if (!PaintingGameViewUI)
            {
                ef.write(textAndTip, width, style.Current);
                return;
            }
#endif

            checkLine();
            GUILayout.Label(textAndTip, style.Current, GUILayout.MaxWidth(width));
        }
        public static void write(this string text, PEGI_Styles.PegiGuiStyle style)
        {
            var cnt = TextAndTip(text);

#if UNITY_EDITOR
            if (!PaintingGameViewUI)
            {
                ef.write(cnt, style.Current);
            }
            else
#endif
            {
                checkLine();
                GUILayout.Label(cnt, style.Current, GuiMaxWidthOption);
            }
        }
        public static void write(this string text, string toolTip, PEGI_Styles.PegiGuiStyle style)
        {
            textAndTip.text    = text;
            textAndTip.tooltip = toolTip;


#if UNITY_EDITOR
            if (!PaintingGameViewUI)
            {
                ef.write(textAndTip, style.Current);
            }
            else
#endif
            {
                checkLine();
                GUILayout.Label(textAndTip, style.Current, GuiMaxWidthOption);
            }
        }
 public static void nl(this string value, string hint, PEGI_Styles.PegiGuiStyle style)
 {
     write(value, hint, style);
     nl();
 }
 private static GUILayoutOption GuiMaxWidthOptionFrom(GUIContent cnt, PEGI_Styles.PegiGuiStyle style) =>
 GUILayout.MaxWidth(Mathf.Min(_playtimeGuiWidth, ApproximateLength(cnt.text, style.Current.fontSize)));
示例#6
0
        public static bool conditional_enter(this string label, bool canEnter, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null)
        {
            if (!canEnter && enteredOne == thisOne)
            {
                if (icon.Back.Click() || "All Done here".ClickText(14))
                {
                    enteredOne = -1;
                }
            }
            else
            {
                if (canEnter)
                {
                    label.enter(ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);
                }
                else
                {
                    ef.isFoldedOutOrEntered = false;
                }
            }

            return(ef.isFoldedOutOrEntered);
        }
示例#7
0
        public static bool conditional_enter(this icon ico, string label, bool canEnter, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null)
        {
            if (!canEnter && enteredOne == thisOne)
            {
                enteredOne = -1;
            }

            if (canEnter)
            {
                ico.enter(label, ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);
            }
            else
            {
                ef.isFoldedOutOrEntered = false;
            }

            return(ef.isFoldedOutOrEntered);
        }
示例#8
0
        public static bool enter_Inspect(this string txt, IPEGI var, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null)
        {
            var changed = false;

            txt.TryAddCount(var).enter(ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);//)

            return((ef.isFoldedOutOrEntered && var.Nested_Inspect()) || changed);
        }
示例#9
0
 public static bool enter(this string txt, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null)
 => icon.Enter.enter(txt, ref enteredOne, thisOne, showLabelIfTrue, enterLabelStyle);
示例#10
0
        public static bool enter(this icon ico, string txt, ref int enteredOne, int thisOne, bool showLabelIfTrue = true, PEGI_Styles.PegiGuiStyle enterLabelStyle = null)
        {
            var outside = enteredOne == -1;

            var current = enteredOne == thisOne;

            if (current)
            {
                if (icon.Exit.ClickUnFocus("{0} {1}".F(icon.Exit.GetText(), txt)))
                {
                    enteredOne = -1;
                }
            }
            else if (outside && ico.ClickUnFocus(txt))
            {
                enteredOne = thisOne;
            }


            if (((showLabelIfTrue && current) || outside) &&
                txt.ClickLabel(txt, -1, outside ? enterLabelStyle ?? PEGI_Styles.EnterLabel : PEGI_Styles.ExitLabel))
            {
                enteredOne = outside ? thisOne : -1;
            }


            ef.isFoldedOutOrEntered = (enteredOne == thisOne);

            return(ef.isFoldedOutOrEntered);
        }