updated some shit
This commit is contained in:
parent
f4e02337b4
commit
f07461bbb8
@ -31,7 +31,7 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
"scripts": [
|
||||
"esmodules": [
|
||||
"scripts/puckochat/main.js"
|
||||
],
|
||||
"url": "https://git.puckoprutt.tech/puckoprutt/puckoprutt-foundry-module",
|
||||
|
||||
@ -1,17 +1,17 @@
|
||||
import "scripts/puckochat/commands"
|
||||
import { puckocommand } from "commands"
|
||||
|
||||
Hooks.on("init", function() {
|
||||
Hooks.on("init", async function() {
|
||||
console.log("[puckoprutt] Hello Init");
|
||||
});
|
||||
|
||||
Hooks.on("ready", function() {
|
||||
Hooks.on("ready", async function() {
|
||||
console.log("[puckoprutt] Hello Ready");
|
||||
});
|
||||
|
||||
Hooks.on("chatMessage", (log, message, data) => {
|
||||
to_send = "";
|
||||
console.log("[puckoprutt] chat!");
|
||||
if(message[0] === "!") to_send = commands.puckocommand(log, message.slice(1).split(" "), data);
|
||||
if(message[0] === "!") to_send = puckocommand(isGM, user, world, log, message.slice(1).split(" "), data);
|
||||
|
||||
if(to_send !== "") {
|
||||
ChatMessage.create({
|
||||
|
||||
17
scripts/puckotheatre/talk_as.js
Normal file
17
scripts/puckotheatre/talk_as.js
Normal file
@ -0,0 +1,17 @@
|
||||
export async function talk_as(idx, name, theatre_idx, message, emote, delay=4500) {
|
||||
theatre.functions.activateStagedByID(theatre_idx);
|
||||
theatre._sendTypingEvent();
|
||||
theatre.setUserTyping(game.user.id, theatre.speakingAs);
|
||||
await new Promise(r => setTimeout(r, 800));
|
||||
theatre._sendTypingEvent();
|
||||
theatre.setUserTyping(game.user.id, theatre.speakingAs);
|
||||
theatre.setEmoteForInsertById(emote, "theatre-"+idx);
|
||||
await new Promise(r => setTimeout(r, 700));
|
||||
ChatMessage.create({
|
||||
user: game.user.id,
|
||||
speaker: ChatMessage.getSpeaker({token: canvas.tokens.objects.getChildByName(name)}),
|
||||
content: message
|
||||
});
|
||||
await new Promise(r => setTimeout(r, delay));
|
||||
theatre.setEmoteForInsertById("none", "theatre-"+idx);
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user