- major progress on the status bar code: SBARINFO's DrawGraphic has been ported into a generic function of the base statusbar class and put to use for a few items on the Strife status bar.
- decided to ditch the widget system I had started to lay out. As it turns out that would make things far more complicated and slower than they need to be.
This commit is contained in:
parent
74a2d58a52
commit
a3ee3c287e
13 changed files with 653 additions and 809 deletions
|
|
@ -672,6 +672,13 @@ static int DrawAmmo(player_t *CPlayer, int x, int y)
|
|||
//---------------------------------------------------------------------------
|
||||
FTextureID GetInventoryIcon(AInventory *item, uint32_t flags, bool *applyscale=NULL) // This function is also used by SBARINFO
|
||||
{
|
||||
if (applyscale != NULL)
|
||||
{
|
||||
*applyscale = false;
|
||||
}
|
||||
|
||||
if (item == nullptr) return FNullTextureID();
|
||||
|
||||
FTextureID picnum, AltIcon = item->AltHUDIcon;
|
||||
FState * state=NULL, *ReadyState;
|
||||
|
||||
|
|
@ -718,6 +725,17 @@ FTextureID GetInventoryIcon(AInventory *item, uint32_t flags, bool *applyscale=N
|
|||
return picnum;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DBaseStatusBar, GetInventoryIcon)
|
||||
{
|
||||
PARAM_PROLOGUE;
|
||||
PARAM_OBJECT(item, AInventory);
|
||||
PARAM_INT(flags);
|
||||
bool applyscale;
|
||||
FTextureID icon = GetInventoryIcon(item, flags, &applyscale);
|
||||
if (numret >= 1) ret[0].SetInt(icon.GetIndex());
|
||||
if (numret >= 2) ret[1].SetInt(applyscale);
|
||||
return MIN(numret, 2);
|
||||
}
|
||||
|
||||
static void DrawOneWeapon(player_t * CPlayer, int x, int & y, AWeapon * weapon)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue