Show the host mission setup in both lobbies, and the VTV in football

The room told you who was in it and nothing about what you were about to
fly into. Only the owner's menu decides the mission, so nobody else could
see the track or the conditions until the race had already started.

The owner now publishes its picks as lobby data (track, time of day,
weather, game length) and the room draws them under the title: the track
on its own line, the conditions under it. Published as display names
rather than catalog keys, because the map list differs between race and
football and resolving it at the source saves the room from knowing
which table a key came from.

Football also names the VTV now. The team sheet was team and position
only, but the vehicle still decides how someone plays the position, and
it was already travelling as member data, just never drawn. Both roster
rows now run keys back through the catalogs, so nobody reads bttlbrg
where Battle Barge belongs, and the rows widened from the middle half to
two thirds to carry three fields.

The setup lines are only taken if they fit. Buttons are laid out upward
from the bottom edge while the roster runs down from the top, so on a
short window the two extra lines would have pushed the roster into MY
TEAM. The room measures the gap first and takes two lines, one, or none.
Checked against every window size from 3440x1440 down to 640x400 in both
scenarios.

Verified live on a hosted lobby. Race shows the track, the conditions
line, and Battle Barge / Red. Football shows the same setup with Battle
Barge, Blue / Aqua, Crusher, tracking the MY TEAM and MY POSITION
buttons as they cycle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Cyd
2026-07-25 15:08:10 -05:00
co-authored by Claude Fable 5
parent abd720dd6e
commit 43cf086ea4
3 changed files with 291 additions and 17 deletions
+116
View File
@@ -1380,6 +1380,122 @@ void
strcpy(badge, kBadges[b].key);
}
//########################################################################
// The host's mission setup, as display names.
//
// The lobby shows everyone what they are about to fly into, and only the
// owner knows it - so the owner publishes these into lobby data and the
// members read them back. Names rather than catalog keys: the map lists
// differ between race and football, so resolving here means the room
// never has to know which scenario's table a key came from.
//########################################################################
const char *
RPL4FrontEnd_SelectedMapName()
{
if (!gHavePersist)
{
return kMaps[0].name;
}
int count = 0;
const CatalogEntry *maps = ActiveMaps(gPersistSelection, &count);
int index = gPersistSelection[GroupMap];
if (index < 0 || index >= count)
{
index = 0;
}
return maps[index].name;
}
const char *
RPL4FrontEnd_SelectedTimeName()
{
int index = gHavePersist ? gPersistSelection[GroupTime] : 0;
if (index < 0 || index >= FE_COUNT(kTimes))
{
index = 0;
}
return kTimes[index].name;
}
const char *
RPL4FrontEnd_SelectedWeatherName()
{
int index = gHavePersist ? gPersistSelection[GroupWeather] : 0;
if (index < 0 || index >= FE_COUNT(kWeather))
{
index = 0;
}
return kWeather[index].name;
}
const char *
RPL4FrontEnd_SelectedLengthName()
{
// the menu defaults this one to 5:00, not to entry zero
int index = gHavePersist ? gPersistSelection[GroupLength] : 2;
if (index < 0 || index >= FE_COUNT(kLengths))
{
index = 0;
}
return kLengths[index].name;
}
//########################################################################
// Catalog key -> display name. Member data travels as keys, so the room
// needs these to show "Battle Barge" where the wire says "bttlbrg".
//########################################################################
namespace
{
const char *
NameForKey(const CatalogEntry *table, int count, const char *key)
{
if (key == NULL || key[0] == '\0')
{
return "";
}
for (int i = 0; i < count; ++i)
{
if (strcmp(table[i].key, key) == 0)
{
return table[i].name;
}
}
return key; // unknown to this build: show it raw rather than blank
}
}
const char *
RPL4FrontEnd_VehicleNameForKey(const char *key)
{
return NameForKey(kVehicles, FE_COUNT(kVehicles), key);
}
const char *
RPL4FrontEnd_PositionNameForKey(const char *key)
{
return NameForKey(kPositions, FE_COUNT(kPositions), key);
}
const char *
RPL4FrontEnd_TeamNameForKey(const char *key)
{
if (key == NULL || key[0] == '\0')
{
return "";
}
for (int i = 0; i < FE_COUNT(kTeams); ++i)
{
if (strcmp(kTeams[i].key, key) == 0)
{
return kTeams[i].name;
}
}
return key;
}
//########################################################################
// Football team / position picks (the lobby publishes and cycles these)
//########################################################################