Skip to content

SusShopScreenContent

SusShopScreenContent

Shop panel — balances, category tabs (SetCategories), item list (SetItems), Buy gated by selection + CanPurchase.

Package

SusGame · Screens (commercial)

Open in Playground

SusGame · Screens

Props

NameTypeDefault
TitleProp<string>"Shop"
SoftBalanceProp<int>0
HardBalanceProp<int>0
CanPurchaseProp<bool>true
BuyLabelProp<string>"Buy"

Slots

No slots.

Events

NameFieldPayload
CategoryChangedOnCategoryChangedstring
ItemSelectedOnItemSelectedstring
BuyClickedOnBuyClicked

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • breakpoint-md
  • breakpoint-sm
  • sus-flow-panel--w320
  • sus-flow-panel--w360
  • sus-flow-panel--w380
  • sus-icon
  • sus-scroll
  • sus-shop-screen
  • sus-shop-screen__bal
  • sus-shop-screen__balances
  • sus-shop-screen__icon
  • sus-shop-screen__item
  • sus-shop-screen__item--owned
  • sus-shop-screen__item--selected
  • sus-shop-screen__items
  • sus-shop-screen__meta
  • sus-shop-screen__name
  • sus-shop-screen__panel
  • sus-shop-screen__price
  • sus-shop-screen__tabs
  • sus-shop-screen__tabs-scroll
  • sus-shop-screen__title
  • sus-shop-screen__top
  • sus-tabs__tab

Usage

xml
<template>
  <sus:SusShopScreenContent
    :Title="Title.Value"
    :SoftBalance="Soft.Value"
    :HardBalance="Hard.Value"
    :CanPurchase="CanBuy.Value"
    :BuyLabel="Buy.Value"
  />
</template>

<script>
public Prop<string> Title = new("Shop");
public Prop<int> Soft = new(1200);
public Prop<int> Hard = new(40);
public Prop<bool> CanBuy = new(true);
public Prop<string> Buy = new("Buy");
</script>
csharp
var shop = new SusShopScreenContent();
shop.Title.Value = "Armory";
shop.SoftBalance.Value = 1200;
shop.HardBalance.Value = 40;
shop.SetCategories(new List<string> { "Weapons", "Cosmetics" }, active: "Weapons");
shop.SetItems(new List<SusShopScreenContent.ShopItem> {
  new() { Id = "rifle", Name = "Rifle", Price = 300, Currency = "soft" },
  new() { Id = "skin", Name = "Camo", Price = 10, Currency = "hard", DiscountPercent = 20 },
  new() { Id = "owned", Name = "Starter kit", Price = 0, Currency = "soft", Owned = true },
});
shop.OnCategoryChanged += cat => { /* reload SetItems */ };
shop.OnItemSelected += id => { /* preview */ };
shop.OnBuyClicked += () => { /* purchase shop.SelectedItemId */ };
shop.BackBtn.OnClick += () => { /* back */ };
Prop / APIRole
TitleHeader chip
SoftBalance / HardBalanceSoft / Hard chips
CanPurchaseGates Buy when an item is selected
BuyLabelBuy button text
SetCategories(tabs, active?)Builds SusTabs items
SetItems(List<ShopItem>)Rows: Id/Name/Icon/Price/Currency/Owned/DiscountPercent
SelectedItemIdLast selected id (read-only)
OnCategoryChanged / OnItemSelected / OnBuyClickedHost events
BackBtn / BuyBtn / EmptyAlertBuilt hosts

Notes

  • Empty list shows «No items in this category.»; Buy starts disabled until a non-owned selection.
  • Owned rows get --owned opacity; selection gets --selected.
  • Present in SusGame pin — nested ShopItem is real.