Skip to content

Commit 26af6e3

Browse files
committed
Rename domains to options
1 parent 4e57cff commit 26af6e3

File tree

8 files changed

+73
-73
lines changed

8 files changed

+73
-73
lines changed

src/module/apps/compendium-browser/tabs/action.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class CompendiumBrowserActionTab extends CompendiumBrowserTab {
1212

1313
/* MiniSearch */
1414
override searchFields = ["name", "originalName"];
15-
override storeFields = ["name", "originalName", "img", "uuid", "domains"];
15+
override storeFields = ["name", "originalName", "img", "uuid", "options"];
1616

1717
constructor(browser: CompendiumBrowser) {
1818
super(browser);
@@ -50,33 +50,33 @@ export class CompendiumBrowserActionTab extends CompendiumBrowserTab {
5050
);
5151
continue;
5252
}
53-
const domains = new Set<string>();
53+
const options = new Set<string>();
5454
const system = actionData.system;
5555
// update icons for any passive actions
5656
if (system.actionType.value === "passive") actionData.img = getActionIcon("passive");
57-
domains.add(`action-type:${system.actionType.value}`);
57+
options.add(`action-type:${system.actionType.value}`);
5858

5959
for (const trait of system.traits.value) {
60-
domains.add(`trait:${trait.replace(/^hb_/, "")}`);
60+
options.add(`trait:${trait.replace(/^hb_/, "")}`);
6161
}
6262

6363
// Prepare publication source
6464
const pubSource = String(system.publication?.title ?? system.source?.value ?? "").trim();
6565
const sourceSlug = sluggify(pubSource);
6666
if (pubSource) {
6767
publications.add(pubSource);
68-
domains.add(`source:${sourceSlug}`);
68+
options.add(`source:${sourceSlug}`);
6969
}
7070

71-
domains.add(`type:${actionData.type}`);
72-
domains.add(`category:${system.category}`);
71+
options.add(`type:${actionData.type}`);
72+
options.add(`category:${system.category}`);
7373

7474
actions.push({
7575
name: actionData.name,
7676
originalName: actionData.originalName, // Added by Babele
7777
img: actionData.img,
7878
uuid: actionData.uuid,
79-
domains,
79+
options,
8080
});
8181
}
8282
}

src/module/apps/compendium-browser/tabs/base.svelte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export abstract class CompendiumBrowserTab {
2121
const searchText = fa.ux.SearchFilter.cleanQuery(this.filterData.search.text);
2222
const baseResults = this.sortResult(searchText ? this.searchEngine.search(searchText) : this.indexData);
2323
const predicate = this.buildPredicate();
24-
return baseResults.filter((i) => predicate.test(i.domains));
24+
return baseResults.filter((i) => predicate.test(i.options));
2525
});
2626
/** The maximum number of items shown in the result list element */
2727
resultLimit = $state(CompendiumBrowser.RESULT_LIMIT);

src/module/apps/compendium-browser/tabs/bestiary.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export class CompendiumBrowserBestiaryTab extends CompendiumBrowserTab {
1919

2020
/* MiniSearch */
2121
override searchFields = ["name", "originalName"];
22-
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "domains"];
22+
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "options"];
2323

2424
constructor(browser: CompendiumBrowser) {
2525
super(browser);
@@ -50,25 +50,25 @@ export class CompendiumBrowserBestiaryTab extends CompendiumBrowserTab {
5050
);
5151
continue;
5252
}
53-
const domains = new Set<string>();
53+
const options = new Set<string>();
5454
const system = actorData.system;
5555
// Prepare publication source
5656
const details = system.details;
5757
const pubSource = String(details.publication?.title ?? details.source?.value ?? "").trim();
5858
const sourceSlug = sluggify(pubSource);
5959
if (pubSource) {
6060
publications.add(pubSource);
61-
domains.add(`source:${sourceSlug}`);
61+
options.add(`source:${sourceSlug}`);
6262
}
6363

6464
for (const trait of system.traits.value) {
65-
domains.add(`trait:${trait.replace(/^hb_/, "")}`);
65+
options.add(`trait:${trait.replace(/^hb_/, "")}`);
6666
}
6767

68-
domains.add(`level:${system.details.level.value}`);
69-
domains.add(`rarity:${system.traits.rarity}`);
70-
domains.add(`size:${system.traits.size.value}`);
71-
domains.add(`type:${actorData.type}`);
68+
options.add(`level:${system.details.level.value}`);
69+
options.add(`rarity:${system.traits.rarity}`);
70+
options.add(`size:${system.traits.size.value}`);
71+
options.add(`type:${actorData.type}`);
7272

7373
bestiaryActors.push({
7474
name: actorData.name,
@@ -77,7 +77,7 @@ export class CompendiumBrowserBestiaryTab extends CompendiumBrowserTab {
7777
uuid: actorData.uuid,
7878
level: actorData.system.details.level.value,
7979
rarity: actorData.system.traits.rarity,
80-
domains,
80+
options,
8181
});
8282
}
8383
console.debug(`PF2e System | Compendium Browser | ${pack.metadata.label} - Loaded`);

