2026-11-20 04:34:28 +00:00
|
|
|
|
using System.Collections.Generic;
|
2026-11-05 12:11:10 +00:00
|
|
|
|
using UnityEngine;
|
|
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
|
|
|
|
|
namespace TKS.OutGame
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
2026-11-09 08:10:25 +00:00
|
|
|
|
/// 본영 로비(Fable 제안서 §4-1 · PD 2026-11-09 「카피바라GO·탕탕특공대 참고 상업 수준」) — 키아트 + 위 비네트 · 진행 띠(지도 핀 · 장 이름 · 진행 바 n/m) ·
|
|
|
|
|
|
/// 좌우 세로 버튼 열(임무·우편·동맹 / 상점·상자·이벤트 · 미구현 = 잠금 자리) · 출전 편성 5인 · 아래 버튼 행(편성 원 · 출정 3층 · 연무장 원) + 뒤 어두운 띠 · 하단 탭 5.
|
|
|
|
|
|
/// 본문 좌표 = 절대 y − 224.
|
2026-11-05 12:11:10 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
public class LobbyScreen : OutGameScreen
|
|
|
|
|
|
{
|
|
|
|
|
|
Text progress;
|
2026-11-09 08:10:25 +00:00
|
|
|
|
Text progressNum;
|
|
|
|
|
|
RectTransform progressFill;
|
|
|
|
|
|
Text sortieSub;
|
|
|
|
|
|
Text chestBadge;
|
2026-11-19 13:37:08 +00:00
|
|
|
|
GameObject eventDot;
|
2026-11-05 12:11:10 +00:00
|
|
|
|
RectTransform field;
|
2026-11-11 14:51:31 +00:00
|
|
|
|
RectTransform scene; // 배경 그림 좌표 층(그림을 꽉 채움 · null = 배경 없음)
|
|
|
|
|
|
float artW;
|
|
|
|
|
|
float artH;
|
2026-11-10 04:50:57 +00:00
|
|
|
|
/// <summary>로비 출전 영웅 표준 키(px · 크기 표 size_px 가 이 높이) — 유비가 예전 칸 맞춤 때와 같은 크기(797×826 틀 → 196 칸 = ×0.246 · size 837 × 0.246 ≈ 206).</summary>
|
|
|
|
|
|
const float LobbyUnitPx = 206f;
|
2026-11-05 12:11:10 +00:00
|
|
|
|
|
2026-11-09 08:10:25 +00:00
|
|
|
|
static RectTransform At(Transform p, string name, float x, float y, float w, float h)
|
|
|
|
|
|
{
|
|
|
|
|
|
return UiKit.Rect(name, p, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(x, -y), new Vector2(w, h));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-05 12:11:10 +00:00
|
|
|
|
public override void Build()
|
|
|
|
|
|
{
|
2026-11-21 04:50:28 +00:00
|
|
|
|
var headBand = Header("본영", "", false);
|
|
|
|
|
|
SettingsButton(headBand);
|
2026-11-09 08:10:25 +00:00
|
|
|
|
var outer = Body();
|
2026-11-05 12:11:10 +00:00
|
|
|
|
|
2026-11-11 14:51:31 +00:00
|
|
|
|
// 배경 = 테마 bg_lobby(관청 마당) · 위치·배율 = 표 lobby_scene.csv view 줄 · 없으면 땅 색 판
|
|
|
|
|
|
// PD 2026-11-11 「로비 화면을 조금 더 상단으로 · 캐릭터가 배경 이미지와 겹치지 않게 · 너무 어둡지 않게 · 배경에 움직이는 연출」
|
2026-11-06 14:20:57 +00:00
|
|
|
|
var art = UISkin.Icon("bg_lobby");
|
2026-11-11 14:51:31 +00:00
|
|
|
|
scene = null;
|
2026-11-06 14:20:57 +00:00
|
|
|
|
if (art != null)
|
|
|
|
|
|
{
|
2026-11-09 08:10:25 +00:00
|
|
|
|
var clip = UiKit.Fill("LobbyBg", outer);
|
2026-11-06 14:20:57 +00:00
|
|
|
|
clip.gameObject.AddComponent<RectMask2D>();
|
2026-11-11 14:51:31 +00:00
|
|
|
|
var view = LobbyScene.First("view");
|
|
|
|
|
|
// 표 좌표의 기준 = 원본 그림 px(view f_w × f_h) — 임포트 크기(최대 크기 제한으로 줄 수 있음)와 무관하게 같은 자리
|
|
|
|
|
|
artW = view != null && view.w > 0f ? view.w : art.rect.width;
|
|
|
|
|
|
artH = view != null && view.h > 0f ? view.h : art.rect.height;
|
|
|
|
|
|
float top = view != null ? view.y : 0f; // 그림의 이 줄(px)이 본문 맨 위
|
|
|
|
|
|
float zoom = view != null && view.scale > 0.01f ? view.scale : 1f; // 화면 폭 대비 배율(가운데 기준)
|
|
|
|
|
|
var art2 = UiKit.Rect("Art", clip, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f - top / Mathf.Max(1f, artH)), Vector2.zero, Vector2.zero);
|
|
|
|
|
|
float pad = (zoom - 1f) * 0.5f;
|
|
|
|
|
|
art2.anchorMin = new Vector2(-pad, 1f);
|
|
|
|
|
|
art2.anchorMax = new Vector2(1f + pad, 1f);
|
|
|
|
|
|
art2.sizeDelta = Vector2.zero;
|
|
|
|
|
|
art2.anchoredPosition = Vector2.zero;
|
2026-11-06 14:20:57 +00:00
|
|
|
|
var bimg = art2.gameObject.AddComponent<Image>();
|
|
|
|
|
|
bimg.sprite = art;
|
|
|
|
|
|
bimg.color = UISkin.Col("lobby_tint", Color.white);
|
|
|
|
|
|
bimg.raycastTarget = false;
|
|
|
|
|
|
var fit = bimg.gameObject.AddComponent<AspectRatioFitter>();
|
|
|
|
|
|
fit.aspectMode = AspectRatioFitter.AspectMode.WidthControlsHeight;
|
2026-11-11 14:51:31 +00:00
|
|
|
|
fit.aspectRatio = artW / Mathf.Max(1f, artH);
|
2026-11-25 23:46:09 +00:00
|
|
|
|
// 세로로 긴 화면 = 그림 아래끝이 본문 아래끝에 닿을 만큼만 확대(좌우 조금 잘림 · PD 2026-11-26 「로비 하단이 비어 보임」 · 더 긴 그림이 오면 확대 없이 덮음)
|
|
|
|
|
|
var cover = bimg.gameObject.AddComponent<UiArtCover>();
|
|
|
|
|
|
cover.baseZoom = zoom;
|
|
|
|
|
|
cover.artW = artW;
|
|
|
|
|
|
cover.artH = artH;
|
|
|
|
|
|
cover.top = top;
|
|
|
|
|
|
cover.Apply();
|
2026-11-11 14:51:31 +00:00
|
|
|
|
// 장면 층(Frame 캔버스 1장) = 뒤 연출(깃발·불빛) → 영웅(대기 프레임 재생) → 앞 연출(새·꽃잎)
|
|
|
|
|
|
scene = LobbyAmbient.Build(art2, artW, artH).Lineup;
|
2026-11-06 14:20:57 +00:00
|
|
|
|
}
|
2026-11-09 08:10:25 +00:00
|
|
|
|
// 위 비네트(Glow_Panel01 = 위 불투명 → 아래 투명 · 실측) · 아래 버튼 뒤 어두운 띠
|
|
|
|
|
|
var vg = UiKit.Rect("Vignette", outer, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(0f, 180f));
|
|
|
|
|
|
vg.anchorMin = new Vector2(0f, 1f);
|
|
|
|
|
|
vg.anchorMax = new Vector2(1f, 1f);
|
|
|
|
|
|
vg.sizeDelta = new Vector2(0f, 180f);
|
|
|
|
|
|
UiKit.Skin(vg, "scroll_fade", UiKit.Col("lobby_vignette", Color.clear)).enabled = UISkin.Has("scroll_fade");
|
|
|
|
|
|
var body = UiKit.Rect("Mock", outer, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), Vector2.zero, new Vector2(OutGameRoot.Reference.x, OutGameRoot.BodyH));
|
2026-11-11 14:51:31 +00:00
|
|
|
|
// 아래 버튼 뒤 띠 = 아래 진함 → 위 투명(위 비네트 그림을 뒤집어 씀) — 밝아진 배경에서 띠 위 경계가 직선으로 끊겨 보임(QA r1 M7)
|
|
|
|
|
|
var band = At(body, "BottomBand", -40f, 1180f, 1160f, 386f);
|
|
|
|
|
|
if (UISkin.Has("scroll_fade"))
|
|
|
|
|
|
{
|
|
|
|
|
|
UiKit.Skin(band, "scroll_fade", UiKit.Col("lobby_band", Color.clear));
|
|
|
|
|
|
// 위아래 뒤집기는 가운데 기준(At 의 피벗 = 왼쪽 위 → 그대로 뒤집으면 위로 올라감)
|
|
|
|
|
|
band.pivot = new Vector2(0f, 0.5f);
|
|
|
|
|
|
band.anchoredPosition = new Vector2(-40f, -(1180f + 386f * 0.5f));
|
|
|
|
|
|
band.localScale = new Vector3(1f, -1f, 1f);
|
|
|
|
|
|
}
|
|
|
|
|
|
else UiKit.Skin(band, "card", UiKit.Col("lobby_band", Color.clear));
|
2026-11-06 14:20:57 +00:00
|
|
|
|
|
2026-11-09 08:10:25 +00:00
|
|
|
|
// 진행 띠(절대 236~312) = 지도 핀 + 장 이름 + 진행 바 n/m
|
|
|
|
|
|
var pb = At(body, "Progress", 24f, 12f, 1032f, 76f);
|
|
|
|
|
|
UiKit.Skin(pb, "card", UiKit.Col("chip_dark", UiKit.Dark));
|
|
|
|
|
|
UiKit.DropShadow(UiKit.Icon(pb, "map_point", new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(18f, 2f), 50f), 3f);
|
|
|
|
|
|
progress = UiKit.Title(UiKit.Label(pb, "", 34, UiKit.White, TextAnchor.MiddleLeft, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(78f, 2f), new Vector2(560f, 60f)), true);
|
|
|
|
|
|
progress.horizontalOverflow = HorizontalWrapMode.Overflow;
|
|
|
|
|
|
var bar = UiKit.Rect("Bar", pb, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(-104f, 0f), new Vector2(240f, 26f));
|
|
|
|
|
|
UiKit.Skin(bar, "lv_bar_bg", UiKit.White);
|
|
|
|
|
|
progressFill = UiKit.Rect("Fill", bar, new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(4f, 0f), new Vector2(0f, 16f));
|
|
|
|
|
|
UiKit.Skin(progressFill, "lv_fill", UiKit.Col("lv_fill", UiKit.Coin));
|
|
|
|
|
|
progressNum = UiKit.Title(UiKit.Label(pb, "", 26, UiKit.White, TextAnchor.MiddleRight, new Vector2(1f, 0.5f), new Vector2(1f, 0.5f), new Vector2(-18f, 2f), new Vector2(80f, 50f)), true);
|
|
|
|
|
|
|
2026-11-20 04:34:28 +00:00
|
|
|
|
// 좌우 세로 버튼 열(166×150 · 미구현 = 잠금 자리) · 숨김 = 표 UI/menu_hidden lobby_side(PD 2026-11-19 동맹 숨김 · 아래 버튼이 빈자리로 올라옴)
|
|
|
|
|
|
var hide = new HashSet<string>();
|
|
|
|
|
|
var mh = ScreenTable.Load(OutGameRoot.MenuHiddenTable);
|
|
|
|
|
|
if (mh != null)
|
|
|
|
|
|
foreach (var v in mh.L("lobby_side")) hide.Add(v.Trim());
|
|
|
|
|
|
float leftY = 106f;
|
|
|
|
|
|
const float LeftStep = 166f;
|
2026-11-20 03:15:36 +00:00
|
|
|
|
// 임무(2026-11-20) = mission_config unlock_stage 클리어 뒤 · 기기 세이브 모드만(서버 임무 API 없음 · 이벤트 화면과 같은 결정 · 열린 항목)
|
2026-11-20 04:40:12 +00:00
|
|
|
|
missionBtn = SideButton(body, 24f, leftY, "lobby_mission", "임무", false, OpenMissions);
|
2026-11-20 03:15:36 +00:00
|
|
|
|
missionBadge = Badge(missionBtn);
|
2026-11-20 04:34:28 +00:00
|
|
|
|
leftY += LeftStep;
|
2026-11-20 03:15:36 +00:00
|
|
|
|
// 우편 = 서버 모드 = 서버 우편함 · 기기 세이브 모드 = 기기 우편함(임무 초기화 보상 · 2026-11-20)
|
2026-11-20 04:40:12 +00:00
|
|
|
|
var mail = SideButton(body, 24f, leftY, "lobby_mail", "우편", false, () =>
|
2026-11-17 04:55:28 +00:00
|
|
|
|
{
|
|
|
|
|
|
if (S.MailAvailable) Net.MailPanel.Open(Root);
|
2026-11-20 03:15:36 +00:00
|
|
|
|
else MailBox.Open(Root);
|
2026-11-17 04:55:28 +00:00
|
|
|
|
});
|
2026-11-20 03:15:36 +00:00
|
|
|
|
mailBadge = Badge(mail);
|
2026-11-20 04:34:28 +00:00
|
|
|
|
leftY += LeftStep;
|
|
|
|
|
|
if (!hide.Contains("alliance"))
|
|
|
|
|
|
{
|
|
|
|
|
|
SideButton(body, 24f, leftY, "lobby_alliance", "동맹", true, () => Root.ComingSoon("동맹", true));
|
|
|
|
|
|
leftY += LeftStep;
|
|
|
|
|
|
}
|
2026-11-23 12:42:17 +00:00
|
|
|
|
// 왼쪽 열 옵션 버튼 = 제거(PD 2026-11-21 「로비 좌측 옵션 메뉴는 제거 · 우측 상단에 이미 옵션 메뉴가 있음」) — 같은 동작 = 제목 띠 오른쪽 설정 톱니(SettingsButton)
|
2026-11-21 04:50:28 +00:00
|
|
|
|
// 오른쪽 열 = 등용(PD 2026-11-20 「상점 자리에 등용 추가」 → 거래 · 명장 등용 탭) · 상자 · 이벤트
|
|
|
|
|
|
// 로비 상점 버튼 = 제거(PD 2026-11-20 「로비 화면의 상점 아이콘은 제거」 · 상점 = 하단 거래 탭 · 아이콘 = 상점 가판대)
|
2026-11-20 12:33:50 +00:00
|
|
|
|
float rightY = 106f;
|
|
|
|
|
|
SideButton(body, 890f, rightY, "lobby_recruit", "등용", false, () =>
|
|
|
|
|
|
{
|
|
|
|
|
|
Root.Show(Root.Trade);
|
|
|
|
|
|
Root.Trade.SetPage(0);
|
|
|
|
|
|
});
|
|
|
|
|
|
rightY += LeftStep;
|
|
|
|
|
|
var chest = SideButton(body, 890f, rightY, "lobby_chest", "상자", false, () =>
|
2026-11-09 08:10:25 +00:00
|
|
|
|
{
|
|
|
|
|
|
Root.Show(Root.Treasures);
|
|
|
|
|
|
Root.Treasures.SetPage(2);
|
|
|
|
|
|
});
|
|
|
|
|
|
var cb = UiKit.Skin(UiKit.Rect("Alert", chest, new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), new Vector2(-12f, -12f), new Vector2(44f, 46f)), "badge_circle", UiKit.Col("alert_red", UiKit.Red));
|
|
|
|
|
|
cb.preserveAspect = true;
|
|
|
|
|
|
chestBadge = UiKit.Title(UiKit.FillLabel(cb.transform, "", 24, UiKit.White), true);
|
2026-11-19 13:37:08 +00:00
|
|
|
|
// 이벤트(PD 2026-11-19 「게임에 구현해」 · 결정 ① 기기 세이브 모드만 · 서버 모드 = 잠금 자리 그대로) · 받을 것 있음 = 붉은 점
|
|
|
|
|
|
bool evOpen = S.EventAvailable && EventData.Loaded; // 로비가 이벤트 화면보다 먼저 만들어짐 → 표만 확인(누름 = ShowEvents 가 화면까지 확인)
|
2026-11-20 12:33:50 +00:00
|
|
|
|
rightY += LeftStep;
|
|
|
|
|
|
var evb = SideButton(body, 890f, rightY, "lobby_event", "이벤트", !evOpen, () => Root.ShowEvents());
|
2026-11-19 13:37:08 +00:00
|
|
|
|
eventDot = UiKit.Skin(UiKit.Rect("Alert", evb, new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), new Vector2(-12f, -12f), new Vector2(30f, 30f)), "badge_circle", UiKit.Col("alert_red", UiKit.Red)).gameObject;
|
|
|
|
|
|
eventDot.SetActive(false);
|
2026-11-05 12:11:10 +00:00
|
|
|
|
|
2026-11-11 14:51:31 +00:00
|
|
|
|
// 출전 편성 = 배경 마당 위 자리(표 slot 줄 · 그림 좌표) · 배경이 없으면 예전 한 줄 판
|
|
|
|
|
|
if (scene != null) field = scene;
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
var ground = UiKit.Fill("Field", body, 24f, 24f, 140f, 520f);
|
|
|
|
|
|
UiKit.Paint(ground, new Color(0.47f, 0.52f, 0.36f));
|
|
|
|
|
|
var shadow = UiKit.Box("Shadow", ground, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 70f), new Vector2(940f, 150f), new Color(0.2f, 0.18f, 0.14f, 0.55f), false);
|
|
|
|
|
|
shadow.sprite = UiKit.Circle;
|
|
|
|
|
|
shadow.type = Image.Type.Simple;
|
|
|
|
|
|
field = UiKit.Fill("Lineup", ground, 20f, 20f, 40f, 40f);
|
|
|
|
|
|
}
|
2026-11-05 12:11:10 +00:00
|
|
|
|
|
2026-11-21 04:50:28 +00:00
|
|
|
|
// 아래 버튼 행(절대 1500~1740) = 편성 · 출정 3층 · 군영(구 연무장)
|
|
|
|
|
|
// PD 2026-11-21 「편성 · 연무장은 컨셉을 살리고 중요한 컨텐츠 메뉴로 · 연무장 → 군영 · battle」 → 콘텐츠 카드 버튼(표 lobby_side content* · 없으면 예전 둥근 아이콘)
|
|
|
|
|
|
System.Action openFormation = () => Root.Show(Root.Formation);
|
|
|
|
|
|
System.Action openCamp = () =>
|
2026-11-05 15:22:54 +00:00
|
|
|
|
{
|
|
|
|
|
|
Root.Arena.SetPage(0);
|
2026-11-21 04:50:28 +00:00
|
|
|
|
Root.Show(Root.Arena); // 군영 허브(PD #1093 C)
|
|
|
|
|
|
};
|
|
|
|
|
|
if (!ContentButton(body, "formation", openFormation)) RoundButton(body, 160f, "btn_formation", "편성", openFormation);
|
|
|
|
|
|
if (!ContentButton(body, "camp", openCamp)) RoundButton(body, 920f, "btn_arena", "군영", openCamp);
|
2026-11-09 08:10:25 +00:00
|
|
|
|
var so = At(body, "Sortie", 310f, 1290f, 460f, 160f);
|
|
|
|
|
|
var soImg = UiKit.Skin(so, "tapered1", UiKit.Red, true);
|
|
|
|
|
|
so.gameObject.AddComponent<Button>().onClick.AddListener(() => Root.OpenWorldMap());
|
|
|
|
|
|
var gl = UiKit.Rect("Gloss", so, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -10f), new Vector2(400f, 70f));
|
|
|
|
|
|
UiKit.Skin(gl, "tapered2", new Color(1f, 1f, 1f, 0.3f)).enabled = UISkin.Has("tapered2");
|
|
|
|
|
|
UiKit.Icon(so, "tapered3", new Vector2(0f, 1f), new Vector2(0.5f, 0.5f), new Vector2(60f, -26f), 24f);
|
|
|
|
|
|
UiKit.Title(UiKit.Label(so, "출정", 64, UiKit.White, TextAnchor.MiddleCenter, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 18f), new Vector2(440f, 90f)), true);
|
|
|
|
|
|
var chip = UiKit.Skin(UiKit.Rect("Chip", so, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 14f), new Vector2(300f, 44f)), "chip", UiKit.Col("chip_dark", UiKit.Dark));
|
|
|
|
|
|
sortieSub = UiKit.Title(UiKit.FillLabel(chip.transform, "", 26, UiKit.White), true);
|
2026-11-05 12:11:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-20 03:15:36 +00:00
|
|
|
|
Transform missionBtn;
|
|
|
|
|
|
Text missionBadge;
|
|
|
|
|
|
Text mailBadge;
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>임무 서버 모드 = 서버 세션(서버 임무 API 없음).</summary>
|
|
|
|
|
|
bool MissionServer
|
|
|
|
|
|
{
|
|
|
|
|
|
get { return S is Net.ServerSession; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void OpenMissions()
|
|
|
|
|
|
{
|
|
|
|
|
|
UiText.Use(MissionScreen.Texts);
|
|
|
|
|
|
if (MissionServer)
|
|
|
|
|
|
{
|
|
|
|
|
|
Root.Toast(MissionScreen.T("menu_server"));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!MissionRules.MenuOpen(S.Db, S.Save))
|
|
|
|
|
|
{
|
|
|
|
|
|
Root.Toast(MissionScreen.F("menu_locked", S.Db.Missions != null ? S.Db.Missions.Value("unlock_stage") : ""));
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
Root.Show(Root.Missions);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>측면 버튼 오른쪽 위 빨간 점 + 숫자(상자 배지와 같은 모양).</summary>
|
|
|
|
|
|
static Text Badge(Transform btn)
|
|
|
|
|
|
{
|
|
|
|
|
|
var b = UiKit.Skin(UiKit.Rect("Alert", btn, new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), new Vector2(-12f, -12f), new Vector2(44f, 46f)), "badge_circle", UiKit.Col("alert_red", UiKit.Red));
|
|
|
|
|
|
b.preserveAspect = true;
|
|
|
|
|
|
var t = UiKit.Title(UiKit.FillLabel(b.transform, "", 24, UiKit.White), true);
|
|
|
|
|
|
b.gameObject.SetActive(false);
|
|
|
|
|
|
return t;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void SetBadge(Text t, int n)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (t == null) return;
|
|
|
|
|
|
t.text = n.ToString();
|
|
|
|
|
|
t.transform.parent.gameObject.SetActive(n > 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>임무 버튼 잠김 표시(흐림 + 자물쇠) · 빨간 점 = 세 탭의 합 · 우편 = 기기 우편 수.</summary>
|
|
|
|
|
|
void RefreshMission()
|
|
|
|
|
|
{
|
|
|
|
|
|
bool open = !MissionServer && MissionRules.MenuOpen(S.Db, S.Save);
|
|
|
|
|
|
if (missionBtn != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
// 잠김 = 아이콘·글자 흐림 + 자물쇠(SideButton locked 와 같은 모양) · 열림 = 원래 색
|
|
|
|
|
|
foreach (var img in missionBtn.GetComponentsInChildren<Image>(true))
|
|
|
|
|
|
if (img.transform.parent == missionBtn && img.gameObject.name != "Alert" && img.gameObject.name != "Lock" && img != missionBtn.GetComponent<Image>()) img.color = open ? Color.white : UiKit.Col("tab_locked", UiKit.InkSoft);
|
|
|
|
|
|
foreach (var tx in missionBtn.GetComponentsInChildren<Text>(true))
|
|
|
|
|
|
if (tx.transform.parent == missionBtn) tx.color = open ? UiKit.White : UiKit.InkSoft;
|
|
|
|
|
|
var lk = missionBtn.Find("Lock");
|
|
|
|
|
|
if (lk == null && !open)
|
|
|
|
|
|
{
|
|
|
|
|
|
var l = UiKit.Icon(missionBtn, "lock_s", new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), new Vector2(-24f, -28f), 40f);
|
|
|
|
|
|
if (l != null) l.gameObject.name = "Lock";
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (lk != null) lk.gameObject.SetActive(!open);
|
|
|
|
|
|
}
|
|
|
|
|
|
SetBadge(missionBadge, open ? MissionRules.LobbyBadge(S.Db, S.Save) : 0);
|
|
|
|
|
|
SetBadge(mailBadge, !S.MailAvailable && S.Save.mail != null ? S.Save.mail.items.Count : 0);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-09 08:10:25 +00:00
|
|
|
|
/// <summary>측면 버튼(팩 Button_Round03_Dark 166×150 · 아이콘 96 · 라벨 28 · 잠금 = 흐림 + 자물쇠).</summary>
|
2026-11-20 12:33:50 +00:00
|
|
|
|
static ScreenTable sideT;
|
|
|
|
|
|
static bool sideLoaded;
|
|
|
|
|
|
|
|
|
|
|
|
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
|
|
|
|
|
static void ResetSide()
|
|
|
|
|
|
{
|
|
|
|
|
|
sideT = null;
|
|
|
|
|
|
sideLoaded = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-09 08:10:25 +00:00
|
|
|
|
Transform SideButton(RectTransform body, float x, float y, string icon, string label, bool locked, System.Action onClick)
|
2026-11-05 12:11:10 +00:00
|
|
|
|
{
|
2026-11-20 12:33:50 +00:00
|
|
|
|
if (!sideLoaded)
|
|
|
|
|
|
{
|
|
|
|
|
|
sideT = ScreenTable.Load("UI/lobby_side");
|
|
|
|
|
|
sideLoaded = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (sideT != null) return SideIcon(body, x, y, icon, label, locked, onClick);
|
2026-11-09 08:10:25 +00:00
|
|
|
|
var b = At(body, "Side_" + label, x, y, 166f, 150f);
|
|
|
|
|
|
UiKit.Skin(b, "btn_round03", UiKit.White, true);
|
|
|
|
|
|
b.gameObject.AddComponent<Button>().onClick.AddListener(() => onClick());
|
|
|
|
|
|
var ic = UiKit.Icon(b, icon, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -10f), 92f);
|
|
|
|
|
|
if (ic != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
UiKit.DropShadow(ic, 3f);
|
|
|
|
|
|
if (locked) ic.color = UiKit.Col("tab_locked", UiKit.InkSoft);
|
|
|
|
|
|
}
|
|
|
|
|
|
UiKit.Title(UiKit.Label(b, label, 28, locked ? UiKit.InkSoft : UiKit.White, TextAnchor.MiddleCenter, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 4f), new Vector2(160f, 40f)), true);
|
|
|
|
|
|
if (locked) UiKit.Icon(b, "lock_s", new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), new Vector2(-24f, -28f), 40f);
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-20 12:33:50 +00:00
|
|
|
|
/// <summary>로비 세로 버튼 = 프레임 없이 스티커 아이콘만 + 외곽선 글자(PD 2026-11-20 · 표 UI/lobby_side · 누름 칸 = 투명 · 이름 Side_<라벨> 그대로).</summary>
|
|
|
|
|
|
Transform SideIcon(RectTransform body, float x, float y, string icon, string label, bool locked, System.Action onClick)
|
|
|
|
|
|
{
|
|
|
|
|
|
var b = At(body, "Side_" + label, x, y, 166f, 150f);
|
|
|
|
|
|
string skin = sideT.S("frame");
|
|
|
|
|
|
var hit = skin.Length > 0 ? UiKit.Skin(b, skin, UiKit.White, true) : b.gameObject.AddComponent<Image>();
|
|
|
|
|
|
if (skin.Length == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
hit.color = new Color(0f, 0f, 0f, 0f);
|
|
|
|
|
|
hit.raycastTarget = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
b.gameObject.AddComponent<Button>().onClick.AddListener(() => onClick());
|
|
|
|
|
|
var ir = sideT.L("icon");
|
|
|
|
|
|
var ic = UiKit.Icon(b, icon, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -ScreenTable.At(ir, 1, -6f)), ScreenTable.At(ir, 0, 124f));
|
|
|
|
|
|
if (ic != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
UiKit.DropShadow(ic, 3f);
|
|
|
|
|
|
if (locked) ic.color = ScreenTable.Col(sideT.L("lock_tint"), 0, new Color(0.5f, 0.5f, 0.56f, 1f)); // 불투명 · 어둡게만(Fable QA r3 B-1)
|
|
|
|
|
|
}
|
|
|
|
|
|
var lr = sideT.L("label");
|
|
|
|
|
|
UiKit.Title(UiKit.Label(b, label, (int)ScreenTable.At(lr, 0, 30f), locked ? UiKit.InkSoft : UiKit.White, TextAnchor.MiddleCenter, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, ScreenTable.At(lr, 1, -2f)), new Vector2(166f, 42f)), true);
|
|
|
|
|
|
if (locked)
|
|
|
|
|
|
{
|
|
|
|
|
|
var lk = sideT.L("lock");
|
|
|
|
|
|
UiKit.Icon(b, "lock_s", new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), new Vector2(ScreenTable.At(lk, 1, -20f), ScreenTable.At(lk, 2, -30f)), ScreenTable.At(lk, 0, 44f));
|
|
|
|
|
|
}
|
|
|
|
|
|
return b;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-21 04:50:28 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 설정 버튼(PD 2026-11-21 「로비 화면 상단 가장자리에 설정 메뉴 버튼을 추가」) = 제목 띠(「본영」) 오른쪽 끝 톱니(테마 아이콘 lobby_option · PD 승인 기어) ·
|
|
|
|
|
|
/// 표 UI/lobby_side settings = 아이콘 크기 | 오른쪽에서 x | 가운데 y(띠 가운데 기준) · 누름 = 옵션과 같음(서버 = 계정 창 · 그 외 = 준비 중) · 이름 = Settings.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void SettingsButton(RectTransform band)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!sideLoaded)
|
|
|
|
|
|
{
|
|
|
|
|
|
sideT = ScreenTable.Load("UI/lobby_side");
|
|
|
|
|
|
sideLoaded = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
var st = sideT != null && sideT.Has("settings") ? sideT.L("settings") : new[] { "76", "60", "0" };
|
|
|
|
|
|
float sz = ScreenTable.At(st, 0, 76f);
|
|
|
|
|
|
var b = UiKit.Rect("Settings", band, new Vector2(1f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(-ScreenTable.At(st, 1, 60f), ScreenTable.At(st, 2, 0f)), new Vector2(sz + 20f, sz + 20f));
|
|
|
|
|
|
var hit = b.gameObject.AddComponent<Image>();
|
|
|
|
|
|
hit.color = new Color(0f, 0f, 0f, 0f);
|
2026-11-25 14:49:37 +00:00
|
|
|
|
b.gameObject.AddComponent<Button>().onClick.AddListener(() => SettingsPopup.Open(Root)); // 설정 팝업(PD 2026-11-25 옵션 메뉴 · 서버 모드 계정 기능 포함)
|
2026-11-21 04:50:28 +00:00
|
|
|
|
var ic = UiKit.Icon(b, sideT != null ? sideT.S("settings_icon", "lobby_option") : "lobby_option", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, sz);
|
|
|
|
|
|
if (ic != null) UiKit.DropShadow(ic, 3f);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 콘텐츠 카드 버튼(PD 2026-11-21 · Fable `lobby_btn/design/디자인기획_r1.md` §2) = 색 카드 판 + 밝은 속 창 + 판 위로 튀어나온 그림 + 아래 이름 리본(글자 = 표 UI/lobby_text 키)
|
|
|
|
|
|
/// + 선택 꼬리표(군영 = BATTLE). 좌표 · 색 · 스킨 · 그림 id = 표 UI/lobby_side(content_* · content.<id> · content_tag.<id>) · 표 줄이 없으면 false(예전 둥근 아이콘).
|
|
|
|
|
|
/// 이름 = Content_<id> · 로비 본문 층(고정) 그대로 · 연출 없음.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
bool ContentButton(RectTransform body, string id, System.Action onClick)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (!sideLoaded)
|
|
|
|
|
|
{
|
|
|
|
|
|
sideT = ScreenTable.Load("UI/lobby_side");
|
|
|
|
|
|
sideLoaded = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (sideT == null || !sideT.Has("content." + id)) return false;
|
|
|
|
|
|
UiText.Use("UI/lobby_text");
|
|
|
|
|
|
var c = sideT.L("content." + id); // 가운데 x | 그림 | 판 스킨 | 판 색 | 속 창 스킨 | 속 창 색 | 리본 스킨 | 리본 틴트
|
|
|
|
|
|
var pn = sideT.L("content_panel"); // 폭 | 높이 | 위 y
|
|
|
|
|
|
var inn = sideT.L("content_inner"); // 좌우 들임 | 위 들임 | 높이
|
|
|
|
|
|
var ar = sideT.L("content_art"); // 크기 | 가운데 y
|
|
|
|
|
|
var rb = sideT.L("content_name"); // 이름 = 폭 | 높이 | 가운데 y | 글자 | 최소 글자 | 글자 색 | 외곽선 색 | 외곽선 두께
|
|
|
|
|
|
float cx = ScreenTable.At(c, 0, 160f), pw = ScreenTable.At(pn, 0, 240f), ph = ScreenTable.At(pn, 1, 136f), py = ScreenTable.At(pn, 2, 1310f);
|
|
|
|
|
|
float art = ScreenTable.At(ar, 0, 168f), artY = ScreenTable.At(ar, 1, 1328f);
|
|
|
|
|
|
float top = Mathf.Min(py, artY - art * 0.5f);
|
|
|
|
|
|
float rbH = ScreenTable.At(rb, 1, 54f), rbY = ScreenTable.At(rb, 2, 1440f);
|
|
|
|
|
|
float bottom = Mathf.Max(py + ph, rbY + rbH * 0.5f);
|
|
|
|
|
|
|
|
|
|
|
|
// 누름 칸 = 그림 위끝 ~ 리본 아래끝 전체(투명)
|
|
|
|
|
|
var b = At(body, "Content_" + id, cx - pw * 0.5f, top, pw, bottom - top);
|
|
|
|
|
|
var hit = b.gameObject.AddComponent<Image>();
|
|
|
|
|
|
hit.color = new Color(0f, 0f, 0f, 0f);
|
|
|
|
|
|
b.gameObject.AddComponent<Button>().onClick.AddListener(() => onClick());
|
|
|
|
|
|
|
|
|
|
|
|
var panel = At(b, "Panel", 0f, py - top, pw, ph);
|
|
|
|
|
|
UiKit.Skin(panel, ScreenTable.Str(c, 2).Length > 0 ? ScreenTable.Str(c, 2) : "card", ScreenTable.Col(c, 3, UiKit.Dark));
|
|
|
|
|
|
float inX = ScreenTable.At(inn, 0, 14f);
|
|
|
|
|
|
var inner = At(panel, "Inner", inX, ScreenTable.At(inn, 1, 12f), pw - 2f * inX, ScreenTable.At(inn, 2, 92f));
|
|
|
|
|
|
UiKit.Skin(inner, ScreenTable.Str(c, 4).Length > 0 ? ScreenTable.Str(c, 4) : "soft", ScreenTable.Col(c, 5, UiKit.Paper));
|
|
|
|
|
|
|
|
|
|
|
|
var ic = UiKit.Icon(b, ScreenTable.Str(c, 1), new Vector2(0.5f, 1f), new Vector2(0.5f, 0.5f), new Vector2(0f, -(artY - top)), art);
|
|
|
|
|
|
if (ic != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
ic.name = "Art";
|
|
|
|
|
|
UiKit.DropShadow(ic, 3f);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 이름(표 content_name = 폭 | 높이 | 가운데 y | 글자 | 최소 글자 | 글자 색 | 외곽선 색 | 외곽선 두께 · 받침 = content.<id> 7·8번째 = 스킨 | 틴트 · 스킨 none = 받침 없이 글자만)
|
|
|
|
|
|
var nm = sideT.L("content_name");
|
|
|
|
|
|
var plate = Plate(b, "Name", ScreenTable.Str(c, 6), ScreenTable.Col(c, 7, Color.white), 0f, ScreenTable.At(nm, 2, rbY) - top, ScreenTable.At(nm, 0, 204f), ScreenTable.At(nm, 1, rbH), 0f);
|
|
|
|
|
|
var lt = PlateText(plate, UiText.T("lobby_btn_" + id), nm, 3, 4, 5, 6, 7, 36f);
|
|
|
|
|
|
lt.name = "Label";
|
|
|
|
|
|
|
|
|
|
|
|
// 꼬리표(군영 = BATTLE · 표 content_tag.<id> = 스킨(none = 글자만) | 틴트 | 폭 | 높이 | 버튼 가운데에서 x | 가운데 y | 기울기 | 글자 | 글자 색 | 외곽선 두께 · 외곽선 색 = content_tag_line)
|
|
|
|
|
|
if (sideT.Has("content_tag." + id))
|
|
|
|
|
|
{
|
|
|
|
|
|
var tg = sideT.L("content_tag." + id);
|
|
|
|
|
|
var tag = Plate(b, "Tag", ScreenTable.Str(tg, 0), ScreenTable.Col(tg, 1, UiKit.Coin), ScreenTable.At(tg, 4, -70f), ScreenTable.At(tg, 5, 1310f) - top, ScreenTable.At(tg, 2, 108f), ScreenTable.At(tg, 3, 34f), ScreenTable.At(tg, 6, 0f));
|
|
|
|
|
|
var tt = UiKit.Title(UiKit.FillLabel(tag, UiText.T("lobby_btn_" + id + "_tag"), (int)ScreenTable.At(tg, 7, 22f), ScreenTable.Col(tg, 8, UiKit.White)), true);
|
|
|
|
|
|
tt.name = "TagLabel";
|
|
|
|
|
|
UISkin.Stroke(tt, sideT.Color("content_tag_line", UiKit.Ink), ScreenTable.At(tg, 9, 3f));
|
|
|
|
|
|
}
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>받침 칸(가운데 기준 · 위 가운데 앵커) — 그림 = 테마 아이콘(tre_plaque · tre_tag 같은 삼국지 명패 · 9 분할이면 Sliced) 또는 스킨 · none/빈칸 = 받침 없이 글자만.</summary>
|
|
|
|
|
|
static RectTransform Plate(RectTransform b, string name, string skin, Color tint, float x, float cy, float w, float h, float rot)
|
|
|
|
|
|
{
|
|
|
|
|
|
var rt = UiKit.Rect(name, b, new Vector2(0.5f, 1f), new Vector2(0.5f, 0.5f), new Vector2(x, -cy), new Vector2(w, h));
|
|
|
|
|
|
if (skin.Length > 0 && skin != "none") GrowthUi.Paint(rt, skin, tint);
|
|
|
|
|
|
rt.localEulerAngles = new Vector3(0f, 0f, rot);
|
|
|
|
|
|
return rt;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>받침 위 글자(표 배열의 글자 · 최소 글자 · 글자 색 · 외곽선 색 · 외곽선 두께 칸 번호).</summary>
|
|
|
|
|
|
Text PlateText(RectTransform plate, string s, string[] row, int iSize, int iMin, int iCol, int iLine, int iLinePx, float defSize)
|
|
|
|
|
|
{
|
|
|
|
|
|
int size = (int)ScreenTable.At(row, iSize, defSize);
|
|
|
|
|
|
var t = UiKit.Title(UiKit.FillLabel(plate, s, size, ScreenTable.Col(row, iCol, UiKit.White)), true);
|
|
|
|
|
|
t.resizeTextForBestFit = true;
|
|
|
|
|
|
t.resizeTextMinSize = (int)ScreenTable.At(row, iMin, 24f);
|
|
|
|
|
|
t.resizeTextMaxSize = size;
|
|
|
|
|
|
if (ScreenTable.Str(row, iLine).Length > 0) UISkin.Stroke(t, ScreenTable.Col(row, iLine, UiKit.Ink), ScreenTable.At(row, iLinePx, 3f));
|
|
|
|
|
|
return t;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2026-11-09 08:10:25 +00:00
|
|
|
|
/// <summary>원형 버튼(팩 Button_Circle122 124 · 진남 틴트 · 아이콘 72 · 라벨 30 아래).</summary>
|
|
|
|
|
|
void RoundButton(RectTransform body, float cx, string icon, string label, System.Action onClick)
|
|
|
|
|
|
{
|
2026-11-20 12:33:50 +00:00
|
|
|
|
if (!sideLoaded)
|
|
|
|
|
|
{
|
|
|
|
|
|
sideT = ScreenTable.Load("UI/lobby_side");
|
|
|
|
|
|
sideLoaded = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (sideT != null && sideT.Has("round"))
|
|
|
|
|
|
{
|
|
|
|
|
|
// 프레임 없이 아이콘만(PD 2026-11-20 「로비 아이콘 = 배경 프레임 없이」 · 표 lobby_side round = 아이콘 크기|아이콘 가운데 y|글자 y)
|
|
|
|
|
|
var rr = sideT.L("round");
|
|
|
|
|
|
float isz = ScreenTable.At(rr, 0, 112f);
|
|
|
|
|
|
var rb = At(body, "Round_" + label, cx - isz * 0.5f, ScreenTable.At(rr, 1, 1352f) - isz * 0.5f, isz, isz);
|
|
|
|
|
|
var hit = rb.gameObject.AddComponent<Image>();
|
|
|
|
|
|
hit.color = new Color(0f, 0f, 0f, 0f);
|
|
|
|
|
|
rb.gameObject.AddComponent<Button>().onClick.AddListener(() => onClick());
|
|
|
|
|
|
var ri = UiKit.Icon(rb, icon, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, isz);
|
|
|
|
|
|
if (ri != null) UiKit.DropShadow(ri, 3f);
|
|
|
|
|
|
UiKit.Title(UiKit.Label(body, label, 30, UiKit.White, TextAnchor.MiddleCenter, new Vector2(0f, 1f), new Vector2(0.5f, 1f), new Vector2(cx, -ScreenTable.At(rr, 2, 1414f)), new Vector2(200f, 44f)), true);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2026-11-09 08:10:25 +00:00
|
|
|
|
var b = At(body, "Round_" + label, cx - 62f, 1290f, 124f, 124f);
|
|
|
|
|
|
var img = UiKit.Skin(b, "circle122", UiKit.Col("menu_btn", UiKit.Dark), true);
|
|
|
|
|
|
img.preserveAspect = true;
|
|
|
|
|
|
b.gameObject.AddComponent<Button>().onClick.AddListener(() => onClick());
|
|
|
|
|
|
UiKit.DropShadow(UiKit.Icon(b, icon, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 4f), 76f), 3f);
|
|
|
|
|
|
UiKit.Title(UiKit.Label(body, label, 30, UiKit.White, TextAnchor.MiddleCenter, new Vector2(0f, 1f), new Vector2(0.5f, 1f), new Vector2(cx, -1420f), new Vector2(200f, 44f)), true);
|
2026-11-05 12:11:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override void Refresh()
|
|
|
|
|
|
{
|
2026-11-20 03:15:36 +00:00
|
|
|
|
S.MissionRoll(); // 임무 기간 맞춤 · 그날 첫 접속(바뀌었을 때만 저장 → 다시 Refresh)
|
|
|
|
|
|
RefreshMission();
|
2026-11-05 12:11:10 +00:00
|
|
|
|
var map = Root.Map;
|
|
|
|
|
|
var cfg = Root.Battle.Config;
|
2026-11-09 08:10:25 +00:00
|
|
|
|
float pct = 0f;
|
2026-11-05 12:11:10 +00:00
|
|
|
|
if (map != null && map.HasData)
|
|
|
|
|
|
{
|
|
|
|
|
|
int ch = Root.CurrentChapter();
|
2026-11-09 08:10:25 +00:00
|
|
|
|
int nodes = map.NodesIn(ch);
|
|
|
|
|
|
int done = WorldProgress.Cleared(ch);
|
|
|
|
|
|
int node = Mathf.Min(done, Mathf.Max(0, nodes - 1));
|
2026-11-05 12:11:10 +00:00
|
|
|
|
int si = map.StageIndexOf(ch, node);
|
|
|
|
|
|
var def = cfg.chapters[ch];
|
2026-11-09 08:10:25 +00:00
|
|
|
|
progress.text = "제" + def.no + "장 " + def.title;
|
|
|
|
|
|
progressNum.text = Mathf.Min(done, nodes) + "/" + nodes;
|
|
|
|
|
|
pct = nodes > 0 ? Mathf.Clamp01(done / (float)nodes) : 0f;
|
|
|
|
|
|
sortieSub.text = si >= 0 ? "챕터 " + def.no + " · " + def.no + "-" + cfg.stages[si].stage : "챕터 " + def.no;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
progress.text = "—";
|
|
|
|
|
|
progressNum.text = "";
|
|
|
|
|
|
sortieSub.text = "챕터 월드맵";
|
2026-11-05 12:11:10 +00:00
|
|
|
|
}
|
2026-11-09 08:10:25 +00:00
|
|
|
|
progressFill.sizeDelta = new Vector2(232f * pct, progressFill.sizeDelta.y);
|
|
|
|
|
|
progressFill.gameObject.SetActive(pct > 0.01f);
|
|
|
|
|
|
int chests = 0;
|
|
|
|
|
|
foreach (var c in S.Db.Chests.chests) chests += TreasureRules.ChestCount(S.Save, c.id);
|
|
|
|
|
|
chestBadge.text = chests.ToString();
|
|
|
|
|
|
chestBadge.transform.parent.gameObject.SetActive(chests > 0);
|
2026-11-19 13:37:08 +00:00
|
|
|
|
if (eventDot != null) eventDot.SetActive(S.EventAvailable && EventRules.AnyClaimable(S.Save, S.Now));
|
2026-11-05 12:11:10 +00:00
|
|
|
|
|
|
|
|
|
|
UiKit.Clear(field);
|
|
|
|
|
|
var lineup = S.BuildLineup();
|
2026-11-11 14:51:31 +00:00
|
|
|
|
if (scene != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
PlaceLineup(lineup, cfg);
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2026-11-05 12:11:10 +00:00
|
|
|
|
int n = Mathf.Max(1, lineup.Count);
|
|
|
|
|
|
float w = Mathf.Min(200f, 980f / n);
|
|
|
|
|
|
for (int i = 0; i < lineup.Count; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
var h = S.Def(lineup[i].id);
|
|
|
|
|
|
float x = (i - (n - 1) / 2f) * w;
|
2026-11-10 04:50:57 +00:00
|
|
|
|
// 크기 표 기준으로 발 맞춰 세움(PD 2026-11-10 「로비 관우만 작게 보임」 = 칸에 그림 틀을 맞추면 틀이 넓은 관우만 작아짐) · 일러 없으면 초상
|
|
|
|
|
|
if (UiKit.UnitStand("Hero" + i, field, h, new Vector2(0.5f, 0f), new Vector2(x, 20f), LobbyUnitPx, cfg.mountedArtMaxTop) == null)
|
|
|
|
|
|
UiKit.Portrait("Hero" + i, field, h, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(x, 20f), new Vector2(w, 340f), false, 1f, Color.clear);
|
2026-11-05 12:11:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-11-11 14:51:31 +00:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 배경 마당 위 진형(표 slot 줄 · 발 = 그림 px) — 뒷줄(위)부터 그려 앞줄이 앞에 오게 · 자리마다 발밑 그림자(표 shadow 줄) · 뒷줄은 조금 작게(f_scale).
|
|
|
|
|
|
/// PD 2026-11-11 「나란히 일렬로 서 있으면 배경 이미지와 겹칠 수밖에 없음」 → 깃발·무기 거치대·북 사이 빈 돌바닥에 두 줄.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
void PlaceLineup(System.Collections.Generic.List<LineupEntry> lineup, BalanceConfig cfg)
|
|
|
|
|
|
{
|
|
|
|
|
|
var slots = LobbyScene.Slots(lineup.Count);
|
|
|
|
|
|
var order = new System.Collections.Generic.List<int>();
|
|
|
|
|
|
for (int i = 0; i < lineup.Count && i < slots.Count; i++) order.Add(i);
|
|
|
|
|
|
order.Sort((a, b) => slots[a].y.CompareTo(slots[b].y));
|
|
|
|
|
|
// 그림자(표 shadow 줄 여러 개 = 비스듬한 그늘 + 발 닿는 곳 접지 그림자 · QA r2)를 먼저 모두(한 아틀라스 = 한 묶음) → 영웅(뒷줄부터)
|
|
|
|
|
|
// 그림자·영웅을 번갈아 두면 묶음이 끊김(실측 로비 batches 18 → 21)
|
|
|
|
|
|
foreach (var sh in LobbyScene.All("shadow"))
|
|
|
|
|
|
{
|
|
|
|
|
|
var glow = UISkin.Icon(sh.sprite);
|
|
|
|
|
|
foreach (int i in order)
|
|
|
|
|
|
{
|
|
|
|
|
|
var r = slots[i];
|
|
|
|
|
|
float k = r.scale > 0.01f ? r.scale : 1f;
|
|
|
|
|
|
var at = new Vector2(r.x / Mathf.Max(1f, artW), 1f - r.y / Mathf.Max(1f, artH));
|
|
|
|
|
|
var s = UiKit.Rect("Shadow" + i, field, at, new Vector2(0.5f, 0.5f), new Vector2(sh.x * k, -sh.y * k), new Vector2(sh.w * k, sh.h * k));
|
|
|
|
|
|
var simg = s.gameObject.AddComponent<Image>();
|
|
|
|
|
|
simg.sprite = glow != null ? glow : UiKit.Circle;
|
|
|
|
|
|
simg.color = sh.color;
|
|
|
|
|
|
simg.raycastTarget = false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
foreach (int i in order)
|
|
|
|
|
|
{
|
|
|
|
|
|
var r = slots[i];
|
|
|
|
|
|
var h = S.Def(lineup[i].id);
|
|
|
|
|
|
var at = new Vector2(r.x / Mathf.Max(1f, artW), 1f - r.y / Mathf.Max(1f, artH));
|
|
|
|
|
|
float k = r.scale > 0.01f ? r.scale : 1f;
|
|
|
|
|
|
var stand = UiKit.UnitStand("Hero" + i, field, h, at, Vector2.zero, LobbyUnitPx * k, cfg.mountedArtMaxTop);
|
|
|
|
|
|
if (stand == null)
|
|
|
|
|
|
UiKit.Portrait("Hero" + i, field, h, at, new Vector2(0.5f, 0f), Vector2.zero, new Vector2(196f * k, 340f * k), false, 1f, Color.clear);
|
|
|
|
|
|
else if (h != null)
|
|
|
|
|
|
UiFrameAnim.Attach(stand.GetComponent<Image>(), UnitArt.Load(h.art), "front_idle"); // 대기 숨 고르기(2~3 프레임 · 있으면)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2026-11-05 12:11:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|