mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 12:05:11 +00:00
some nametags improvements (#50)
- crouching now hides your nametag entirely - nametag transparency is now based on player opacity - nametags are no longer rendered while the player does not have a valid area sync
This commit is contained in:
parent
d9e50581ff
commit
f8b5f2a9f6
1 changed files with 15 additions and 7 deletions
|
@ -63,6 +63,18 @@ void nametags_render(void) {
|
||||||
struct MarioState* m = &gMarioStates[i];
|
struct MarioState* m = &gMarioStates[i];
|
||||||
if (!is_player_active(m)) { continue; }
|
if (!is_player_active(m)) { continue; }
|
||||||
struct NetworkPlayer* np = &gNetworkPlayers[i];
|
struct NetworkPlayer* np = &gNetworkPlayers[i];
|
||||||
|
if (!np->currAreaSyncValid) { continue; }
|
||||||
|
|
||||||
|
switch (m->action) {
|
||||||
|
case ACT_START_CROUCHING:
|
||||||
|
case ACT_CROUCHING:
|
||||||
|
case ACT_STOP_CROUCHING:
|
||||||
|
case ACT_START_CRAWLING:
|
||||||
|
case ACT_CRAWLING:
|
||||||
|
case ACT_STOP_CRAWLING:
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
Vec3f pos;
|
Vec3f pos;
|
||||||
Vec3f out;
|
Vec3f out;
|
||||||
vec3f_copy(pos, m->marioObj->header.gfx.pos);
|
vec3f_copy(pos, m->marioObj->header.gfx.pos);
|
||||||
|
@ -88,12 +100,8 @@ void nametags_render(void) {
|
||||||
np->palette.parts[CAP][2]
|
np->palette.parts[CAP][2]
|
||||||
};
|
};
|
||||||
f32 measure = djui_hud_measure_text(name) * scale * 0.5f;
|
f32 measure = djui_hud_measure_text(name) * scale * 0.5f;
|
||||||
f32 alpha = m->action == ACT_START_CROUCHING ||
|
|
||||||
m->action == ACT_CROUCHING ||
|
f32 alpha = (np->fadeOpacity / 32) * 255;
|
||||||
m->action == ACT_STOP_CROUCHING ||
|
|
||||||
m->action == ACT_START_CRAWLING ||
|
|
||||||
m->action == ACT_CRAWLING ||
|
|
||||||
m->action == ACT_STOP_CRAWLING ? 100 : 255;
|
|
||||||
|
|
||||||
struct StateExtras* e = &sStateExtras[i];
|
struct StateExtras* e = &sStateExtras[i];
|
||||||
djui_hud_print_outlined_text_interpolated(name, e->prevPos[0] - measure, e->prevPos[1], e->prevScale, out[0] - measure, out[1], scale, color[0], color[1], color[2], alpha, 0.25);
|
djui_hud_print_outlined_text_interpolated(name, e->prevPos[0] - measure, e->prevPos[1], e->prevScale, out[0] - measure, out[1], scale, color[0], color[1], color[2], alpha, 0.25);
|
||||||
|
|
Loading…
Reference in a new issue