[Add] Date to player info window.

This commit is contained in:
Allanis 2013-04-22 14:49:42 +01:00
parent 5bfb1cb71e
commit 1e30edbc83

View File

@ -10,6 +10,7 @@
#include "player.h"
#include "plasmaf.h"
#include "mission.h"
#include "ltime.h"
#include "menu.h"
#define MAIN_WIDTH 130
@ -156,30 +157,35 @@ void menu_info(void) {
if(menu_isOpen(MENU_INFO)) return;
pause();
char str[128];;
char str[128];
char* lt;
unsigned int wid;
wid = window_create("Info", -1, -1, INFO_WIDTH, INFO_HEIGHT);
// Pilot generics.
lt = ltime_pretty(ltime_get());
window_addText(wid, 20, 20, 120, INFO_HEIGHT-60,
0, "txtDPilot", &gl_smallFont, &cDConsole,
"Pilot:\n"
"Date:\n"
"Combat\n"
" Rating:"
"\n"
"Ship:\n");
snprintf(str, 128,
"%s\n"
"%s\n"
"\n"
"%s\n"
"\n"
"%s\n",
player_name, player_rating(), player->name);
player_name, lt, player_rating(), player->name);
window_addText(wid, 80, 20,
INFO_WIDTH-120-BUTTON_WIDTH, INFO_HEIGHT-60,
0, "txtPilot", &gl_smallFont, &cBlack, str);
free(lt);
// Menu.
window_addButton(wid, -20, (20 + BUTTON_HEIGHT)*4 + 20,