SusShopScreenContent

Shop panel — balances, category tabs (SetCategories), item list (SetItems), Buy gated by selection + CanPurchase.
Package
SusGame · Screens (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
Title | Prop<string> | "Shop" | |
SoftBalance | Prop<int> | 0 | |
HardBalance | Prop<int> | 0 | |
CanPurchase | Prop<bool> | true | |
BuyLabel | Prop<string> | "Buy" |
Slots
No slots.
Events
| Name | Field | Payload |
|---|---|---|
CategoryChanged | OnCategoryChanged | string |
ItemSelected | OnItemSelected | string |
BuyClicked | OnBuyClicked | — |
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
breakpoint-mdbreakpoint-smsus-flow-panel--w320sus-flow-panel--w360sus-flow-panel--w380sus-iconsus-scrollsus-shop-screensus-shop-screen__balsus-shop-screen__balancessus-shop-screen__iconsus-shop-screen__itemsus-shop-screen__item--ownedsus-shop-screen__item--selectedsus-shop-screen__itemssus-shop-screen__metasus-shop-screen__namesus-shop-screen__panelsus-shop-screen__pricesus-shop-screen__tabssus-shop-screen__tabs-scrollsus-shop-screen__titlesus-shop-screen__topsus-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 / API | Role |
|---|---|
Title | Header chip |
SoftBalance / HardBalance | Soft / Hard chips |
CanPurchase | Gates Buy when an item is selected |
BuyLabel | Buy button text |
SetCategories(tabs, active?) | Builds SusTabs items |
SetItems(List<ShopItem>) | Rows: Id/Name/Icon/Price/Currency/Owned/DiscountPercent |
SelectedItemId | Last selected id (read-only) |
OnCategoryChanged / OnItemSelected / OnBuyClicked | Host events |
BackBtn / BuyBtn / EmptyAlert | Built hosts |
Notes
- Empty list shows «No items in this category.»; Buy starts disabled until a non-owned selection.
- Owned rows get
--ownedopacity; selection gets--selected. - Present in SusGame pin — nested
ShopItemis real.