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

fix(shop): fix shop compendium searching #197

Merged
merged 1 commit into from
May 25, 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: 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
Loading