public static void RegisterPurchasableLandPlot(LandPlotShopEntry entry) { PurchasableUIRegistry.RegisterPurchasable <EmptyPlotUI>((x) => { return(new PurchaseUI.Purchasable(entry.NameKey, entry.icon, entry.mainImg, entry.DescKey, entry.cost, entry.pediaId, () => x.BuyPlot(new LandPlotUI.PlotPurchaseItem() { icon = entry.icon, img = entry.mainImg, cost = entry.cost, plotPrefab = GameContext.Instance.LookupDirector.GetPlotPrefab(entry.plot) }), entry.isUnlocked ?? (() => true), () => true)); }); }
public static void RegisterPurchasableLandPlot(LandPlotShopEntry entry) { PurchasableUIRegistry.RegisterPurchasable <EmptyPlotUI>(x => new PurchaseUI.Purchasable(entry.NameKey, entry.icon, entry.mainImg, entry.DescKey, entry.cost, entry.pediaId, () => { EmptyPlotUI emptyPlotUi = x; emptyPlotUi.BuyPlot(new LandPlotUI.PlotPurchaseItem() { icon = entry.icon, img = entry.mainImg, cost = entry.cost, plotPrefab = SRSingleton <GameContext> .Instance.LookupDirector.GetPlotPrefab(entry.plot) }); }, entry.isUnlocked ?? (() => true), (() => true), null, null, null, null)); }
public static void RegisterPurchasableUpgrade <T>(UpgradeShopEntry entry) where T : LandPlotUI { PurchasableUIRegistry.RegisterPurchasable <T>((x) => new PurchaseUI.Purchasable(entry.NameKey, entry.icon, entry.mainImg, entry.DescKey, entry.cost, entry.landplotPediaId, () => { x.Upgrade(entry.upgrade, entry.cost); }, entry.isUnlocked ?? (() => true), () => !x.activator.HasUpgrade(entry.upgrade))); }
public static void RegisterPurchasableUpgrade <T>(UpgradeShopEntry entry) where T : LandPlotUI { PurchasableUIRegistry.RegisterPurchasable <T>((x) => new Purchasable(entry.NameKey, entry.icon, entry.mainImg, entry.DescKey, entry.cost, entry.landplotPediaId, () => { x.Upgrade(entry.upgrade, entry.cost); }, entry.isUnlocked != null ? (Func <bool>)(() => entry.isUnlocked(x.activator)) : (() => true), entry.isAvailable != null ? (Func <bool>)(() => entry.isAvailable(x.activator)) : (() => !x.activator.HasUpgrade(entry.upgrade)), null, entry.warning ?? null, null, null, entry.holdtopurchase)); }