Danro-Jump/Assets/Scripts/Runtime/UI/MainMenu/ServiceInfoModalWindow.cs
Danil Iarosh c1b72854f4 Implement prize QR and service UI polish
Подробные изменения:

- Добавлена система призовых уровней и выдачи призов с QR-контуром Telegram, шаблоном сообщения и генерацией QR без внешних библиотек.

- Доработаны сервисные настройки: действия кнопок, модальные окна, ввод с джойстика/клавиатуры, статистика, настройки призов и маршрутизация QR.

- Переработаны gameplay HUD и overlay-панели на UI Toolkit со спрайтовыми плашками, DEV BUILD-статистикой, экраном продолжения и экраном результата приза.

- Исправлены сценарии смерти, GameOver, продолжения игры, начисления очков за высоту и перехода в главное меню.

- Перенесены UI-шаблоны из Resources в Assets/UI, подключена Addressables-загрузка шаблонов настроек и standalone-стили для MainMenuModals.

- Добавлены EditMode/PlayMode тесты для призов, QR, arcade input, UI-модалок, scene flow, HUD и gameplay-сессии.

- Обновлены сцены, настройки Addressables, service settings database, документация и дорожная карта.

Проверки:

- Targeted EditMode QR/UI/settings: 23/23 passed

- Targeted UI templates/EditMode: 17/17 passed

- MainMenuUxmlTests: 3/3 passed

- Full EditMode: 129/129 passed

- PlayMode: 6/6 passed

- Runtime Addressables template load check: loaded=5

- Unity Console после финального refresh: 0 errors
2026-06-12 16:43:28 +03:00

69 lines
2.2 KiB
C#

using DanroJump.Settings;
using DanroJump.UI.Modals;
using UnityEngine.UIElements;
namespace DanroJump.UI.MainMenu
{
/// <summary>
/// Универсальное служебное модальное окно для сервисных действий.
/// Используется как первый слой для статистики, QR, призов и витрины.
/// </summary>
public sealed class ServiceInfoModalWindow : ModalWindowBase
{
private readonly Label titleLabel;
private readonly Label contentLabel;
private readonly Label focusLabel;
private readonly Button closeButton;
public ServiceInfoModalWindow(VisualElement root)
: base(root)
{
titleLabel = root?.Q<Label>("ServiceInfoTitle");
contentLabel = root?.Q<Label>("ServiceInfoContent");
focusLabel = root?.Q<Label>("ServiceInfoFocus");
closeButton = root?.Q<Button>("ServiceInfoCloseButton");
if (closeButton != null)
{
closeButton.clicked += RequestClose;
}
}
public void SetResult(ServiceSettingsActionResult result)
{
SetContent(result.Title, result.Status, result.FocusKey);
}
public void SetContent(string title, string content, string focus)
{
if (titleLabel != null)
{
titleLabel.text = string.IsNullOrWhiteSpace(title) ? "Служебное окно" : title;
}
if (contentLabel != null)
{
contentLabel.text = string.IsNullOrWhiteSpace(content) ? "Данные пока недоступны." : content;
}
if (focusLabel != null)
{
focusLabel.text = string.IsNullOrWhiteSpace(focus) ? string.Empty : $"Раздел: {focus}";
}
}
public void Dispose()
{
if (closeButton != null)
{
closeButton.clicked -= RequestClose;
}
}
protected override VisualElement GetDefaultFocusElement()
{
return closeButton;
}
}
}