Skip to content

Commit

Permalink
Merge pull request #194 from wrycu/vendor_edit_184
Browse files Browse the repository at this point in the history
feat(shop): compendiums
  • Loading branch information
wrycu authored May 21, 2024
2 parents bfda331 + 43e9000 commit d7e523a
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 9 deletions.
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

0 comments on commit d7e523a

Please sign in to comment.