diff --git a/src/map.c b/src/map.c index a0ed2e4..c422669 100644 --- a/src/map.c +++ b/src/map.c @@ -161,13 +161,23 @@ static void map_update(void) { /* Right text. */ if(!sys_isKnown(sys)) { /* System isn't known. Erase all. */ + /* Right text. */ window_modifyText(map_wid, "txtSysname", "Unknown"); window_modifyText(map_wid, "txtFaction", "Unknown"); + /* Standing. */ + window_moveWidget(map_wid, "txtSStanding", -20, -100); + window_moveWidget(map_wid, "txtStanding", -20, -100-gl_smallFont.h-5); window_modifyText(map_wid, "txtStanding", "Unknown"); + /* Planets. */ + window_moveWidget(map_wid, "txtSPlanets", -20, -140); + window_moveWidget(map_wid, "txtPlanets", -20, -140-gl_smallFont.h-5); window_modifyText(map_wid, "txtPlanets", "Unknown"); + /* Services. */ window_moveWidget(map_wid, "txtSServices", -20, -180); window_moveWidget(map_wid, "txtServices", -20, -180-gl_smallFont.h-5); window_modifyText(map_wid, "txtServices", "Unknown"); + + /* Bottom text. */ window_modifyText(map_wid, "txtSystemStatus", NULL); return; @@ -177,8 +187,11 @@ static void map_update(void) { window_modifyText(map_wid, "txtSysname", sys->name); if(sys->nplanets == 0) { /* No planets -> no factions. */ - window_modifyText(map_wid, "txtFaction", "NA"); - window_modifyText(map_wid, "txtStanding", "NA"); + window_modifyText(map_wid, "txtFaction", "NA"); + window_moveWidget(map_wid, "txtSStanding", -20, -100); + window_moveWidget(map_wid, "txtStanding", -20, -100-gl_smallFont.h-5); + window_modifyText(map_wid, "txtStanding", "NA"); + y = -100; } else { standing = 0; nstanding = 0; @@ -193,16 +206,23 @@ static void map_update(void) { (sys->planets[i].faction!=0)) { /* TODO: more verbosity. */ snprintf(buf, 100, "Multiple"); + break; } } if(i == sys->nplanets) /* Saw them all, and all the same. */ - snprintf(buf, 100, "%s", faction_name(f)); + snprintf(buf, 100, "%s", faction_longname(f)); /* Modify the text. */ window_modifyText(map_wid, "txtFaction", buf); window_modifyText(map_wid, "txtStanding", faction_getStanding(standing / nstanding)); + + /* Lower text if needed. */ + h = gl_printHeight(&gl_smallFont, 80, buf); + y = -100 - (h - gl_smallFont.h); + window_moveWidget(map_wid, "txtSStanding", -20, y); + window_moveWidget(map_wid, "txtStanding", -20, y-gl_smallFont.h-5); } /* Get planets. */ @@ -218,13 +238,15 @@ static void map_update(void) { } window_modifyText(map_wid, "txtPlanets", buf); } + y -= 40; + window_moveWidget(map_wid, "txtSPlanets", -20, y); + window_moveWidget(map_wid, "txtPlanets", -20, y-gl_smallFont.h-5); /* Get the services. */ h = gl_printHeight(&gl_smallFont, 80, buf); - y = -180 - (h - gl_smallFont.h); + y -= 40 +(h - gl_smallFont.h); window_moveWidget(map_wid, "txtSServices", -20, y); - y -= gl_smallFont.h+5; - window_moveWidget(map_wid, "txtServices", -20, y); + window_moveWidget(map_wid, "txtServices", -20, y-gl_smallFont.h-5); services = 0; for(i = 0; i < sys->nplanets; i++) services |= sys->planets[i].services;