0.1 initial release.

This commit is contained in:
JavidPack
2016-12-17 23:03:34 -07:00
parent eb77bf70f6
commit 7f037576dc
14 changed files with 1026 additions and 0 deletions

43
UIHoverImageButton.cs Normal file
View File

@@ -0,0 +1,43 @@
using ItemChecklist.UI;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Terraria;
using Terraria.GameContent.UI.Elements;
namespace ItemChecklist
{
internal class UIHoverImageButton : UIImageButton
{
internal string hoverText;
public UIHoverImageButton(Texture2D texture, string hoverText) : base(texture)
{
this.hoverText = hoverText;
}
protected override void DrawSelf(SpriteBatch spriteBatch)
{
base.DrawSelf(spriteBatch);
if (IsMouseHovering)
{
ItemChecklistUI.hoverText = hoverText;
//float x = Main.fontMouseText.MeasureString(hoverText).X;
//Vector2 vector = new Vector2((float)Main.mouseX, (float)Main.mouseY) + new Vector2(16f, 0f);
//if (vector.Y > (float)(Main.screenHeight - 30))
//{
// vector.Y = (float)(Main.screenHeight - 30);
//}
//if (vector.X > (float)(Parent.GetDimensions().Width + Parent.GetDimensions().X - x - 16))
//{
// vector.X = (float)(Parent.GetDimensions().Width + Parent.GetDimensions().X - x - 16);
//}
//Utils.DrawBorderStringFourWay(spriteBatch, Main.fontMouseText, hoverText, vector.X, vector.Y, new Color((int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor, (int)Main.mouseTextColor), Color.Black, Vector2.Zero, 1f);
}
}
}
}