Example #1
0
        public void DrawOneAchievement(SpriteBatch spriteBatch, Vector2 position, bool large)
        {
            List <AchievementAdvisorCard> bestCards = GetBestCards(1);

            if (bestCards.Count < 1)
            {
                return;
            }
            AchievementAdvisorCard hoveredCard = bestCards[0];
            float num = 0.35f;

            if (large)
            {
                num = 0.75f;
            }
            _hoveredCard = null;
            DrawCard(bestCards[0], spriteBatch, position + new Vector2(8f) * num, num, out var hovered);
            if (!hovered)
            {
                return;
            }
            _hoveredCard = hoveredCard;
            if (!PlayerInput.IgnoreMouseInterface)
            {
                Main.player[Main.myPlayer].mouseInterface = true;
                if (Main.mouseLeft && Main.mouseLeftRelease)
                {
                    Main.ingameOptionsWindow = false;
                    IngameFancyUI.OpenAchievementsAndGoto(_hoveredCard.achievement);
                }
            }
        }
        // Token: 0x06000BB3 RID: 2995 RVA: 0x003CF710 File Offset: 0x003CD910
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if (alpha > 0f)
            {
                string    title       = ach.Title;
                Vector2   arg_53_0    = center;
                Vector2   value       = Main.fontItemStack.MeasureString(title);
                float     num         = ach.Scale * 1.1f;
                Rectangle r           = Utils.CenteredRectangle(arg_53_0, (value + new Vector2(58f, 10f)) * num);
                Vector2   mouseScreen = Main.MouseScreen;
                bool      expr_6F     = r.Contains(mouseScreen.ToPoint());
                Color     c           = expr_6F ? (new Color(64, 109, 164) * 0.75f) : (new Color(64, 109, 164) * 0.5f);
                Utils.DrawInvBG(sb, r, c);
                float   num2   = num * 0.3f;
                Color   value2 = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)(Main.mouseTextColor / 5), (int)Main.mouseTextColor);
                Vector2 vector = r.Right() - Vector2.UnitX * num * (12f + num2 * (float)ach.Frame.Width);
                sb.Draw(AchievementCompleteUI.AchievementsTexture, vector, new Rectangle?(ach.Frame), Color.White * alpha, 0f, new Vector2(0f, (float)(ach.Frame.Height / 2)), num2, SpriteEffects.None, 0f);
                sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, vector, null, Color.White * alpha, 0f, new Vector2(0f, (float)(ach.Frame.Height / 2)), num2, SpriteEffects.None, 0f);
                Utils.DrawBorderString(sb, title, vector - Vector2.UnitX * 10f, value2 * alpha, num * 0.9f, 1f, 0.4f, -1);
                if (expr_6F && !PlayerInput.IgnoreMouseInterface)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
Example #3
0
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if ((double)alpha > 0.0)
            {
                string    title       = ach.Title;
                Vector2   center1     = center;
                Vector2   vector2     = Main.fontItemStack.MeasureString(title);
                float     num         = ach.Scale * 1.1f;
                Rectangle rectangle   = Utils.CenteredRectangle(center1, (vector2 + new Vector2(58f, 10f)) * num);
                Vector2   mouseScreen = Main.MouseScreen;
                bool      flag        = rectangle.Contains(mouseScreen.ToPoint());
                Color     c           = flag ? new Color(64, 109, 164) * 0.75f : new Color(64, 109, 164) * 0.5f;
                Utils.DrawInvBG(sb, rectangle, c);
                float   scale    = num * 0.3f;
                Color   color    = new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor / 5, (int)Main.mouseTextColor);
                Vector2 position = rectangle.Right() - Vector2.UnitX * num * (float)(12.0 + (double)scale * (double)ach.Frame.Width);
                sb.Draw(AchievementCompleteUI.AchievementsTexture, position, new Rectangle?(ach.Frame), Color.White * alpha, 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), scale, SpriteEffects.None, 0.0f);
                sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, position, new Rectangle?(), Color.White * alpha, 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), scale, SpriteEffects.None, 0.0f);
                Utils.DrawBorderString(sb, title, position - Vector2.UnitX * 10f, color * alpha, num * 0.9f, 1f, 0.4f, -1);
                if (flag && !PlayerInput.IgnoreMouseInterface)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
 public static void OpenAchievements()
 {
     IngameFancyUI.CoverNextFrame();
     Main.playerInventory = false;
     Main.editChest       = false;
     Main.npcChatText     = "";
     Main.inFancyUI       = true;
     Main.InGameUI.SetState((UIState)Main.AchievementsMenu);
 }
 public static void OpenKeybinds()
 {
     IngameFancyUI.CoverNextFrame();
     Main.playerInventory = false;
     Main.editChest       = false;
     Main.npcChatText     = "";
     Main.inFancyUI       = true;
     Main.InGameUI.SetState((UIState)Main.ManageControlsMenu);
 }
