mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- code consolidation in invnext and invprev.
This commit is contained in:
parent
023efc7685
commit
e7d309cb96
1 changed files with 10 additions and 6 deletions
|
@ -372,6 +372,14 @@ CCMD (weapprev)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void DisplayNameTag(const char *tag)
|
||||||
|
{
|
||||||
|
if ((displaynametags & 1) && StatusBar && SmallFont)
|
||||||
|
StatusBar->AttachMessage(Create<DHUDMessageFadeOut>(SmallFont, tag,
|
||||||
|
1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S', 'I', 'N', 'V'));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
CCMD (invnext)
|
CCMD (invnext)
|
||||||
{
|
{
|
||||||
AInventory *next;
|
AInventory *next;
|
||||||
|
@ -398,9 +406,7 @@ CCMD (invnext)
|
||||||
who->InvSel = who->Inventory;
|
who->InvSel = who->Inventory;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((displaynametags & 1) && StatusBar && SmallFont && who->InvSel)
|
if (who->InvSel) DisplayNameTag(who->InvSel->GetTag());
|
||||||
StatusBar->AttachMessage (Create<DHUDMessageFadeOut> (SmallFont, who->InvSel->GetTag(),
|
|
||||||
1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V'));
|
|
||||||
}
|
}
|
||||||
who->player->inventorytics = 5*TICRATE;
|
who->player->inventorytics = 5*TICRATE;
|
||||||
if (old != who->InvSel)
|
if (old != who->InvSel)
|
||||||
|
@ -433,9 +439,7 @@ CCMD (invprev)
|
||||||
}
|
}
|
||||||
who->InvSel = item;
|
who->InvSel = item;
|
||||||
}
|
}
|
||||||
if ((displaynametags & 1) && StatusBar && SmallFont && who->InvSel)
|
if (who->InvSel) DisplayNameTag(who->InvSel->GetTag());
|
||||||
StatusBar->AttachMessage (Create<DHUDMessageFadeOut> (SmallFont, who->InvSel->GetTag(),
|
|
||||||
1.5f, 0.80f, 0, 0, (EColorRange)*nametagcolor, 2.f, 0.35f), MAKE_ID('S','I','N','V'));
|
|
||||||
}
|
}
|
||||||
who->player->inventorytics = 5*TICRATE;
|
who->player->inventorytics = 5*TICRATE;
|
||||||
if (old != who->InvSel)
|
if (old != who->InvSel)
|
||||||
|
|
Loading…
Reference in a new issue