public void UpdateEntry(MarketUI.PlortEntry entry) { int collected = ModdedMarketUI.PlortsCollected(entry.id); int change = dir.GetChangeInValue(entry.id) ?? 0; float alpha = 0f; if (market.IsPlortShown(entry, collected)) { alpha = market.IsPlortUnlocked(entry, collected) ? 1 : 0.5f; } bonusFill.currValue = collected; changeIcon.sprite = market.GetChangeIcon(change, collected); changeIcon.enabled = changeIcon.sprite != null; changeAmountText.text = SceneContext.Instance.GameModeConfig.GetModeSettings().plortMarketDynamic ? Math.Abs(change).ToString() : string.Empty; amountText.color = amountText.color.Alpha(alpha); changeAmountText.color = amountText.color.Alpha(alpha); changeIcon.color = amountText.color.Alpha(alpha); coinIcon.color = amountText.color.Alpha(alpha); itemIcon.color = amountText.color.Alpha(alpha); }
/// <summary> /// Registers a plort into the market /// </summary> /// <param name="entry">The entry to register</param> public static void RegisterMarketPlort(MarketUI.PlortEntry entry) { if (ModLoader.CurrentStep != LoadingState.REGISTER) { throw new Exception("You can only register things during the 'Register' step"); } MARKET_PLORTS.RemoveWhere(plortEntry => plortEntry.id == entry.id); MARKET_PLORTS.Add(entry); }
public static void AddPlortEntry(MarketUI.PlortEntry entry) { plortsToPatch.Add(entry); }
public void UpdateValue(MarketUI.PlortEntry entry) { amountText.text = dir.GetCurrValue(entry.id)?.ToString() ?? "---"; }