Skip to content

Commit

Permalink
[adds]
Browse files Browse the repository at this point in the history
+ CCL_Widgets.ImageButton which supports altText (on missing texture) and tip string
  • Loading branch information
ForsakenShell committed Jun 2, 2016
1 parent 655360a commit 566c208
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions DLL_Project/Classes/Static/CCL_Widgets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,19 @@ public static string StringJoin( this IEnumerable<string> enmumerable, string se
{
return String.Join( seperator, enmumerable.ToArray() );
}

public static bool ImageButton( Rect canvas, Texture2D tex, string altString, string tip = "" )
{
if( !tip.NullOrEmpty() )
{
TooltipHandler.TipRegion( canvas, tip );
}
if( tex == null )
{
return Widgets.TextButton( canvas, altString, false, true );
}
return Widgets.ImageButton( canvas, tex );
}

}
}
Binary file not shown.
Binary file not shown.

0 comments on commit 566c208

Please sign in to comment.