Пример #1
0
        private void ApplyButtonClicked(UIMouseEvent evt, UIElement listeningElement)
        {
            if (itemSlot.item != null && itemSlot.item.active && !itemSlot.item.IsAir)
            {
                CustomizerItem info = itemSlot.item.Customizer();
                if (textBox.Text != "")
                {
                    itemSlot.item.SetNameOverride(textBox.Text);
                }
                else
                {
                    itemSlot.item.ClearNameOverride();
                }
                info.itemName = textBox.Text;

                if (dyeSlot.item != null && dyeSlot.item.active && !dyeSlot.item.IsAir)
                {
                    info.shaderID = ShaderLoader.GetShaderID(dyeSlot.item);
                }
                else
                {
                    info.shaderID = new ShaderID(-1);
                }
            }

            Main.PlaySound(SoundID.Grab);
        }
Пример #2
0
        private void ResetButtonClicked(UIMouseEvent evt, UIElement listeningElement)
        {
            if (itemSlot.item != null && itemSlot.item.active && !itemSlot.item.IsAir)
            {
                CustomizerItem info = itemSlot.item.Customizer();
                info.itemName = "";
                info.shaderID = new ShaderID(-1);
                itemSlot.item.ClearNameOverride();
            }
            textBox.SetText("");

            Main.PlaySound(SoundID.Grab);
        }
Пример #3
0
        public override bool ConsumeAmmo(Item item, Player player)
        {
            if (player.whoAmI == Main.myPlayer)
            {
                CustomizerItem info = item.Customizer();

                CustomizerMod.mod.ammoShaders[player.whoAmI] = info.shaderID;
                //Main.NewText("Ammo shader: " + info.shaderID);
                CustomizerMod.mod.SendAmmoShaderPacket();
            }

            return(true);
        }
Пример #4
0
 private void ItemSlotClicked(UIMouseEvent evt, UIElement listeningElement)
 {
     if (itemSlot.item != null && itemSlot.item.active && !itemSlot.item.IsAir)
     {
         CustomizerItem info = itemSlot.item.Customizer();
         if (info.itemName != "")
         {
             textBox.SetText(info.itemName);
         }
         else
         {
             textBox.SetText("");
         }
     }
     else
     {
         textBox.SetText("");
     }
 }