[Change] Small change to secondary weapon display.
This commit is contained in:
parent
36f1936667
commit
ef108e9f2e
29
src/player.c
29
src/player.c
@ -250,6 +250,7 @@ void player_render(void) {
|
||||
Pilot* p;
|
||||
Vec2 v;
|
||||
glColour* c;
|
||||
gl_font* f;
|
||||
|
||||
// Render the player target graphics.
|
||||
if(player_target != PLAYER_ID) {
|
||||
@ -349,20 +350,34 @@ void player_render(void) {
|
||||
vect_csetmin(&v, VX(gui.pos_weapon) + (gui.weapon.w - i)/2., VY(gui.pos_weapon) - 10 - gl_defFont.h);
|
||||
gl_print(&gui.smallFont, &v, &cGrey, "None");
|
||||
} else {
|
||||
f = &gl_defFont;
|
||||
if(player->ammo == NULL) {
|
||||
i = gl_printWidth(&gui.smallFont, "%s", player->secondary->outfit->name);
|
||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
||||
if(i > gui.weapon.w) {
|
||||
// Font is too big.
|
||||
f = &gui.smallFont;
|
||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
||||
}
|
||||
vect_csetmin(&v, VX(gui.pos_weapon) + (gui.weapon.w - i)/2.,
|
||||
VY(gui.pos_weapon) - (gui.weapon.h - gui.smallFont.h)/2.);
|
||||
gl_print(&gui.smallFont, &v, &cConsole, "%s", player->secondary->outfit->name);
|
||||
VY(gui.pos_weapon) - (gui.weapon.h - f->h)/2.);
|
||||
gl_print(f, &v, &cConsole, "%s", player->secondary->outfit->name);
|
||||
} else {
|
||||
i = gl_printWidth(&gui.smallFont, "%s", player->secondary->outfit->name);
|
||||
// Use the ammunitions name.
|
||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
||||
if(i > gui.weapon.w) {
|
||||
// Font is too big.
|
||||
f = &gui.smallFont;
|
||||
i = gl_printWidth(f, "%s", player->ammo->outfit->name);
|
||||
}
|
||||
vect_csetmin(&v, VX(gui.pos_weapon) + (gui.weapon.w - i)/2.,
|
||||
VY(gui.pos_weapon) - 5);
|
||||
gl_print(&gui.smallFont, &v, NULL, "%s", player->ammo->outfit->name);
|
||||
i = gl_printWidth(NULL, "%d", player->ammo->quantity);
|
||||
gl_print(f, &v, NULL, "%s", player->ammo->outfit->name);
|
||||
|
||||
// Print ammo underneath to the left.
|
||||
i = gl_printWidth(&gui.smallFont, "%d", player->ammo->quantity);
|
||||
vect_csetmin(&v, VX(gui.pos_weapon) + (gui.weapon.w - i)/2.,
|
||||
VY(gui.pos_weapon) - 10 - gl_defFont.h);
|
||||
gl_print(NULL, &v, &cConsole, "%d", player->ammo->quantity);
|
||||
gl_print(&gui.smallFont, &v, &cConsole, "%d", player->ammo->quantity);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user