@axiapps/forge-render 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,52 @@
1
+ // Weapon type icons from gw2-class-icons package.
2
+ // Imported as raw SVG strings via Vite's ?raw suffix.
3
+ import Axe from "gw2-class-icons/weapons/svg/Axe.svg?raw";
4
+ import Dagger from "gw2-class-icons/weapons/svg/Dagger.svg?raw";
5
+ import Focus from "gw2-class-icons/weapons/svg/Focus.svg?raw";
6
+ import Greatsword from "gw2-class-icons/weapons/svg/Greatsword.svg?raw";
7
+ import Hammer from "gw2-class-icons/weapons/svg/Hammer.svg?raw";
8
+ import HarpoonGun from "gw2-class-icons/weapons/svg/HarpoonGun.svg?raw";
9
+ import Longbow from "gw2-class-icons/weapons/svg/Longbow.svg?raw";
10
+ import Mace from "gw2-class-icons/weapons/svg/Mace.svg?raw";
11
+ import Pistol from "gw2-class-icons/weapons/svg/Pistol.svg?raw";
12
+ import Rifle from "gw2-class-icons/weapons/svg/Rifle.svg?raw";
13
+ import Scepter from "gw2-class-icons/weapons/svg/Scepter.svg?raw";
14
+ import Shield from "gw2-class-icons/weapons/svg/Shield.svg?raw";
15
+ import ShortBow from "gw2-class-icons/weapons/svg/ShortBow.svg?raw";
16
+ import Spear from "gw2-class-icons/weapons/svg/Spear.svg?raw";
17
+ import Staff from "gw2-class-icons/weapons/svg/Staff.svg?raw";
18
+ import Sword from "gw2-class-icons/weapons/svg/Sword.svg?raw";
19
+ import Torch from "gw2-class-icons/weapons/svg/Torch.svg?raw";
20
+ import Trident from "gw2-class-icons/weapons/svg/Trident.svg?raw";
21
+ import Warhorn from "gw2-class-icons/weapons/svg/Warhorn.svg?raw";
22
+
23
+ // Keyed by GW2_WEAPONS_BY_ID weapon IDs
24
+ const WEAPON_SVG_MAP = {
25
+ axe: Axe,
26
+ dagger: Dagger,
27
+ focus: Focus,
28
+ greatsword: Greatsword,
29
+ hammer: Hammer,
30
+ harpoon: HarpoonGun,
31
+ longbow: Longbow,
32
+ mace: Mace,
33
+ pistol: Pistol,
34
+ rifle: Rifle,
35
+ scepter: Scepter,
36
+ shield: Shield,
37
+ shortbow: ShortBow,
38
+ spear: Spear,
39
+ staff: Staff,
40
+ sword: Sword,
41
+ torch: Torch,
42
+ trident: Trident,
43
+ warhorn: Warhorn,
44
+ };
45
+
46
+ /**
47
+ * Returns the raw SVG string for a weapon type ID, or null if unknown.
48
+ * @param {string} weaponId — e.g. "sword", "axe", "staff" (matches GW2_WEAPONS_BY_ID keys)
49
+ */
50
+ export function getWeaponSvg(weaponId) {
51
+ return WEAPON_SVG_MAP[weaponId] ?? null;
52
+ }
package/src/weapons.js ADDED
@@ -0,0 +1,28 @@
1
+ // GW2 weapon catalog — ids, display labels, hand slots, and wiki icons.
2
+ // Extracted from src/renderer/modules/constants.js so the renderers are
3
+ // self-contained.
4
+ const _WK = "https://wiki.guildwars2.com/images";
5
+
6
+ export const GW2_WEAPONS = [
7
+ { id: "axe", label: "Axe", hand: "main", icon: `${_WK}/b/b5/Bandit_Cleaver.png` },
8
+ { id: "dagger", label: "Dagger", hand: "either", icon: `${_WK}/a/ac/Bandit_Shiv.png` },
9
+ { id: "mace", label: "Mace", hand: "either", icon: `${_WK}/b/b3/Bandit_Mallet.png` },
10
+ { id: "pistol", label: "Pistol", hand: "either", icon: `${_WK}/f/f3/Bandit_Revolver.png` },
11
+ { id: "sword", label: "Sword", hand: "main", icon: `${_WK}/e/e1/Bandit_Slicer.png` },
12
+ { id: "scepter", label: "Scepter", hand: "main", icon: `${_WK}/9/95/Bandit_Baton.png` },
13
+ { id: "focus", label: "Focus", hand: "off", icon: `${_WK}/d/da/Bandit_Focus.png` },
14
+ { id: "shield", label: "Shield", hand: "off", icon: `${_WK}/7/7c/Bandit_Ward.png` },
15
+ { id: "torch", label: "Torch", hand: "off", icon: `${_WK}/7/7e/Bandit_Torch.png` },
16
+ { id: "warhorn", label: "Warhorn", hand: "off", icon: `${_WK}/3/31/Bandit_Bugle.png` },
17
+ { id: "greatsword", label: "Greatsword", hand: "two", icon: `${_WK}/0/0b/Bandit_Sunderer.png` },
18
+ { id: "hammer", label: "Hammer", hand: "two", icon: `${_WK}/f/fb/Bandit_Demolisher.png` },
19
+ { id: "longbow", label: "Longbow", hand: "two", icon: `${_WK}/2/2d/Bandit_Longbow.png` },
20
+ { id: "rifle", label: "Rifle", hand: "two", icon: `${_WK}/3/37/Bandit_Musket.png` },
21
+ { id: "shortbow", label: "Short Bow", hand: "two", icon: `${_WK}/2/2f/Bandit_Short_Bow.png` },
22
+ { id: "staff", label: "Staff", hand: "two", icon: `${_WK}/9/98/Bandit_Spire.png` },
23
+ { id: "harpoon", label: "Harpoon Gun", hand: "aquatic", icon: `${_WK}/2/20/Bandit_Harpoon_Gun.png` },
24
+ { id: "spear", label: "Spear", hand: "two", icon: `${_WK}/c/c9/Bandit_Spear.png` },
25
+ { id: "trident", label: "Trident", hand: "aquatic", icon: `${_WK}/6/66/Bandit_Trident.png` },
26
+ ];
27
+
28
+ export const GW2_WEAPONS_BY_ID = new Map(GW2_WEAPONS.map((w) => [w.id, w]));