chore: fix name

This commit is contained in:
WinterMyst 2024-09-26 00:35:05 +00:00
parent cc49017b3f
commit 1ec482a98f
7 changed files with 23 additions and 23 deletions

View File

@ -7,9 +7,9 @@
return loadTemplates([ return loadTemplates([
// Actor partials. // Actor partials.
"systems/kids-on-brooms/templates/actor/parts/actor-features.html", "systems/kidsonbrooms/templates/actor/parts/actor-features.html",
"systems/kids-on-brooms/templates/actor/parts/actor-adversity.html", "systems/kidsonbrooms/templates/actor/parts/actor-adversity.html",
"systems/kids-on-brooms/templates/actor/parts/actor-stats.html", "systems/kidsonbrooms/templates/actor/parts/actor-stats.html",
"systems/kids-on-brooms/templates/actor/parts/actor-npc-stats.html", "systems/kidsonbrooms/templates/actor/parts/actor-npc-stats.html",
]); ]);
}; };

View File

@ -47,7 +47,7 @@ Hooks.once('init', async function() {
// Register sheet application classes // Register sheet application classes
Actors.unregisterSheet("core", ActorSheet); Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("kids-on-brooms", KidsOnBroomsActorSheet, { makeDefault: true }); Actors.registerSheet("kidsonbrooms", KidsOnBroomsActorSheet, { makeDefault: true });
//If there is a new chat message that is a roll we add the adversity token controls //If there is a new chat message that is a roll we add the adversity token controls
Hooks.on("renderChatMessage", (message, html, messageData) => { Hooks.on("renderChatMessage", (message, html, messageData) => {
@ -67,7 +67,7 @@ Hooks.once('init', async function() {
} }
// Check if the token has already been claimed -- Contigency if the button somehow activates again // Check if the token has already been claimed -- Contigency if the button somehow activates again
if (message.getFlag("kids-on-brooms", "tokenClaimed")) { if (message.getFlag("kidsonbrooms", "tokenClaimed")) {
ui.notifications.warn("This adversity token has already been claimed."); ui.notifications.warn("This adversity token has already been claimed.");
return; return;
} }
@ -85,10 +85,10 @@ Hooks.once('init', async function() {
// Update the message content // Update the message content
tokenControls.update({ content: updatedContent }); tokenControls.update({ content: updatedContent });
// Set the flag on the chat message to indicate that the token has been claimed // Set the flag on the chat message to indicate that the token has been claimed
tokenControls.setFlag("kids-on-brooms", "tokenClaimed", true); tokenControls.setFlag("kidsonbrooms", "tokenClaimed", true);
} else { } else {
// Emit a socket request to update the message to show that the token has been claimed // Emit a socket request to update the message to show that the token has been claimed
game.socket.emit('system.kids-on-brooms', { game.socket.emit('system.kidsonbrooms', {
action: "takeToken", action: "takeToken",
messageID: message.id, messageID: message.id,
actorID: actor.id, actorID: actor.id,
@ -118,7 +118,7 @@ Hooks.once('init', async function() {
* if a player wants to claim a token we will update the message since they do not have the permissions * if a player wants to claim a token we will update the message since they do not have the permissions
*/ */
Hooks.once('ready', function() { Hooks.once('ready', function() {
game.socket.on('system.kids-on-brooms', async (data) => { game.socket.on('system.kidsonbrooms', async (data) => {
console.log("Socket data received:", data); console.log("Socket data received:", data);
if (data.action === "spendTokens") { if (data.action === "spendTokens") {
@ -190,7 +190,7 @@ Hooks.once('ready', function() {
// Update the message content // Update the message content
tokenControls.update({ content: updatedContent }); tokenControls.update({ content: updatedContent });
// Set the flag on the chat message to indicate that the token has been claimed // Set the flag on the chat message to indicate that the token has been claimed
tokenControls.setFlag("kids-on-brooms", "tokenClaimed", true); tokenControls.setFlag("kidsonbrooms", "tokenClaimed", true);
} }
}); });
}); });
@ -277,7 +277,7 @@ async function _onSpendAdversityTokens(e, rollMessageId) {
console.log(`Requesting to spend ${tokensToSpend} tokens for ${rollActor.name} by ${spendingPlayerActor.name} (cost: ${tokenCost})`); console.log(`Requesting to spend ${tokensToSpend} tokens for ${rollActor.name} by ${spendingPlayerActor.name} (cost: ${tokenCost})`);
// Emit a socket request to spend tokens // Emit a socket request to spend tokens
game.socket.emit('system.kids-on-brooms', { game.socket.emit('system.kidsonbrooms', {
action: "spendTokens", action: "spendTokens",
rollActorId: rollActorId, rollActorId: rollActorId,
spendingActorId: spendingPlayerActor.id, // Send the player's actor who is spending the tokens spendingActorId: spendingPlayerActor.id, // Send the player's actor who is spending the tokens
@ -300,8 +300,8 @@ async function _updateRollMessage(rollMessageId, tokensToSpend, isPlayerOfActor)
} }
// Retrieve current tokens spent from flags, or initialize to 0 if not found // Retrieve current tokens spent from flags, or initialize to 0 if not found
let cumulativeTokensSpent = message.getFlag("kids-on-brooms", "tokensSpent") || 0; let cumulativeTokensSpent = message.getFlag("kidsonbrooms", "tokensSpent") || 0;
let newTotal = message.getFlag("kids-on-brooms", "newRollTotal") || message.rolls[0].total; let newTotal = message.getFlag("kidsonbrooms", "newRollTotal") || message.rolls[0].total;
/*if(isPlayerOfActor) /*if(isPlayerOfActor)
{ {
@ -312,10 +312,10 @@ async function _updateRollMessage(rollMessageId, tokensToSpend, isPlayerOfActor)
}*/ }*/
cumulativeTokensSpent += tokensToSpend; cumulativeTokensSpent += tokensToSpend;
newTotal += tokensToSpend; newTotal += tokensToSpend;
await message.setFlag("kids-on-brooms", "newRollTotal", newTotal); await message.setFlag("kidsonbrooms", "newRollTotal", newTotal);
// Update the message's flags to store the cumulative tokens spent // Update the message's flags to store the cumulative tokens spent
await message.setFlag("kids-on-brooms", "tokensSpent", cumulativeTokensSpent); await message.setFlag("kidsonbrooms", "tokensSpent", cumulativeTokensSpent);
let newContent = ""; let newContent = "";
if(cumulativeTokensSpent === 1) if(cumulativeTokensSpent === 1)
{ {

View File

@ -1,5 +1,5 @@
{ {
"name": "kids-on-brooms", "name": "kidsonbrooms",
"version": "1.1.0", "version": "1.1.0",
"description": "CSS compiler for the Kids On Brooms system", "description": "CSS compiler for the Kids On Brooms system",
"scripts": { "scripts": {
@ -22,7 +22,7 @@
"gulp-sass": "^5", "gulp-sass": "^5",
"gulp-sourcemaps": "^2.6.5", "gulp-sourcemaps": "^2.6.5",
"gulp-zip": "^5.0.1", "gulp-zip": "^5.0.1",
"kids-on-brooms": "file:", "kidsonbrooms": "file:",
"node-fetch": "^3.3.2" "node-fetch": "^3.3.2"
}, },
"devDependencies": { "devDependencies": {

View File

@ -1,3 +1,3 @@
The Kids On Brooms System Implemented in FoundryVTT, reupload from https://github.com/Singularity-Lathe-VTT/kids-on-brooms The Kids On Brooms System Implemented in FoundryVTT
To get support create a issue on this Repository To get support create a issue on this Repository

View File

@ -1,7 +1,7 @@
{ {
"id": "kidsonbrooms", "id": "kidsonbrooms",
"title": "Kids on Brooms System", "title": "Kids on Brooms System",
"description": "The Kids on Brooms system for FoundryVTT! - Deprecated", "description": "The Kids on Brooms system for FoundryVTT!",
"version": "1.1.0", "version": "1.1.0",
"compatibility": { "compatibility": {
"minimum": 12, "minimum": 12,

View File

@ -32,12 +32,12 @@
<div class="tab features" data-group="primary" data-tab="features"> <div class="tab features" data-group="primary" data-tab="features">
<section class="grid grid-3col"> <section class="grid grid-3col">
<section class="main grid-span-2"> <section class="main grid-span-2">
{{> "systems/kids-on-brooms/templates/actor/parts/actor-features.html"}} {{> "systems/kidsonbrooms/templates/actor/parts/actor-features.html"}}
{{> "systems/kids-on-brooms/templates/actor/parts/actor-adversity.html"}} {{> "systems/kidsonbrooms/templates/actor/parts/actor-adversity.html"}}
</section> </section>
<aside class="sidebar"> <aside class="sidebar">
{{> "systems/kids-on-brooms/templates/actor/parts/actor-stats.html"}} {{> "systems/kidsonbrooms/templates/actor/parts/actor-stats.html"}}
</aside> </aside>

View File

@ -28,7 +28,7 @@
{{!-- Owned Features Tab --}} {{!-- Owned Features Tab --}}
<div class="tab features" data-group="primary" data-tab="features"> <div class="tab features" data-group="primary" data-tab="features">
{{> "systems/kids-on-brooms/templates/actor/parts/actor-npc-stats.html"}} {{> "systems/kidsonbrooms/templates/actor/parts/actor-npc-stats.html"}}
</div> </div>
</section> </section>
</form> </form>