RP412MFDPROTRUDE: optional extra indicator strip on the MFD/map buttons
Ports BattleTech 4.11's button-protrusion knob to Red Planet, DEFAULT 0 -- nothing changes unless a player asks for it. BT411 shipped this at 10 because its players asked for longer lamps; Red Planet keeps the pod's geometry until someone wants otherwise, so the two games stay tuned separately. Mechanism: the bonus is added to `indicatorStrip` (10) at the two places it is consumed -- strip_h for the MFD strips, strip_w for the map's side columns. Everything else already derives from those two locals (the client size, the display offset, both banks), so the window grows to fit and no other code needs to know. Only the strip moves, so the button keeps its width and its reach behind the glass: a LONGER lamp bar, not a fatter face, and the press target and the picture over it are unchanged. Scope is the red MFD strips and the amber side columns -- the only two ButtonStyles that have glass to hide behind. Value rules match BT411's: unset -> 0; a number is that many pixels; negative clamps to 0, over 200 clamps to 200; a WORD parses to 0, i.e. off. A non-zero value logs 'MFDView: RP412MFDPROTRUDE=N (indicator strip 10 -> N+10)' once. Named for this repo's convention (RP412-prefixed, no underscores), following RP412MFDLAYOUT -- itself the port of BT411's BT_GLASS_LAYOUT. Verified live in dist with the freshly linked rpl4opt.exe: RP412MFDPROTRUDE=25 prints the receipt and the exploded windows lay out around the longer strips; UNSET prints nothing at all, i.e. bonus 0 and geometry byte-identical to before this commit. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
+42
-2
@@ -92,6 +92,46 @@ namespace
|
||||
const int buttonDepth = 240;
|
||||
const int indicatorStrip = 10;
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Extra pixels of indicator strip, on top of the 10 above, so a
|
||||
// FLASHING lamp is easier to notice on desktop glass - the pod's
|
||||
// buttons were physical and backlit and never had that problem.
|
||||
// Only the strip moves, so the button keeps its width and reaches
|
||||
// the same distance behind the glass: this makes the lamp a
|
||||
// LONGER bar, not a fatter face. The client size, the display
|
||||
// offset and both banks all derive from strip_h/strip_w below, so
|
||||
// the window grows to fit and nothing needs to know about it.
|
||||
//
|
||||
// DEFAULT 0 - Red Planet keeps the pod's geometry unless a player
|
||||
// asks otherwise. (BattleTech 4.11 carries the same knob defaulted
|
||||
// to 10, where the players asked for it; the two games are tuned
|
||||
// separately on purpose.) Ported alongside RP412MFDLAYOUT, which
|
||||
// took the same route from BT411's BT_GLASS_LAYOUT.
|
||||
//---------------------------------------------------------------
|
||||
const int defaultProtrude = 0;
|
||||
|
||||
int ProtrudeBonus()
|
||||
{
|
||||
static int bonus = -1;
|
||||
if (bonus < 0)
|
||||
{
|
||||
const char *setting = getenv("RP412MFDPROTRUDE");
|
||||
bonus = (setting != NULL && setting[0] != '\0')
|
||||
? atoi(setting) // a word parses to 0, i.e. off
|
||||
: defaultProtrude;
|
||||
if (bonus < 0) bonus = 0;
|
||||
if (bonus > 200) bonus = 200;
|
||||
|
||||
if (bonus != 0)
|
||||
{
|
||||
DEBUG_STREAM << "MFDView: RP412MFDPROTRUDE=" << bonus
|
||||
<< " (indicator strip " << indicatorStrip << " -> "
|
||||
<< (indicatorStrip + bonus) << ")\n" << std::flush;
|
||||
}
|
||||
}
|
||||
return bonus;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// The map paints its own legend beside each side button, and that
|
||||
// grid is not the naive height/6: measured off the 640-tall map,
|
||||
@@ -649,7 +689,7 @@ void
|
||||
// and the picture above/below it is the click target. Paint
|
||||
// draws the buttons before the MFD image for that reason.
|
||||
//-----------------------------------------------------------
|
||||
int strip_h = indicatorStrip;
|
||||
int strip_h = indicatorStrip + ProtrudeBonus();
|
||||
int button_h = buttonDepth;
|
||||
|
||||
// on a scaled-down cockpit, keep the two banks from meeting
|
||||
@@ -692,7 +732,7 @@ void
|
||||
// indicatorStrip clearing the edge, so the lamp reads as a
|
||||
// slim column and the map itself is the click target.
|
||||
//-----------------------------------------------------------
|
||||
int strip_w = indicatorStrip;
|
||||
int strip_w = indicatorStrip + ProtrudeBonus();
|
||||
int button_w = buttonDepth;
|
||||
|
||||
// keep the two columns from meeting behind a narrow map
|
||||
|
||||
Reference in New Issue
Block a user