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