Skip to content

Commit

Permalink
integrate dialog tooltips with library, update scripts using item dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
moo-man committed Oct 29, 2024
1 parent e5f62da commit 6142239
Show file tree
Hide file tree
Showing 12 changed files with 48 additions and 28 deletions.
30 changes: 25 additions & 5 deletions modules/apps/roll-dialog/roll-dialog.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
import { DialogTooltips } from "./tooltips";

export default class RollDialog extends WarhammerRollDialog {

// tooltipConfig = {modifier : "", slBonus : game.i18n.localize("DIALOG.SLBonus"), successBonus : game.i18n.localize("DIALOG.SuccessBonus"), difficulty : ""};
static tooltipClass = DialogTooltips;
static tooltipConfig = {
modifier : {
label : "Modifier",
type : 1,
path : "fields.modifier",
hideLabel : true
},
slBonus : {
label : "DIALOG.SLBonus",
type : 1,
path : "fields.slBonus"
},
successBonus : {
label : "DIALOG.SuccessBonus",
type : 1,
path : "fields.successBonus"
},
difficulty : {
label : "Difficulty",
type : 0,
path : "fields.difficulty"
}
}

testClass = null;

Expand Down Expand Up @@ -65,8 +84,9 @@ export default class RollDialog extends WarhammerRollDialog {
{
throw new Error("Only subclasses of RollDialog can be submitted")
}
this.data.context = {};
let data = super._getSubmissionData();
data.breakdown = this.createBreakdown();
data.breakdown = data.context.breakdown;
if (!this.options.skipTargets)
{
data.targets = Array.from(data.targets).map(t => t.actor.speakerData(t.document))
Expand Down
2 changes: 1 addition & 1 deletion scripts/4ylzjgUdHY5D0yVh.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let filters = [
}
]

items = items.concat(await ItemDialog.createFromFilters(filters, 1, "Choose an appropriate Polearm or Two-Handed Weapon"))
items = items.concat(await ItemDialog.createFromFilters(filters, 1, {text : "Choose an appropriate Polearm or Two-Handed Weapon"}))

let ride = await Dialog.confirm({title : "Skill", content : "Add Chaos Steed and +20 Ride (Horse)?"})

Expand Down
4 changes: 2 additions & 2 deletions scripts/8zTkDVziBPaNbMQX.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let filters = [
}
]

let petty = await ItemDialog.createFromFilters(filters, 6, "Choose 6 Petty Spells")
let petty = await ItemDialog.createFromFilters(filters, 6, {text : "Choose 6 Petty Spells"})


filters = [
Expand All @@ -23,7 +23,7 @@ filters = [
}
]

let arcane = await ItemDialog.createFromFilters(filters, 9, "Choose 9 Arcane Spells")
let arcane = await ItemDialog.createFromFilters(filters, 9, {text : "Choose 9 Arcane Spells"})

let items = petty.concat(arcane).map(i => i.toObject())

Expand Down
4 changes: 2 additions & 2 deletions scripts/HG2fKOfruT5QV3A4.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let filters = [
}
]

let petty = await ItemDialog.createFromFilters(filters, 3, "Choose 3 Petty Spells")
let petty = await ItemDialog.createFromFilters(filters, 3, {text: "Choose 3 Petty Spells"})


filters = [
Expand All @@ -25,7 +25,7 @@ filters = [
}
]

let arcane = await ItemDialog.createFromFilters(filters, 6, "Choose 6 Arcane Spells")
let arcane = await ItemDialog.createFromFilters(filters, 6, {text: "Choose 6 Arcane Spells"})

let items = petty.map(i => i.toObject()).concat(arcane.map(i => {
let spell = i.toObject();
Expand Down
4 changes: 2 additions & 2 deletions scripts/OEy2lxvic37dRBEt.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let filters = [
}
]

let petty = await ItemDialog.createFromFilters(filters, 3, "Choose 3 Petty Spells")
let petty = await ItemDialog.createFromFilters(filters, 3, {text : "Choose 3 Petty Spells"})


filters = [
Expand All @@ -23,7 +23,7 @@ filters = [
}
]

let arcane = await ItemDialog.createFromFilters(filters, 3, "Choose 3 Arcane Spells")
let arcane = await ItemDialog.createFromFilters(filters, 3, {text : "Choose 3 Arcane Spells"})

let items = petty.concat(arcane).map(i => i.toObject())

Expand Down
2 changes: 1 addition & 1 deletion scripts/QoEOxRruQXYrZrv3.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ let filters = [
}
]

let items = await ItemDialog.createFromFilters(filters, 2, "Choose 2 Skills to add +20")
let items = await ItemDialog.createFromFilters(filters, 2, {text: "Choose 2 Skills to add +20"})
items = items.map(i => i.toObject())
items.forEach(i => i.system.advances.value = 20)

Expand Down
6 changes: 3 additions & 3 deletions scripts/UQtXuQmUlTyDKqhe.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ let filters = [
}
]

let petty = (await ItemDialog.createFromFilters(filters, 3, "Choose 3 Petty Spells")).map(i => i.toObject());
let petty = (await ItemDialog.createFromFilters(filters, 3, {text: "Choose 3 Petty Spells"})).map(i => i.toObject());


