Finished work on chat nameplate format settings.

This commit is contained in:
rainbow napkin 2026-10-14 04:34:30 -04:00
parent 6346b8f148
commit cd5f168243
8 changed files with 94 additions and 5 deletions

View file

@ -62,6 +62,11 @@ class settingsPanel extends panelObj{
*/
this.theme = this.panelDocument.querySelector("#settings-panel-theme");
/**
* Chat nameplate format
*/
this.nameplateFormat = this.panelDocument.querySelector("#settings-panel-nameplate-format");
/**
* Chat Width Minimum while Size-Locked to Media Aspect Ratio
*/
@ -144,6 +149,7 @@ class settingsPanel extends panelObj{
this.liveSyncTolerance.addEventListener('change', this.updateLiveSyncTolerance.bind(this));
this.syncDelta.addEventListener('change', this.updateSyncDelta.bind(this));
this.theme.addEventListener('change', this.updateTheme.bind(this));
this.nameplateFormat.addEventListener('change', this.updateNameplateFormat.bind(this));
this.chatWidthMinimum.addEventListener('change', this.updateChatWidthMinimum.bind(this));
this.disablePortrait.addEventListener('change', this.updateDisablePortrait.bind(this));
this.disableSendButton.addEventListener('change', this.updateDisableSendButton.bind(this));
@ -163,6 +169,7 @@ class settingsPanel extends panelObj{
this.liveSyncTolerance.value = localStorage.getItem("liveSyncTolerance");
this.syncDelta.value = localStorage.getItem("syncDelta");
this.theme.querySelector('select').value = localStorage.getItem("theme");
this.nameplateFormat.querySelector('select').value = localStorage.getItem("nameplateFormat");
this.chatWidthMinimum.value = localStorage.getItem("chatWidthMin");
this.disablePortrait.checked = localStorage.getItem("disablePortrait") == 'true';
this.disableSendButton.checked = localStorage.getItem("disableSendButton") == 'true';
@ -261,6 +268,15 @@ class settingsPanel extends panelObj{
client.processConfig("theme", theme);
}
/**
* Update nameplate format
*/
updateNameplateFormat(){
let format = this.nameplateFormat.querySelector('select').value;
localStorage.setItem("nameplateFormat", format);
client.processConfig("nameplateFormat", format);
}
/**
* Handles Chat Width minimum Changes
*/