Ejemplo n.º 1
0
 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));
     });
 }
Ejemplo n.º 2
0
 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));
 }
Ejemplo n.º 3
0
 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)));
 }
Ejemplo n.º 4
0
 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));
 }