ThreeKingdomsSlingshot/Assets/Scripts/OutGame/UI/LobbyScreen.cs

82 lines
4.9 KiB
C#
Raw Normal View History

아웃게임 1차(PD #1093 세션 A) — 본영 로비 · 세이브 · 군량 · 영웅(레벨·승급 6칸·진화·스킬 표시) · 편성(전열 3/후열 2 · 프리셋 3) · 거래(뽑기·골드 장비 상점) · 스테이지 보상·별 3·소탕 - 데이터: 기획 tables/ 12장 → Assets/Data/OutGame/*.csv · 메뉴 TKS/Import OutGame Data(Editor/DataImporter) → Resources/OutGame 9 자산(HeroDb·GearDb·GachaConfig·EconomyConfig·RewardTable·LevelTable·PromotionTable·EvolveTable·SkillInfoDb) · 검증(행 수·필수 열·id 유일·hero↔skill↔gear·확률 합) 오류 시 자산 불변 · BalanceConfig.heroes[]/HeroDef 삭제 → HeroDb(기존 5인 id 유지) · economy.csv 키 17 + gacha.csv 키 2 추가(기획서 본문 값 · C45) - 세이브: persistentDataPath/save.json · ver 1 · 즉시 저장 · 오프라인 군량 회복 · 일일 초기화 · 신규 유저 = 유비·관우·장비·조운·황충 Lv1 녹 ★=희귀도 · 골드 1000 · 보옥 300 · 군량 30 · 테스트·캡처 = 메모리 전용 - 화면(uGUI 와이어프레임 · img03·06·08·11): 시작 = 본영 로비(출정 → 월드맵 · 편성 · 연무장/보물/내정 준비 중 · 동맹 추후) · 재화 바(월드맵 포함 · 군량 타이머) · 하단 탭 5 · ◀/Esc 일관 · 영웅 목록·상세·상세정보·도감 · 편성(탭·드래그) · 뽑기(천장 n/80 · 확률 공개 · 첫 10연 무료 · 10연 ★★ 보장 · 카드 순차 공개) · 장비 상점(흰/녹 6종 일일 · sell×5 · 새로고침 보옥 20) - 전투 연결: BattleManager.LineupProvider/Deployed(LineupEntry · §3-2 스탯 · 방어 배율 생성 뒤) · playerSpawnPoints = 전열 (−4/0/4, −12) · 후열 (−2/2, −14) · WorldMapScreen 훅(팝업 군량·보상·별 · 입장 군량 · 노드 별 star_on/off · 소탕 · ◀ 본영 · TopInset) · 결과 패널(별 3 조건 · 골드·경험·보옥·장비) · GameBootstrap/AutoPlayDriver 로비 시작 - B 세션 파일(ActionResolver·Combat·UnitView·BattleHUD·SlingshotInput·EnemyAI) 미변경 - 테스트 56/56(기존 41 유지 · 신규 OutGameTests 15) · console error 0 · 사본 GUI 캡처 11장(DataImporter.CaptureOutGame) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 12:11:10 +00:00
using UnityEngine;
using UnityEngine.UI;
namespace TKS.OutGame
{
/// <summary>
/// 본영 로비(img03 · 기획 S4) — 진행 칩 · 출전 편성 5인 · 중앙 큰 「출정」(→ 챕터 월드맵) · 좌 「편성」 · 우 「연무장」(준비 중) · 하단 탭 5.
/// </summary>
public class LobbyScreen : OutGameScreen
{
Text progress;
RectTransform field;
public override void Build()
{
Header("본영", "로비", false);
var body = Body();
var chip = UiKit.Box("Progress", body, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -28f), new Vector2(760f, 84f), UiKit.Paper);
UiKit.Border(chip, UiKit.Line, 2f);
progress = UiKit.FillLabel(chip.transform, "", 34, UiKit.Ink);
// 전장 자리(배경 아트 없음 → 땅 색 판) · 출전 편성 5인
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));
shadow.sprite = UiKit.Circle;
shadow.type = Image.Type.Simple;
field = UiKit.Fill("Lineup", ground, 20f, 20f, 40f, 40f);
float y = 40f;
var sortie = UiKit.Btn("Sortie", body, "", 40, UiKit.Red, UiKit.White, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, y), new Vector2(440f, 400f), () => Root.OpenWorldMap());
UiKit.Border(sortie.GetComponent<Image>(), new Color(0.98f, 0.86f, 0.7f), 5f);
UiKit.LabelOf(sortie).text = "";
UiKit.Label(sortie.transform, "로비 중앙", 28, new Color(1f, 0.85f, 0.8f), TextAnchor.MiddleCenter, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -22f), new Vector2(400f, 50f), false);
UiKit.Label(sortie.transform, "출정", 120, UiKit.White, TextAnchor.MiddleCenter, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, 30f), new Vector2(420f, 170f));
int stages = Root.Battle != null ? Root.Battle.Config.stages.Length : 0;
UiKit.Label(sortie.transform, "챕터 월드맵\n" + stages + " 스테이지", 34, UiKit.White, TextAnchor.MiddleCenter, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 30f), new Vector2(420f, 100f), false);
SideButton(body, "Formation", "편", "편성", "출정 좌측", -1, () => Root.Show(Root.Formation));
SideButton(body, "Arena", "연", "연무장", "출정 우측", 1, () => Root.ComingSoon("연무장 (탑 · 일일 던전 · 투기장 · 적장 토벌)"));
}
void SideButton(RectTransform body, string name, string mark, string title, string sub, int side, System.Action onClick)
{
float x = side * (220f + 160f);
var b = UiKit.Btn(name, body, "", 30, UiKit.Paper, UiKit.Ink, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(x, 70f), new Vector2(290f, 340f), onClick);
UiKit.Border(b.GetComponent<Image>(), UiKit.Line, 3f);
var dot = UiKit.Dot("Mark", b.transform, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -36f), 110f, UiKit.Dark);
UiKit.FillLabel(dot.transform, mark, 50, UiKit.White);
UiKit.Label(b.transform, title, 52, UiKit.Ink, TextAnchor.MiddleCenter, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0f, -40f), new Vector2(280f, 80f));
UiKit.Label(b.transform, sub, 28, UiKit.InkSoft, TextAnchor.MiddleCenter, new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 30f), new Vector2(280f, 50f), false);
}
public override void Refresh()
{
var map = Root.Map;
var cfg = Root.Battle.Config;
if (map != null && map.HasData)
{
int ch = Root.CurrentChapter();
int node = Mathf.Min(WorldProgress.Cleared(ch), Mathf.Max(0, map.NodesIn(ch) - 1));
int si = map.StageIndexOf(ch, node);
var def = cfg.chapters[ch];
progress.text = "현재 진행: 제" + def.no + "장 " + def.title + (si >= 0 ? " · " + def.no + "-" + cfg.stages[si].stage : "");
}
else progress.text = "현재 진행: —";
UiKit.Clear(field);
var lineup = S.BuildLineup();
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;
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, new Color(1f, 1f, 1f, 0f));
}
}
}
}