Skip to content

Commit

Permalink
fix(shop): fix shop compendium searching
Browse files Browse the repository at this point in the history
* defaults to a comma seperated string and splits it into an array
  • Loading branch information
wrycu committed May 25, 2024
1 parent faf4ebd commit eabcb5d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 17 deletions.
8 changes: 4 additions & 4 deletions scripts/shop.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class Shop {
log(module_name, "Initializing shop object");
let specialization_mapping = {
general: {
compendiums: game.settings.get("ffg-star-wars-enhancements", "general_shop_compendiums"),
compendiums: game.settings.get("ffg-star-wars-enhancements", "general_shop_compendiums").split(","),
types: [
"weapon",
"gear",
Expand All @@ -48,19 +48,19 @@ class Shop {
],
},
armor: {
compendiums: game.settings.get("ffg-star-wars-enhancements", "armor_shop_compendiums"),
compendiums: game.settings.get("ffg-star-wars-enhancements", "armor_shop_compendiums").split(","),
types: [
"armour",
"armor", // attachments use the US spelling while items use the UK spelling
"itemattachment",
],
},
gear: {
compendiums: game.settings.get("ffg-star-wars-enhancements", "gear_shop_compendiums"),
compendiums: game.settings.get("ffg-star-wars-enhancements", "gear_shop_compendiums").split(","),
types: ["gear", "itemattachment"],
},
weapon: {
compendiums: game.settings.get("ffg-star-wars-enhancements", "weapon_shop_compendiums"),
compendiums: game.settings.get("ffg-star-wars-enhancements", "weapon_shop_compendiums").split(","),
types: ["weapon", "itemattachment"],
},
nerf_herder: {
Expand Down
22 changes: 9 additions & 13 deletions scripts/shop_sheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,33 @@ export function init() {
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",
],
type: String,
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"],
type: String,
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"],
type: String,
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"],
type: String,
default: "starwarsffg.oggdudeweapons,starwarsffg.oggdudeweaponattachments",
});
}

Expand Down

0 comments on commit eabcb5d

Please sign in to comment.