Finished work on chat nameplate format settings.
This commit is contained in:
parent
6346b8f148
commit
cd5f168243
8 changed files with 94 additions and 5 deletions
|
|
@ -680,4 +680,24 @@ class chatBox{
|
|||
this.chatBuffer.scrollTop = this.chatBuffer.scrollHeight - Math.round(this.chatBuffer.getBoundingClientRect().height);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Re-render buffer from raw data (useful for settings changes)
|
||||
*/
|
||||
rerenderBuffer(){
|
||||
//Yank existing messages from buffer, converting nodelist to array to avoid annoying behavior in for loops
|
||||
const buffer = Array.from(this.chatBuffer.children);
|
||||
|
||||
//Iterate through all received messages
|
||||
for(const message of buffer){
|
||||
//Pull raw message data from saved message
|
||||
const rawData = JSON.parse(message.dataset.rawData);
|
||||
|
||||
//Nuke the message
|
||||
message.remove();
|
||||
|
||||
//Re-render chat out to the buffer
|
||||
this.displayChat(rawData);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue