diff --git a/client/Assets/Vanguard/Editor/SceneSmoke.cs b/client/Assets/Vanguard/Editor/SceneSmoke.cs index 531a43f..06930f0 100644 --- a/client/Assets/Vanguard/Editor/SceneSmoke.cs +++ b/client/Assets/Vanguard/Editor/SceneSmoke.cs @@ -115,17 +115,21 @@ namespace Vanguard.Editor var active = SceneManager.GetActiveScene().name; var environment = GameObject.Find("Vanguard 3D Environment"); + var backdrop = GameObject.Find("LoginBackdrop"); var login = GameObject.Find("LoginScreen"); var lobby = GameObject.Find("MetaScreen"); var onboarding = GameObject.Find("OnboardingScreen"); - var success = environment != null - && (active == SceneFlow.Login || active == SceneFlow.Lobby) - && (login != null || lobby != null || onboarding != null); + var isLogin = active == SceneFlow.Login; + var isLobby = active == SceneFlow.Lobby; + var success = (isLogin || isLobby) + && (login != null || lobby != null || onboarding != null) + && (isLogin ? backdrop != null : environment != null); Debug.Log( "SCENE_SMOKE success=" + success + " active=" + active + " env=" + (environment != null) + + " backdrop=" + (backdrop != null) + " login=" + (login != null) + " lobby=" + (lobby != null) + " onboarding=" + (onboarding != null) diff --git a/client/Assets/Vanguard/Resources/Login.meta b/client/Assets/Vanguard/Resources/Login.meta new file mode 100644 index 0000000..1664a87 --- /dev/null +++ b/client/Assets/Vanguard/Resources/Login.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1500707083b88724a98ef1abd9602118 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/client/Assets/Vanguard/Resources/Login/login_bg.png b/client/Assets/Vanguard/Resources/Login/login_bg.png new file mode 100644 index 0000000..918093f Binary files /dev/null and b/client/Assets/Vanguard/Resources/Login/login_bg.png differ diff --git a/client/Assets/Vanguard/Resources/Login/login_bg.png.meta b/client/Assets/Vanguard/Resources/Login/login_bg.png.meta new file mode 100644 index 0000000..7d5316a --- /dev/null +++ b/client/Assets/Vanguard/Resources/Login/login_bg.png.meta @@ -0,0 +1,132 @@ +fileFormatVersion: 2 +guid: a5cd624cf86a9a64aaee9fe1bc10ab9d +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 13 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + flipGreenChannel: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + vTOnly: 0 + ignoreMipmapLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationMethod: 0 + spriteTessellationDetail: -1 + spriteGeometrySubdivision: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + swizzle: 50462976 + cookieLightType: 0 + platformSettings: + - serializedVersion: 4 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 4 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + ignorePlatformSupport: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + customData: + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spriteCustomMetadata: + entries: [] + nameFileIdTable: {} + mipmapLimitGroupName: + pSDRemoveMatte: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/client/Assets/Vanguard/Runtime/App/LoginSceneController.cs b/client/Assets/Vanguard/Runtime/App/LoginSceneController.cs index d5d4d19..f207f82 100644 --- a/client/Assets/Vanguard/Runtime/App/LoginSceneController.cs +++ b/client/Assets/Vanguard/Runtime/App/LoginSceneController.cs @@ -12,7 +12,6 @@ namespace Vanguard.App private void Start() { - SceneEnvironment.Build(SceneTheme.Login); _auth = Resolve(); var config = Resolve(); diff --git a/client/Assets/Vanguard/Runtime/UI/Localization.cs b/client/Assets/Vanguard/Runtime/UI/Localization.cs index a44ae9a..ef53577 100644 --- a/client/Assets/Vanguard/Runtime/UI/Localization.cs +++ b/client/Assets/Vanguard/Runtime/UI/Localization.cs @@ -117,6 +117,16 @@ namespace Vanguard.UI ["Готово."] = "Done.", ["Забрать"] = "Claim", ["Закрыть"] = "Close", + ["Войти"] = "Sign in", + ["Подключение…"] = "Connecting…", + ["Создать аккаунт"] = "Create account", + ["Забыли пароль?"] = "Forgot password?", + ["Логин"] = "Login", + ["Меню"] = "Menu", + ["Адрес сервера"] = "Server address", + ["Введите логин и пароль."] = "Enter login and password.", + ["Сброс пароля не поддерживается. Обратитесь к администратору."] = + "Password reset is not supported. Contact an administrator.", ["История"] = "History", ["Карта: "] = "Card: ", ["Магазин"] = "Store", diff --git a/client/Assets/Vanguard/Runtime/UI/LoginBackdrop.cs b/client/Assets/Vanguard/Runtime/UI/LoginBackdrop.cs new file mode 100644 index 0000000..74261ec --- /dev/null +++ b/client/Assets/Vanguard/Runtime/UI/LoginBackdrop.cs @@ -0,0 +1,73 @@ +using UnityEngine; +using UnityEngine.UI; + +namespace Vanguard.UI +{ + /// + /// Фон экрана входа: key art на весь экран (cover) и затемнение по краям. + /// Арт лежит в Resources, потому что Addressables в клиенте ещё не подключены. + /// + public static class LoginBackdrop + { + private const string ResourcePath = "Login/login_bg"; + + public static RectTransform Create(Transform parent) + { + var rootGo = new GameObject("LoginBackdrop", typeof(RectTransform)); + var root = (RectTransform)rootGo.transform; + root.SetParent(parent, false); + UiKit.Stretch(root); + root.SetAsFirstSibling(); + + var texture = Resources.Load(ResourcePath); + + if (texture != null) + { + var artGo = new GameObject( + "Art", + typeof(RectTransform), + typeof(Image), + typeof(AspectRatioFitter)); + var art = (RectTransform)artGo.transform; + art.SetParent(root, false); + UiKit.Stretch(art); + + var image = artGo.GetComponent(); + image.sprite = Sprite.Create( + texture, + new Rect(0f, 0f, texture.width, texture.height), + new Vector2(0.5f, 0.5f), + 100f); + image.type = Image.Type.Simple; + image.preserveAspect = false; + image.raycastTarget = false; + + var fitter = artGo.GetComponent(); + fitter.aspectMode = AspectRatioFitter.AspectMode.EnvelopeParent; + fitter.aspectRatio = texture.width / (float)texture.height; + } + else + { + // Арта нет — тёмная заливка, экран не должен падать. + var fallback = UiKit.CreatePanel( + root, "Fallback", new Color(0.02f, 0.05f, 0.13f, 1f)); + fallback.GetComponent().raycastTarget = false; + } + + var shade = NeonUi.AddImage( + root, + "Shade", + NeonUi.Vignette( + 480, + 270, + new Color(0f, 0f, 0f, 0.08f), + new Color(0.004f, 0.016f, 0.055f, 0.72f)), + new Vector2(480f, 270f), + Vector2.zero); + shade.preserveAspect = false; + UiKit.Stretch(shade.rectTransform); + + return root; + } + } +} diff --git a/client/Assets/Vanguard/Runtime/UI/LoginBackdrop.cs.meta b/client/Assets/Vanguard/Runtime/UI/LoginBackdrop.cs.meta new file mode 100644 index 0000000..3b9d312 --- /dev/null +++ b/client/Assets/Vanguard/Runtime/UI/LoginBackdrop.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ae0147101ebe1d14da83d20cf2212c04 \ No newline at end of file diff --git a/client/Assets/Vanguard/Runtime/UI/LoginMenu.cs b/client/Assets/Vanguard/Runtime/UI/LoginMenu.cs new file mode 100644 index 0000000..74cb88e --- /dev/null +++ b/client/Assets/Vanguard/Runtime/UI/LoginMenu.cs @@ -0,0 +1,198 @@ +using UnityEngine; +using UnityEngine.UI; +using Vanguard.App; + +namespace Vanguard.UI +{ + /// Гамбургер-меню логина: язык, версия и адрес сервера. + public sealed class LoginMenu + { + private readonly GameObject _blocker; + private readonly RectTransform _panel; + + public bool IsOpen => _panel != null && _panel.gameObject.activeSelf; + + public LoginMenu(Transform parent, AppConfig config) + { + _blocker = new GameObject( + "MenuBlocker", + typeof(RectTransform), + typeof(Image), + typeof(Button)); + var blockerRect = (RectTransform)_blocker.transform; + blockerRect.SetParent(parent, false); + UiKit.Stretch(blockerRect); + + var blockerImage = _blocker.GetComponent(); + blockerImage.color = new Color(0f, 0f, 0f, 0.001f); + blockerImage.raycastTarget = true; + + var blockerButton = _blocker.GetComponent