Skip to content

Instantly share code, notes, and snippets.

@gnarf
Created May 10, 2019 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gnarf/a00a224bbadbe1b3d0423a3075c7830c to your computer and use it in GitHub Desktop.
Save gnarf/a00a224bbadbe1b3d0423a3075c7830c to your computer and use it in GitHub Desktop.
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