Skip to content

Commit

Permalink
fix defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVauxs committed Jun 18, 2023
1 parent 141f243 commit ce13dff
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 25 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion packs/macros/CURRENT
Original file line number Diff line number Diff line change
@@ -1 +1 @@
MANIFEST-000018
MANIFEST-000022
16 changes: 8 additions & 8 deletions packs/macros/LOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
2023/06/18-19:27:36.992624 ffff74e7e160 Recovering log #16
2023/06/18-19:27:37.003088 ffff74e7e160 Delete type=0 #16
2023/06/18-19:27:37.003115 ffff74e7e160 Delete type=3 #14
2023/06/18-19:56:59.611723 fffe53fff160 Level-0 table #21: started
2023/06/18-19:56:59.611769 fffe53fff160 Level-0 table #21: 0 bytes OK
2023/06/18-19:56:59.614804 fffe53fff160 Delete type=0 #19
2023/06/18-19:56:59.620689 fffe53fff160 Manual compaction at level-0 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
2023/06/18-19:56:59.623407 fffe53fff160 Manual compaction at level-1 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
2023/06/18-20:55:59.886966 ffff7467d160 Recovering log #20
2023/06/18-20:55:59.895468 ffff7467d160 Delete type=3 #18
2023/06/18-20:55:59.895510 ffff7467d160 Delete type=0 #20
2023/06/18-21:00:33.833232 fffe53fff160 Level-0 table #25: started
2023/06/18-21:00:33.833300 fffe53fff160 Level-0 table #25: 0 bytes OK
2023/06/18-21:00:33.836508 fffe53fff160 Delete type=0 #23
2023/06/18-21:00:33.836644 fffe53fff160 Manual compaction at level-0 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
2023/06/18-21:00:33.836678 fffe53fff160 Manual compaction at level-1 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
16 changes: 8 additions & 8 deletions packs/macros/LOG.old
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
2023/06/18-18:52:47.336438 ffff7567f160 Recovering log #12
2023/06/18-18:52:47.348643 ffff7567f160 Delete type=0 #12
2023/06/18-18:52:47.348694 ffff7567f160 Delete type=3 #10
2023/06/18-19:26:57.867368 fffe53fff160 Level-0 table #17: started
2023/06/18-19:26:57.867411 fffe53fff160 Level-0 table #17: 0 bytes OK
2023/06/18-19:26:57.870206 fffe53fff160 Delete type=0 #15
2023/06/18-19:26:57.875841 fffe53fff160 Manual compaction at level-0 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
2023/06/18-19:26:57.876053 fffe53fff160 Manual compaction at level-1 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
2023/06/18-19:27:36.992624 ffff74e7e160 Recovering log #16
2023/06/18-19:27:37.003088 ffff74e7e160 Delete type=0 #16
2023/06/18-19:27:37.003115 ffff74e7e160 Delete type=3 #14
2023/06/18-19:56:59.611723 fffe53fff160 Level-0 table #21: started
2023/06/18-19:56:59.611769 fffe53fff160 Level-0 table #21: 0 bytes OK
2023/06/18-19:56:59.614804 fffe53fff160 Delete type=0 #19
2023/06/18-19:56:59.620689 fffe53fff160 Manual compaction at level-0 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
2023/06/18-19:56:59.623407 fffe53fff160 Manual compaction at level-1 from '!macros!Ix6ye8207xMySmjN' @ 72057594037927935 : 1 .. '!macros!mnKNj84r6ZmGZyX3' @ 0 : 0; will stop at (end)
Binary file not shown.
6 changes: 4 additions & 2 deletions src/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,13 @@ Hooks.once('init', () => {
});

Hooks.once('ready', () => {
if (game.settings.get(moduleID, 'sources') === 'none') {
if (game.settings.get(moduleID, 'sources').includes('none')) {
console.log('Foundry Summons | Selecting default sources');
selectDefaultSources();
}

if (game.settings.get(moduleID, 'indexFields') === 'none') {
if (game.settings.get(moduleID, 'indexFields').includes('none')) {
console.log('Foundry Summons | Selecting default index fields');
setDefaultIndexFields();
}

Expand Down
12 changes: 6 additions & 6 deletions src/settings/systemSpecific.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function selectDefaultSources() {
.map((x) => x.metadata)
.filter((x) => x.name === 'monsters');

game.settings.set(moduleID, 'sources', array);
gameSettings.getStore('sources').set(array);
break;
}
case 'pf2e': {
Expand All @@ -47,11 +47,11 @@ export function selectDefaultSources() {
.includes(x.id)
);

game.settings.set(moduleID, 'sources', array);
gameSettings.getStore('sources').set(array);
break;
}
default: {
game.settings.set(moduleID, 'sources', ['']);
gameSettings.getStore('sources').set(['']);
break;
}
}
Expand All @@ -63,15 +63,15 @@ export function selectDefaultSources() {
export function setDefaultIndexFields() {
switch (game.system.id) {
case 'dnd5e': {
game.settings.set(moduleID, 'indexFields', ['img']);
gameSettings.getStore('indexFields').set(['img']);
break;
}
case 'pf2e': {
game.settings.set(moduleID, 'indexFields', game.pf2e.compendiumBrowser.tabs.bestiary.index);
gameSettings.getStore('indexFields').set(game.pf2e.compendiumBrowser.tabs.bestiary.index);
break;
}
default: {
game.settings.set(moduleID, 'indexFields', ['']);
gameSettings.getStore('indexFields').set(['']);
break;
}
}
Expand Down

0 comments on commit ce13dff

Please sign in to comment.