Example #6
0
 public static void OpenUIState(UIState uiState)
 {
     IngameFancyUI.CoverNextFrame();
     Main.playerInventory = false;
     Main.editChest       = false;
     Main.npcChatText     = "";
     Main.inFancyUI       = true;
     IngameFancyUI.ClearChat();
     Main.InGameUI.SetState(uiState);
 }
Example #7
0
        public void DrawOptionsPanel(
            SpriteBatch spriteBatch,
            Vector2 leftPosition,
            Vector2 rightPosition)
        {
            List <AchievementAdvisorCard> bestCards = this.GetBestCards(10);

            this._hoveredCard = (AchievementAdvisorCard)null;
            int num = bestCards.Count;

            if (num > 5)
            {
                num = 5;
            }
            bool hovered;

            for (int index = 0; index < num; ++index)
            {
                this.DrawCard(bestCards[index], spriteBatch, leftPosition + new Vector2((float)(42 * index), 0.0f), 0.5f, out hovered);
                if (hovered)
                {
                    this._hoveredCard = bestCards[index];
                }
            }
            for (int index = 5; index < bestCards.Count; ++index)
            {
                this.DrawCard(bestCards[index], spriteBatch, rightPosition + new Vector2((float)(42 * index), 0.0f), 0.5f, out hovered);
                if (hovered)
                {
                    this._hoveredCard = bestCards[index];
                }
            }
            if (this._hoveredCard == null)
            {
                return;
            }
            if (this._hoveredCard.achievement.IsCompleted)
            {
                this._hoveredCard = (AchievementAdvisorCard)null;
            }
            else
            {
                if (PlayerInput.IgnoreMouseInterface)
                {
                    return;
                }
                Main.player[Main.myPlayer].mouseInterface = true;
                if (!Main.mouseLeft || !Main.mouseLeftRelease)
                {
                    return;
                }
                Main.ingameOptionsWindow = false;
                IngameFancyUI.OpenAchievementsAndGoto(this._hoveredCard.achievement);
            }
        }
 private void OnMouseOver()
 {
     if (!PlayerInput.IgnoreMouseInterface)
     {
         Main.player[Main.myPlayer].mouseInterface = true;
         if (Main.mouseLeft && Main.mouseLeftRelease)
         {
             Main.mouseLeftRelease = false;
             IngameFancyUI.OpenAchievementsAndGoto(_theAchievement);
             _ingameDisplayTimeLeft = 0;
             ShouldBeRemoved        = true;
         }
     }
 }
Example #9
0
 private void OnMouseOver()
 {
     if (PlayerInput.IgnoreMouseInterface)
     {
         return;
     }
     Main.player[Main.myPlayer].mouseInterface = true;
     if (!Main.mouseLeft || !Main.mouseLeftRelease)
     {
         return;
     }
     Main.mouseLeftRelease = false;
     IngameFancyUI.OpenAchievementsAndGoto(this._theAchievement);
     this._ingameDisplayTimeLeft = 0;
     this.ShouldBeRemoved        = true;
 }