src/module/apps/compendium-browser/tabs/campaign-feature.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class CompendiumBrowserCampaignFeaturesTab extends CompendiumBrowserTab {
1212

1313
/* MiniSearch */
1414
override searchFields = ["name", "originalName"];
15-
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "domains"];
15+
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "options"];
1616

1717
constructor(browser: CompendiumBrowser) {
1818
super(browser);
@@ -45,24 +45,24 @@ export class CompendiumBrowserCampaignFeaturesTab extends CompendiumBrowserTab {
4545
)) {
4646
console.debug(`PF2e System | Compendium Browser | ${pack.metadata.label} - ${index.size} entries found`);
4747
for (const featData of index.filter((i) => i.type === "campaignFeature")) {
48-
const domains = new Set<string>();
48+
const options = new Set<string>();
4949
const system = featData.system;
5050

5151
for (const trait of system.traits.value.map((t: string) => t.replace(/^hb_/, ""))) {
52-
domains.add(`trait:${trait}`);
52+
options.add(`trait:${trait}`);
5353
}
5454

5555
// Prepare publication source
5656
const pubSource = String(system.publication?.title ?? system.source?.value ?? "").trim();
5757
const sourceSlug = sluggify(pubSource);
5858
if (pubSource) {
5959
publications.add(pubSource);
60-
domains.add(`source:${sourceSlug}`);
60+
options.add(`source:${sourceSlug}`);
6161
}
6262

63-
domains.add(`category:${system.category}`);
64-
domains.add(`level:${system.level?.value ?? 0}`);
65-
domains.add(`rarity:${system.traits.rarity}`);
63+
options.add(`category:${system.category}`);
64+
options.add(`level:${system.level?.value ?? 0}`);
65+
options.add(`rarity:${system.traits.rarity}`);
6666

6767
feats.push({
6868
name: featData.name,
@@ -71,7 +71,7 @@ export class CompendiumBrowserCampaignFeaturesTab extends CompendiumBrowserTab {
7171
uuid: featData.uuid,
7272
level: featData.system.level?.value,
7373
rarity: system.traits.rarity,
74-
domains,
74+
options,
7575
});
7676
}
7777
}

src/module/apps/compendium-browser/tabs/equipment.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export class CompendiumBrowserEquipmentTab extends CompendiumBrowserTab {
1515

1616
/* MiniSearch */
1717
override searchFields = ["name", "originalName"];
18-
override storeFields = ["name", "originalName", "img", "uuid", "level", "price", "rarity", "domains"];
18+
override storeFields = ["name", "originalName", "img", "uuid", "level", "price", "rarity", "options"];
1919

2020
constructor(browser: CompendiumBrowser) {
2121
super(browser);
@@ -66,22 +66,22 @@ export class CompendiumBrowserEquipmentTab extends CompendiumBrowserTab {
6666
);
6767
continue;
6868
}
69-
const domains = new Set<string>();
69+
const options = new Set<string>();
7070

7171
// Store price as a number for better sorting (note: we may be dealing with old data, convert if needed)
7272
const priceValue = itemData.system.price.value;
7373
const priceCoins =
7474
typeof priceValue === "string" ? Coins.fromString(priceValue) : new Coins(priceValue);
7575
const coinValue = priceCoins.copperValue;
76-
domains.add(`price:${coinValue}`);
76+
options.add(`price:${coinValue}`);
7777

7878
// Prepare publication source
7979
const system = itemData.system;
8080
const pubSource = String(system.publication?.title ?? system.source?.value ?? "").trim();
8181
const sourceSlug = sluggify(pubSource);
8282
if (pubSource) {
8383
publications.add(pubSource);
84-
domains.add(`source:${sourceSlug}`);
84+
options.add(`source:${sourceSlug}`);
8585
}
8686

8787
// Infer magical trait from runes
@@ -96,13 +96,13 @@ export class CompendiumBrowserEquipmentTab extends CompendiumBrowserTab {
9696
traits.push("magical");
9797
}
9898
for (const trait of R.unique(traits)) {
99-
domains.add(`trait:${trait}`);
99+
options.add(`trait:${trait}`);
100100
}
101-
domains.add(`level:${itemData.system.level?.value ?? 0}`);
102-
domains.add(`category:${itemData.system.category ?? "none"}`);
103-
domains.add(`type:group:${itemData.system.group ?? "none"}`);
104-
domains.add(`rarity:${itemData.system.traits.rarity}`);
105-
domains.add(`type:${itemData.type}`);
101+
options.add(`level:${itemData.system.level?.value ?? 0}`);
102+
options.add(`category:${itemData.system.category ?? "none"}`);
103+
options.add(`type:group:${itemData.system.group ?? "none"}`);
104+
options.add(`rarity:${itemData.system.traits.rarity}`);
105+
options.add(`type:${itemData.type}`);
106106

107107
equipment.push({
108108
name: itemData.name,
@@ -112,7 +112,7 @@ export class CompendiumBrowserEquipmentTab extends CompendiumBrowserTab {
112112
level: itemData.system.level?.value ?? 0,
113113
price: priceCoins,
114114
rarity: itemData.system.traits.rarity,
115-
domains,
115+
options,
116116
});
117117
}
118118
}

src/module/apps/compendium-browser/tabs/feat.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export class CompendiumBrowserFeatTab extends CompendiumBrowserTab {
1212

1313
/* MiniSearch */
1414
override searchFields = ["name", "originalName"];
15-
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "domains"];
15+
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "options"];
1616

