public void OpenPurchaseWindow(Entity entity, ShopDialogs dialogs = null) { if (dialogs != null) { base.shopDialogs = dialogs; } if (base.shopDialogs != null) { base.OnPackClick(entity, false); } }
public void FillPurchaseWindow(NodeAddedEvent e, SingleNode <TankPurchaseScreenComponent> screen, [Context] SingleNode <SelectedPresetComponent> selectedPreset, [JoinBy(typeof(SpecialOfferGroupComponent)), Context, Combine] TankRentOfferNode offer, [JoinBy(typeof(SpecialOfferGroupComponent)), Context] PersonalOfferNode personalOffer, [JoinAll] SingleNode <Dialogs60Component> dialogs) { ShopDialogs shopDialogs = dialogs.component.Get <ShopDialogs>(); screen.component.InitiateScreen(offer.goodsPrice, personalOffer.discount, offer.legendaryTankSpecialOffer.TankRole, shopDialogs); }
public void InitiateScreen(GoodsPriceComponent offerGoodsPrice, DiscountComponent personalOfferDiscount, RentTankRole tankRole, ShopDialogs shopDialogs) { base.shopDialogs = shopDialogs; if (personalOfferDiscount.DiscountCoeff <= 0f) { this.actualPrice.text = offerGoodsPrice.Price + " " + offerGoodsPrice.Currency; this.SetDiscountObjects(false); } else { float num = this.RoundPrice(offerGoodsPrice.Price * (1f - personalOfferDiscount.DiscountCoeff)); this.actualPrice.text = num + " " + offerGoodsPrice.Currency; this.priceWithoutDiscount.text = offerGoodsPrice.Price.ToString(CultureInfo.InvariantCulture); this.discount.text = $"-{personalOfferDiscount.DiscountCoeff * 100f}%"; this.SetDiscountObjects(true); } this.SetWindowContent(tankRole); }
public void BuyPreset(ConfirmButtonClickEvent e, SingleNode <TankPurchaseScreenComponent> purchaseScreen, [JoinAll] SingleNode <SelectedPresetComponent> selectedPreset, [JoinBy(typeof(SpecialOfferGroupComponent))] TankRentOfferNode offer, [JoinAll] SelfUserNode selfUser, [JoinAll] SingleNode <TankRentMainScreenElementsComponents> helper, [JoinAll] SingleNode <Dialogs60Component> dialogs) { ShopDialogs dialogs2 = dialogs.component.Get <ShopDialogs>(); purchaseScreen.component.OpenPurchaseWindow(offer.Entity, dialogs2); }