Example #10
0
        public void DrawOptionsPanel(SpriteBatch spriteBatch, Vector2 leftPosition, Vector2 rightPosition)
        {
            List <AchievementAdvisorCard> bestCards = GetBestCards();

            _hoveredCard = null;
            int num = bestCards.Count;

            if (num > 5)
            {
                num = 5;
            }
            bool hovered;

            for (int i = 0; i < num; i++)
            {
                DrawCard(bestCards[i], spriteBatch, leftPosition + new Vector2(42 * i, 0f), 0.5f, out hovered);
                if (hovered)
                {
                    _hoveredCard = bestCards[i];
                }
            }
            for (int j = 5; j < bestCards.Count; j++)
            {
                DrawCard(bestCards[j], spriteBatch, rightPosition + new Vector2(42 * j, 0f), 0.5f, out hovered);
                if (hovered)
                {
                    _hoveredCard = bestCards[j];
                }
            }
            if (_hoveredCard == null)
            {
                return;
            }
            if (_hoveredCard.achievement.IsCompleted)
            {
                _hoveredCard = null;
            }
            else if (!PlayerInput.IgnoreMouseInterface)
            {
                Main.player[Main.myPlayer].mouseInterface = true;
                if (Main.mouseLeft && Main.mouseLeftRelease)
                {
                    Main.ingameOptionsWindow = false;
                    IngameFancyUI.OpenAchievementsAndGoto(_hoveredCard.achievement);
                }
            }
        }
        public static bool Draw(SpriteBatch spriteBatch, GameTime gameTime)
        {
            if (!Main.gameMenu && Main.player[Main.myPlayer].dead && !Main.player[Main.myPlayer].ghost)
            {
                IngameFancyUI.Close();
                Main.playerInventory = false;
                return(false);
            }

            var flag = false;

            if (Main.InGameUI.CurrentState is UIVirtualKeyboard && UIVirtualKeyboard.KeyboardContext > 0)
            {
                if (!Main.inFancyUI)
                {
                    Main.InGameUI.SetState((UIState)null);
                }
                if (Main.screenWidth >= 1705 || !PlayerInput.UsingGamepad)
                {
                    flag = true;
                }
            }

            if (!Main.gameMenu)
            {
                Main.mouseText = false;
                if (Main.InGameUI != null && Main.InGameUI.IsElementUnderMouse())
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                }
                Main.instance.GUIBarsDraw();
                if (Main.InGameUI.CurrentState is UIVirtualKeyboard && UIVirtualKeyboard.KeyboardContext > 0)
                {
                    Main.instance.GUIChatDraw();
                }
                if (!Main.inFancyUI)
                {
                    Main.InGameUI.SetState((UIState)null);
                }
                Main.instance.DrawMouseOver();
                Main.DrawCursor(Main.DrawThickCursor(false), false);
            }

            return(flag);
        }
        private static void DrawAchievement(SpriteBatch sb, ref Vector2 center, AchievementCompleteUI.DrawCache ach)
        {
            float alpha = ach.Alpha;

            if ((double)alpha > 0.0)
            {
                string    title       = ach.Title;
                Vector2   center1     = center;
                Vector2   vector2_1   = Main.fontItemStack.MeasureString(title);
                float     num1        = ach.Scale * 1.1f;
                Vector2   size        = Vector2.op_Multiply(Vector2.op_Addition(vector2_1, new Vector2(58f, 10f)), num1);
                Rectangle rectangle   = Utils.CenteredRectangle(center1, size);
                Vector2   mouseScreen = Main.MouseScreen;
                // ISSUE: explicit reference operation
                int   num2 = ((Rectangle)@rectangle).Contains(mouseScreen.ToPoint()) ? 1 : 0;
                Color c    = num2 != 0 ? Color.op_Multiply(new Color(64, 109, 164), 0.75f) : Color.op_Multiply(new Color(64, 109, 164), 0.5f);
                Utils.DrawInvBG(sb, rectangle, c);
                float num3 = num1 * 0.3f;
                Color color;
                // ISSUE: explicit reference operation
                ((Color)@color).\u002Ector((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor / 5, (int)Main.mouseTextColor);
                Vector2 vector2_2 = Vector2.op_Subtraction(rectangle.Right(), Vector2.op_Multiply(Vector2.op_Multiply(Vector2.get_UnitX(), num1), (float)(12.0 + (double)num3 * (double)(float)ach.Frame.Width)));
                sb.Draw(AchievementCompleteUI.AchievementsTexture, vector2_2, new Rectangle?(ach.Frame), Color.op_Multiply(Color.get_White(), alpha), 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), num3, (SpriteEffects)0, 0.0f);
                sb.Draw(AchievementCompleteUI.AchievementsTextureBorder, vector2_2, new Rectangle?(), Color.op_Multiply(Color.get_White(), alpha), 0.0f, new Vector2(0.0f, (float)(ach.Frame.Height / 2)), num3, (SpriteEffects)0, 0.0f);
                Utils.DrawBorderString(sb, title, Vector2.op_Subtraction(vector2_2, Vector2.op_Multiply(Vector2.get_UnitX(), 10f)), Color.op_Multiply(color, alpha), num1 * 0.9f, 1f, 0.4f, -1);
                if (num2 != 0 && !PlayerInput.IgnoreMouseInterface)
                {
                    Main.player[Main.myPlayer].mouseInterface = true;
                    if (Main.mouseLeft && Main.mouseLeftRelease)
                    {
                        IngameFancyUI.OpenAchievementsAndGoto(ach.theAchievement);
                        ach.TimeLeft = 0;
                    }
                }
            }
            ach.ApplyHeight(ref center);
        }
