Mining 6 C5: Event Log shows each take (CargoGained), Sell Ore foldout entry; dormant log activated, placeholder text removed

Option event-log of question mining-6-feedback-surface (recommended; no ruling).
Unity files are not compiled here.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Nibu 2026-11-13 05:32:18 +00:00
commit c131045e7d
4 changed files with 23 additions and 22 deletions

View file

@ -13,7 +13,8 @@ public class EventLog : MonoBehaviour
private SizedQueue<string> LogMessages;
private StringBuilder LogText;
private void Start()
// Awake, not Start: a message can arrive in the frame the parent activates, before Start would run.
private void Awake()
{
LogMessages = new SizedQueue<string>(LineCount);
LogText = new StringBuilder();

View file

@ -1092,6 +1092,12 @@ public class ActionGameManager : MonoBehaviour
_shipSubscriptions.Add(CurrentEntity.Zone.ShotResolved
.Where(outcome => outcome.Source == CurrentEntity)
.Subscribe(outcome => _debugLastShots[outcome.Weapon] = outcome));
_shipSubscriptions.Add(CurrentEntity.Zone.CargoGained
.Where(gain => gain.Taker == CurrentEntity)
.Subscribe(gain =>
{
if (EventLog != null) EventLog.LogMessage(HaulFeed.Line(gain, ItemManager), gain.Adrift > 0 ? Color.yellow : Color.white);
}));
FollowCamera.LookAt = ZoneRenderer.EntityInstances[CurrentEntity].LookAtPoint;
FollowCamera.Follow = ZoneRenderer.EntityInstances[CurrentEntity].transform;

View file

@ -312,6 +312,17 @@ public class TradeMenu : MonoBehaviour
Dialog.MoveToCursor();
}
// Sells every mined stack of the player's ships' bays in one step; the station pays through TrySell, so nothing refuses.
private void SellOre()
{
StationServices.TrySellOre(PlayerBays(), GameManager.DockedEntity, ref GameManager.Credits);
UpdateCreditsLabel();
Populate();
}
private IEnumerable<EquippedCargoBay> PlayerBays() =>
GameManager.CurrentEntity.Parent.Children.Where(e => e is Ship {IsPlayerShip: true}).SelectMany(s => s.CargoBays);
private void Repair()
{
if (StationServices.TryRepair(GameManager.CurrentEntity, ref GameManager.Credits))
@ -398,6 +409,8 @@ public class TradeMenu : MonoBehaviour
});
var repairCost = StationServices.RepairCost(GameManager.ItemManager, GameManager.CurrentEntity);
if (repairCost > 0) ContextMenu.AddOption($"Repair ({repairCost:N0})", Repair);
var oreValue = StationServices.OreValue(GameManager.ItemManager, PlayerBays());
if (oreValue > 0) ContextMenu.AddOption($"Sell Ore ({oreValue:N0})", SellOre);
ContextMenu.Show();
});
}