К содержимому

SusProfileScreenContent

SusProfileScreenContent

Панель профиля игрока — avatar, chips name/rank, wins/matches/K-D, список друзей через SetFriends, edit gate.

Пакет

SusGame · Экраны (коммерческий)

Открыть в песочнице

SusGame · Screens

Свойства

ИмяТипПо умолчанию
DisplayNameProp<string>"Player"
AvatarImageProp<string>""
AvatarStatusProp<string>""
LevelProp<int>1
XpProp<int>0
RankProp<string>"Recruit"
WinsProp<int>0
MatchesProp<int>0
KdProp<float>0f
CanEditProp<bool>true

Слоты

Слотов нет.

События

ИмяПолеPayload
FriendClickedOnFriendClickedstring

Хуки стиля

Контракт USS-классов — внешний вид переопределяется без правки C#. Состояния переключаются этими классами:

  • sus-chip__text
  • sus-profile-screen
  • sus-profile-screen__friend
  • sus-profile-screen__friend-av
  • sus-profile-screen__friend-name
  • sus-profile-screen__friend-status
  • sus-profile-screen__friends
  • sus-profile-screen__id-col
  • sus-profile-screen__identity
  • sus-profile-screen__name
  • sus-profile-screen__rank
  • sus-profile-screen__rank-row
  • sus-profile-screen__stat
  • sus-profile-screen__stats
  • sus-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 / AvatarStatusURL изображения аватара / статус
Level / RankЧипы строки ранга
Wins / Matches / KdЧипы статистики
XpОбъявленный Prop<int>не отображается в UI в текущем пине
CanEditОтключает EditBtn, когда false
SetFriends(List<FriendRow>)Пересобирает строки друзей (Id/Name/Status/AvatarIcon)
OnFriendClickedAction<string> (id или имя)
BackBtn / EditBtn / FriendsHostПодключение со стороны хоста

Заметки

  • Пустой список друзей показывает «No friends yet.» через EmptyFriends.
  • FriendRow.Status приводится к нижнему регистру для статуса аватара; online также подсвечивает подпись статуса.
  • Присутствует в пине SusGame — типы реальные (SusProfileScreenContent / вложенный FriendRow).