Example #13
0
        public void DrawOneAchievement(SpriteBatch spriteBatch, Vector2 position, bool large)
        {
            List <AchievementAdvisorCard> bestCards = this.GetBestCards(1);

            if (bestCards.Count < 1)
            {
                return;
            }
            AchievementAdvisorCard achievementAdvisorCard = bestCards[0];
            float scale = 0.35f;

            if (large)
            {
                scale = 0.75f;
            }
            this._hoveredCard = (AchievementAdvisorCard)null;
            bool hovered;

            this.DrawCard(bestCards[0], spriteBatch, position + new Vector2(8f) * scale, scale, out hovered);
            if (!hovered)
            {
                return;
            }
            this._hoveredCard = achievementAdvisorCard;
            if (PlayerInput.IgnoreMouseInterface)
            {
                return;
            }
            Main.player[Main.myPlayer].mouseInterface = true;
            if (!Main.mouseLeft || !Main.mouseLeftRelease)
            {
                return;
            }
            Main.ingameOptionsWindow = false;
            IngameFancyUI.OpenAchievementsAndGoto(this._hoveredCard.achievement);
        }
Example #14
0
        // Token: 0x06000BBC RID: 3004 RVA: 0x003CF118 File Offset: 0x003CD318
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0f);
            string text = "";

            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    text = Language.GetTextValue("UI.EnterNewName");
                    Player player = Main.player[Main.myPlayer];
                    Main.npcChatText = Main.chest[player.chest].name;
                    if (Main.tile[player.chestX, player.chestY].type == 21)
                    {
                        Main.defaultChestName = Lang.chestType[(int)(Main.tile[player.chestX, player.chestY].frameX / 36)].Value;
                    }
                    if (Main.tile[player.chestX, player.chestY].type == 467)
                    {
                        Main.defaultChestName = Lang.chestType2[(int)(Main.tile[player.chestX, player.chestY].frameX / 36)].Value;
                    }
                    if (Main.tile[player.chestX, player.chestY].type == 88)
                    {
                        Main.defaultChestName = Lang.dresserType[(int)(Main.tile[player.chestX, player.chestY].frameX / 54)].Value;
                    }
                    if (Main.npcChatText == "")
                    {
                        Main.npcChatText = Main.defaultChestName;
                    }
                    Main.editChest = true;
                }
            }
            else
            {
                Main.editSign = true;
                text          = Language.GetTextValue("UI.EnterMessage");
            }
            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    UserInterface arg_243_0 = Main.InGameUI;
                    string        arg_23E_0 = text;
                    string        arg_23E_1 = Main.npcChatText;
                    arg_243_0.SetState(new UIVirtualKeyboard(arg_23E_0, arg_23E_1, (s) => {
                        ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                        IngameFancyUI.Close();
                    }, () => {
                        ChestUI.RenameChestCancel();
                        IngameFancyUI.Close();
                    }, keyboardContext, false));
                }
            }
            else
            {
                UserInterface arg_1EC_0 = Main.InGameUI;
                string        arg_1E7_0 = text;
                string        arg_1E7_1 = Main.npcChatText;
                arg_1EC_0.SetState(new UIVirtualKeyboard(arg_1E7_0, arg_1E7_1, (s) => {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                }, () => {
                    Main.InputTextSignCancel();
                    IngameFancyUI.Close();
                }, keyboardContext, false));
            }
            UILinkPointNavigator.GoToDefaultPage(1);
        }
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
            var labelText = "";

            switch (keyboardContext)
            {
            case 1:
                Main.editSign = true;
                labelText     = Language.GetTextValue("UI.EnterMessage");
                break;

            case 2:
                labelText = Language.GetTextValue("UI.EnterNewName");
                var player = Main.player[Main.myPlayer];
                Main.npcChatText = Main.chest[player.chest].name;
                if (Main.tile[player.chestX, player.chestY].type == (ushort)21)
                {
                    Main.defaultChestName =
                        Lang.chestType[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if (Main.tile[player.chestX, player.chestY].type == (ushort)467)
                {
                    Main.defaultChestName =
                        Lang.chestType2[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if (Main.tile[player.chestX, player.chestY].type == (ushort)88)
                {
                    Main.defaultChestName =
                        Lang.dresserType[(int)Main.tile[player.chestX, player.chestY].frameX / 54].Value;
                }
                if (Main.npcChatText == "")
                {
                    Main.npcChatText = Main.defaultChestName;
                }
                Main.editChest = true;
                break;
            }

            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            switch (keyboardContext)
            {
            case 1:
                Main.InGameUI.SetState((UIState) new UIVirtualKeyboard(labelText, Main.npcChatText,
                                                                       (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                }), (Action)(() =>
                {
                    Main.InputTextSignCancel();
                    IngameFancyUI.Close();
                }), keyboardContext, false));
                break;

            case 2:
                Main.InGameUI.SetState((UIState) new UIVirtualKeyboard(labelText, Main.npcChatText,
                                                                       (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                    IngameFancyUI.Close();
                }), (Action)(() =>
                {
                    ChestUI.RenameChestCancel();
                    IngameFancyUI.Close();
                }), keyboardContext, false));
                break;
            }

            UILinkPointNavigator.GoToDefaultPage(1);
        }
Example #16
0
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
            string str = "";

            switch (keyboardContext)
            {
            case 1:
                Main.editSign = true;
                str           = Language.GetTextValue("UI.EnterMessage");
                break;

            case 2:
                str = Language.GetTextValue("UI.EnterNewName");
                Player player = Main.player[Main.myPlayer];
                Main.npcChatText = Main.chest[player.chest].name;
                if ((int)Main.tile[player.chestX, player.chestY].type == 21)
                {
                    Main.defaultChestName = Lang.chestType[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if ((int)Main.tile[player.chestX, player.chestY].type == 467)
                {
                    Main.defaultChestName = Lang.chestType2[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                }
                if ((int)Main.tile[player.chestX, player.chestY].type == 88)
                {
                    Main.defaultChestName = Lang.dresserType[(int)Main.tile[player.chestX, player.chestY].frameX / 54].Value;
                }
                if (Main.npcChatText == "")
                {
                    Main.npcChatText = Main.defaultChestName;
                }
                Main.editChest = true;
                break;
            }
            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            switch (keyboardContext)
            {
            case 1:
                UserInterface inGameUi1    = Main.InGameUI;
                string        labelText1   = str;
                string        npcChatText1 = Main.npcChatText;
                UIVirtualKeyboard.KeyboardSubmitEvent submitAction1 = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                });
                // ISSUE: reference to a compiler-generated field
                if (IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate5 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate5 = new Action((object)null, __methodptr(\u003COpenVirtualKeyboard\u003Eb__1));
                }
                // ISSUE: reference to a compiler-generated field
                Action            anonymousMethodDelegate5 = IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate5;
                int               inputMode1         = keyboardContext;
                int               num1               = 0;
                UIVirtualKeyboard uiVirtualKeyboard1 = new UIVirtualKeyboard(labelText1, npcChatText1, submitAction1, anonymousMethodDelegate5, inputMode1, num1 != 0);
                inGameUi1.SetState((UIState)uiVirtualKeyboard1);
                break;

            case 2:
                UserInterface inGameUi2    = Main.InGameUI;
                string        labelText2   = str;
                string        npcChatText2 = Main.npcChatText;
                UIVirtualKeyboard.KeyboardSubmitEvent submitAction2 = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                    IngameFancyUI.Close();
                });
                // ISSUE: reference to a compiler-generated field
                if (IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate7 == null)
                {
                    // ISSUE: reference to a compiler-generated field
                    // ISSUE: method pointer
                    IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate7 = new Action((object)null, __methodptr(\u003COpenVirtualKeyboard\u003Eb__3));
                }
                // ISSUE: reference to a compiler-generated field
                Action            anonymousMethodDelegate7 = IngameFancyUI.CS\u0024\u003C\u003E9__CachedAnonymousMethodDelegate7;
                int               inputMode2         = keyboardContext;
                int               num2               = 0;
                UIVirtualKeyboard uiVirtualKeyboard2 = new UIVirtualKeyboard(labelText2, npcChatText2, submitAction2, anonymousMethodDelegate7, inputMode2, num2 != 0);
                inGameUi2.SetState((UIState)uiVirtualKeyboard2);
                break;
            }
            UILinkPointNavigator.GoToDefaultPage(1);
        }
 public static void OpenAchievementsAndGoto(Achievement achievement)
 {
     IngameFancyUI.OpenAchievements();
     Main.AchievementsMenu.GotoAchievement(achievement);
 }
