client: DeckBuilder по референсу — топбар Lobby и крупные карты
CI / test (push) Successful in 1m51s
Details
CI / test (push) Successful in 1m51s
Details
- PlayerTopBar вынесен из LobbyView в общий компонент; DeckBuilder использует его: Rating/Community неактивны, «В лобби» — в меню. - Меню может рендериться над сценой (overlayParent), Esc закрывает меню и оверлеи DeckBuilder. - Коллекция: сетка 6 в ряд со скроллом, ячейка 216×242 — грейд, иллюстрация, имя поверх, количество, камень редкости. - Просмотр: ЛКМ не добавляет, ПКМ открывает карточку; режим колоды включает добавление и показывает «в колоде ×N · есть ×M». - Список колод: + Новый набор, эмблема клана, N/50 · T N/16, кебаб-меню «Открыть/Удалить». - Фильтры: поиск по названию, редкость C/R/RR/RRR/SP, клан, грейд, триггер. - Проверки: EditMode 69/69, SCENE_SMOKE success=True, PLAYMAT_SMOKE success=True, standalone собран.
This commit is contained in:
parent
f9aed0cae8
commit
874ec6aa1a
|
|
@ -25,14 +25,26 @@ namespace Vanguard.App
|
||||||
info => _ = Flow.LoadBattleAsync(info));
|
info => _ = Flow.LoadBattleAsync(info));
|
||||||
|
|
||||||
_topBar = new PlayerTopBar(
|
_topBar = new PlayerTopBar(
|
||||||
canvas.transform,
|
_view.Root,
|
||||||
Resolve<AppConfig>(),
|
Resolve<AppConfig>(),
|
||||||
Resolve<PlayerState>(),
|
Resolve<PlayerState>(),
|
||||||
() => _ = Flow.LoadLoginAsync(),
|
() => _ = Flow.LoadLoginAsync(),
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
() => _ = Flow.LoadLobbyAsync());
|
() => _ = Flow.LoadLobbyAsync(),
|
||||||
|
overlayParent: canvas.transform);
|
||||||
|
|
||||||
|
_topBar.Root.SetAsFirstSibling();
|
||||||
|
|
||||||
|
var hotkeys = canvas.gameObject.AddComponent<HotkeysDriver>();
|
||||||
|
hotkeys.Cancel = () =>
|
||||||
|
{
|
||||||
|
if (_topBar.IsMenuOpen)
|
||||||
|
_topBar.CloseMenu();
|
||||||
|
else
|
||||||
|
_view.CloseTopmost();
|
||||||
|
};
|
||||||
|
|
||||||
_view.Show();
|
_view.Show();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,6 +124,33 @@ namespace Vanguard.UI
|
||||||
_root.gameObject.SetActive(false);
|
_root.gameObject.SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public RectTransform Root => _root;
|
||||||
|
|
||||||
|
/// <summary>Esc: закрывает верхний оверлей, если он открыт.</summary>
|
||||||
|
public void CloseTopmost()
|
||||||
|
{
|
||||||
|
if (_cardOverlay.gameObject.activeSelf)
|
||||||
|
{
|
||||||
|
CloseCardOverlay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_confirmOverlay.gameObject.activeSelf)
|
||||||
|
{
|
||||||
|
CancelDelete();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_deckMenuOverlay.gameObject.activeSelf)
|
||||||
|
{
|
||||||
|
CloseDeckMenu();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (_filterOverlay.gameObject.activeSelf)
|
||||||
|
CloseFilters();
|
||||||
|
}
|
||||||
|
|
||||||
public void Show()
|
public void Show()
|
||||||
{
|
{
|
||||||
UiKit.SetActive(_root, true);
|
UiKit.SetActive(_root, true);
|
||||||
|
|
|
||||||
|
|
@ -24,11 +24,13 @@ namespace Vanguard.UI
|
||||||
Action onLogout = null,
|
Action onLogout = null,
|
||||||
Action onHistory = null,
|
Action onHistory = null,
|
||||||
Action onLobby = null,
|
Action onLobby = null,
|
||||||
string title = "Меню")
|
string title = "Меню",
|
||||||
|
Transform overlayParent = null)
|
||||||
{
|
{
|
||||||
_onLogout = onLogout;
|
_onLogout = onLogout;
|
||||||
_onHistory = onHistory;
|
_onHistory = onHistory;
|
||||||
_onLobby = onLobby;
|
_onLobby = onLobby;
|
||||||
|
var overlayRoot = overlayParent != null ? overlayParent : parent;
|
||||||
|
|
||||||
_blocker = new GameObject(
|
_blocker = new GameObject(
|
||||||
"MenuBlocker",
|
"MenuBlocker",
|
||||||
|
|
@ -36,7 +38,7 @@ namespace Vanguard.UI
|
||||||
typeof(Image),
|
typeof(Image),
|
||||||
typeof(Button));
|
typeof(Button));
|
||||||
var blockerRect = (RectTransform)_blocker.transform;
|
var blockerRect = (RectTransform)_blocker.transform;
|
||||||
blockerRect.SetParent(parent, false);
|
blockerRect.SetParent(overlayRoot, false);
|
||||||
UiKit.Stretch(blockerRect);
|
UiKit.Stretch(blockerRect);
|
||||||
|
|
||||||
var blockerImage = _blocker.GetComponent<Image>();
|
var blockerImage = _blocker.GetComponent<Image>();
|
||||||
|
|
@ -98,7 +100,7 @@ namespace Vanguard.UI
|
||||||
+ (onLobby != null ? 46f : 0f);
|
+ (onLobby != null ? 46f : 0f);
|
||||||
var panelGo = new GameObject("MenuPanel", typeof(RectTransform), typeof(Image));
|
var panelGo = new GameObject("MenuPanel", typeof(RectTransform), typeof(Image));
|
||||||
_panel = (RectTransform)panelGo.transform;
|
_panel = (RectTransform)panelGo.transform;
|
||||||
_panel.SetParent(parent, false);
|
_panel.SetParent(overlayRoot, false);
|
||||||
_panel.anchorMin = new Vector2(1f, 1f);
|
_panel.anchorMin = new Vector2(1f, 1f);
|
||||||
_panel.anchorMax = new Vector2(1f, 1f);
|
_panel.anchorMax = new Vector2(1f, 1f);
|
||||||
_panel.pivot = new Vector2(1f, 1f);
|
_panel.pivot = new Vector2(1f, 1f);
|
||||||
|
|
@ -133,6 +135,7 @@ namespace Vanguard.UI
|
||||||
public void Open()
|
public void Open()
|
||||||
{
|
{
|
||||||
_blocker.SetActive(true);
|
_blocker.SetActive(true);
|
||||||
|
_blocker.transform.SetAsLastSibling();
|
||||||
_panel.gameObject.SetActive(true);
|
_panel.gameObject.SetActive(true);
|
||||||
_panel.SetAsLastSibling();
|
_panel.SetAsLastSibling();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,8 @@ namespace Vanguard.UI
|
||||||
onLoggedOut,
|
onLoggedOut,
|
||||||
onHistory,
|
onHistory,
|
||||||
onRating,
|
onRating,
|
||||||
onCommunity);
|
onCommunity,
|
||||||
|
overlayParent: _root);
|
||||||
|
|
||||||
BuildActions(onBattle, onDecks, onStore);
|
BuildActions(onBattle, onDecks, onStore);
|
||||||
BuildMissions(out _status);
|
BuildMissions(out _status);
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,7 @@ namespace Vanguard.UI
|
||||||
|
|
||||||
private readonly PlayerState _player;
|
private readonly PlayerState _player;
|
||||||
private readonly HamburgerMenu _menu;
|
private readonly HamburgerMenu _menu;
|
||||||
|
private readonly RectTransform _root;
|
||||||
private Text _avatar;
|
private Text _avatar;
|
||||||
private Text _playerName;
|
private Text _playerName;
|
||||||
private Text _mmr;
|
private Text _mmr;
|
||||||
|
|
@ -39,11 +40,13 @@ namespace Vanguard.UI
|
||||||
Action onHistory,
|
Action onHistory,
|
||||||
Action onRating,
|
Action onRating,
|
||||||
Action onCommunity,
|
Action onCommunity,
|
||||||
Action onLobby = null)
|
Action onLobby = null,
|
||||||
|
Transform overlayParent = null)
|
||||||
{
|
{
|
||||||
_player = player;
|
_player = player;
|
||||||
|
|
||||||
var top = Surface(parent, RootName, new Color(0.012f, 0.03f, 0.08f, 0.94f), 0);
|
var top = Surface(parent, RootName, new Color(0.012f, 0.03f, 0.08f, 0.94f), 0);
|
||||||
|
_root = top;
|
||||||
top.anchorMin = new Vector2(0f, 1f);
|
top.anchorMin = new Vector2(0f, 1f);
|
||||||
top.anchorMax = new Vector2(1f, 1f);
|
top.anchorMax = new Vector2(1f, 1f);
|
||||||
top.pivot = new Vector2(0.5f, 1f);
|
top.pivot = new Vector2(0.5f, 1f);
|
||||||
|
|
@ -113,7 +116,14 @@ namespace Vanguard.UI
|
||||||
AddAction(top, "Rating", "Рейтинг", -312f, 180f, onRating, LobbyIcon.Chart);
|
AddAction(top, "Rating", "Рейтинг", -312f, 180f, onRating, LobbyIcon.Chart);
|
||||||
AddAction(top, "Community", "Сообщество", -96f, 200f, onCommunity, LobbyIcon.Friends);
|
AddAction(top, "Community", "Сообщество", -96f, 200f, onCommunity, LobbyIcon.Friends);
|
||||||
|
|
||||||
_menu = new HamburgerMenu(parent, config, onLoggedOut, onHistory, onLobby);
|
_menu = new HamburgerMenu(
|
||||||
|
top,
|
||||||
|
config,
|
||||||
|
onLoggedOut,
|
||||||
|
onHistory,
|
||||||
|
onLobby,
|
||||||
|
"Меню",
|
||||||
|
overlayParent);
|
||||||
|
|
||||||
_player.Changed += UpdateTexts;
|
_player.Changed += UpdateTexts;
|
||||||
Loc.LanguageChanged += UpdateTexts;
|
Loc.LanguageChanged += UpdateTexts;
|
||||||
|
|
@ -122,6 +132,8 @@ namespace Vanguard.UI
|
||||||
|
|
||||||
public bool IsMenuOpen => _menu != null && _menu.IsOpen;
|
public bool IsMenuOpen => _menu != null && _menu.IsOpen;
|
||||||
|
|
||||||
|
public RectTransform Root => _root;
|
||||||
|
|
||||||
public void CloseMenu()
|
public void CloseMenu()
|
||||||
{
|
{
|
||||||
if (_menu != null)
|
if (_menu != null)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue