public static bool enter(this icon ico, string txt, ref bool state, bool showLabelIfTrue = true)
        {
            if (state)
            {
                if (icon.Exit.ClickUnFocus("{0} {1}".F(icon.Exit.GetText(), txt)))
                {
                    state = false;
                }
            }
            else if (ico.ClickUnFocus("{0} {1}".F(icon.Enter.GetText(), txt)))
            {
                state = true;
            }


            if ((showLabelIfTrue || !state) &&
                txt.ClickLabel(txt, -1, state ? PEGI_Styles.ExitLabel : PEGI_Styles.EnterLabel))
            {
                state = !state;
            }

            ef.isFoldedOutOrEntered = state;

            return(ef.isFoldedOutOrEntered);
        }
Пример #2
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);
        }
Пример #3
0
        public static bool ClickConfirm(this icon icon, string confirmationTag, object obj, string tip = "", int width = defaultButtonSize)
        {
            if (IsConfirmingRequestedFor(confirmationTag, obj))
            {
                return(ConfirmClick());
            }

            if (icon.ClickUnFocus(tip, width))
            {
                RequestConfirmation(confirmationTag, obj, tip);
            }

            return(false);
        }
Пример #4
0
        public static bool ClickConfirm(this icon icon, string confirmationTag, string tip = "", int width = defaultButtonSize)
        {
            if (confirmationTag.Equals(_confirmTag))
            {
                return(ConfirmClick());
            }

            if (icon.ClickUnFocus(tip, width))
            {
                RequestConfirmation(confirmationTag, details: tip);
            }

            return(false);
        }
Пример #5
0
        public static bool ClickConfirm(this icon icon, string confirmationTag, string toolTip = "", int width = defaultButtonSize)
        {
            if (ConfirmationDialogue.IsRequestedFor(confirmationTag))
            {
                return(ConfirmClick());
            }

            if (icon.ClickUnFocus(toolTip, width))
            {
                ConfirmationDialogue.Request(confirmationTag, details: toolTip);
            }

            return(false);
        }
Пример #6
0
        public static bool enter(this icon ico, ref bool state, string tip = null)
        {
            if (state)
            {
                if (icon.Exit.ClickUnFocus(tip))
                {
                    state = false;
                }
            }
            else if (ico.ClickUnFocus(tip))
            {
                state = true;
            }

            ef.isFoldedOutOrEntered = state;

            return(ef.isFoldedOutOrEntered);
        }
Пример #7
0
        public static bool enter(this icon ico, ref int enteredOne, int thisOne, string tip = null)
        {
            var outside = enteredOne == -1;

            if (enteredOne == thisOne)
            {
                if (icon.Exit.ClickUnFocus(tip))
                {
                    enteredOne = -1;
                }
            }
            else if (outside)
            {
                if (ico.ClickUnFocus(tip))
                {
                    enteredOne = thisOne;
                }
            }

            ef.isFoldedOutOrEntered = (enteredOne == thisOne);

            return(ef.isFoldedOutOrEntered);
        }
 public static bool Click(this icon icon, Msg text, ref bool changed) => icon.ClickUnFocus(text.GetText()).changes(ref changed);
 public static bool Click(this icon icon, Msg text) => icon.ClickUnFocus(text.GetText());