1717
#creatureTraits = CONFIG.PF2E.creatureTraits;
1818

@@ -61,7 +61,7 @@ export class CompendiumBrowserFeatTab extends CompendiumBrowserTab {
6161
);
6262
continue;
6363
}
64-
const domains = new Set<string>();
64+
const options = new Set<string>();
6565
const system = featData.system;
6666

6767
// Accommodate deprecated featType objects
@@ -89,33 +89,33 @@ export class CompendiumBrowserFeatTab extends CompendiumBrowserTab {
8989
}
9090

9191
for (const skill of skills) {
92-
domains.add(`skill:${skill}`);
92+
options.add(`skill:${skill}`);
9393
}
9494

9595
const category = system.category;
9696
const type = featData.type;
9797
const traits: string[] = system.traits.value;
9898
// Tag ancestry items without an ancestry trait
9999
if (category === "ancestry" && !traits.some((t) => t in this.#creatureTraits)) {
100-
domains.add("trait:ancestry:universal");
100+
options.add("trait:ancestry:universal");
101101
}
102-
domains.add(`category:${category}`);
103-
domains.add(`type:${type}`);
102+
options.add(`category:${category}`);
103+
options.add(`type:${type}`);
104104

105105
for (const trait of traits) {
106-
domains.add(`trait:${trait.replace(/^hb_/, "")}`);
106+
options.add(`trait:${trait.replace(/^hb_/, "")}`);
107107
}
108108

109109
// Prepare source
110110
const pubSource = system.publication?.title ?? system.source?.value ?? "";
111111
const sourceSlug = sluggify(pubSource);
112112
if (pubSource) {
113113
publications.add(pubSource);
114-
domains.add(`source:${sourceSlug}`);
114+
options.add(`source:${sourceSlug}`);
115115
}
116116

117-
domains.add(`level:${system.level.value}`);
118-
domains.add(`rarity:${system.traits.rarity}`);
117+
options.add(`level:${system.level.value}`);
118+
options.add(`rarity:${system.traits.rarity}`);
119119

120120
feats.push({
121121
name: featData.name,
@@ -124,7 +124,7 @@ export class CompendiumBrowserFeatTab extends CompendiumBrowserTab {
124124
uuid: featData.uuid,
125125
level: featData.system.level.value,
126126
rarity: featData.system.traits.rarity,
127-
domains,
127+
options,
128128
});
129129
}
130130
}

src/module/apps/compendium-browser/tabs/hazard.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export class CompendiumBrowserHazardTab extends CompendiumBrowserTab {
1111

1212
/* MiniSearch */
1313
override searchFields = ["name", "originalName"];
14-
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "domains"];
14+
override storeFields = ["name", "originalName", "img", "uuid", "level", "rarity", "options"];
1515

1616
protected index = ["img", "system.details.level.value", "system.details.isComplex", "system.traits"];
1717

@@ -46,11 +46,11 @@ export class CompendiumBrowserHazardTab extends CompendiumBrowserTab {
4646
);
4747
continue;
4848
}
49-
const domains = new Set<string>();
49+
const options = new Set<string>();
5050
const system = actorData.system;
5151

5252
for (const trait of system.traits.value) {
53-
domains.add(`trait:${trait}`);
53+
options.add(`trait:${trait}`);
5454
}
5555

5656
// Prepare publication source
@@ -59,13 +59,13 @@ export class CompendiumBrowserHazardTab extends CompendiumBrowserTab {
5959
const sourceSlug = sluggify(pubSource);
6060
if (pubSource) {
6161
publications.add(pubSource);
62-
domains.add(`source:${sourceSlug}`);
62+
options.add(`source:${sourceSlug}`);
6363
}
6464

65-
domains.add(`complexity:${system.details.isComplex ? "complex" : "simple"}`);
66-
domains.add(`level:${system.details.level.value}`);
67-
domains.add(`rarity:${system.traits.rarity}`);
68-
domains.add(`type:${actorData.type}`);
65+
options.add(`complexity:${system.details.isComplex ? "complex" : "simple"}`);
66+
options.add(`level:${system.details.level.value}`);
67+
options.add(`rarity:${system.traits.rarity}`);
68+
options.add(`type:${actorData.type}`);
6969

7070
hazardActors.push({
7171
name: actorData.name,
@@ -74,7 +74,7 @@ export class CompendiumBrowserHazardTab extends CompendiumBrowserTab {
7474
uuid: actorData.uuid,
7575
level: actorData.system.details.level.value,
7676
rarity: actorData.system.traits.rarity,
77-
domains,
77+
options,
7878
});
7979
}
8080
console.debug(`PF2e System | Compendium Browser | ${pack.metadata.label} - Loaded`);

0 commit comments

Comments
 (0)