Skip to content

Commit

Permalink
Changed to set flag from settings
Browse files Browse the repository at this point in the history
  • Loading branch information
ChasarooniZ committed Aug 5, 2024
1 parent b82d230 commit 0311f66
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Hooks.on("ready", () => {
icon: "fa-solid fa-dragon",
label: "RPG #s",
onclick: async (ev, itemD = item) => {
console.log({ ev, itemD });
const existingValue = game.settings.get("pf2e-rpg-numbers", "finishing-move.name") || "";
//console.log({ ev, itemD });
const existingValue = item.getFlag("pf2e-rpg-numbers", "finishing-move.name") || "";
// Create and display the dialog box
new Dialog({
title: "Finishing Move Name",
Expand All @@ -134,7 +134,7 @@ Hooks.on("ready", () => {
const newValue = html.find("#finishing-move-name").val().trim();

// Save the new value to the module flag
await game.settings.set("pf2e-rpg-numbers", "finishing-move.name", newValue);
await item.setFlag("pf2e-rpg-numbers", "finishing-move.name", newValue);

// Optionally, show a message or perform additional actions here
ui.notifications.info(`Finishing Move Name updated to: ${newValue}`);
Expand Down

0 comments on commit 0311f66

Please sign in to comment.