Skip to content

Commit

Permalink
10.11 changes
Browse files Browse the repository at this point in the history
ironmonk88 committed May 14, 2023
1 parent 294832d commit 8983aa8
Showing 13 changed files with 180 additions and 18 deletions.
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## Version 10.11

Allow drag and drop of items to the assign loot dialog if there are no items there.

Fixed issues with the configure settings when Enhanced Journal is not installed

Use the last roll when using the key press to open the request roll dialog.

Fixed support for changes with Active Tiles.

Fixed issue with checking XP when there are two GMs in the game.

Fixed issues with some systems when checking for tools, if the actor isn't allowed items.

Fixed issue with default loot image.

Fixed issue with group actors and assigning XP.

## Version 10.10

Fixed issue where an alternate requested roll wasn't being reported correctly to the chat message
2 changes: 1 addition & 1 deletion apps/assignxp.js
Original file line number Diff line number Diff line change
@@ -341,7 +341,7 @@ export class AssignXP {
}
await message.setFlag('monks-tokenbar', 'actors', actors);
} else {
$(e.target).hide();
//$(e.target).hide();
MonksTokenBar.emit('assignxp', { actorid: actorid, msgid: message.id });
}
}
2 changes: 1 addition & 1 deletion apps/lootables.js
Original file line number Diff line number Diff line change
@@ -133,7 +133,7 @@ export class LootablesApp extends Application {
template: "./modules/monks-tokenbar/templates/lootables.html",
width: 500,
popOut: true,
dragDrop: [{ dropSelector: ".entry-list" }],
dragDrop: [{ dropSelector: ".dialog-content" }],
scrollY: [".entry-list"]
});
}
141 changes: 141 additions & 0 deletions css/tokenbar.css
Original file line number Diff line number Diff line change
@@ -1261,4 +1261,145 @@ a.inline-request-roll {
#assignexperience .sheet-body .items-list .item-list {
height: 200px;
overflow-y: auto;
}

/* Select with Folders */
.journal-select {
position: relative;
width: 100%;
height: 27px;
background: rgba(0, 0, 0, 0.05);
border: 1px solid #7a7971;
border-radius: 3px;
padding: 0 3px;
text-overflow: ellipsis;
}

.journal-select:focus {
box-shadow: 0 0 5px #ff0000;
outline: none;
}

.journal-select > div > span {
line-height: 26px !important;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: inline-block;
}

.journal-select > div > i {
flex: 0 0 12px;
text-align: center;
line-height: 24px;
font-size: 11px;
color: #000;
}

.journal-list {
display: none;
max-height: 250px;
overflow-y: auto;
margin: 0px 5px;
color: black;
position: absolute;
float: left;
left: -1px;
top: 100%;
background: url(../../../ui/parchment.jpg) repeat;
border: 1px solid #808080;
width: calc(100% + 2px);
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
list-style: none;
margin: 0;
padding: 0;
z-index: 100;
}

.scene-sheet .journal-list {
max-height: 250px;
}

.journal-select.open .journal-list,
.journal-list.open {
display: block;
}

