From 8ac8b2cf3ff592dd50eccef12897fca8fbe2e295 Mon Sep 17 00:00:00 2001 From: Drefvelin <54400154+Drefvelin@users.noreply.github.com> Date: Thu, 24 Sep 2026 17:01:50 +0000 Subject: [PATCH 1/2] Offer lutes as a handheld and 3D skin type. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Players can submit a 16×16 texture or a 3D model and apply it to lutes the same way they do for swords. Co-authored-by: Cursor --- backend/src/skins/submissions.py | 1 + backend/src/skins/test_base_sets.py | 21 +++++++++++++++++++++ frontend/lib/skins/baseSets.test.ts | 14 ++++++++++++++ frontend/lib/skins/baseSets.ts | 2 ++ 4 files changed, 38 insertions(+) create mode 100644 backend/src/skins/test_base_sets.py create mode 100644 frontend/lib/skins/baseSets.test.ts diff --git a/backend/src/skins/submissions.py b/backend/src/skins/submissions.py index 4e76b75..1faa098 100644 --- a/backend/src/skins/submissions.py +++ b/backend/src/skins/submissions.py @@ -50,6 +50,7 @@ _HANDHELD_BASES = frozenset( { "swords", + "lutes", "battleaxes", "daggers", "warhammers", diff --git a/backend/src/skins/test_base_sets.py b/backend/src/skins/test_base_sets.py new file mode 100644 index 0000000..7645042 --- /dev/null +++ b/backend/src/skins/test_base_sets.py @@ -0,0 +1,21 @@ +"""Base-set allowlists for skin kinds.""" + +from __future__ import annotations + +import unittest + +from skins.submissions import SubmissionError, _validate_base_set + + +class LuteBaseSetTest(unittest.TestCase): + def test_lutes_allowed_for_handheld_and_item_3d(self) -> None: + self.assertEqual(_validate_base_set("handheld", "lutes"), "lutes") + self.assertEqual(_validate_base_set("item_3d", "lutes"), "lutes") + + def test_lutes_rejected_for_large_handheld(self) -> None: + with self.assertRaises(SubmissionError): + _validate_base_set("large_handheld", "lutes") + + +if __name__ == "__main__": + unittest.main() diff --git a/frontend/lib/skins/baseSets.test.ts b/frontend/lib/skins/baseSets.test.ts new file mode 100644 index 0000000..874e3b0 --- /dev/null +++ b/frontend/lib/skins/baseSets.test.ts @@ -0,0 +1,14 @@ +import { describe, expect, it } from "vitest"; +import { baseSetLabel, baseSetsForKind } from "./baseSets"; + +describe("lute base set", () => { + it("offers Lutes for 16×16 handheld and item 3D", () => { + expect(baseSetsForKind("handheld")).toContain("lutes"); + expect(baseSetsForKind("item_3d")).toContain("lutes"); + expect(baseSetLabel("lutes")).toBe("Lutes"); + }); + + it("keeps Lutes off large handheld", () => { + expect(baseSetsForKind("large_handheld")).not.toContain("lutes"); + }); +}); diff --git a/frontend/lib/skins/baseSets.ts b/frontend/lib/skins/baseSets.ts index 40673de..b143fdb 100644 --- a/frontend/lib/skins/baseSets.ts +++ b/frontend/lib/skins/baseSets.ts @@ -14,6 +14,7 @@ export const MAX_ARMOR_TIERS = ARMOR_TIERS.length; const HANDHELD = [ "swords", + "lutes", "battleaxes", "daggers", "warhammers", @@ -54,6 +55,7 @@ const LABELS: Record = { mage: "Mage", infantry: "Infantry", swords: "Swords", + lutes: "Lutes", battleaxes: "Battleaxes", daggers: "Daggers", warhammers: "Warhammers", From 226e43098510624b97864d5fd8093bd925b513af Mon Sep 17 00:00:00 2001 From: Drefvelin <54400154+Drefvelin@users.noreply.github.com> Date: Thu, 24 Sep 2026 17:08:53 +0000 Subject: [PATCH 2/2] Keep the lute base-set test stable when the skins package is imported twice. Co-authored-by: Cursor --- backend/src/skins/test_base_sets.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/skins/test_base_sets.py b/backend/src/skins/test_base_sets.py index 7645042..3faf54a 100644 --- a/backend/src/skins/test_base_sets.py +++ b/backend/src/skins/test_base_sets.py @@ -4,7 +4,7 @@ import unittest -from skins.submissions import SubmissionError, _validate_base_set +from skins.submissions import _validate_base_set class LuteBaseSetTest(unittest.TestCase): @@ -13,8 +13,11 @@ def test_lutes_allowed_for_handheld_and_item_3d(self) -> None: self.assertEqual(_validate_base_set("item_3d", "lutes"), "lutes") def test_lutes_rejected_for_large_handheld(self) -> None: - with self.assertRaises(SubmissionError): + # skins.submissions and src.skins.submissions are both on the path, so + # the raised class is not always the imported one. + with self.assertRaises(Exception) as ctx: _validate_base_set("large_handheld", "lutes") + self.assertIn("not valid for kind 'large_handheld'", str(ctx.exception)) if __name__ == "__main__":