413 lines
22 KiB
C#
413 lines
22 KiB
C#
using System;
|
||
using System.Collections.Generic;
|
||
using System.Globalization;
|
||
using UnityEngine;
|
||
using UnityEngine.UI;
|
||
|
||
namespace TKS.OutGame
|
||
{
|
||
/// <summary>
|
||
/// 영웅 「정보」 창(2026-11-20 개발요청_영웅정보 · 목업 영웅정보_img 01 · 02 · 03) — 배너(진영 색 · 큰 유닛 · 한자 무늬 · 이름판) · 탭 능력치 / 열전 · ◀ ▶.
|
||
/// 능력치 = 기본(병종 기본 × 영웅 배율) + 성장 = 합계(HeroRules.Compute 그대로) · 전투 능력치 7(스킬 패시브 + 각성 + 보물 세트 · 0 = 회색) · 성장 내역 6 + 바로가기 · 칸 = 내역 창.
|
||
/// 열전 = hero_chronicle(연도 · 사건 · 연의 전기 편) · 없으면 「열전 준비 중」. 글자 = UI/HeroInfo/info_text · 값 = 표(C45).
|
||
/// </summary>
|
||
public static class HeroInfoWindow
|
||
{
|
||
public const string Texts = "UI/HeroInfo/info_text";
|
||
const float W = 940f;
|
||
const float L = 34f;
|
||
const float RW = 872f;
|
||
|
||
static string heroId;
|
||
static bool bio;
|
||
|
||
/// <summary>시험 · 캡처 — 마지막 창(stats · bio · breakdown).</summary>
|
||
public static string Last { get; private set; }
|
||
|
||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||
static void ResetStatics()
|
||
{
|
||
heroId = Last = null;
|
||
bio = false;
|
||
}
|
||
|
||
static string T(string k)
|
||
{
|
||
return UiText.T(k).Replace("\\n", "\n");
|
||
}
|
||
|
||
static string F(string k, params string[] a)
|
||
{
|
||
return UiText.F(k, a).Replace("\\n", "\n");
|
||
}
|
||
|
||
static string P(float v)
|
||
{
|
||
return v.ToString("0.#", CultureInfo.InvariantCulture);
|
||
}
|
||
|
||
static Text Txt(RectTransform p, string name, string s, int size, Color c, float x, float y, float w, float h, TextAnchor a = TextAnchor.MiddleLeft, bool title = false)
|
||
{
|
||
var t = UiKit.Label(p, s, size, c, a, new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(x, -y), new Vector2(w, h), title);
|
||
t.name = name;
|
||
if (title) UiKit.Title(t, true);
|
||
t.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||
return t;
|
||
}
|
||
|
||
static Image Box(RectTransform p, string name, float x, float y, float w, float h, Color c, bool raycast = false)
|
||
{
|
||
return UiKit.Skin(UiKit.At(p, name, x, y, w, h), "card", c, raycast);
|
||
}
|
||
|
||
static Color Soft
|
||
{
|
||
get { return UiKit.Col("text_soft", UiKit.InkSoft); }
|
||
}
|
||
|
||
// ---------- 값(지금 HeroRules 그대로 · 기본 · 성장 몫만 나눠 꺼냄) ----------
|
||
|
||
/// <summary>기본(병종 기본 × 영웅 배율) · 합계 — stat = hp|atk|def.</summary>
|
||
public static void BaseTotal(HeroRules.Stats st, string stat, out float baseV, out float total)
|
||
{
|
||
switch (stat)
|
||
{
|
||
case "hp":
|
||
baseV = st.baseHp * st.hpMult;
|
||
total = st.hp;
|
||
break;
|
||
case "def":
|
||
baseV = st.baseDef * st.defMult;
|
||
total = st.def;
|
||
break;
|
||
default:
|
||
baseV = st.baseAtk * st.atkMult;
|
||
total = st.atk;
|
||
break;
|
||
}
|
||
}
|
||
|
||
/// <summary>성장 내역 % (공격력 기준 · hero_info_sources s_key).</summary>
|
||
public static float SourcePct(HeroRules.Stats st, string key)
|
||
{
|
||
switch (key)
|
||
{
|
||
case "lv": return st.lvPct;
|
||
case "promo": return st.promoPct + st.gearPct;
|
||
case "star": return st.starPct;
|
||
case "train": return st.trainPct;
|
||
case "treasure": return st.treasureAtkPct;
|
||
case "awaken": return st.awakenAtkPct;
|
||
}
|
||
return 0f;
|
||
}
|
||
|
||
/// <summary>전투 능력치(표 Battle 키 → 표시 % · 스킬 패시브 + 각성 + 보물 세트 합 · 밀기 = 곱 → % · 받는 피해 감소 = 양수 %).</summary>
|
||
public static Dictionary<string, float> BattleStats(OutGameSession s, HeroDb.Hero h, HeroState hs)
|
||
{
|
||
var db = s.Db;
|
||
var res = new Dictionary<string, float>();
|
||
foreach (var r in db.HeroInfo.stats)
|
||
if (r.section == "Battle") res[r.key] = 0f;
|
||
var fx = new List<SkillEffect>();
|
||
fx.AddRange(AwakenRules.Effects(db, hs));
|
||
var sk = SkillCatalog.Get(h.skillPassive);
|
||
if (sk != null) fx.AddRange(sk.ScaledEffects(SkillRules.Level(hs, 1), SkillRules.PassiveMult(db, hs != null ? hs.star : h.rarity)));
|
||
var tre = TreasureRules.BattleEffects(db, s.Save);
|
||
if (tre != null) fx.AddRange(tre);
|
||
foreach (var e in fx)
|
||
{
|
||
if (e == null || !res.ContainsKey(e.Key)) continue;
|
||
float v;
|
||
switch (e.Key)
|
||
{
|
||
case SkillKeys.PushMult:
|
||
v = (e.P - 1f) * 100f;
|
||
break;
|
||
case SkillKeys.CounterTakenPct:
|
||
case SkillKeys.DmgTakenRangedPct:
|
||
v = -e.P * 100f;
|
||
break;
|
||
default:
|
||
v = e.P * 100f;
|
||
break;
|
||
}
|
||
res[e.Key] += v;
|
||
}
|
||
return res;
|
||
}
|
||
|
||
// ---------- 창 ----------
|
||
|
||
public static void Open(OutGameRoot root, string id)
|
||
{
|
||
heroId = id;
|
||
bio = false;
|
||
Draw(root);
|
||
}
|
||
|
||
static void Draw(OutGameRoot root)
|
||
{
|
||
UiText.Use(Texts);
|
||
var s = root.Session;
|
||
var db = s.Db;
|
||
var h = s.Def(heroId);
|
||
var hs = s.Save.Hero(heroId);
|
||
if (h == null || h.isSoldier || db.HeroInfo == null)
|
||
{
|
||
root.Toast(T("hi_none"));
|
||
return;
|
||
}
|
||
Last = bio ? "bio" : "stats";
|
||
var content = root.ModalCustom(T("hi_title"), 1780f);
|
||
var panel = (RectTransform)content.parent;
|
||
foreach (var dd in new[] { -1, 1 })
|
||
{
|
||
int k = dd;
|
||
var b = Box(panel, dd < 0 ? "Prev" : "Next", W - (dd < 0 ? 300f : 216f), 26f, 72f, 72f, UiKit.Col("chip_dark", UiKit.Dark), true);
|
||
b.gameObject.AddComponent<Button>().onClick.AddListener(() =>
|
||
{
|
||
heroId = root.HeroDetail.StepHero(k);
|
||
Draw(root);
|
||
});
|
||
UiKit.Icon(b.rectTransform, dd < 0 ? "arrow_prev" : "arrow_next", new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), Vector2.zero, 46f);
|
||
}
|
||
var st = s.StatsOf(heroId);
|
||
// 배너 = 진영 색 · 한자 무늬 · 큰 유닛 · 이름판
|
||
float y = 128f;
|
||
var banner = Box(panel, "Banner", L, y, RW, 440f, UiKit.Col("faction_" + h.faction, new Color(0.2f, 0.55f, 0.3f, 1f)));
|
||
var br = banner.rectTransform;
|
||
br.gameObject.AddComponent<RectMask2D>();
|
||
var hz = Txt(br, "Hanja", h.hanja ?? "", 300, new Color(1f, 1f, 1f, 0.08f), RW - 620f, 40f, 600f, 360f, TextAnchor.MiddleRight, true);
|
||
hz.raycastTarget = false;
|
||
var stand = UiKit.UnitStand("Hero", br, h, new Vector2(1f, 0f), new Vector2(-190f, 20f), 400f, 1f);
|
||
if (stand != null) UiFrameAnim.Attach(stand.GetComponent<Image>(), UnitArt.Load(h.art), "front_idle");
|
||
var plate = Box(br, "Plate", 16f, 170f, 520f, 250f, new Color(0.1f, 0.12f, 0.2f, 0.85f)).rectTransform;
|
||
var fb = UiKit.FactionBadge(plate, h.faction, new Vector2(0f, 1f), new Vector2(0.5f, 0.5f), new Vector2(40f, -42f), 44f);
|
||
if (fb != null) UiKit.DropShadow(fb, 2f);
|
||
var ci = UiKit.Icon(plate, UiKit.TypeSymbolId(h.type), new Vector2(0f, 1f), new Vector2(0.5f, 0.5f), new Vector2(94f, -42f), 44f);
|
||
if (ci != null) UiKit.DropShadow(ci, 2f);
|
||
if (hs != null)
|
||
{
|
||
var gc = UiKit.Skin(UiKit.At(plate, "Grade", 124f, 22f, 52f, 40f), "chip", UiKit.GradeColor(hs.grade));
|
||
UiKit.GradeTint(gc, hs.grade);
|
||
UiKit.Title(UiKit.FillLabel(gc.transform, UiKit.GradeKo(hs.grade), 22, UiKit.White), true);
|
||
}
|
||
Txt(plate, "Name", h.nameKo, 40, UiKit.White, 190f, 14f, 300f, 56f, TextAnchor.MiddleLeft, true);
|
||
string ep = db.HeroInfo.EpithetOf(h.id);
|
||
Txt(plate, "Epithet", (ep.Length > 0 ? ep + " · " : "") + UnitTypeInfo.Korean(h.type), 22, Soft, 22f, 74f, 480f, 34f);
|
||
int max = db.Evolve.MaxStar, star = hs != null ? hs.star : h.rarity;
|
||
for (int i = 0; i < max; i++)
|
||
{
|
||
var si = UiKit.Icon(plate, i < star ? "star_l" : "star_off", new Vector2(0f, 1f), new Vector2(0.5f, 0.5f), new Vector2(40f + i * 44f, -136f), 42f);
|
||
if (si != null) UiKit.DropShadow(si, 2f);
|
||
}
|
||
var lv = s.Save.Level(heroId);
|
||
Txt(plate, "Lv", "Lv " + (lv != null ? lv.lv : 1) + " / " + AwakenRules.HeroLevelCap(db, s.Save, lv), 28, UiKit.White, 30f + max * 44f, 116f, 220f, 40f, TextAnchor.MiddleLeft, true);
|
||
var pw = Txt(plate, "Power", F("hi_power", st.power.ToString("N0")), 30, UiKit.Col("gold", UiKit.Coin), 22f, 178f, 300f, 50f, TextAnchor.MiddleLeft, true);
|
||
if (hs != null) Txt(plate, "AwPower", F("hi_awaken_power", AwakenRules.Power(db, s.Cfg, h, hs, s.Save).ToString("N0")), 22, Soft, 34f + pw.preferredWidth, 188f, 200f, 34f);
|
||
y += 456f;
|
||
// 탭
|
||
float tw = (RW - 16f) * 0.5f;
|
||
for (int i = 0; i < 2; i++)
|
||
{
|
||
bool on = (i == 1) == bio;
|
||
bool to = i == 1;
|
||
var tb = UiKit.SkinBtn(panel, i == 0 ? "TabStats" : "TabBio", on ? "btn_red" : "btn_s_gray", UiKit.White, T(i == 0 ? "hi_tab_stats" : "hi_tab_bio"), 32, UiKit.White, L + i * (tw + 16f), y, tw, 78f, () =>
|
||
{
|
||
bio = to;
|
||
Draw(root);
|
||
});
|
||
if (!UISkin.Has(on ? "btn_red" : "btn_s_gray")) tb.GetComponent<Image>().color = on ? UiKit.Red : UiKit.Dark;
|
||
}
|
||
y += 96f;
|
||
if (bio) DrawBio(root, panel, h, y);
|
||
else DrawStats(root, panel, h, hs, st, y);
|
||
}
|
||
|
||
static void Section(RectTransform panel, string name, string head, string hint, float y)
|
||
{
|
||
var t = Txt(panel, name, head, 30, UiKit.White, L + 10f, y, 400f, 44f, TextAnchor.MiddleLeft, true);
|
||
Txt(panel, name + "Hint", hint, 20, Soft, L + 24f + t.preferredWidth, y + 6f, 400f, 34f);
|
||
}
|
||
|
||
static void DrawStats(OutGameRoot root, RectTransform panel, HeroDb.Hero h, HeroState hs, HeroRules.Stats st, float y)
|
||
{
|
||
var db = root.Session.Db;
|
||
float cw = (RW - 16f) * 0.5f;
|
||
Section(panel, "Base", T("hi_base"), T("hi_base_hint"), y);
|
||
y += 52f;
|
||
int bi = 0;
|
||
foreach (var r in db.HeroInfo.stats)
|
||
{
|
||
if (r.section != "Base") continue;
|
||
float x = L + (bi % 2) * (cw + 16f), cy = y + (bi / 2) * 96f;
|
||
var c = Box(panel, "Base_" + r.key, x, cy, cw, 86f, UiKit.Col("row", new Color(0.13f, 0.15f, 0.23f, 1f)), r.show == "BaseBonus");
|
||
var cr = c.rectTransform;
|
||
Txt(cr, "Name", r.nameKo, 26, UiKit.White, 16f, 22f, 200f, 42f, TextAnchor.MiddleLeft, true);
|
||
if (r.show == "BaseBonus")
|
||
{
|
||
float bv, tot;
|
||
BaseTotal(st, r.key, out bv, out tot);
|
||
Txt(cr, "Base", Mathf.RoundToInt(bv).ToString("N0"), 20, UiKit.White, cw - 330f, 12f, 120f, 30f, TextAnchor.MiddleRight);
|
||
Txt(cr, "Bonus", "+" + Mathf.RoundToInt(tot - bv).ToString("N0"), 20, UiKit.Col("up", UiKit.Ok), cw - 330f, 42f, 120f, 30f, TextAnchor.MiddleRight);
|
||
Txt(cr, "Total", Mathf.RoundToInt(tot).ToString("N0"), 38, UiKit.White, cw - 200f, 18f, 184f, 50f, TextAnchor.MiddleRight, true);
|
||
string key = r.key, nm = r.nameKo;
|
||
c.gameObject.AddComponent<Button>().onClick.AddListener(() => OpenBreakdown(root, key, nm));
|
||
}
|
||
else Txt(cr, "Total", st.power.ToString("N0"), 38, UiKit.Col("gold", UiKit.Coin), cw - 240f, 18f, 224f, 50f, TextAnchor.MiddleRight, true);
|
||
bi++;
|
||
}
|
||
y += ((bi + 1) / 2) * 96f + 16f;
|
||
Section(panel, "Battle", T("hi_battle"), T("hi_battle_hint"), y);
|
||
y += 52f;
|
||
var vals = BattleStats(root.Session, h, hs);
|
||
int k = 0;
|
||
foreach (var r in db.HeroInfo.stats)
|
||
{
|
||
if (r.section != "Battle") continue;
|
||
float x = L + (k % 2) * (cw + 16f), cy = y + (k / 2) * 66f;
|
||
float v;
|
||
vals.TryGetValue(r.key, out v);
|
||
bool zero = Mathf.Abs(v) < 0.05f;
|
||
var aw = db.Awaken != null ? db.Awaken.StatOf(r.key) : null;
|
||
string nm = r.nameKo.Length > 0 ? r.nameKo : aw != null ? aw.nameKo : r.key;
|
||
string unit = aw != null ? aw.unit : "%";
|
||
var c = Box(panel, "Battle_" + r.key, x, cy, cw, 58f, UiKit.Col("row", new Color(0.13f, 0.15f, 0.23f, 1f)));
|
||
var cr = c.rectTransform;
|
||
var chip = Box(cr, "Unit", 10f, 9f, 50f, 40f, UiKit.Col("chip_dark", UiKit.Dark));
|
||
UiKit.Title(UiKit.FillLabel(chip.transform, unit, 18, UiKit.White), true);
|
||
Color col = zero ? Soft : UiKit.White;
|
||
Txt(cr, "Name", nm, 22, col, 72f, 12f, 260f, 34f, TextAnchor.MiddleLeft, true);
|
||
Txt(cr, "Value", (zero ? "0" : (v > 0f ? "+" : "") + P(v)) + unit, 24, col, cw - 180f, 12f, 164f, 34f, TextAnchor.MiddleRight, true);
|
||
k++;
|
||
}
|
||
y += ((k + 1) / 2) * 66f + 16f;
|
||
Section(panel, "Growth", T("hi_growth"), T("hi_growth_hint"), y);
|
||
y += 52f;
|
||
float mx = 1f;
|
||
foreach (var r in db.HeroInfo.sources) mx = Mathf.Max(mx, SourcePct(st, r.key));
|
||
foreach (var r in db.HeroInfo.sources)
|
||
{
|
||
float v = SourcePct(st, r.key);
|
||
Txt(panel, "G_" + r.key, r.nameKo, 24, UiKit.White, L + 10f, y, 160f, 40f, TextAnchor.MiddleLeft, true);
|
||
var track = Box(panel, "Track_" + r.key, L + 180f, y + 12f, 440f, 18f, UiKit.Col("chip_dark", UiKit.Dark));
|
||
var fill = Box(track.rectTransform, "Fill", 0f, 0f, Mathf.Max(14f, 440f * v / mx), 18f, UiKit.Col("up", UiKit.Ok));
|
||
fill.raycastTarget = false;
|
||
Txt(panel, "V_" + r.key, "+" + P(v) + "%", 24, UiKit.Col("up", UiKit.Ok), L + 630f, y, 150f, 40f, TextAnchor.MiddleRight, true);
|
||
string go = r.go;
|
||
var gb = Box(panel, "Go_" + r.key, L + RW - 56f, y + 2f, 48f, 40f, UiKit.Col("chip_dark", UiKit.Dark), true);
|
||
gb.gameObject.AddComponent<Button>().onClick.AddListener(() => Goto(root, go));
|
||
UiKit.Title(UiKit.FillLabel(gb.transform, "▶", 22, UiKit.White), true);
|
||
y += 50f;
|
||
}
|
||
}
|
||
|
||
/// <summary>성장 내역 바로가기(hero_info_sources s_goto).</summary>
|
||
static void Goto(OutGameRoot root, string go)
|
||
{
|
||
switch (go)
|
||
{
|
||
case "hero_evolve":
|
||
AwakenWindows.OpenEvolve(root, heroId);
|
||
return;
|
||
case "hero_awaken":
|
||
AwakenWindows.OpenAwaken(root, heroId);
|
||
return;
|
||
case "domestic_training":
|
||
root.CloseModal();
|
||
if (root.Domestic != null) root.Show(root.Domestic);
|
||
return;
|
||
case "treasure":
|
||
root.CloseModal();
|
||
if (root.Treasures != null) root.Show(root.Treasures);
|
||
return;
|
||
default: // hero_levelup · hero_promote = 뒤 영웅 화면(레벨업 · 승급 버튼)
|
||
root.CloseModal();
|
||
return;
|
||
}
|
||
}
|
||
|
||
/// <summary>기본 능력치 내역 창(목업 02) — 곱하는 배수 + 근거 · 합계 · 계산식.</summary>
|
||
public static void OpenBreakdown(OutGameRoot root, string stat, string nameKo)
|
||
{
|
||
UiText.Use(Texts);
|
||
var s = root.Session;
|
||
var h = s.Def(heroId);
|
||
var hs = s.Save.Hero(heroId);
|
||
var st = s.StatsOf(heroId);
|
||
Last = "breakdown";
|
||
var content = root.ModalCustom(F("hi_bd_title", nameKo), 860f);
|
||
var panel = (RectTransform)content.parent;
|
||
float bv, tot;
|
||
BaseTotal(st, stat, out bv, out tot);
|
||
float tr = stat == "hp" ? st.trainHpPct : stat == "def" ? st.trainDefPct : st.trainPct;
|
||
float ts = stat == "hp" ? st.treasureHpPct : stat == "def" ? st.treasureDefPct : st.treasureAtkPct;
|
||
float aw = stat == "hp" ? st.awakenHpPct : stat == "def" ? st.awakenDefPct : st.awakenAtkPct;
|
||
var lv = s.Save.Level(heroId);
|
||
string type = UnitTypeInfo.Korean(h.type);
|
||
var rows = new List<string[]>
|
||
{
|
||
new[] { T("hi_bd_base"), F("hi_bd_base_note", type, h.nameKo), Mathf.RoundToInt(bv).ToString("N0") },
|
||
new[] { "레벨", F("hi_bd_lv_note", (lv != null ? lv.lv : 1).ToString(), P(st.lvPct)), "×" + (1f + st.lvPct / 100f).ToString("0.###", CultureInfo.InvariantCulture) },
|
||
new[] { T("hi_bd_promo"), F("hi_bd_promo_note", hs != null ? UiKit.GradeKo(hs.grade) : "-"), "×" + (1f + (st.promoPct + st.gearPct) / 100f).ToString("0.###", CultureInfo.InvariantCulture) },
|
||
new[] { "성급", F("hi_bd_star_note", (hs != null ? hs.star : h.rarity).ToString()), "×" + (1f + st.starPct / 100f).ToString("0.###", CultureInfo.InvariantCulture) },
|
||
new[] { "병법 훈련", F("hi_bd_train_note", type), "×" + (1f + tr / 100f).ToString("0.###", CultureInfo.InvariantCulture) },
|
||
new[] { T("hi_bd_ta"), F("hi_bd_ta_note", P(ts), P(aw)), "×" + ((1f + ts / 100f) * (1f + aw / 100f)).ToString("0.###", CultureInfo.InvariantCulture) },
|
||
};
|
||
float y = 130f;
|
||
foreach (var r in rows)
|
||
{
|
||
Txt(panel, "R_" + r[0], r[0], 24, UiKit.White, L + 10f, y, 230f, 52f, TextAnchor.MiddleLeft, true);
|
||
Txt(panel, "N_" + r[0], r[1], 20, Soft, L + 240f, y, 420f, 52f);
|
||
Txt(panel, "V_" + r[0], r[2], 30, UiKit.White, L + RW - 230f, y, 220f, 52f, TextAnchor.MiddleRight, true);
|
||
y += 60f;
|
||
}
|
||
Txt(panel, "Total", T("hi_bd_total"), 26, UiKit.Col("gold", UiKit.Coin), L + 10f, y + 8f, 200f, 60f, TextAnchor.MiddleLeft, true);
|
||
Txt(panel, "TotalNote", F("hi_bd_total_note", Mathf.RoundToInt(bv).ToString("N0"), Mathf.RoundToInt(tot - bv).ToString("N0")), 22, Soft, L + 240f, y + 8f, 400f, 60f, TextAnchor.MiddleRight);
|
||
Txt(panel, "TotalV", Mathf.RoundToInt(tot).ToString("N0"), 44, UiKit.White, L + RW - 230f, y + 4f, 220f, 66f, TextAnchor.MiddleRight, true);
|
||
y += 80f;
|
||
var f = Txt(panel, "Formula", T("hi_bd_formula"), 20, Soft, L + 10f, y, RW - 20f, 60f, TextAnchor.UpperLeft);
|
||
f.horizontalOverflow = HorizontalWrapMode.Wrap;
|
||
y += 70f;
|
||
UiKit.SkinBtn(panel, "BdClose", UISkin.Has("btn_s_gray") ? "btn_s_gray" : "button", UiKit.White, "닫기", 32, UiKit.White, (W - 360f) * 0.5f, y, 360f, 90f, () => Draw(root));
|
||
}
|
||
|
||
static void DrawBio(OutGameRoot root, RectTransform panel, HeroDb.Hero h, float y)
|
||
{
|
||
var db = root.Session.Db;
|
||
var evs = db.HeroInfo.ChronicleOf(h.id);
|
||
string ep = db.HeroInfo.EpithetOf(h.id);
|
||
Section(panel, "BioHead", F("hi_bio_head", h.nameKo), (h.hanja ?? "") + (ep.Length > 0 ? " · " + ep : ""), y);
|
||
y += 56f;
|
||
if (evs.Count == 0)
|
||
{
|
||
var e = Box(panel, "BioEmpty", L, y, RW, 200f, UiKit.Col("row", new Color(0.13f, 0.15f, 0.23f, 1f)));
|
||
Txt(e.rectTransform, "T", T("hi_bio_empty"), 32, Soft, 0f, 70f, RW, 60f, TextAnchor.MiddleCenter, true);
|
||
return;
|
||
}
|
||
var line = Box(panel, "Line", L + 60f, y, 6f, Mathf.Min(980f, evs.Count * 132f), UiKit.Col("chip_dark", UiKit.Dark));
|
||
line.raycastTarget = false;
|
||
foreach (var ev in evs)
|
||
{
|
||
bool link = !string.IsNullOrEmpty(ev.scenario);
|
||
float ch = link ? 128f : 92f;
|
||
var yc = Box(panel, "Year_" + ev.order, L, y + 16f, 116f, 46f, UiKit.Red);
|
||
UiKit.Title(UiKit.FillLabel(yc.transform, ev.year, 24, UiKit.White), true);
|
||
var card = Box(panel, "Ev_" + ev.order, L + 140f, y, RW - 140f, ch, UiKit.Col("row", new Color(0.13f, 0.15f, 0.23f, 1f))).rectTransform;
|
||
Txt(card, "Title", ev.title, 28, UiKit.White, 18f, 10f, RW - 180f, 40f, TextAnchor.MiddleLeft, true);
|
||
var tx = Txt(card, "Text", ev.text, 21, Soft, 18f, 48f, RW - 180f, 36f);
|
||
tx.horizontalOverflow = HorizontalWrapMode.Wrap;
|
||
if (link)
|
||
{
|
||
string sc = ev.scenario;
|
||
UiKit.SkinBtn(card, "Go_" + ev.order, UISkin.Has("btn_purple") ? "btn_purple" : "button", UiKit.White, F("hi_bio_go", sc), 20, UiKit.White, 18f, 86f, 300f, 36f, () => root.Toast(F("hi_bio_go_soon", sc)));
|
||
}
|
||
y += ch + 12f;
|
||
}
|
||
var n = Txt(panel, "BioNote", T("hi_bio_note"), 20, Soft, L, y + 4f, RW, 34f, TextAnchor.MiddleCenter);
|
||
n.horizontalOverflow = HorizontalWrapMode.Wrap;
|
||
}
|
||
}
|
||
}
|