added item display, item rolling
This commit is contained in:
@@ -57,7 +57,7 @@ let WSconnected = false;
|
||||
async function analyzeWSmessage(msg){
|
||||
if (enableModule == false) return;
|
||||
const data = JSON.parse(msg);
|
||||
console.log("Received",data);
|
||||
// console.log("Received",data);
|
||||
|
||||
if (data.type == "connected" && data.data == "SD"){
|
||||
const msg = {
|
||||
|
||||
@@ -127,7 +127,13 @@ export class wfrp4e {
|
||||
|
||||
|
||||
getItemUses(item) {
|
||||
return {available: item.data.data.quantity};
|
||||
console.log("getItemUses(" , item , ")")
|
||||
if ( item.type == 'ammunition') {
|
||||
return {available: item.data.data.quantity.value};
|
||||
}
|
||||
else {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
10
src/token.js
10
src/token.js
@@ -741,7 +741,15 @@ export class TokenControl{
|
||||
items = this.sortItems(items);
|
||||
|
||||
const item = items[itemNr];
|
||||
if (item != undefined) item.roll();
|
||||
if (item != undefined) {
|
||||
if (game.system.id == 'wfrp4e') {
|
||||
console.log("rolling wfrp4e item macro")
|
||||
game.wfrp4e.utility.rollItemMacro(item.name, item.type, false);
|
||||
}
|
||||
else {
|
||||
item.roll();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user