Example #18
0
 public static void OpenKeybinds()
 {
     IngameFancyUI.OpenUIState((UIState)Main.ManageControlsMenu);
 }
Example #19
0
        public static void OpenVirtualKeyboard(int keyboardContext)
        {
            IngameFancyUI.CoverNextFrame();
            Main.PlaySound(12, -1, -1, 1, 1f, 0.0f);
            string str = "";

            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    str = Language.GetTextValue("UI.EnterNewName");
                    Player player = Main.player[Main.myPlayer];
                    Main.npcChatText = Main.chest[player.chest].name;
                    if ((int)Main.tile[player.chestX, player.chestY].type == 21)
                    {
                        Main.defaultChestName = Lang.chestType[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                    }
                    if ((int)Main.tile[player.chestX, player.chestY].type == 467)
                    {
                        Main.defaultChestName = Lang.chestType2[(int)Main.tile[player.chestX, player.chestY].frameX / 36].Value;
                    }
                    if ((int)Main.tile[player.chestX, player.chestY].type == 88)
                    {
                        Main.defaultChestName = Lang.dresserType[(int)Main.tile[player.chestX, player.chestY].frameX / 54].Value;
                    }
                    if (Main.npcChatText == "")
                    {
                        Main.npcChatText = Main.defaultChestName;
                    }
                    Main.editChest = true;
                }
            }
            else
            {
                Main.editSign = true;
                str           = Language.GetTextValue("UI.EnterMessage");
            }
            Main.clrInput();
            if (!IngameFancyUI.CanShowVirtualKeyboard(keyboardContext))
            {
                return;
            }
            Main.inFancyUI = true;
            if (keyboardContext != 1)
            {
                if (keyboardContext == 2)
                {
                    UserInterface inGameUi    = Main.InGameUI;
                    string        labelText   = str;
                    string        npcChatText = Main.npcChatText;
                    UIVirtualKeyboard.KeyboardSubmitEvent keyboardSubmitEvent = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                    {
                        ChestUI.RenameChestSubmit(Main.player[Main.myPlayer]);
                        IngameFancyUI.Close();
                    });
                    int inputMode = keyboardContext;
                    int num       = 0;
                    UIVirtualKeyboard.KeyboardSubmitEvent submitAction;
                    UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(labelText, npcChatText, submitAction, (Action)(() =>
                    {
                        ChestUI.RenameChestCancel();
                        IngameFancyUI.Close();
                    }), inputMode, num != 0);
                    inGameUi.SetState((UIState)uiVirtualKeyboard);
                }
            }
            else
            {
                UserInterface inGameUi    = Main.InGameUI;
                string        labelText   = str;
                string        npcChatText = Main.npcChatText;
                UIVirtualKeyboard.KeyboardSubmitEvent keyboardSubmitEvent = (UIVirtualKeyboard.KeyboardSubmitEvent)(s =>
                {
                    Main.SubmitSignText();
                    IngameFancyUI.Close();
                });
                int inputMode = keyboardContext;
                int num       = 0;
                UIVirtualKeyboard.KeyboardSubmitEvent submitAction;
                UIVirtualKeyboard uiVirtualKeyboard = new UIVirtualKeyboard(labelText, npcChatText, submitAction, (Action)(() =>
                {
                    Main.InputTextSignCancel();
                    IngameFancyUI.Close();
                }), inputMode, num != 0);
                inGameUi.SetState((UIState)uiVirtualKeyboard);
            }
            UILinkPointNavigator.GoToDefaultPage(1);
        }