Skip to content

Commit

Permalink
MVD_UTILS: MVD announcer update (mvd_moreinfo)
Browse files Browse the repository at this point in the history
- Player location state wasn't up to date (led to location name not being
  constant over item pickups)
- Pack drops are announced when the player dies, not when they respawn
- Weapon dropped now reports based on active weapon when dying, not last
  weapon fired
- {} stripped from item name cvars
- If there is only one entity baseline for an item type, don't print
  location name on the pickup announcement
- If raw item name (no colors) matches or is in the location name, only
  print location name when announcing item pickups
- Announces when the pickup is from a pack, rather than the item
- Store location of items when simple clock entries added
- Store location of megas as players pick them up (max 4)
- List location when items are spawning if > 1 on the map

Obviously this still has all the limitations of the client making
best-guess attempts at working out what is going on across mvd frames,
so we keep guessing incorrectly with packs vs items :(

This really needs fixed in the protocol/.mvd ...
  • Loading branch information
meag committed Nov 7, 2018
1 parent 8ab558f commit 312d75f
Show file tree
Hide file tree
Showing 7 changed files with 315 additions and 86 deletions.
1 change: 1 addition & 0 deletions draw.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ void Draw_BigCharacter(int x, int y, char c, color_t color, float scale, float a
void Draw_SColoredCharacterW (int x, int y, wchar num, color_t color, float scale);
void Draw_SCharacter (int x, int y, int num, float scale);
void Draw_SString (int x, int y, const char *str, float scale);
void Draw_SStringAlpha(int x, int y, const char *text, float scale, float alpha);
void Draw_SAlt_String (int x, int y, const char *text, float scale);
void Draw_SPic (int x, int y, mpic_t *, float scale);
void Draw_FitPic (int x, int y, int fit_width, int fit_height, mpic_t *gl); // Will fit image into given area; will keep it's proportions.
Expand Down
5 changes: 5 additions & 0 deletions gl_draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,11 @@ void Draw_SString (int x, int y, const char *text, float scale)
Draw_StringBase(x, y, str2wcs(text), NULL, 0, false, scale, 1, false, 0);
}

void Draw_SStringAlpha(int x, int y, const char *text, float scale, float alpha)
{
Draw_StringBase(x, y, str2wcs(text), NULL, 0, false, scale, alpha, false, 0);
}

void Draw_SAlt_String (int x, int y, const char *text, float scale)
{
Draw_StringBase(x, y, str2wcs(text), NULL, 0, true, scale, 1, false, 0);
Expand Down
7 changes: 6 additions & 1 deletion hud_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -5379,13 +5379,16 @@ static int SCR_HudDrawTeamInfoPlayer(ti_player_t *ti_cl, int x, int y, int maxna
void SCR_HUD_DrawItemsClock(hud_t *hud)
{
extern qbool hud_editor;
extern const char* MVD_AnnouncerString(int line, int total, float* alpha);
int width, height;
int x, y;
int i;
static cvar_t
*hud_itemsclock_timelimit = NULL,
*hud_itemsclock_style = NULL,
*hud_itemsclock_scale = NULL,
*hud_itemsclock_filter = NULL;
*hud_itemsclock_filter = NULL,
*hud_itemsclock_announcer = NULL;

if (hud_itemsclock_timelimit == NULL) {
char val[256];
Expand All @@ -5394,6 +5397,7 @@ void SCR_HUD_DrawItemsClock(hud_t *hud)
hud_itemsclock_style = HUD_FindVar(hud, "style");
hud_itemsclock_scale = HUD_FindVar(hud, "scale");
hud_itemsclock_filter = HUD_FindVar(hud, "filter");
hud_itemsclock_announcer = HUD_FindVar(hud, "announcer");

// Unecessary to parse the item filter string on each frame.
hud_itemsclock_filter->OnChange = ItemsClock_OnChangeItemFilter;
Expand Down Expand Up @@ -6783,6 +6787,7 @@ void CommonDraw_Init(void)
"style", "0",
"scale", "1",
"filter", "",
"announcer", "0",
NULL
);

Expand Down
Loading

0 comments on commit 312d75f

Please sign in to comment.