public override void RefreshValues() { base.RefreshValues(); // WORKAROUND IN 1.5.9 if (_brothel == null) { _brothel = new CEBrothel(Workshop.Settlement); } Name = _brothel.Name.ToString(); WorkshopType workshopType = WorkshopType.Find("pottery_shop"); WorkshopTypeId = workshopType.StringId; Location = _brothel.Settlement.Name.ToString(); Income = (int)(Math.Max(0, _brothel.ProfitMade) / Campaign.Current.Models.ClanFinanceModel.RevenueSmoothenFraction()) * (_brothel.Level + 1); IncomeValueText = DetermineIncomeText(Income); InputsText = new TextObject("{=CEBROTHEL0985}Description").ToString(); OutputsText = new TextObject("{=CEBROTHEL0994}Notable Prostitutes").ToString(); ActionList.Clear(); ItemProperties.Clear(); PopulateActionList(); PopulateStatsList(); }
public static void UpdateTooltip(this TooltipVM tooltipVM, CEBrothel brothel) { tooltipVM.Mode = 1; tooltipVM.AddProperty("", new TextObject("{=CEEVENTS1099}Brothel").ToString(), 0, TooltipProperty.TooltipPropertyFlags.Title); tooltipVM.AddProperty(new TextObject("{=qRqnrtdX}Owner").ToString(), brothel.Owner.Name.ToString()); tooltipVM.AddProperty(new TextObject("{=CEBROTHEL0994}Notable Prostitutes").ToString(), "None"); }
public CEBrothelClanFinanceItemVM(CEBrothel brothel, Workshop workshop, Action <ClanFinanceIncomeItemBaseVM> onSelection, Action onRefresh) : base(workshop, onSelection, onRefresh) { _brothel = brothel; IncomeTypeAsEnum = IncomeTypes.Workshop; SettlementComponent component = _brothel.Settlement.GetComponent <SettlementComponent>(); ImageName = component != null ? component.WaitMeshName : ""; RefreshValues(); }
protected override void PopulateActionList() { if (_brothel == null) { _brothel = new CEBrothel(Workshop.Settlement); } int sellingCost = _brothel.Capital; TextObject hint = GetBrothelSellHintText(sellingCost); ActionList.Add(new StringItemWithEnabledAndHintVM(ExecuteSellBrothel, new TextObject("{=PHkC8Gia}Sell").ToString(), true, null, hint)); bool isCurrentlyActive = _brothel.IsRunning; int costToStart = _brothel.Expense; TextObject hint2 = GetBrothelSellHintText(sellingCost); ActionList.Add(isCurrentlyActive ? new StringItemWithEnabledAndHintVM(ExecuteToggleBrothel, new TextObject("{=CEBROTHEL0995}Stop Operations").ToString(), true, null, hint2) : new StringItemWithEnabledAndHintVM(ExecuteToggleBrothel, new TextObject("{=CEBROTHEL0996}Start Operations").ToString(), Hero.MainHero.Gold >= costToStart, null, hint2)); }