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

91 lines
2.8 KiB
C#
Raw Normal View History

이벤트 화면 — 출석부(오픈 기념 7일 · 일일 14일) · 7일 특별 미션 · 행운 룰렛 · 이벤트 미션 · 선물 팩 팝업 · 특별 이벤트 「준비 중」 (PD 2026-11-19 「게임에 구현해」 · 시안 7장 event_attend/final/mock) PD 결정 4건(모두 추천안): - ① 로비 오른쪽 「이벤트」 버튼 · 기기 세이브 모드만(OutGameSession.EventAvailable · ServerSession = false → 준비 중 · 서버 이벤트 API = 따로) - ② 유료 선물 팩 = 「결제 준비 중」 토스트만(지급 0) · 광고 칸 = 시험 즉시 지급 하루 3회 - ③⑤ 값 = 시안 예시 그대로 게임 표 · 룰렛 판 = 시안 돌(흰 · 검은 · 최종 금 상감) · 등급 색 = 확률 정보 창에만 - ④ 하루 = 0시 · 접속일 기준(출석 = 접속한 날마다 1칸 · 일일 14일 = 다 받으면 새 회차 · 7일 미션 = 첫 접속일부터 하루 1일차 · 룰렛 = 표 날짜 · 문구 「오전 5시」 → 「0시」) - 규칙 표 Resources/Event/*.csv(event_config · items · kinds · attend · mission7(_steps) · roulette(_extra)) → EventData · EventRules · 세이브 SaveData.ev(EventState) - 화면 OutGame/Event/EventScreen(+ Attend · Mission · Roulette · EventSpin) · 화면 표 Resources/UI/Event/event_screen.csv · 글자 event_text.csv(그림에 글자 0) - 층(P41) = Bg(Static) · Page/Art(Static) · Page/Info(Event + 레이캐스터) · Page/Fx(Frame) · EventTabs(Event) · 부품 아틀라스 UI_Event - 미션 집계 = OutGameSession 동작 성공 경로마다 EventRules.Count 한 줄 · OutGameRoot(이벤트 화면 등록 · ShowEvents · OwnTabBar) · LobbyScreen(이벤트 버튼 + 받을 것 붉은 점) - 받은 칸 탈색 셰이더 Resources/UI/UiGray.shader · 세로 그러데이션 OutGame/UI/UiGradient · 임포트 분기 UnitArtImporter UiEventRoot - 공용 표 읽기 OutGame/UI/ScreenTable 함께 올림(이벤트 화면이 씀 · 같은 날 영웅 배경 · 편성 미커밋 작업에서 만든 파일) - 캡처 UICaptureDriver -uiOnly event_*(9장) · 테스트 EventTests 2 검증: 컴파일 오류 0 · EventTests 2/2 · OutGameTests.Lobby_Tabs_Back_ComingSoon 1/1 · UILayerTests.Canvases_SplitByUpdateRate_InputAndAtlas 1/1 · 캡처 9장 시안 대조 · Fable QA r1 PASS(B 0) → M 일괄 수정 · 이 커밋 묶음만(HEAD + 이벤트) 검증 사본 배치 컴파일 오류 0 섞인 파일(OutGameRoot · LobbyScreen · UICaptureDriver · CLAUDE.md)은 이벤트 부분만 올림 — 메뉴 숨김 · 팝업 글꼴 · 영웅 배경 · 편성 변경은 작업 트리에 그대로(미커밋) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 13:37:08 +00:00
using System.Collections.Generic;
using System.Globalization;
using UnityEngine;
namespace TKS.OutGame
{
/// <summary>
/// 화면 설정 표(키 · 값 · 같은 키 여러 줄 = 목록 · 값 안 | = 칸) — 투기장(ArenaLeague)과 같은 형식을 편성 · 영웅 정보 배경이 같이 쓴다(C45 · 좌표·색·그림 경로는 표에만).
/// </summary>
public class ScreenTable
{
readonly Dictionary<string, List<string>> kv = new Dictionary<string, List<string>>();
/// <summary>Resources 경로(확장자 없음)의 표를 읽는다 · 없으면 null.</summary>
public static ScreenTable Load(string path)
{
var rows = UiText.Rows(path);
if (rows == null) return null;
var t = new ScreenTable();
foreach (var r in rows)
{
string k, v;
if (!r.TryGetValue("s_key", out k) || string.IsNullOrEmpty(k)) continue;
r.TryGetValue("s_value", out v);
List<string> l;
if (!t.kv.TryGetValue(k, out l)) t.kv[k] = l = new List<string>();
l.Add(v ?? "");
}
return t;
}
public bool Has(string key)
{
return kv.ContainsKey(key);
}
public string S(string key, string def = "")
{
List<string> l;
return kv.TryGetValue(key, out l) && l.Count > 0 && l[0].Length > 0 ? l[0] : def;
}
public string[] L(string key)
{
return S(key).Split('|');
}
public List<string[]> All(string key)
{
var list = new List<string[]>();
List<string> l;
if (kv.TryGetValue(key, out l))
foreach (var v in l)
list.Add(v.Split('|'));
return list;
}
public static float F(string v, float def = 0f)
{
float f;
return v != null && float.TryParse(v.Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out f) ? f : def;
}
public static float At(string[] a, int i, float def = 0f)
{
return a != null && i < a.Length && a[i].Trim().Length > 0 ? F(a[i], def) : def;
}
public static string Str(string[] a, int i)
{
return a != null && i < a.Length ? a[i].Trim() : "";
}
public static Color Col(string[] a, int i, Color def)
{
Color c;
return a != null && i < a.Length && ColorUtility.TryParseHtmlString(a[i].Trim(), out c) ? c : def;
}
public float Num(string key, float def = 0f)
{
return F(S(key), def);
}
public Color Color(string key, Color def)
{
return Col(L(key), 0, def);
}
}
}