diff --git a/CHANGELOG.md b/CHANGELOG.md index a27e9f6..545a3e6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - 修正:电子元件拖到矿架上原来会被元件自己的判断否决(游戏取三方判断的与),改为在原版电子元件(普通、稀有)上追加“作用于矿架”的判断,升级才真正可触发。升级流程用探查命令和真实鼠标拖拽都走通(4 次拖拽解锁第 3 槽):普通 ×4 解锁第 3 槽,稀有 ×1 第 4 槽,稀有 ×2 第 5 槽,满级后不再收;5 张卡放满窗口显示 5/5。 - 解锁“Web3 治理社区”时,矿架优先放进机器区(没有位置才退回原来的送货位置)。在干净存档里走通:人脉网络 Web3 页买下 400 / 700 / 1500 三项,扣 2600,终端、显卡、鉴定指南、Web3 手册到手,矿架在机器区,终端里混币器和商店页签出现。 - 重译:矿架升级提示(拖到矿架上)、鉴定指南“指出”一页(改后的按钮规则);矿架状态面板标签校对(俄语“状态”避开与成色同词,德语、俄语、日语“显卡数”改用各语言已有的显卡词,法语、波兰语算力标签缩短)。删除不再使用的旧键 18 个(档次、依据、旧升级槽位等)。 +- 各语言下核对鉴定指南与检视面板的排版:示例页的“最终价值”改为各项折价相加(原来用带种子的卡现算,被健康度重算覆盖,数字对不上);长语言下第 1、3、4、5、6 页的插图按剩余空间自动缩小(原来德语、俄语等超出纸面);小节标题折行时下推;检视面板名称列加宽(德语“Rückseiten-Aufdruck”不再被截),去掉成色行末尾的“(卖家说:…)”;波兰语挡板译成“Zaślepka”(原来误译成“鲱鱼”)。 - 检视面板的型号鉴定只留一个“指出型号”按钮(第一行,型号);风扇数、供电口、背面丝印、序列号四行只读,四项全部符合才是正品。 - 检视面板的型号行右侧显示“标签价”(当前报价,随指出和改标签实时变化),鉴定客户的估价框同步。 - 显卡鉴定指南的鉴定示例由 1 个增至 5 个(成色很差、假冒、轻微使用、全新),共 13 页。 diff --git a/src/Decentralized/GpuGuide.cs b/src/Decentralized/GpuGuide.cs index a284a17..4d0e99b 100644 --- a/src/Decentralized/GpuGuide.cs +++ b/src/Decentralized/GpuGuide.cs @@ -122,12 +122,13 @@ namespace Decentralized return y + h + gap; } - /// 小节标题(原版的蓝灰色粗体小标题)。 + /// 小节标题(原版的蓝灰色粗体小标题);标题太长折行时按折行后的高度往下推。 private static float Section(PaperUI b, float y, string text) { - b.AddText(X, y, W, 13, text, "label", fontSize: 8f); + float h = Mathf.Max(13f, Measure(text, "label", 8f, W)); + b.AddText(X, y, W, h, text, "label", fontSize: 8f); b.Last.color = "#2E5A78"; - return y + 15f; + return y + h + 2f; } /// 一张图(底图加叠加层,同一个位置),居中,宽高是显示尺寸;返回图的底边。 @@ -160,6 +161,13 @@ namespace Decentralized b.Last.color = "#1B1B1B"; } + /// 剩余高度能放下的图缩放(图高 128 设计单位):长语言文字多,图自动缩小,不超出纸面。 + private static float FitScale(float usedHeight, int count, float max, float min = 0.3f) + { + float avail = Bottom - Top - usedHeight; + return Mathf.Clamp(avail / (128f * count), min, max); + } + private static string SampleSerial(string model, string chip = null, int kind = 0) { var u = new Unit { Model = model, FakeOf = chip, Health = 100, Look = new CardLook { Seed = 31337, Serial = kind } }; @@ -170,13 +178,16 @@ namespace Decentralized private static void Page1(PaperUI b) { float y = NewPage(b); - y = Text(b, y, L.T("gg.p1.body"), gap: 6f); - float x = X + (W - 192f * 0.9f) / 2; - float bottom = Art(b, x, y, 0.9f, Front("probidia", 1)); + string body = L.T("gg.p1.body"), makers = L.T("gg.p1.makers"), note = T("gg.p1.note"); + float used = Measure(body, "body", 0, W) + Measure(makers, "body", 0, W) + Measure(note, "body", 7f, W) + 6f + 14f + 8f + 14f; + float scale = FitScale(used, 1, 0.9f); + y = Text(b, y, body, gap: 6f); + float x = X + (W - 192f * scale) / 2; + float bottom = Art(b, x, y, scale, Front("probidia", 1)); Caption(b, X, bottom + 1, W, L.T("gg.p1.cap")); - y = bottom + 16f; - y = Text(b, y, L.T("gg.p1.makers"), gap: 8f); - Text(b, y, T("gg.p1.note"), "body", Good); + y = bottom + 14f; + y = Text(b, y, makers, gap: 8f); + Text(b, y, note, "body", Good); b.Last.fontSize = 7f; } @@ -207,10 +218,12 @@ namespace Decentralized { float y = NewPage(b); y = Section(b, y, L.T("gg.count.h")); - y = Text(b, y, L.T("gg.count.body"), gap: 6f); + string cb = L.T("gg.count.body"); + float cs = FitScale(15f + Measure(cb, "body", 0, W) + 6f + 3 * 15f, 3, 0.5f, 0.3f); + y = Text(b, y, cb, gap: 6f); for (int n = 1; n <= 3; n++) { - float bottom = Art(b, X + (W - 96f) / 2, y, 0.5f, Front("probidia", 1, n)); + float bottom = Art(b, X + (W - 192f * cs) / 2, y, cs, Front("probidia", 1, n)); Caption(b, X, bottom, W, L.T("lbl.count." + n)); y = bottom + 15f; } @@ -221,10 +234,12 @@ namespace Decentralized { float y = NewPage(b); y = Section(b, y, L.T("gg.pin.h")); - y = Text(b, y, L.T("gg.pin.body"), gap: 6f); + string pbd = L.T("gg.pin.body"); + float ps = FitScale(15f + Measure(pbd, "body", 0, W) + 6f + 3 * 15f, 3, 0.5f, 0.3f); + y = Text(b, y, pbd, gap: 6f); for (int p = 0; p < 3; p++) { - float bottom = Art(b, X + (W - 96f) / 2, y, 0.5f, Front("probidia", p, 2)); + float bottom = Art(b, X + (W - 192f * ps) / 2, y, ps, Front("probidia", p, 2)); Caption(b, X, bottom, W, L.T("lbl.pin." + p)); y = bottom + 15f; } @@ -235,15 +250,18 @@ namespace Decentralized { float y = NewPage(b); y = Section(b, y, L.T("gg.serial.h")); - y = Text(b, y, L.T("gg.serial.body"), gap: 6f); - float ax = X + (W - 150f) / 2; - float bottom = Art(b, ax, y, 0.78f, "gpu_big_probidia_b", "gpu_big_ov_print_normal_rtx80"); - SerialOnSticker(b, ax, y, 0.78f, SampleSerial("RTX80")); + string body = L.T("gg.serial.body"), pb = L.T("gg.serial.pb"), md = L.T("gg.serial.md"), rule = L.T("gg.serial.rule"); + float used = 15f + Measure(body, "body", 0, W) + Measure(pb, "body", 0, W) + Measure(md, "body", 0, W) + Measure(rule, "body", 0, W) + 6f + 14f + 4f + 8f; + float scale = FitScale(used, 1, 0.78f); + y = Text(b, y, body, gap: 6f); + float ax = X + (W - 192f * scale) / 2; + float bottom = Art(b, ax, y, scale, "gpu_big_probidia_b", "gpu_big_ov_print_normal_rtx80"); + SerialOnSticker(b, ax, y, scale, SampleSerial("RTX80")); Caption(b, X, bottom + 1, W, L.T("gg.serial.cap")); - y = bottom + 16f; - y = Text(b, y, L.T("gg.serial.pb"), gap: 4f); - y = Text(b, y, L.T("gg.serial.md"), gap: 8f); - Text(b, y, L.T("gg.serial.rule"), "body"); + y = bottom + 14f; + y = Text(b, y, pb, gap: 4f); + y = Text(b, y, md, gap: 8f); + Text(b, y, rule, "body"); } // ---- 6 背面丝印 ---- @@ -251,17 +269,19 @@ namespace Decentralized { float y = NewPage(b); y = Section(b, y, L.T("gg.print.h")); + string note = L.T("gg.print.note"); string[] kinds = { "normal", "stamp", "skew" }; + float scale = FitScale(15f + Measure(note, "body", 0, W) + 3 * 14f, 3, 0.5f, 0.3f); for (int s = 0; s < 3; s++) { string model = s == 1 ? "rtx60" : "rtx80"; - float ax = X + (W - 96f) / 2; - float bottom = Art(b, ax, y, 0.5f, "gpu_big_probidia_b", $"gpu_big_ov_print_{kinds[s]}_{model}"); - SerialOnSticker(b, ax, y, 0.5f, SampleSerial("RTX80")); + float ax = X + (W - 192f * scale) / 2; + float bottom = Art(b, ax, y, scale, "gpu_big_probidia_b", $"gpu_big_ov_print_{kinds[s]}_{model}"); + SerialOnSticker(b, ax, y, scale, SampleSerial("RTX80")); Caption(b, X, bottom, W, L.T("gg.print." + s), s == 0 ? null : Bad); y = bottom + 14f; } - Text(b, y, L.T("gg.print.note"), "body"); + Text(b, y, note, "body"); } // ---- 7 叶片与金手指 ---- @@ -375,8 +395,8 @@ namespace Decentralized y = Text(b, y, L.T("gg.ex.claimed", CardValue.Of(e.Label, e.Health)), "caption", Ink, "right", 3f, lx, lw); } y = Text(b, y, L.T("gg.ex.base", baseV), "caption", Ink, "right", 3f, lx, lw); - int n = 0; - long Disc(double p) { n++; return (long)Math.Round(baseV * p); } + int n = 0; long discSum = 0; + long Disc(double p) { n++; long d = (long)Math.Round(baseV * p); discSum += d; return d; } if (e.Fan == 1) y = Text(b, y, L.T("gg.ex.fan1", Disc(Tuning.CardFanDust)), "caption", Bad, "right", 3f, lx, lw); if (e.Fan == 2) y = Text(b, y, L.T("gg.ex.fan", Disc(Tuning.CardFanChipped)), "caption", Bad, "right", 3f, lx, lw); if (e.Fingers == 1) y = Text(b, y, L.T("gg.ex.fin", Disc(Tuning.CardFingersDark)), "caption", Bad, "right", 3f, lx, lw); @@ -387,7 +407,8 @@ namespace Decentralized y += 3f; b.AddLine(lx, y, lx + lw, y, 1f, "#6A6458"); y += 6f; - long total = CardLabels.Value(u, null, 0); + // 外观写死(种子 0)才不会被健康度重算覆盖,价值按它算;序列号要种子,用上面带种子的那个 + long total = baseV - discSum; // 页面上各项相加,和游戏的价值函数差不过 1(四舍五入) y = Text(b, y, L.T("gg.ex.total", total), "label", Ink, "right", 8f, lx, lw); if (e.Chip != null) y = Text(b, y, L.T("gg.ex.gap", CardValue.Of(e.Label, e.Health) - total), "caption", Bad, "right", 8f, lx, lw); Text(b, y, L.T("gg.ex.note"), "caption", Ink, "center"); diff --git a/src/Decentralized/GpuInspectView.cs b/src/Decentralized/GpuInspectView.cs index 0d4b88a..a3ac3cc 100644 --- a/src/Decentralized/GpuInspectView.cs +++ b/src/Decentralized/GpuInspectView.cs @@ -189,8 +189,8 @@ namespace Decentralized { int row = CardLabels.Rows[i]; float y = GroupTop(i) - RowH / 2; - rowName[i] = MakeText(root, "RowName" + i, new Vector2(-245, y), new Vector2(130, RowH), TextAlignmentOptions.Left, 20); - rowText[i] = MakeText(root, "RowText" + i, new Vector2(-20, y), new Vector2(330, RowH), TextAlignmentOptions.Left, 20); + rowName[i] = MakeText(root, "RowName" + i, new Vector2(-232, y), new Vector2(156, RowH), TextAlignmentOptions.Left, 20); + rowText[i] = MakeText(root, "RowText" + i, new Vector2(24, y), new Vector2(300, RowH), TextAlignmentOptions.Left, 20); rowButton[i] = MakeButton(root, "RowButton" + i, new Vector2(245, y), new Vector2(110, RowH - 3), out rowButtonText[i]); rowButton[i].onClick.AddListener(() => Log.Guard("标签栏", () => OnRowButton(row))); } @@ -238,7 +238,7 @@ namespace Decentralized { text = Show(real); bool lied = row == CardLabels.RowSpec ? claim.Value.Model != real.Model : claim.Value.Get(row) != real.Get(row); - if (lied) { color = new Color(1f, 0.45f, 0.4f); if (!CardLabels.IsAuth(row)) text += L.T("lbl.said", Show(claim.Value)); } + if (lied) color = new Color(1f, 0.45f, 0.4f); // 卖家的说法只在机制里起作用,面板上不写 else color = new Color(0.5f, 1f, 0.55f); } else text = Show(claim.Value); diff --git a/src/Decentralized/ModFiles/Localization/pl.csv b/src/Decentralized/ModFiles/Localization/pl.csv index e5a6b85..73d6ce6 100644 --- a/src/Decentralized/ModFiles/Localization/pl.csv +++ b/src/Decentralized/ModFiles/Localization/pl.csv @@ -95,12 +95,12 @@ cust.worn.1,Nie to pisałeś. Pominąłeś wady. cust.worn.2,Stan na etykiecie to kłamstwo. Nie za tę cenę. lbl.row.fan,Łopatki lbl.row.fingers,Styki -lbl.row.bracket,Śledź +lbl.row.bracket,Zaślepka lbl.row.print,Nadruk z tyłu lbl.row.serial,Nr seryjny lbl.row.seal,Plomba -lbl.bracket.0,Nienaruszony -lbl.bracket.1,Porysowany +lbl.bracket.0,Nienaruszona +lbl.bracket.1,Porysowana lbl.serial.0,Prawidłowy lbl.serial.1,Zły kod fabryki lub zła długość lbl.serial.2,Kod modelu nie pasuje @@ -814,9 +814,9 @@ gg.fin.h,Styki gg.fin.0,Błyszczące (cena bez zmian) gg.fin.1,Zmatowiałe (-{CardFingersDark:%}) gg.fin.2,Utlenione (-{CardFingersOxidized:%}) -gg.brk.h,Śledź -gg.brk.0,Nienaruszony (cena bez zmian) -gg.brk.1,Porysowany (-{CardBracketScratch:%}) +gg.brk.h,Zaślepka +gg.brk.0,Nienaruszona (cena bez zmian) +gg.brk.1,Porysowana (-{CardBracketScratch:%}) gg.seal.h,Plomba gg.seal.0,Nienaruszona (cena bez zmian) gg.seal.2,Brak (-{CardSealMissing:%}) diff --git a/src/Decentralized/ShowcaseCases.cs b/src/Decentralized/ShowcaseCases.cs index acf2c41..46e256f 100644 --- a/src/Decentralized/ShowcaseCases.cs +++ b/src/Decentralized/ShowcaseCases.cs @@ -16,7 +16,7 @@ namespace Decentralized public string Name; public string Label, Chip; // 标称型号;真实芯片(null 表示真卡) public double Health; - public int Fan, Fingers, Bracket, Print, Sticker, Serial; + public int Fan, Fingers, Bracket, Print, Sticker, Serial, CountBad, PinBad; public bool Honest; // 卖家如实说 } @@ -29,11 +29,11 @@ namespace Decentralized new Case { Name = "旗舰九成新", Label = "RTX90", Health = 92, Honest = true }, new Case { Name = "PMD 高端磨损", Label = "RX800", Health = 55, Fan = 2, Fingers = 1, Bracket = 1 }, new Case { Name = "旗舰氧化", Label = "RX900", Health = 28, Fan = 2, Fingers = 2, Bracket = 1, Sticker = 2 }, - new Case { Name = "低档冒充旗舰:接口数对不上", Label = "RTX90", Chip = "RTX60", Health = 90 }, - new Case { Name = "重印丝印", Label = "RX900", Chip = "RX80", Health = 80, Print = 2 }, - new Case { Name = "丝印印着真实型号", Label = "RTX80", Chip = "RTX60", Health = 75, Print = 1, Serial = 2 }, - new Case { Name = "手贴序列号", Label = "RX800", Chip = "RX70", Health = 65, Serial = 1, Sticker = 2 }, - new Case { Name = "全套破绽加老化", Label = "RTX90", Chip = "RTX70", Health = 45, Fan = 1, Fingers = 2, Print = 2, Serial = 2, Sticker = 2 }, + new Case { Name = "低档冒充旗舰:接口数对不上", Label = "RTX90", Chip = "RTX60", Health = 90, CountBad = 1, PinBad = 1 }, + new Case { Name = "重印丝印", Label = "RX900", Chip = "RX80", Health = 80, Print = 2, CountBad = 1 }, + new Case { Name = "丝印印着真实型号", Label = "RTX80", Chip = "RTX60", Health = 75, Print = 1, Serial = 2, PinBad = 1 }, + new Case { Name = "手贴序列号", Label = "RX800", Chip = "RX70", Health = 65, Serial = 1, Sticker = 2, CountBad = 1, PinBad = 1 }, + new Case { Name = "全套破绽加老化", Label = "RTX90", Chip = "RTX70", Health = 45, Fan = 1, Fingers = 2, Print = 2, Serial = 2, Sticker = 2, PinBad = 1 }, }; private static int _next; @@ -51,7 +51,7 @@ namespace Decentralized public static GameItem Make(Case c, DealerKind kind) { var item = ModHelper.SpawnItem(Items.GpuId(c.Label)); - var look = new CardLook { Seed = 0, Fan = c.Fan, Fingers = c.Fingers, Bracket = c.Bracket, Print = c.Print, Sticker = c.Sticker, Serial = c.Serial }; + var look = new CardLook { Seed = 0, Fan = c.Fan, Fingers = c.Fingers, Bracket = c.Bracket, Print = c.Print, Sticker = c.Sticker, Serial = c.Serial, CountBad = c.CountBad, PinBad = c.PinBad }; Items.Store(item, new Unit { Model = c.Label, FakeOf = c.Chip, Health = c.Health, Look = look }); GeneralHelper.SetItemOwned(item, false); var u = Items.ToUnit(item);