[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" | ||||
|                  "Date:\n" | ||||
|                  "Combat\n" | ||||
|                  "    Rating:" | ||||
|                  "  Rating:" | ||||
|                  "\n" | ||||
|                  "Ship:\n"); | ||||
|                  "Ship:\n" | ||||
|                  "Fuel:\n"); | ||||
| 
 | ||||
|   snprintf(str, 128, | ||||
|            "%s\n" | ||||
| @ -191,8 +192,10 @@ void menu_info(void) { | ||||
|            "\n" | ||||
|            "%s\n" | ||||
|            "\n" | ||||
|            "%s\n", | ||||
|            player_name, lt, player_rating(), player->name); | ||||
|            "%s\n" | ||||
|            "%d %d jumps)", | ||||
|            player_name, lt, player_rating(), player->name, | ||||
|            (int)player->fuel, (int)(player->fuel) / HYPERSPACE_FUEL); | ||||
| 
 | ||||
|   window_addText(wid, 80, 20, | ||||
|                  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; | ||||
|   char buf[1024]; | ||||
|   unsigned int wid; | ||||
|   wid = window_create(shipname, -1, -1, VIEW_WIDTH, VIEW_HEIGHT); | ||||
|   int h; | ||||
|   s = ship_get(shipname); | ||||
| 
 | ||||
|   window_addText(wid, 20, 0, 100, VIEW_HEIGHT-40, | ||||
|                  0, "txtLabel", &gl_smallFont, &cDConsole, | ||||
|   snprintf(buf, 1024, | ||||
|                  "Name:\n" | ||||
|                  "Class:\n" | ||||
|                  "Crew:\n" | ||||
| @ -284,7 +283,13 @@ void ship_view(char* shipname) { | ||||
|                  "Energy:\n" | ||||
|                  "\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, | ||||
|            "%s\n" | ||||
| @ -301,13 +306,15 @@ void ship_view(char* shipname) { | ||||
|            "%.2f MJ (%.2f MJ/s)\n)" | ||||
|            "\n" | ||||
|            "%d Tons\n" | ||||
|            "%d Tons\n", | ||||
|            "%d Tons\n" | ||||
|            "%d Units\n", | ||||
|            s->name, ship_class(s), s->crew, s->mass, | ||||
|            s->thrust/s->mass, s->speed, s->turn, | ||||
|            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); | ||||
| 
 | ||||
|   // Close the button.
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Allanis
						Allanis