filters = [
Expand All @@ -112,7 +112,7 @@ filters = [
}
]

let arcane = (await ItemDialog.createFromFilters(filters, 2, "Choose 2 Arcane Spells")).map(i => i.toObject());
let arcane = (await ItemDialog.createFromFilters(filters, 2, {text : "Choose 2 Arcane Spells"})).map(i => i.toObject());

filters = [
{
Expand All @@ -130,7 +130,7 @@ filters = [
}
]

let necromancy = (await ItemDialog.createFromFilters(filters, 1, "Choose 1 Necromancy Spell")).map(i => i.toObject());
let necromancy = (await ItemDialog.createFromFilters(filters, 1, {text : "Choose 1 Necromancy Spell"})).map(i => i.toObject());

arcane.forEach(i => {
i.img = "modules/wfrp4e-core/icons/spells/necromancy.png";
Expand Down
4 changes: 2 additions & 2 deletions scripts/YJX7WnxzXXIVdH6P.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let filters = [
}
]

let petty = await ItemDialog.createFromFilters(filters, 6, "Choose 3 Petty Spells")
let petty = await ItemDialog.createFromFilters(filters, 6, {text : {text : "Choose 3 Petty Spells"}})


filters = [
Expand All @@ -25,7 +25,7 @@ filters = [
}
]

let arcane = await ItemDialog.createFromFilters(filters, 12, "Choose 12 Arcane Spells")
let arcane = await ItemDialog.createFromFilters(filters, 12, {text : {text : "Choose 12 Arcane Spells"}})

let items = petty.map(i => i.toObject()).concat(arcane.map(i => {
let spell = i.toObject();
Expand Down
2 changes: 1 addition & 1 deletion scripts/oPg4se8iQRD14kmB.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let filters = [
}
]

let items = await ItemDialog.createFromFilters(filters, 1, "Choose an appropriate Polearm or Two-Handed Weapon")
let items = await ItemDialog.createFromFilters(filters, 1, {text : "Choose an appropriate Polearm or Two-Handed Weapon"})
items = items.map(i => i.toObject())

items.forEach(i => i.system.equipped.value = true);
Expand Down
2 changes: 1 addition & 1 deletion scripts/oTXPA6rbPnYOKNmo.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ let filters = [
}
]

items = items.concat(await ItemDialog.createFromFilters(filters, 1, "Choose an appropriate Polearm or Two-Handed Weapon"))
items = items.concat(await ItemDialog.createFromFilters(filters, 1, {text: "Choose an appropriate Polearm or Two-Handed Weapon"}))

let ride = await Dialog.confirm({title : "Skill", content : "Add Chaos Steed and +20 Ride (Horse)?"})

Expand Down
6 changes: 3 additions & 3 deletions scripts/zIpl3SkWv8zzlr2D.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let filters = [
}
]

let petty = (await ItemDialog.createFromFilters(filters, 4, "Choose 4 Petty Spells")).map(i => i.toObject());
let petty = (await ItemDialog.createFromFilters(filters, 4, {text : "Choose 4 Petty Spells"})).map(i => i.toObject());


filters = [
Expand All @@ -23,7 +23,7 @@ filters = [
}
]

let arcane = (await ItemDialog.createFromFilters(filters, 8, "Choose 8 Arcane Spells & Lore of Death")).map(i => i.toObject());
let arcane = (await ItemDialog.createFromFilters(filters, 8, {text : "Choose 8 Arcane Spells & Lore of Death"})).map(i => i.toObject());

filters = [
{
Expand All @@ -41,7 +41,7 @@ filters = [
}
]

let necromancy = (await ItemDialog.createFromFilters(filters, 3, "Choose 3 from the Lore of Necromancy")).map(i => i.toObject());
let necromancy = (await ItemDialog.createFromFilters(filters, 3, {text : "Choose 3 from the Lore of Necromancy"})).map(i => i.toObject());

let items = [...necromancy, ...petty, ...arcane]

Expand Down
10 changes: 5 additions & 5 deletions system.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "wfrp4e",
"title": "Warhammer Fantasy Roleplay 4th Edition",
"description": "A comprehensive system for running grim and perilous games of Warhammer Fantasy Roleplay in the Foundry VTT environment.",
"version": "8.2.0",
"version": "8.2.1",
"authors" : [
{
"name": "Moo Man",
Expand Down Expand Up @@ -63,15 +63,15 @@
"requires": [{
"id": "warhammer-lib",
"type": "module",
"manifest": "https://raw.githubusercontent.com/moo-man/WarhammerLibrary-FVTT/1.1.1/module.json",
"manifest": "https://raw.githubusercontent.com/moo-man/WarhammerLibrary-FVTT/1.1.2/module.json",
"compatibility": {
"minimum" : "1.1.1",
"verified": "1.1.1"
"minimum" : "1.1.2",
"verified": "1.1.2"
}
}]
},
"socket": true,
"manifest" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/latest/download/system.json",
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/8.2.0/wfrp4e.zip",
"download" : "https://github.com/moo-man/WFRP4e-FoundryVTT/releases/download/8.2.1/wfrp4e.zip",
"url" : "https://github.com/moo-man/WFRP4e-FoundryVTT"
}

0 comments on commit 6142239

Please sign in to comment.