fix: the orbital tooltip no longer promises Blax Slaves payouts

Slaves has no payouts yet, and whether ZonesApi drops follow Route orbital trade is still open. With routing off the tooltip now says orbital trade doesn't land here.
This commit is contained in:
Fabian @ Blax Software 2026-11-29 20:49:47 +01:00
parent 8c401b3f04
commit b479d55db8
6 changed files with 19 additions and 38 deletions

Binary file not shown.

Binary file not shown.

View File

@ -8,9 +8,7 @@
<BlaxZones_PriorityTip>Deliveries try the zone with the highest priority first. Zones with the same priority go oldest first.</BlaxZones_PriorityTip>
<BlaxZones_AcceptOrbital>Orbital trade lands here</BlaxZones_AcceptOrbital>
<BlaxZones_AcceptOrbitalTip>What you buy from orbital traders, and the silver from selling, lands here when the item filter allows it.</BlaxZones_AcceptOrbitalTip>
<BlaxZones_AcceptOrbitalSlavesTip>Also Blax Slaves payouts (ransom, buy-back, wages).</BlaxZones_AcceptOrbitalSlavesTip>
<BlaxZones_AcceptOrbitalOffTip>"Route orbital trade" is off in the mod settings, so nothing lands here now.</BlaxZones_AcceptOrbitalOffTip>
<BlaxZones_AcceptOrbitalOffSlavesTip>"Route orbital trade" is off in the mod settings, so orbital trade doesn't land here now. Blax Slaves payouts still do.</BlaxZones_AcceptOrbitalOffSlavesTip>
<BlaxZones_AcceptOrbitalOffTip>"Route orbital trade" is off in the mod settings, so orbital trade doesn't land here now.</BlaxZones_AcceptOrbitalOffTip>
<BlaxZones_CampHere>Caravans camp here</BlaxZones_CampHere>
<BlaxZones_CampHereTip>Trader caravans and tribute collectors camp next to this zone instead of a random spot outside the colony. Visitor groups don't.</BlaxZones_CampHereTip>
<BlaxZones_CampHereOffTip>"Caravans may camp at zones" is off in the mod settings, so no caravan camps here now.</BlaxZones_CampHereOffTip>

View File

@ -8,7 +8,7 @@ namespace BlaxZones
{
/// <summary>
/// Package Tab. The delivery zone tab: priority dropdown (Low to Critical), source checkboxes
/// (orbital in 1.0; its tooltip adds "Also Blax Slaves payouts" while Compat.SlavesActive), the
/// (orbital in 1.0), the
/// "Caravans camp here" checkbox and ThingFilterUI.DoThingFilterConfigWindow under
/// DeliveryFilters.Parent.
///
@ -129,11 +129,8 @@ namespace BlaxZones
public static string OrbitalTip()
{
string tip = "BlaxZones_AcceptOrbitalTip".Translate();
bool slaves = Compat.SlavesActive;
if (slaves)
tip += "\n\n" + "BlaxZones_AcceptOrbitalSlavesTip".Translate();
if (!BlaxZonesMod.S.routeOrbital)
tip += "\n\n" + (slaves ? "BlaxZones_AcceptOrbitalOffSlavesTip" : "BlaxZones_AcceptOrbitalOffTip").Translate();
tip += "\n\n" + "BlaxZones_AcceptOrbitalOffTip".Translate();
return tip;
}

View File

@ -60,7 +60,7 @@ namespace BlaxZonesTests
T.Check(ZonesApi.TryFindDropSpot(map, steel, out cell) && zone.cells.Contains(cell), "ZonesApi refused steel with the checkbox back on");
}
[BlaxTest("router: ZonesApi ignores Route orbital trade, so Blax Slaves payouts still land in the zone")]
[BlaxTest("router: ZonesApi does not read Route orbital trade (current behaviour, owner decision open)")]
public static void ApiIgnoresRouteOrbital()
{
Map map = Fixtures.Map;
@ -68,7 +68,7 @@ namespace BlaxZonesTests
Zone_Delivery zone = Fixtures.DeliveryZone(Fixtures.TestArea(2, 2));
Fixtures.Settings.routeOrbital = false;
T.Check(ZonesApi.TryFindDropSpot(map, Fixtures.Stack(ThingDefOf.Silver, 100), out IntVec3 cell) && zone.cells.Contains(cell),
"ZonesApi returned " + cell + " for silver with Route orbital trade off; the orbital tooltip says Slaves payouts still land");
"ZonesApi returned " + cell + " for silver with Route orbital trade off; ZonesApi callers are not gated by the setting today");
}
[BlaxTest("router: with overflowRadius 1 the overflow search ends and uses radius 5")]

View File

