Say when the Steam buttons are off rather than removing them
With RP412STEAM=1 but no Steam client, the lobby buttons were not drawn at all - the menu simply had two fewer buttons than last time, with the only explanation a line near the top of rpl4.log that scrolls past during a normal startup. It reads as a broken build, and it cost someone a puzzled look today. The buttons are now laid out whenever environ.ini asks for Steam, and greyed out when the wire did not come up, with STEAM NOT RUNNING above them. Clicks on a greyed button do nothing - a dead control that still fires would be worse than the silence it replaces. Two conditions rather than one, so RPL4Lobby_Configured joins Available: configured is the ini switch, available is whether the transport got a FakeIP. Configured keeps the #ifdef in the lobby module, so a build without the Steam SDK still shows no buttons at all rather than a pair that can never work. The notice does not fit inside a button - they are about sixteen characters wide and "HOST STEAM GAME - STEAM NOT RUNNING" is more than twice that, so appending it clipped mid-word. It goes on its own line above the pair instead. Verified both ways, with the Steam client up and with it unavailable: bright and clickable, dim and inert. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
+37
-6
@@ -413,8 +413,9 @@ namespace
|
||||
launch->rect.right = col3 + col_w;
|
||||
launch->rect.bottom = client_h - row_h;
|
||||
|
||||
// Steam lobby buttons (only when the Steam wire is live)
|
||||
if (RPL4Lobby_Available())
|
||||
// Steam lobby buttons, offered whenever environ.ini asked for Steam.
|
||||
// Painting greys them out and says so if the wire never came up.
|
||||
if (RPL4Lobby_Configured())
|
||||
{
|
||||
FEItem *host = &fe->items[fe->itemCount++];
|
||||
host->group = GroupSteamHost;
|
||||
@@ -544,12 +545,38 @@ namespace
|
||||
RECT row = item->rect;
|
||||
if (item->group >= GroupLaunch)
|
||||
{
|
||||
HBRUSH launch_brush = CreateSolidBrush(kGreenBright);
|
||||
//
|
||||
// The lobby buttons are offered whenever environ.ini asked
|
||||
// for Steam, but they only work once the client is actually
|
||||
// there. Dim them and say why rather than leaving them out -
|
||||
// two buttons quietly missing looks like a broken build.
|
||||
//
|
||||
Logical steam_button =
|
||||
(item->group == GroupSteamHost || item->group == GroupSteamJoin);
|
||||
Logical dead = steam_button && !RPL4Lobby_Available();
|
||||
|
||||
COLORREF ink = dead ? kGreenDim : kGreenBright;
|
||||
HBRUSH launch_brush = CreateSolidBrush(ink);
|
||||
FrameRect(mem, &row, launch_brush);
|
||||
DeleteObject(launch_brush);
|
||||
SetTextColor(mem, kGreenBright);
|
||||
SetTextColor(mem, ink);
|
||||
DrawTextA(mem, ItemName(item->group, item->index), -1, &row,
|
||||
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
|
||||
//
|
||||
// The reason, on its own line above the pair. It does not
|
||||
// fit inside a button - they are about sixteen characters
|
||||
// wide and this is more than twice that.
|
||||
//
|
||||
if (dead && item->group == GroupSteamHost)
|
||||
{
|
||||
RECT notice = row;
|
||||
notice.bottom = row.top;
|
||||
notice.top = row.top - (row.bottom - row.top);
|
||||
SetTextColor(mem, kGreenDim);
|
||||
DrawTextA(mem, "STEAM NOT RUNNING", -1, ¬ice,
|
||||
DT_CENTER | DT_VCENTER | DT_SINGLELINE);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -613,8 +640,12 @@ namespace
|
||||
}
|
||||
else if (item->group == GroupSteamHost || item->group == GroupSteamJoin)
|
||||
{
|
||||
fe->steamAction = (item->group == GroupSteamHost) ? 1 : 2;
|
||||
PostMessageA(fe->menuWindow, WM_NULL, 0, 0);
|
||||
// dead until the Steam client is there; the button says so
|
||||
if (RPL4Lobby_Available())
|
||||
{
|
||||
fe->steamAction = (item->group == GroupSteamHost) ? 1 : 2;
|
||||
PostMessageA(fe->menuWindow, WM_NULL, 0, 0);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user