SusProfileScreenContent

Панель профиля игрока — avatar, chips name/rank, wins/matches/K-D, список друзей через SetFriends, edit gate.
Пакет
SusGame · Экраны (коммерческий)
Свойства
| Имя | Тип | По умолчанию | |
|---|---|---|---|
DisplayName | Prop<string> | "Player" | |
AvatarImage | Prop<string> | "" | |
AvatarStatus | Prop<string> | "" | |
Level | Prop<int> | 1 | |
Xp | Prop<int> | 0 | |
Rank | Prop<string> | "Recruit" | |
Wins | Prop<int> | 0 | |
Matches | Prop<int> | 0 | |
Kd | Prop<float> | 0f | |
CanEdit | Prop<bool> | true |
Слоты
Слотов нет.
События
| Имя | Поле | Payload |
|---|---|---|
FriendClicked | OnFriendClicked | string |
Хуки стиля
Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:
sus-chip__textsus-profile-screensus-profile-screen__friendsus-profile-screen__friend-avsus-profile-screen__friend-namesus-profile-screen__friend-statussus-profile-screen__friendssus-profile-screen__id-colsus-profile-screen__identitysus-profile-screen__namesus-profile-screen__ranksus-profile-screen__rank-rowsus-profile-screen__statsus-profile-screen__statssus-profile-screen__top
Использование
Привяжите пропы identity/stats; отправляйте друзей через SetFriends. Подключите BackBtn / EditBtn / OnFriendClicked.
xml
<template>
<sus:SusProfileScreenContent
:DisplayName="Name.Value"
:AvatarImage="AvatarImg.Value"
:AvatarStatus="Status.Value"
:Level="Lvl.Value"
:Rank="Rank.Value"
:Wins="Wins.Value"
:Matches="Matches.Value"
:Kd="Kd.Value"
:CanEdit="Edit.Value"
/>
</template>
<script>
public Prop<string> Name = new("Player");
public Prop<string> AvatarImg = new("");
public Prop<string> Status = new("online");
public Prop<int> Lvl = new(1);
public Prop<string> Rank = new("Recruit");
public Prop<int> Wins = new(0);
public Prop<int> Matches = new(0);
public Prop<float> Kd = new(0f);
public Prop<bool> Edit = new(true);
</script>csharp
var profile = new SusProfileScreenContent();
profile.DisplayName.Value = "Nova";
profile.Level.Value = 12;
profile.Rank.Value = "Veteran";
profile.Wins.Value = 40;
profile.Matches.Value = 55;
profile.Kd.Value = 1.25f;
profile.CanEdit.Value = true;
profile.SetFriends(new List<SusProfileScreenContent.FriendRow> {
new() { Id = "u1", Name = "Ally", Status = "online" },
new() { Id = "u2", Name = "Rival", Status = "offline" },
});
profile.OnFriendClicked += id => { /* open friend */ };
profile.BackBtn.OnClick += () => { /* back */ };
profile.EditBtn.OnClick += () => { /* edit flow */ };| Prop / API | Роль |
|---|---|
DisplayName | Чип имени + текст аватара |
AvatarImage / AvatarStatus | URL изображения аватара / статус |
Level / Rank | Чипы строки ранга |
Wins / Matches / Kd | Чипы статистики |
Xp | Объявленный Prop<int> — не отображается в UI в текущем пине |
CanEdit | Отключает EditBtn, когда false |
SetFriends(List<FriendRow>) | Пересобирает строки друзей (Id/Name/Status/AvatarIcon) |
OnFriendClicked | Action<string> (id или имя) |
BackBtn / EditBtn / FriendsHost | Подключение со стороны хоста |
Заметки
- Пустой список друзей показывает «No friends yet.» через
EmptyFriends. FriendRow.Statusприводится к нижнему регистру для статуса аватара;onlineтакже подсвечивает подпись статуса.- Присутствует в пине SusGame — типы реальные (
SusProfileScreenContent/ вложенныйFriendRow).