[Change] Cleaned up that last commit.
This commit is contained in:
parent
89f690eda0
commit
4d0e838d84
38
src/player.c
38
src/player.c
@ -415,21 +415,23 @@ void player_render(void) {
|
|||||||
gui.weapon.y - 10 - gl_defFont.h, &cGrey, "None");
|
gui.weapon.y - 10 - gl_defFont.h, &cGrey, "None");
|
||||||
} else {
|
} else {
|
||||||
f = &gl_defFont;
|
f = &gl_defFont;
|
||||||
if(player->ammo == NULL) {
|
|
||||||
if(outfit_isLauncher(player->secondary->outfit)) {
|
if(outfit_isLauncher(player->secondary->outfit)) {
|
||||||
// Out of ammo.
|
// Use the ammunitions name.
|
||||||
i = gl_printWidth(f, "%s", player->secondary->outfit->u.lau.ammo);
|
i = gl_printWidth(f, "%s", player->secondary->outfit->u.lau.ammo);
|
||||||
if(i > (int)gui.weapon.w)
|
if(i > gui.weapon.w)
|
||||||
// Font is too big.
|
// Font is too big.
|
||||||
f = &gl_smallFont;
|
f = &gl_smallFont;
|
||||||
gl_printMid(f, (int)gui.weapon.w,
|
|
||||||
gui.weapon.x, gui.weapon.y - 5,
|
gl_printMid(f, (int)gui.weapon.w, gui.weapon.x,
|
||||||
&cConsole, "%s", player->secondary->outfit->u.lau.ammo);
|
gui.weapon.y - 5,
|
||||||
gl_printMid(&gl_smallFont, (int)gui.weapon.w,
|
&cConsole, "%s", player->ammo->outfit->u.lau.ammo);
|
||||||
gui.weapon.x, gui.weapon.y - 10 - gl_defFont.h,
|
|
||||||
NULL, "0");
|
// Print ammo underneath to the left.
|
||||||
|
gl_printMid(&gl_smallFont, gui.weapon.w, gui.weapon.x,
|
||||||
|
gui.weapon.y - 10 - gl_defFont.h,
|
||||||
|
NULL, "%d", (player->ammo) ? player->ammo->quantity : 0);
|
||||||
} else {
|
} else {
|
||||||
// Not a launcher.
|
// Just print the item name.
|
||||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
||||||
if(i > (int)gui.weapon.w)
|
if(i > (int)gui.weapon.w)
|
||||||
// Font is too big.
|
// Font is too big.
|
||||||
@ -438,22 +440,6 @@ void player_render(void) {
|
|||||||
gui.weapon.x, gui.weapon.y - (gui.weapon.h - f->h)/2.,
|
gui.weapon.x, gui.weapon.y - (gui.weapon.h - f->h)/2.,
|
||||||
&cConsole, "%s", player->secondary->outfit->name);
|
&cConsole, "%s", player->secondary->outfit->name);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Use the ammunitions name.
|
|
||||||
i = gl_printWidth(f, "%s", player->secondary->outfit->name);
|
|
||||||
if(i > gui.weapon.w)
|
|
||||||
// Font is too big.
|
|
||||||
f = &gl_smallFont;
|
|
||||||
|
|
||||||
gl_printMid(f, (int)gui.weapon.w, gui.weapon.x,
|
|
||||||
gui.weapon.y - 5,
|
|
||||||
&cConsole, "%s", player->ammo->outfit->name);
|
|
||||||
|
|
||||||
// Print ammo underneath to the left.
|
|
||||||
gl_printMid(&gl_smallFont, gui.weapon.w, gui.weapon.x,
|
|
||||||
gui.weapon.y - 10 - gl_defFont.h,
|
|
||||||
NULL, "%d", player->ammo->quantity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Target.
|
// Target.
|
||||||
|
Loading…
Reference in New Issue
Block a user