Exemplo n.º 1
0
        public override void OnChatButtonClicked(bool firstButton, ref bool shop)
        {
            if (firstButton)
            {
                shop = true;
            }
            else
            {
                bool eventOccurring = false;
                if (Fargowiltas.ClearEvents(ref eventOccurring))
                {
                    if (Main.netMode != NetmodeID.SinglePlayer)
                    {
                        var netMessage = mod.GetPacket();
                        netMessage.Write((byte)2);
                        netMessage.Send();
                    }
                    else
                    {
                        Main.NewText("The event has been cancelled!", 175, 75, 255);
                    }

                    Main.PlaySound(SoundID.Roar, npc.position, 0);
                    Main.npcChatText = "Hocus pocus, the event is over.";
                }
                else
                {
                    if (eventOccurring)
                    {
                        Main.npcChatText = "I'm not feeling it right now, come back in " + (FargoWorld.AbomClearCD / 60).ToString() + " seconds.";
                    }
                    else
                    {
                        Main.npcChatText = "I don't think there's an event right now.";
                    }
                }
            }
        }
Exemplo n.º 2
0
        public sealed override void ModifyTooltips(List <TooltipLine> tooltips)
        {
            if (tooltips.TryFindTooltipLine("ItemName", out TooltipLine itemNameLine))
            {
                // If this item is exclusive to e-mode, give it a custom item "rarity" (not an actual rarity, wait for 1.4).
                // This is often overridden.
                if (Eternity)
                {
                    itemNameLine.overrideColor = Fargowiltas.EModeColor();
                }

                // Call the artcle-prefix adjustment method.
                // This automatically handles fixing item names that begin with an article.
                itemNameLine.ArticlePrefixAdjustment(item.prefix, Articles.ToArray());
            }

            SafeModifyTooltips(tooltips);

            // Add the Eternity toolip after tooltip modification in order to be displayed underneath any manual tooltips (i.e. SoE cycling).
            if (Eternity)
            {
                tooltips.Add(new TooltipLine(mod, $"{mod.Name}:Eternity", "Eternity"));
            }
        }
 public override bool PreDrawTooltipLine(DrawableTooltipLine line, ref int yOffset)
 {
     if (line.mod == "Terraria" && line.Name == "ItemName")
     {
         Main.spriteBatch.End(); //end and begin main.spritebatch to apply a shader
         Main.spriteBatch.Begin(SpriteSortMode.Immediate, null, null, null, null, null, Main.UIScaleMatrix);
         var lineshader = GameShaders.Misc["PulseUpwards"].UseColor(new Color(42, 42, 99)).UseSecondaryColor(Fargowiltas.EModeColor());
         lineshader.Apply(null);
         Utils.DrawBorderString(Main.spriteBatch, line.text, new Vector2(line.X, line.Y), Color.White, 1); //draw the tooltip manually
         Main.spriteBatch.End();                                                                           //then end and begin again to make remaining tooltip lines draw in the default way
         Main.spriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, null, Main.UIScaleMatrix);
         return(false);
     }
     return(true);
 }