예제 #1
0
 static UIController()
 {
     _userInterface = new UserInterface();
     _state = new UIState();
     _userInterface.SetState(_state);
     TooltipText = string.Empty;
     TooltipItem = new Item();
 }
		public void Use()
		{
			if (UserInterface.ActiveInstance != this)
			{
				UserInterface.ActiveInstance = this;
				this.Recalculate();
				return;
			}
			UserInterface.ActiveInstance = this;
		}
예제 #3
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);
        }
예제 #4
0
 public override void Load()
 {
     for (int k = 1; k <= 4; k++)
     {
         AddBossHeadTexture(captiveElementHead + k);
         AddBossHeadTexture(captiveElement2Head + k);
     }
     RandomBuffHotKey = RegisterHotKey("Random Buff", "P");
     FaceCustomCurrencyID = CustomCurrencyManager.RegisterCurrency(new ExampleCustomCurrency(ItemType<Items.Face>(), 999L));
     if (!Main.dedServ)
     {
         AddEquipTexture(null, EquipType.Legs, "ExampleRobe_Legs", "ExampleMod/Items/Armor/ExampleRobe_Legs");
         //Main.music[MusicID.Dungeon].ModMusic = GetSound("Sounds/Music/ExampleMusic").CreateInstance();
         AddMusicBox(GetSoundSlot(SoundType.Music, "Sounds/Music/DriveMusic"), ItemType("ExampleMusicBox"), TileType("ExampleMusicBox"));
         Main.instance.LoadTiles(TileID.Loom);
         Main.tileTexture[TileID.Loom] = GetTexture("Tiles/AnimatedLoom");
         // What if....Replace a vanilla item texture and equip texture.
         //Main.itemTexture[ItemID.CopperHelmet] = GetTexture("Resprite/CopperHelmet_Item");
         //Item copperHelmet = new Item();
         //copperHelmet.SetDefaults(ItemID.CopperHelmet);
         //Main.armorHeadLoaded[copperHelmet.headSlot] = true;
         //Main.armorHeadTexture[copperHelmet.headSlot] = GetTexture("Resprite/CopperHelmet_Head");
         Filters.Scene["ExampleMod:PuritySpirit"] = new Filter(new PuritySpiritScreenShaderData("FilterMiniTower").UseColor(0.4f, 0.9f, 0.4f).UseOpacity(0.7f), EffectPriority.VeryHigh);
         SkyManager.Instance["ExampleMod:PuritySpirit"] = new PuritySpiritSky();
         Filters.Scene["ExampleMod:MonolithVoid"] = new Filter(new ScreenShaderData("FilterMoonLord"), EffectPriority.Medium);
         SkyManager.Instance["ExampleMod:MonolithVoid"] = new VoidSky();
         exampleFont = GetFont("Fonts/ExampleFont");
         exampleUI = new ExampleUI();
         exampleUI.Activate();
         exampleUserInterface = new UserInterface();
         exampleUserInterface.SetState(exampleUI);
     }
 }
		public UserInterface()
		{
			UserInterface.ActiveInstance = this;
		}
예제 #6
0
 public UserInterface()
 {
     UserInterface.ActiveInstance = this;
 }
예제 #7
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);
        }