.journal-list .journal-item .journal-title {
padding: 4px;
cursor: pointer;
min-height: 25px;
width: 100%;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.journal-list .journal-item.note-item .journal-title {
padding: 1px 4px;
overflow: hidden;
}

.journal-list .journal-item .journal-icon {
width: 30px;
height: 30px;
border-radius: 4px;
border: 2px solid #000000;
background: rgba(0, 0, 0, 0.4);
padding: 2px;
flex: 0 0 30px;
}

.journal-list .journal-item .journal-text {
line-height: 30px;
padding-left: 4px;
}

.journal-list .journal-item .journal-text.custom-text {
color: #333333;
}

.journal-list .journal-item:not(.folder):hover,
.journal-list .journal-item.selected {
background-color: #1e90ff;
color: #fff;
}

.journal-list .journal-item.folder > .journal-title {
background: rgba(0, 0, 0, 0.1);
font-weight: bold;
}

.journal-list .journal-item.folder > .journal-title:hover {
background: rgba(0, 0, 0, 0.3);
}

.journal-list .subfolder {
border-left: 4px solid #c0c0c0;
border-bottom: 4px solid #c0c0c0;
}

.journal-list .subfolder .journal-item {
margin-left: 5px;
}

.journal-list .journal-item.folder .journal-title i {
margin-right: 8px;
}

.journal-list .journal-item.folder.collapse .journal-title i.fa-folder-open:before {
content: '\f07b';
}

.journal-list .journal-item.folder.collapse > ul {
display: none;
}

.journal-select .journal-list .subfolder {
padding-left: 1px;
margin-top: 0px;
list-style-type: none;
margin-bottom: 0px;
}
1 change: 1 addition & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
@@ -237,6 +237,7 @@
"MonksTokenBar.IncreaseLevel": "Increase Level",
"MonksTokenBar.Creatures": "Creatures",
"MonksTokenBar.Tokenbar": "Tokenbar",
"MonksTokenBar.ReadyToUpdate": "{name} has enough xp to level up!",

"MonksTokenBar.None": "No one",
"MonksTokenBar.GMOnly": "GM Only",
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"title": "Monk's TokenBar",
"description": "Add a bar with all the current player tokens. Limit movement, roll saving throws, assign XP.",
"version": "10.10",
"version": "10.11",
"authors": [
{
"name": "IronMonk",
@@ -67,7 +67,7 @@
"css/tokenbar.css"
],
"url": "https://github.com/ironmonk88/monks-tokenbar",
"download": "https://github.com/ironmonk88/monks-tokenbar/archive/10.10.zip",
"download": "https://github.com/ironmonk88/monks-tokenbar/archive/10.11.zip",
"manifest": "https://github.com/ironmonk88/monks-tokenbar/releases/latest/download/module.json",
"bugs": "https://github.com/ironmonk88/monks-tokenbar/issues",
"allowBugReporter": true,
16 changes: 9 additions & 7 deletions monks-tokenbar.js
Original file line number Diff line number Diff line change
@@ -114,7 +114,9 @@ export class MonksTokenBar {
editable: [{ key: 'KeyR', modifiers: [KeyboardManager.MODIFIER_KEYS?.ALT] }],
restricted: true,
onDown: (data) => {
new SavingThrowApp().render(true);
let roll = game.user.getFlag("monks-tokenbar", "lastmodeST");
if (roll == "selfroll") roll = "blindroll";
new SavingThrowApp(null, { rollmode: roll }).render(true);
},
});

@@ -1232,7 +1234,7 @@ Hooks.on("setupTileActions", (app) => {
name: "Select Entity",
type: "select",
subtype: "entity",
options: { showToken: true, showWithin: true, showPlayers: true, showPrevious: true },
options: { show: ['token', 'within', 'players', 'previous'] },
restrict: (entity) => { return (entity instanceof Token); },
conditional: (app) => {
return !$('input[name="data.global"]', app.element).prop('checked');
@@ -1278,7 +1280,7 @@ Hooks.on("setupTileActions", (app) => {
name: "Select Entity",
type: "select",
subtype: "entity",
options: { showTile: false, showToken: true, showWithin: true, showPlayers: true, showPrevious: true, showTagger: true },
options: { show: ['tile', 'token', 'within', 'players', 'previous', 'tagger'] },
restrict: (entity) => { return (entity instanceof Token); }
},
{
@@ -1417,7 +1419,7 @@ Hooks.on("setupTileActions", (app) => {
type: "select",
subtype: "entity",
required: true,
options: { showTile: false, showToken: true, showWithin: true, showPlayers: true, showPrevious: true },
options: { show: ['tile', 'token', 'within', 'players', 'previous'] },
restrict: (entity) => { return (entity instanceof Token); },
defaultType: 'tokens',
placeholder: "Please select a token"
@@ -1435,7 +1437,7 @@ Hooks.on("setupTileActions", (app) => {
type: "select",
subtype: "entity",
required: true,
options: { showTile: false, showToken: true, showWithin: true, showPlayers: true },
options: { show: ['tile', 'token', 'within', 'players'] },
restrict: (entity) => { return (entity instanceof Token); },
defaultType: 'tokens',
placeholder: "Please select a token"
@@ -1617,7 +1619,7 @@ Hooks.on("setupTileActions", (app) => {
name: "Select Entity",
type: "select",
subtype: "entity",
options: { showTile: false, showToken: true, showWithin: true, showPlayers: true, showPrevious: true },
options: { show: ['tile', 'token', 'within', 'players', 'previous'] },
restrict: (entity) => { return (entity instanceof Token); }
},
{
@@ -1700,7 +1702,7 @@ Hooks.on("preUpdateChatMessage", (message, data, dif, userId) => {
});

Hooks.on("updateActor", (actor, data, dif, userId) => {
if (getProperty(data, "system.details.xp") != undefined) {
if (getProperty(data, "system.details.xp") != undefined && game.user.isTheGM) {
MonksTokenBar.system.checkXP(actor);
}
});
2 changes: 1 addition & 1 deletion systems/coc7-rolls.js
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ export class CoC7Rolls extends BaseRolls {
dynamicRequest(entries) {
let skills = {};
for (let entry of entries) {
for (let item of entry.token.actor?.items) {
for (let item of (entry.token.actor?.items || [])) {
if (item.type == 'skill') {
let sourceID = item.getFlag("core", "sourceId") || MonksTokenBar.slugify(item.name);
if (skills[sourceID] == undefined) {
4 changes: 2 additions & 2 deletions systems/dnd5e-rolls.js
Original file line number Diff line number Diff line change
@@ -66,7 +66,7 @@ export class DnD5eRolls extends BaseRolls {
}

getXP(actor) {
return actor?.system.details.xp;
return actor?.system?.details?.xp || 0;
}

calcXP(actors, monsters) {
@@ -116,7 +116,7 @@ export class DnD5eRolls extends BaseRolls {
let tools = {};

for (let entry of entries) {
for (let item of entry.token.actor?.items) {
for (let item of (entry.token.actor?.items || [])) {
if (item.type == 'tool') {
let sourceID = item.getFlag("core", "sourceId") || MonksTokenBar.slugify(item.name);
if (tools[sourceID] == undefined) {
2 changes: 1 addition & 1 deletion systems/pf2e-rolls.js
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ export class PF2eRolls extends BaseRolls {
let lore = {};
//get the first token's tools
for (let entry of entries) {
for (let item of entry.token.actor?.items) {
for (let item of (entry.token.actor?.items || [])) {
if (item.type == 'lore') {
let sourceID = MonksTokenBar.slugify(item.name);
if (lore[sourceID] == undefined) {
2 changes: 1 addition & 1 deletion systems/swade-rolls.js
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ export class SwadeRolls extends BaseRolls {
dynamicRequest(entries) {
let skills = {};
for (let entry of entries) {
for (let item of entry.token.actor?.items) {
for (let item of (entry.token.actor?.items || [])) {
if (item.type == 'skill') {
let sourceID = MonksTokenBar.slugify(item.name);
if (skills[sourceID] == undefined) {
2 changes: 1 addition & 1 deletion templates/levelup.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="monks-tokenbar level-up flexcol">
<div class="dialog-content">
{{ name }} has enough xp to level up!
{{localize 'MonksTokenBar.ReadyToUpdate' name=name}}
<form style="height:100%;">
<div class="form-group">
<label>{{localize 'MonksTokenBar.Level'}}: {{ level }}, ({{ xp }} XP)</label>
2 changes: 1 addition & 1 deletion templates/lootables.html
Original file line number Diff line number Diff line change
@@ -59,7 +59,7 @@ <h4 class="loot-entry-name">
<ul style="padding: 0px; margin: 0px;">
{{#each this.items}}
<li class="flexrow item" data-item-id="{{this.id}}">
<img class="loot-item-image" src="{{this.img}}" />
<img class="loot-item-image" src="{{this.img}}" onerror="$(this).css({visibility:'hidden'});" />
<span class="loot-item-name">{{this.name}}{{#if (gt this.sysQty 1)}} <small>(In qty of {{this.sysQty}})</small>{{/if}}</span>
<input class="loot-item-quantity" type="text" name="tokens.{{../id}}.items.{{this._id}}.quantity" value="{{this.quantity}}" />
<div class="flexrow" style="flex: 0 0 40px;margin: 0px 4px;line-height: 25px;">

0 comments on commit 8983aa8

Please sign in to comment.