Verse Library verse

04 Populateoffers

Defines a function that safely retrieves pricing data and updates a UI widget.

extracted-snippets/documentation/en-us/fortnite/verse-fields-examples-in-fortnite/04-populateoffers.verse

# Source URL: https://dev.epicgames.com/documentation/en-us/fortnite/verse-fields-examples-in-fortnite
# Local doc:  epic-docs/documentation/en-us/fortnite/verse-fields-examples-in-fortnite.md
# Section:    PopulateOffers
UpdateSelectedOfferDetails(SelectedOffer : offer) : void =
var PriceFloat : float = 0.0
if (PriceVB := price_vbucks[SelectedOffer.Price]):
set PriceFloat = GetPriceVBucks(PriceVB)
set OfferDetailsWidget.OfferName = SelectedOffer.Name
set OfferDetailsWidget.OfferIcon = SelectedOffer.Icon
set OfferDetailsWidget.OfferShortDescription = SelectedOffer.ShortDescription
set OfferDetailsWidget.OfferPrice = PriceFloat

Comments

    Sign in to vote, comment, or suggest an edit. Sign in