Skip to content

Instantly share code, notes, and snippets.

@gnarf gnarf/sidebar.cs
Created May 10, 2019

Embed
What would you like to do?
sidebar.cs
static void RenderAbilityStatus( GameObject Player, int xp, int yp, ScreenBuffer _Buffer )
{
if( Player.HasPart( "ActivatedAbilities" ) )
{
ActivatedAbilities pAA = Player.GetPart("ActivatedAbilities") as ActivatedAbilities;
if( pAA.AbilityByGuid != null )
if( pAA.AbilityByGuid.Count > 0 )
{
int x = xp;
int y = yp;
_Buffer.Goto(x, y);
_Buffer.Write(""+(char)193);
foreach( ActivatedAbilityEntry Entry in pAA.AbilityByGuid.Values )
{
y++;
string sColor = "&G";
if( !Entry.Enabled ) sColor = "&K";
if (Entry.Cooldown > 0) sColor = "&K";
if (Entry.Toggleable && !Entry.ToggleState) sColor = "&r";
if (Entry.Toggleable && Entry.ToggleState) sColor = "&g";
_Buffer.Goto(x, y);
_Buffer.Write(sColor + Entry.Icon);
}
y++;
_Buffer.Goto(x, y);
_Buffer.Write("" + (char)194);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.