Skip to content

Commit 2ec523c

Browse files
committed
11.08 changes
1 parent 586c6fc commit 2ec523c

19 files changed

+73
-45
lines changed

CHANGELOG.md

+18
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,24 @@ Fixed issue when adjusting the shop prices not accepting decimal values.
8080

8181
Fixed issue with the transfer currency dialog not translating strings properly.
8282

83+
Fixed issue with PF2e labeling of Perception
84+
85+
Fixed issue where the quest rewards entry was getting the context menu for the main tab bar
86+
87+
Added the option when purchasing an item from the shop to store the price as the original price rather than the price the player actually bought it for. I'd highly recommend not using this as it can lead to a lot of strange economic issues where a player ends up being able to sell the item for more than they purchased it for. Use at your own risk.
88+
89+
Fixed issue with clearing all items before filling with item from a Roll Table.
90+
91+
Fixed issue where Encounter loot that's just currency was not being added to a loot entity.
92+
93+
Fixed issue with copying text to chat, or splitting text to a new journal entry in Firefox.
94+
95+
Fixed List sheet search.
96+
97+
Fixed issue deleting rewards.
98+
99+
Fixed type in the placeholder text for Folder name when creating a new List Folder.
100+
83101
# Version 11.05
84102

85103
Fixed issue with playing a slideshow when a scene loads.

apps/dc-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class DCConfig extends FormApplication {
3232
{ id: "skill", text: "MonksEnhancedJournal.Skill", groups: config.skills || config.pericias || skills }
3333
];
3434
if (game.system.id == "pf2e")
35-
attributeOptions.push({ id: "attribute", text: i18n("MonksTokenBar.Attribute"), groups: { perception: CONFIG.PF2E.attributes.perception } });
35+
attributeOptions.push({ id: "attribute", text: i18n("MonksTokenBar.Attribute"), groups: { perception: i18n("PF2E.PerceptionLabel") } });
3636

3737
attributeOptions = attributeOptions.filter(g => g.groups);
3838
for (let attr of attributeOptions) {

apps/encounter-template.js

-1
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,6 @@ export class EncounterTemplate extends MeasuredTemplate {
157157
const snapped = canvas.grid.getSnappedPosition(center.x, center.y, this.gridPrecision);
158158

159159
// Compute the ray
160-
console.log("Size Placement", origin, snapped);
161160
const ray = new Ray(origin, snapped);
162161
const ratio = (canvas.dimensions.size / canvas.dimensions.distance);
163162

apps/enhanced-journal.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1462,16 +1462,18 @@ export class EnhancedJournal extends Application {
14621462
}
14631463
]);
14641464

