Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(shop): compendiums #194

Merged
merged 1 commit into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@
"ffg-star-wars-enhancements.shop.html.setup.pc": "Player Character",
"ffg-star-wars-enhancements.shop.html.setup.price": "Base Price Percent",
"ffg-star-wars-enhancements.shop.html.setup.button": "Create Shop",
"ffg-star-wars-enhancements.shop.setting.general.name": "General Shop Compendiums",
"ffg-star-wars-enhancements.shop.setting.general.hint": "Comma seperated list of compendiums to pull items from when generating the inventory (no spaces)",
"ffg-star-wars-enhancements.shop.setting.armor.name": "Armor Shop Compendiums",
"ffg-star-wars-enhancements.shop.setting.armor.hint": "Comma seperated list of compendiums to pull items from when generating the inventory (no spaces)",
"ffg-star-wars-enhancements.shop.setting.gear.name": "Gear Shop Compendiums",
"ffg-star-wars-enhancements.shop.setting.gear.hint": "Comma seperated list of compendiums to pull items from when generating the inventory (no spaces)",
"ffg-star-wars-enhancements.shop.setting.weapon.name": "Weapon Shop Compendiums",
"ffg-star-wars-enhancements.shop.setting.weapon.hint": "Comma seperated list of compendiums to pull items from when generating the inventory (no spaces)",
"ffg-star-wars-enhancements.controls.hyperspace.name": "hyperspace-transition",
"ffg-star-wars-enhancements.controls.hyperspace.title": "Hyperspace Transition",
"ffg-star-wars-enhancements.hyperspace.title": "Hyperspace Transition",
Expand Down
1 change: 1 addition & 0 deletions release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
`2.1.0` - ?

- COMPATABILITY: Module updated to work with FoundryVTT v12
- NEW FEATURE: You can specify compendiums from which shops will auto-build inventories
- FIX: Correct Bounty CSS datapad breaking after editing
- FIX: Attack animations are now properly aligned when the system is set to any language other than English

Expand Down
13 changes: 4 additions & 9 deletions scripts/shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ class Shop {
log(module_name, "Initializing shop object");
let specialization_mapping = {
general: {
compendiums: [
"starwarsffg.oggdudearmor",
"starwarsffg.oggdudegear",
"starwarsffg.oggdudeweapons",
"starwarsffg.oggdudeitemattachments",
],
compendiums: game.settings.get("ffg-star-wars-enhancements", "general_shop_compendiums"),
types: [
"weapon",
"gear",
Expand All @@ -53,19 +48,19 @@ class Shop {
],
},
armor: {
compendiums: ["starwarsffg.oggdudearmor", "starwarsffg.oggdudeitemattachments"],
compendiums: game.settings.get("ffg-star-wars-enhancements", "armor_shop_compendiums"),
types: [
"armour",
"armor", // attachments use the US spelling while items use the UK spelling
"itemattachment",
],
},
gear: {
compendiums: ["starwarsffg.oggdudegear", "starwarsffg.oggdudeitemattachments"],
compendiums: game.settings.get("ffg-star-wars-enhancements", "gear_shop_compendiums"),
types: ["gear", "itemattachment"],
},
weapon: {
compendiums: ["starwarsffg.oggdudeweapons", "starwarsffg.oggdudeitemattachments"],
compendiums: game.settings.get("ffg-star-wars-enhancements", "weapon_shop_compendiums"),
types: ["weapon", "itemattachment"],
},
nerf_herder: {
Expand Down
37 changes: 37 additions & 0 deletions scripts/shop_sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,43 @@ export function init() {
label: "ffg-sw-enhanced-vendor",
makeDefault: false,
});
game.settings.register("ffg-star-wars-enhancements", "general_shop_compendiums", {
name: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.general.name"),
hint: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.general.hint"),
scope: "world",
config: true,
type: Array,
default: [
"starwarsffg.oggdudearmor",
"starwarsffg.oggdudegear",
"starwarsffg.oggdudeweapons",
"starwarsffg.oggdudegenericattachments",
],
});
game.settings.register("ffg-star-wars-enhancements", "armor_shop_compendiums", {
name: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.armor.name"),
hint: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.armor.hint"),
scope: "world",
config: true,
type: Array,
default: ["starwarsffg.oggdudearmor", "starwarsffg.oggdudearmorattachments"],
});
game.settings.register("ffg-star-wars-enhancements", "gear_shop_compendiums", {
name: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.gear.name"),
hint: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.gear.hint"),
scope: "world",
config: true,
type: Array,
default: ["starwarsffg.oggdudegear", "starwarsffg.oggdudegenericattachments"],
});
game.settings.register("ffg-star-wars-enhancements", "weapon_shop_compendiums", {
name: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.weapon.name"),
hint: game.i18n.localize("ffg-star-wars-enhancements.shop.setting.weapon.hint"),
scope: "world",
config: true,
type: Array,
default: ["starwarsffg.oggdudeweapons", "starwarsffg.oggdudeweaponattachments"],
});
}

/*
Expand Down
Loading