@ -22,8 +22,8 @@ namespace BlaxZonesTests
private static readonly string[] TabKeys =
{
"BlaxZones_TabDelivery", "BlaxZones_PriorityTip",
"BlaxZones_AcceptOrbital", "BlaxZones_AcceptOrbitalTip", "BlaxZones_AcceptOrbitalSlavesTip", "BlaxZones_AcceptOrbitalOffTip",
"BlaxZones_AcceptOrbitalOffSlavesTip", "BlaxZones_CampHere", "BlaxZones_CampHereTip", "BlaxZones_CampHereOffTip", "BlaxZones_CampHereStandDownTip",
"BlaxZones_AcceptOrbital", "BlaxZones_AcceptOrbitalTip", "BlaxZones_AcceptOrbitalOffTip",
"BlaxZones_CampHere", "BlaxZones_CampHereTip", "BlaxZones_CampHereOffTip", "BlaxZones_CampHereStandDownTip",
"BlaxZones_CopySettings", "BlaxZones_CopySettingsDesc", "BlaxZones_PasteSettings", "BlaxZones_PasteSettingsDesc",
"BlaxZones_SettingsCopied", "BlaxZones_SettingsPasted", "BlaxZones_NothingCopied",
};
@ -315,26 +315,27 @@ namespace BlaxZonesTests
T.Equal("BlaxZones_TabDelivery", new ITab_Delivery().labelKey, "labelKey of a new tab");
}
[BlaxTest("tab: the orbital tooltip adds the Blax Slaves line only while Slaves is active")]
[BlaxTest("tab: the orbital tooltip promises nothing about Blax Slaves, which has no payouts yet")]
public static void SlavesTooltip()
{
string slavesLine = "BlaxZones_AcceptOrbitalSlavesTip".Translate();
Fixtures.OnCleanup(() => Compat.SimulatedActive.Remove(Compat.BlaxSlaves));
bool slavesReallyActive = ModLister.GetActiveModWithIdentifier(Compat.BlaxSlaves, ignorePostfix: true) != null;
if (slavesReallyActive)
T.Info("Blax Slaves is loaded in this run; the tooltip-without-Slaves check is skipped");
else
T.Check(!ITab_Delivery.OrbitalTip().Contains(slavesLine), "Slaves line shown without Blax Slaves");
Compat.SimulatedActive.Add(Compat.BlaxSlaves);
T.Check(ITab_Delivery.OrbitalTip().Contains(slavesLine), "Slaves line missing while Blax Slaves is active");
foreach (bool route in new[] { true, false })
{
Fixtures.Settings.routeOrbital = route;
Compat.SimulatedActive.Remove(Compat.BlaxSlaves);
string without = ITab_Delivery.OrbitalTip();
Compat.SimulatedActive.Add(Compat.BlaxSlaves);
string with = ITab_Delivery.OrbitalTip();
T.Equal(without, with, "orbital tooltip changes with Blax Slaves active (routeOrbital " + route + ")");
T.Check(!with.Contains("Blax Slaves"), "orbital tooltip names Blax Slaves");
}
}
[BlaxTest("tab: the orbital and camp tooltips say when the mod settings turn them off")]
public static void SettingsOffTooltips()
{
BlaxZonesSettings s = Fixtures.Settings;
// With Blax Slaves loaded in this run the off note names its payouts (tested below).
string orbitalOff = (Compat.SlavesActive ? "BlaxZones_AcceptOrbitalOffSlavesTip" : "BlaxZones_AcceptOrbitalOffTip").Translate();
string orbitalOff = "BlaxZones_AcceptOrbitalOffTip".Translate();
string campOff = "BlaxZones_CampHereOffTip".Translate();
s.routeOrbital = true;
s.campAtZones = true;
@ -345,20 +346,5 @@ namespace BlaxZonesTests
T.Check(ITab_Delivery.OrbitalTip().Contains(orbitalOff), "orbital off note missing while routing is off");
T.Check(ITab_Delivery.CampTip().Contains(campOff), "camp off note missing while camping is off");
}
[BlaxTest("tab: with Blax Slaves active and orbital routing off, the tooltip says Slaves payouts still land")]
public static void SlavesOffTooltip()
{
string plainOff = "BlaxZones_AcceptOrbitalOffTip".Translate();
string slavesOff = "BlaxZones_AcceptOrbitalOffSlavesTip".Translate();
Fixtures.OnCleanup(() => Compat.SimulatedActive.Remove(Compat.BlaxSlaves));
Compat.SimulatedActive.Add(Compat.BlaxSlaves);
Fixtures.Settings.routeOrbital = false;
string tip = ITab_Delivery.OrbitalTip();
T.Check(tip.Contains(slavesOff), "the off note doesn't say Blax Slaves payouts still land");
T.Check(!tip.Contains(plainOff), "the tooltip says nothing lands here, though Blax Slaves payouts still do");
Fixtures.Settings.routeOrbital = true;
T.Check(!ITab_Delivery.OrbitalTip().Contains(slavesOff), "orbital off note while routing is on");
}
}
}