1465-
this._tabcontext = new ContextMenu(html, ".tab-bar", [
1465+
this._tabcontext = new ContextMenu(html, ".enhanced-journal-header .tab-bar", [
14661466
{
14671467
name: "Open outside Enhanced Journal",
14681468
icon: '<i class="fas fa-file-export"></i>',
14691469
condition: (li) => {
14701470
let tab = this.tabs.find(t => t.id == this.contextTab);
1471-
return !["blank", "folder"].includes(tab.type);
1471+
if (!tab) return false;
1472+
return !["blank", "folder"].includes(tab.entity?.type);
14721473
},
14731474
callback: async (li) => {
14741475
let tab = this.tabs.find(t => t.id == this.contextTab);
1476+
if (!tab) return;
14751477
let document = tab.entity;
14761478
if (!tab.entity) {
14771479
document = await fromUuid(tab.entityId);
@@ -1508,6 +1510,7 @@ export class EnhancedJournal extends Application {
15081510
this.tabs.splice(0, idx);
15091511
this.tabs.splice(1, this.tabs.length);
15101512
this.saveTabs();
1513+
this.render();
15111514
}
15121515
},
15131516
{
@@ -1517,6 +1520,7 @@ export class EnhancedJournal extends Application {
15171520
let idx = this.tabs.findIndex(t => t.id == this.contextTab);
15181521
this.tabs.splice(idx + 1, this.tabs.length);
15191522
this.saveTabs();
1523+
this.render();
15201524
}
15211525
}
15221526
]);

lang/en.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"MonksEnhancedJournal.show-chat-bubbles.name": "Show chat bubbles",
6868
"MonksEnhancedJournal.show-chat-bubbles.hint": "Show chat bubbles when clicking on a Note or Token that's linked to a Journal",
6969
"MonksEnhancedJournal.objectives-always.name": "Always Show Objectives",
70-
"MonksEnhancedJournal.objectives-always.hint": "Show Objectives even if the Notes layer isn't active'",
70+
"MonksEnhancedJournal.objectives-always.hint": "Show Objectives even if the Notes layer isn't active",
7171
"MonksEnhancedJournal.loot-name.name": "Loot Name",
7272
"MonksEnhancedJournal.loot-name.hint": "This name will be used when creating the new entry.",
7373
"MonksEnhancedJournal.add-create-link.name": "Add Create Link",
@@ -80,6 +80,8 @@
8080
"MonksEnhancedJournal.defaultprices.hint": "Default prices for shops",
8181
"MonksEnhancedJournal.customise-pages.name": "Customise Pages",
8282
"MonksEnhancedJournal.customise-pages.hint": "Customise the pages that are shown in the journal",
83+
"MonksEnhancedJournal.use-generic-price.name": "Use Original Price",
84+
"MonksEnhancedJournal.use-generic-price.hint": "After purchasing, set price of purchased item to the original non-adjusted price",
8385

8486
"MonksEnhancedJournal.SlideConfiguration": "Slide Configuration",
8587
"MonksEnhancedJournal.DCConfiguration": "DC Configuration",

module.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Monk's Enhanced Journal",
33
"description": "Treat the journal like it's going to be popped out and used as a digital guide book. Add extra information to summarize an encounter. Show summaries of people and places. Allow for bookmarking of commonly used pages",
4-
"version": "11.07.1",
4+
"version": "11.07.3",
55
"authors": [
66
{
77
"name": "IronMonk",
@@ -95,7 +95,7 @@
9595
"css/apsjournal.css"
9696
],
9797
"url": "https://github.com/ironmonk88/monks-enhanced-journal",
98-
"download": "https://github.com/ironmonk88/monks-enhanced-journal/archive/11.07.1.zip",
98+
"download": "https://github.com/ironmonk88/monks-enhanced-journal/archive/11.07.3.zip",
9999
"manifest": "https://github.com/ironmonk88/monks-enhanced-journal/releases/latest/download/module.json",
100100
"bugs": "https://github.com/ironmonk88/monks-enhanced-journal/issues",
101101
"allowBugReporter": true,

monks-enhanced-journal.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -2065,7 +2065,7 @@ export class MonksEnhancedJournal {
20652065
let settings = setting('sheet-settings');
20662066

20672067
let adjustmentDefaults = setting('adjustment-defaults');
2068-
setProperty(settings, "shop.adjustment", mergeObject(settings.shop.adjustment, adjustmentDefaults));
2068+
setProperty(settings, "shop.adjustment", mergeObject((settings?.shop?.adjustment || {}), adjustmentDefaults));
20692069

20702070
let personDefaults = setting('person-attributes');
20712071
//use reduce to turn the array into an object
@@ -3567,7 +3567,7 @@ export class MonksEnhancedJournal {
35673567
}
35683568
let itemQty = getValue(itemData, quantityname(), 1);
35693569
setValue(itemData, quantityname(), purchaseQty * itemQty);
3570-
if (data.sell > 0)
3570+
if (data.sell > 0 && !setting("use-generic-price"))
35713571
setPrice(itemData, pricename(), data.sell + " " + data.currency);
35723572
delete itemData._id;
35733573
if (!data.consumable) {
@@ -4364,7 +4364,8 @@ Hooks.on('dropActorSheetData', (actor, sheet, data) => {
43644364
let itemQty = Number(getValue(data.data, quantityname()));
43654365
if (isNaN(itemQty)) itemQty = 1;
43664366
setValue(data.data, quantityname(), result.quantity * itemQty);
4367-
setPrice(data.data, pricename(), result.price);
4367+
if (!setting("use-generic-price"))
4368+
setPrice(data.data, pricename(), result.price);
43684369
data.uuid = `${data.uuid}${data.rewardId ? `.Rewards.${data.rewardId}` : ""}.Items.${data.itemId}`;
43694370
if (sheet._onDropItem && game.system.id != "cyphersystem")
43704371
sheet._onDropItem({ preventDefault: () => { } }, data);

monks-enhanced-journal.zip

22.6 KB
Binary file not shown.

settings.js

+9-8
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,6 @@ export const registerSettings = function () {
8787
type: EditCurrency
8888
});
8989

90-
game.settings.registerMenu(modulename, 'defaultPrices', {
91-
label: i18n("MonksEnhancedJournal.defaultprices.name"),
92-
hint: i18n("MonksEnhancedJournal.defaultprices.hint"),
93-
icon: 'fas fa-dollar-sign',
94-
restricted: true,
95-
type: AdjustPrice
96-
});
97-
9890
game.settings.registerMenu(modulename, 'customise-pages', {
9991
label: i18n("MonksEnhancedJournal.customise-pages.name"),
10092
hint: i18n("MonksEnhancedJournal.customise-pages.hint"),
@@ -403,6 +395,15 @@ export const registerSettings = function () {
403395
type: Boolean,
404396
});
405397

398+
game.settings.register(modulename, "use-generic-price", {
399+
name: i18n("MonksEnhancedJournal.use-generic-price.name"),
400+
hint: i18n("MonksEnhancedJournal.use-generic-price.hint"),
401+
scope: "world",
402+
config: true,
403+
default: false,
404+
type: Boolean,
405+
});
406+
406407
game.settings.register(modulename, "loot-sheet", {
407408
name: game.i18n.localize("MonksEnhancedJournal.loot-sheet.name"),
408409
hint: game.i18n.localize("MonksEnhancedJournal.loot-sheet.hint"),

sheets/EncounterSheet.js

-1
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,6 @@ export class EncounterSheet extends EnhancedJournalSheet {
467467
}
468468

469469
let newSpot = MonksEnhancedJournal.findVacantSpot(template, { width: actor.prototypeToken.width, height: actor.prototypeToken.height }, tokens, data.center || options.center);
470-
log("Encounter, New Spot", newSpot);
471470
let td = await actor.getTokenDocument({ x: newSpot.x, y: newSpot.y, hidden: ea.hidden });
472471
//if (ea.hidden)
473472
// td.hidden = true;

sheets/EnhancedJournalSheet.js

+14-11
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ export class EnhancedJournalSheet extends JournalPageSheet {
329329
super.activateListeners(html);
330330
this._contextMenu(html);
331331

332-
new EnhancedJournalContextMenu($(html), (this.type == "text" ? ".editor-parent" : ".tab.description .tab-inner"), this._getDescriptionContextOptions());
332+
new EnhancedJournalContextMenu($(html), (this.constructor.type == "text" ? ".editor-parent" : ".tab.description .tab-inner"), this._getDescriptionContextOptions());
333333

334334
$("a.picture-link", html).click(MonksEnhancedJournal._onClickPictureLink.bind(this));
335335
$("img:not(.nopopout)", html).click(this._onClickImage.bind(this));
@@ -1055,7 +1055,8 @@ export class EnhancedJournalSheet extends JournalPageSheet {
10551055
let ctrls = [];
10561056
if (this.object.id)
10571057
ctrls.push({ id: 'locate', text: i18n("SIDEBAR.JumpPin"), icon: 'fa-crosshairs', conditional: game.user.isGM, attr: { "page-id": this.object.id, "journal-id": this.object.parent.id }, callback: this.enhancedjournal.findMapEntry.bind(this) });
1058-
if ((game.settings.settings.get("monks-enhanced-journal.sheet-settings")?.default || {})[this.constructor.type] != undefined)
1058+
let defaultSettings = (game.settings.settings.get("monks-enhanced-journal.sheet-settings")?.default || {})[this.constructor.type];
1059+
if (defaultSettings != undefined && Object.keys(defaultSettings).length > 0)
10591060
ctrls.push({ id: 'settings', text: i18n("MonksEnhancedJournal.EditFields"), icon: 'fa-cog', conditional: game.user.isGM, callback: this.onEditFields });
10601061
return ctrls;
10611062
}
@@ -1802,17 +1803,18 @@ export class EnhancedJournalSheet extends JournalPageSheet {
18021803
numberof = await getDiceRoll(numberof);
18031804

18041805
let items = that.object.getFlag('monks-enhanced-journal', "items") || [];
1805-
if (clear == "all")
1806-
items = [];
1807-
else if (clear == "notlocked")
1808-
items = items.filter((i) => getProperty(i, "flags.monks-enhanced-journal.lock"));
18091806

18101807
if (that.object.getFlag('monks-enhanced-journal', "type") == "quest") {
18111808
let rewardId = that.object.getFlag('monks-enhanced-journal', "reward");
18121809
let rewards = that.object.getFlag('monks-enhanced-journal', "rewards");
18131810
let reward = rewards.find(r => r.id == rewardId || r.active);
18141811
items = reward.items;
18151812
}
1813+
if (clear == "all")
1814+
items = [];
1815+
else if (clear == "notlocked")
1816+
items = items.filter((i) => getProperty(i, "flags.monks-enhanced-journal.lock"));
1817+
18161818
let currency = that.object.getFlag('monks-enhanced-journal', "currency") || {};
18171819
let currChanged = false;
18181820

@@ -1922,8 +1924,8 @@ export class EnhancedJournalSheet extends JournalPageSheet {
19221924
itemData._id = makeid();
19231925
let sysPrice = MEJHelpers.getSystemPrice(itemData, pricename());
19241926
let price = MEJHelpers.getPrice(sysPrice);
1925-
let adjustment = this.sheetSettings()?.adjustment;
1926-
let sell = adjustment[itemData.type]?.sell ?? adjustment.default.sell ?? 1;
1927+
let adjustment = this.sheetSettings()?.adjustment || {};
1928+
let sell = adjustment[itemData.type]?.sell ?? adjustment?.default?.sell ?? 1;
19271929
let cost = MEJHelpers.getPrice(`${price.value * sell} ${price.currency}`);
19281930
itemData.flags['monks-enhanced-journal'] = {
19291931
parentId: oldId,
@@ -2184,7 +2186,8 @@ export class EnhancedJournalSheet extends JournalPageSheet {
21842186

21852187
if (newitems.length == 0) {
21862188
ui.notifications.warn(i18n("MonksEnhancedJournal.msg.NoItemsToAssign"));
2187-
return items;
2189+
if (!Object.values(currency).some(c => !!c))
2190+
return items;
21882191
}
21892192

21902193
let entity;
@@ -2717,7 +2720,7 @@ export class EnhancedJournalSheet extends JournalPageSheet {
27172720
}
27182721

27192722
async splitJournal() {
2720-
let ctrl = window.getSelection().baseNode?.parentNode;
2723+
let ctrl = window.getSelection().baseNode?.parentNode || window.getSelection().anchorNode?.parentNode;
27212724

27222725
if (ctrl == undefined) {
27232726
ui.notifications.info(i18n("MonksEnhancedJournal.NoTextSelected"));
@@ -2763,7 +2766,7 @@ export class EnhancedJournalSheet extends JournalPageSheet {
27632766
}
27642767

27652768
async copyToChat() {
2766-
let ctrl = window.getSelection().baseNode?.parentNode;
2769+
let ctrl = window.getSelection().baseNode?.parentNode || window.getSelection().anchorNode?.parentNode;
27672770

27682771
if (ctrl == undefined) {
27692772
ui.notifications.info(i18n("MonksEnhancedJournal.NoTextSelected"));

sheets/ListSheet.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class ListSheet extends EnhancedJournalSheet {
186186

187187
// Match document names
188188
for ( let d of this.items ) {
189-
if ( rgx.test(SearchFilter.cleanQuery(d.data.text)) ) {
189+
if ((d.data.text && rgx.test(SearchFilter.cleanQuery(d.data.text))) || (d.data.title && rgx.test(SearchFilter.cleanQuery(d.data.title)) )) {
190190
documentIds.add(d.id);
191191
if ( d.data.folder ) folderIds.add(d.data.folder);
192192
}
@@ -240,7 +240,7 @@ export class ListSheet extends EnhancedJournalSheet {
240240

241241
// Folder-level events
242242
html.find('.create-item').click((ev) => {
243-
let folderId = ev.currentTarget.closest("li.folder").dataset.folderId;
243+
let folderId = ev.currentTarget.closest("li.folder")?.dataset?.folderId;
244244
new ListEdit({ data: { folder: folderId } }, this).render(true, { focus: true });
245245
ev.preventDefault();
246246
ev.stopPropagation();

sheets/PersonSheet.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ export class PersonSheet extends EnhancedJournalSheet {
106106
fieldlist() {
107107
let settings = this.sheetSettings() || {};
108108
let fields = MonksEnhancedJournal.convertObjectToArray(settings)?.attributes;
109-
let attributes = this.object.flags['monks-enhanced-journal'].attributes;
109+
let attributes = this.object.flags['monks-enhanced-journal'].attributes || {};
110110
return fields
111111
.filter(f => f.shown)
112112
.map(f => {

sheets/PlaceSheet.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export class PlaceSheet extends EnhancedJournalSheet {
139139
fieldlist() {
140140
let settings = this.sheetSettings() || {};
141141
let fields = MonksEnhancedJournal.convertObjectToArray(settings)?.attributes;
142-
let attributes = this.object.flags['monks-enhanced-journal'].attributes;
142+
let attributes = this.object.flags['monks-enhanced-journal'].attributes || {};
143143
return fields
144144
.filter(f => f.shown)
145145
.map(f => {

sheets/QuestSheet.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,12 +383,12 @@ export class QuestSheet extends EnhancedJournalSheet {
383383
this.changeReward(reward.id);
384384
}
385385

386-
deleteReward(event) {
386+
async deleteReward(event) {
387387
let id = $(event.currentTarget).closest('.reward-tab').data('rewardId');
388388

389389
let rewards = duplicate(this.getRewardData());
390390
rewards.findSplice(r => r.id == id);
391-
this.object.setFlag('monks-enhanced-journal', 'rewards', rewards);
391+
await this.object.setFlag('monks-enhanced-journal', 'rewards', rewards);
392392
//$('.reward-list .journal-tab[data-reward-id="' + id + '"]').remove();
393393

394394
if (id == this.object.getFlag('monks-enhanced-journal', 'reward')) {

0 commit comments

Comments
 (0)