[Add] Fuel info to ship information panel.
This commit is contained in:
parent
960017f2f9
commit
709c611a20
11
src/menu.c
11
src/menu.c
@ -181,9 +181,10 @@ void menu_info(void) {
|
|||||||
"Pilot:\n"
|
"Pilot:\n"
|
||||||
"Date:\n"
|
"Date:\n"
|
||||||
"Combat\n"
|
"Combat\n"
|
||||||
" Rating:"
|
" Rating:"
|
||||||
"\n"
|
"\n"
|
||||||
"Ship:\n");
|
"Ship:\n"
|
||||||
|
"Fuel:\n");
|
||||||
|
|
||||||
snprintf(str, 128,
|
snprintf(str, 128,
|
||||||
"%s\n"
|
"%s\n"
|
||||||
@ -191,8 +192,10 @@ void menu_info(void) {
|
|||||||
"\n"
|
"\n"
|
||||||
"%s\n"
|
"%s\n"
|
||||||
"\n"
|
"\n"
|
||||||
"%s\n",
|
"%s\n"
|
||||||
player_name, lt, player_rating(), player->name);
|
"%d %d jumps)",
|
||||||
|
player_name, lt, player_rating(), player->name,
|
||||||
|
(int)player->fuel, (int)(player->fuel) / HYPERSPACE_FUEL);
|
||||||
|
|
||||||
window_addText(wid, 80, 20,
|
window_addText(wid, 80, 20,
|
||||||
INFO_WIDTH-120-BUTTON_WIDTH, INFO_HEIGHT-60,
|
INFO_WIDTH-120-BUTTON_WIDTH, INFO_HEIGHT-60,
|
||||||
|
21
src/ship.c
21
src/ship.c
@ -265,11 +265,10 @@ void ship_view(char* shipname) {
|
|||||||
Ship* s;
|
Ship* s;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
unsigned int wid;
|
unsigned int wid;
|
||||||
wid = window_create(shipname, -1, -1, VIEW_WIDTH, VIEW_HEIGHT);
|
int h;
|
||||||
s = ship_get(shipname);
|
s = ship_get(shipname);
|
||||||
|
|
||||||
window_addText(wid, 20, 0, 100, VIEW_HEIGHT-40,
|
snprintf(buf, 1024,
|
||||||
0, "txtLabel", &gl_smallFont, &cDConsole,
|
|
||||||
"Name:\n"
|
"Name:\n"
|
||||||
"Class:\n"
|
"Class:\n"
|
||||||
"Crew:\n"
|
"Crew:\n"
|
||||||
@ -284,7 +283,13 @@ void ship_view(char* shipname) {
|
|||||||
"Energy:\n"
|
"Energy:\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Weapon Space:\n"
|
"Weapon Space:\n"
|
||||||
"Cargo Space:\n");
|
"Cargo Space:\n"
|
||||||
|
"Fuel:\n");
|
||||||
|
h = gl_printHeight(&gl_smallFont, VIEW_WIDTH, buf);
|
||||||
|
|
||||||
|
wid = window_create(shipname, -1, -1, VIEW_WIDTH, h+60+BUTTON_HEIGHT);
|
||||||
|
window_addText(wid, 20, -40, VIEW_WIDTH, h,
|
||||||
|
0, "txtLabel", &gl_smallFont, &cDConsole, buf);
|
||||||
|
|
||||||
snprintf(buf, 1024,
|
snprintf(buf, 1024,
|
||||||
"%s\n"
|
"%s\n"
|
||||||
@ -301,13 +306,15 @@ void ship_view(char* shipname) {
|
|||||||
"%.2f MJ (%.2f MJ/s)\n)"
|
"%.2f MJ (%.2f MJ/s)\n)"
|
||||||
"\n"
|
"\n"
|
||||||
"%d Tons\n"
|
"%d Tons\n"
|
||||||
"%d Tons\n",
|
"%d Tons\n"
|
||||||
|
"%d Units\n",
|
||||||
s->name, ship_class(s), s->crew, s->mass,
|
s->name, ship_class(s), s->crew, s->mass,
|
||||||
s->thrust/s->mass, s->speed, s->turn,
|
s->thrust/s->mass, s->speed, s->turn,
|
||||||
s->shield, s->shield_regen, s->armour, s->armour_regen,
|
s->shield, s->shield_regen, s->armour, s->armour_regen,
|
||||||
s->energy, s->energy_regen, s->cap_weapon, s->cap_cargo);
|
s->energy, s->energy_regen,
|
||||||
|
s->cap_weapon, s->cap_cargo, s->fuel);
|
||||||
|
|
||||||
window_addText(wid, 120, 0, VIEW_WIDTH-140, VIEW_HEIGHT-40,
|
window_addText(wid, 120, -40, VIEW_WIDTH-140, h,
|
||||||
0, "txtProperties", &gl_smallFont, &cBlack, buf);
|
0, "txtProperties", &gl_smallFont, &cBlack, buf);
|
||||||
|
|
||||||
// Close the button.
|
// Close the button.
|
||||||
|
Loading…
Reference in New Issue
Block a user