
path = r"C:\Users\Norme\Documents\verdent-projects\new-project\GuildDeathLog\Modules\UI.lua"

with open(path, "r", encoding="utf-8") as f:
    lines = f.readlines()

# ── Exact single-line replacements (line numbers from grep above) ──────────
changes = {
    # ROW_H
    3875: "    local ROW_H = 100\n",

    # iconGlow: 90x90, vertically centered in 100px row (top = ROW_Y-5)
    3886: "    iconGlow:SetSize(90, 90)\n",
    3887: "    iconGlow:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL1_X - 2, ROW_Y - 5)\n",

    # iconBacking: 70x70, top = ROW_Y-15
    3894: "    iconBacking:SetSize(70, 70)\n",
    3895: "    iconBacking:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL1_X, ROW_Y - 15)\n",

    # iconBorder: 76x76, top = ROW_Y-12
    3901: "    iconBorder:SetSize(76, 76)\n",
    3902: "    iconBorder:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL1_X - 2, ROW_Y - 12)\n",

    # classIcon: 64x64, top = ROW_Y-18
    3908: "    o.classIcon:SetSize(64, 64)\n",
    3909: "    o.classIcon:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL1_X + 3, ROW_Y - 18)\n",

    # nameText: 22pt, top = ROW_Y-22
    3922: "    o.nameText:SetFont(\"Fonts\\\\MORPHEUS.TTF\", 22, \"OUTLINE\")\n",
    3923: "    o.nameText:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL1_X + 72, ROW_Y - 10)\n",
    3924: "    o.nameText:SetWidth(COL1_W - 75)\n",

    # classText: 11pt, top = ROW_Y-40
    3930: "    o.classText:SetFont(\"Fonts\\\\FRIZQT__.TTF\", 11, \"OUTLINE\")\n",
    3931: "    o.classText:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL1_X + 73, ROW_Y - 40)\n",
    3932: "    o.classText:SetWidth(COL1_W - 75)\n",

    # killerText: 15pt, top = ROW_Y-28 (two-line stack centered in 100px)
    3939: "    o.killerText:SetFont(\"Fonts\\\\FRIZQT__.TTF\", 15, \"OUTLINE\")\n",
    3940: "    o.killerText:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL2_X, ROW_Y - 28)\n",

    # spellText: 11pt, below killer
    3948: "    o.spellText:SetFont(\"Fonts\\\\FRIZQT__.TTF\", 11, \"OUTLINE\")\n",
    3949: "    o.spellText:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL2_X, ROW_Y - 50)\n",

    # timestampText: 13pt, vertically centered
    3957: "    o.timestampText:SetFont(\"Fonts\\\\FRIZQT__.TTF\", 13, \"OUTLINE\")\n",
    3958: "    o.timestampText:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL3_X, ROW_Y - 37)\n",

    # zoneText: 13pt, vertically centered
    3966: "    o.zoneText:SetFont(\"Fonts\\\\FRIZQT__.TTF\", 13, \"OUTLINE\")\n",
    3967: "    o.zoneText:SetPoint(\"TOPLEFT\", o, \"TOPLEFT\", COL4_X, ROW_Y - 37)\n",
}

for ln0, new_line in sorted(changes.items()):
    idx = ln0 - 1  # 0-based
    old = lines[idx].rstrip()
    lines[idx] = new_line
    print(f"L{ln0}: {old!r} -> {new_line.rstrip()!r}")

with open(path, "w", encoding="utf-8") as f:
    f.writelines(lines)

print("\nDone. Verifying LW_Y line...")

with open(path, "r", encoding="utf-8") as f:
    lines2 = f.readlines()
for i, l in enumerate(lines2[3970:3990], start=3971):
    if "LW_Y" in l or "lwLabel" in l or "lastWordsText" in l:
        print(f"  L{i}: {l.rstrip()}")
