/// <summary> /// Updates the headings for this critter species. /// </summary> /// <param name="allTotals">The total critter counts for all species.</param> /// <param name="ci">The currently active critter inventory.</param> internal void UpdateContents(IDictionary<Tag, CritterTotals> allTotals, CritterInventory ci) { if (!allTotals.TryGetValue(Species, out var totals)) totals = new CritterTotals(); References.GetReference<LocText>("AvailableLabel").SetText(GameUtil. GetFormattedSimple(totals.Available)); References.GetReference<LocText>("TotalLabel").SetText(GameUtil. GetFormattedSimple(totals.Total)); References.GetReference<LocText>("ReservedLabel").SetText(GameUtil. GetFormattedSimple(totals.Reserved)); UpdatePinnedState(ci); }
/// <summary> /// Updates the pin checkbox to match the actual pinned state. /// </summary> /// <param name="ci">The currently active critter inventory</param> private void UpdatePinnedState(CritterInventory ci) { References.GetReference<MultiToggle>("PinToggle").ChangeState(ci. GetPinnedSpecies(CritterType).Contains(Species) ? 1 : 0); }