Update layout.js

This commit is contained in:
Spicy_Marinara
2025-12-29 18:07:33 +01:00
parent 474e3ce963
commit 530d871fd3
+24 -8
View File
@@ -18,15 +18,31 @@ import { i18n } from '../../core/i18n.js';
* Toggles the visibility of plot buttons based on settings. * Toggles the visibility of plot buttons based on settings.
*/ */
export function togglePlotButtons() { export function togglePlotButtons() {
if (extensionSettings.enablePlotButtons && extensionSettings.enabled) { if (!extensionSettings.enabled) {
$('#rpg-plot-buttons').show(); $('#rpg-plot-buttons').hide();
return;
}
// Show/hide encounter button based on encounter settings // Show/hide plot progression buttons based on enablePlotButtons setting
if (extensionSettings.encounterSettings?.enabled) { if (extensionSettings.enablePlotButtons) {
$('#rpg-encounter-button').show(); $('#rpg-plot-random').show();
} else { $('#rpg-plot-natural').show();
$('#rpg-encounter-button').hide(); } else {
} $('#rpg-plot-random').hide();
$('#rpg-plot-natural').hide();
}
// Show/hide encounter button independently based on encounter settings
if (extensionSettings.encounterSettings?.enabled) {
$('#rpg-encounter-button').show();
} else {
$('#rpg-encounter-button').hide();
}
// Show the container if at least one button is visible
const shouldShowContainer = extensionSettings.enablePlotButtons || extensionSettings.encounterSettings?.enabled;
if (shouldShowContainer) {
$('#rpg-plot-buttons').show();
} else { } else {
$('#rpg-plot-buttons').hide(); $('#rpg-plot-buttons').hide();
} }