Skip to content

Commit

Permalink
Added DM-only button to force close a note for all players
Browse files Browse the repository at this point in the history
  • Loading branch information
WillBrook29 committed Feb 23, 2025
1 parent 939b8e2 commit 5596136
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
12 changes: 12 additions & 0 deletions Journal.js
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,18 @@ class JournalManager{
});

visibility_container.append(popup_btn);

let force_close_popup_btn=$("<button>Force Close by Players</button>")

force_close_popup_btn.click(function(){
window.MB.sendMessage('custom/myVTT/note',{
id: id,
note:self.notes[id],
popup: false,
});
});

visibility_container.append(force_close_popup_btn);

let edit_btn=$("<button>Edit</button>");
edit_btn.click(function(){
Expand Down
9 changes: 6 additions & 3 deletions MessageBroker.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,10 +790,13 @@ class MessageBroker {

if(msg.data.id in window.TOKEN_OBJECTS){
window.TOKEN_OBJECTS[msg.data.id].place();
}
if(msg.data.popup)
}
const openNote = $(`.note[data-id='${msg.data.id}']`);
if(msg.data.popup){
window.JOURNAL.display_note(msg.data.id);
const openNote = $(`.note[data-id='${msg.data.id}']`);
}else {
openNote.remove();
}


if(window.JOURNAL.notes[msg.data.id].abilityTracker && openNote.length>0){
Expand Down
2 changes: 1 addition & 1 deletion abovevtt.css
Original file line number Diff line number Diff line change
Expand Up @@ -3970,7 +3970,7 @@ audio::-webkit-media-controls-time-remaining-display{
border: 1px solid #dddddd;
background: #e9e9e9;
padding: 5px;
width: 370px;
min-width: 370px;
margin-right: auto;
}
.visibility-container button {
Expand Down

0 comments on commit 5596136

Please sign in to comment.