Better UI scaling, quest tweaking, contentpackage hash bugfix, misc bugfixes
This commit is contained in:
@@ -42,6 +42,14 @@ namespace Subsurface
|
||||
set;
|
||||
}
|
||||
|
||||
public string ToolTip
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
private GUITextBlock toolTipBlock;
|
||||
|
||||
//protected float alpha;
|
||||
|
||||
public GUIComponent Parent
|
||||
@@ -222,6 +230,20 @@ namespace Subsurface
|
||||
//DrawChildren(spriteBatch);
|
||||
}
|
||||
|
||||
public void DrawToolTip(SpriteBatch spriteBatch)
|
||||
{
|
||||
int width = 200;
|
||||
if (toolTipBlock==null || (string)toolTipBlock.userData != ToolTip)
|
||||
{
|
||||
string wrappedText = ToolBox.WrapText(ToolTip, width, GUI.SmallFont);
|
||||
toolTipBlock = new GUITextBlock(new Rectangle(0,0,width, wrappedText.Split('\n').Length*15), ToolTip, GUI.style, null, true);
|
||||
toolTipBlock.userData = ToolTip;
|
||||
}
|
||||
|
||||
toolTipBlock.rect = new Rectangle((int)PlayerInput.MousePosition.X, (int)PlayerInput.MousePosition.Y, toolTipBlock.rect.Width, toolTipBlock.rect.Height);
|
||||
toolTipBlock.Draw(spriteBatch);
|
||||
}
|
||||
|
||||
public virtual void Update(float deltaTime)
|
||||
{
|
||||
if (CanBeFocused)
|
||||
|
||||
Reference in New Issue
Block a user