v3.5.0: Weather effects improvements and dice roll fixes

- Refactor weather effects toggles to radio buttons in settings
  - Replace weatherEffectsForeground with weatherBackground/weatherForeground
  - Add Background/Foreground position options as radio toggles
  - Remove weather foreground toggle from main panel
- Fix dice roll to work independently of RPG attributes
  - Dice rolls now sent regardless of attribute settings
  - Adjust prompt wording based on whether attributes are enabled
- Improve History Persistence UI styling
  - Update input/select CSS to match tracker editor
  - Fix alignment issues
- Add theme-based radio button styling
  - Radio buttons now use theme colors instead of default blue
  - Support for all themes (default, sci-fi, fantasy, cyberpunk, custom)
- Update weather effects z-index logic for both modes
- Bump version to v3.5.0
This commit is contained in:
Spicy_Marinara
2026-01-11 20:05:35 +01:00
parent 46e6de0eba
commit c614f7b8dc
9 changed files with 225 additions and 43 deletions
+29 -14
View File
@@ -392,21 +392,30 @@ export function generateTrackerInstructions(includeHtmlPrompt = true, includeCon
// Include attributes based on settings (only if includeAttributes is true)
if (includeAttributes) {
const alwaysSendAttributes = trackerConfig?.userStats?.alwaysSendAttributes;
const shouldSendAttributes = alwaysSendAttributes || extensionSettings.lastDiceRoll;
const showRPGAttributes = trackerConfig?.userStats?.showRPGAttributes !== false;
const shouldSendAttributes = alwaysSendAttributes && showRPGAttributes;
if (shouldSendAttributes) {
const attributesString = buildAttributesString();
instructions += `${userName}'s attributes: ${attributesString}\n`;
// Add dice roll context if there was one
if (extensionSettings.lastDiceRoll) {
const roll = extensionSettings.lastDiceRoll;
instructions += `${userName} rolled ${roll.total} on the last ${roll.formula} roll. Based on their attributes, decide whether they succeeded or failed the action they attempted.\n\n`;
} else {
instructions += `\n`;
}
}
}
// Add dice roll context if there was one (independent of attributes)
if (extensionSettings.lastDiceRoll) {
const roll = extensionSettings.lastDiceRoll;
const showRPGAttributes = trackerConfig?.userStats?.showRPGAttributes !== false;
const alwaysSendAttributes = trackerConfig?.userStats?.alwaysSendAttributes;
const hasAttributes = includeAttributes && (alwaysSendAttributes && showRPGAttributes);
if (hasAttributes) {
instructions += `${userName} rolled ${roll.total} on the last ${roll.formula} roll. Based on their attributes, decide whether they succeeded or failed the action they attempted.\n\n`;
} else {
instructions += `${userName} rolled ${roll.total} on the last ${roll.formula} roll. Decide whether they succeeded or failed the action they attempted.\n\n`;
}
} else if (includeAttributes && trackerConfig?.userStats?.alwaysSendAttributes && trackerConfig?.userStats?.showRPGAttributes !== false) {
instructions += `\n`;
}
}
// Append HTML prompt if enabled AND includeHtmlPrompt is true
@@ -990,19 +999,25 @@ export function generateContextualSummary() {
// Include attributes based on settings
const alwaysSendAttributes = trackerConfig?.userStats?.alwaysSendAttributes;
const shouldSendAttributes = alwaysSendAttributes || extensionSettings.lastDiceRoll;
const showRPGAttributes = trackerConfig?.userStats?.showRPGAttributes !== false;
const shouldSendAttributes = alwaysSendAttributes && showRPGAttributes;
if (shouldSendAttributes) {
const attributesString = buildAttributesString();
summary += `${userName}'s attributes: ${attributesString}\n`;
}
// Add dice roll context if there was one
if (extensionSettings.lastDiceRoll) {
const roll = extensionSettings.lastDiceRoll;
// Add dice roll context if there was one (independent of attributes)
if (extensionSettings.lastDiceRoll) {
const roll = extensionSettings.lastDiceRoll;
if (shouldSendAttributes) {
summary += `${userName} rolled ${roll.total} on the last ${roll.formula} roll. Based on their attributes, decide whether they succeeded or failed the action they attempted.\n\n`;
} else {
summary += `\n`;
summary += `${userName} rolled ${roll.total} on the last ${roll.formula} roll. Decide whether they succeeded or failed the action they attempted.\n\n`;
}
} else if (shouldSendAttributes) {
summary += `\n`;
}
return summary.trim();
-3
View File
@@ -143,7 +143,6 @@ export function updateFeatureTogglesVisibility() {
const $spotifyToggle = $('#rpg-spotify-toggle-wrapper');
const $dynamicWeatherToggle = $('#rpg-dynamic-weather-toggle-wrapper');
const $weatherForegroundToggle = $('#rpg-weather-foreground-toggle-wrapper');
const $narratorToggle = $('#rpg-narrator-toggle-wrapper');
const $autoAvatarsToggle = $('#rpg-auto-avatars-toggle-wrapper');
@@ -155,8 +154,6 @@ export function updateFeatureTogglesVisibility() {
$spotifyToggle.toggle(extensionSettings.showSpotifyToggle);
$dynamicWeatherToggle.toggle(extensionSettings.showDynamicWeatherToggle);
// Weather foreground toggle is only shown when dynamic weather toggle is visible
$weatherForegroundToggle.toggle(extensionSettings.showDynamicWeatherToggle);
$narratorToggle.toggle(extensionSettings.showNarratorMode);
$autoAvatarsToggle.toggle(extensionSettings.showAutoAvatars);
+8 -3
View File
@@ -270,9 +270,14 @@ export function updateWeatherEffect() {
}
if (weatherContainer) {
// Apply foreground z-index if experimental setting is enabled
if (extensionSettings.weatherEffectsForeground) {
weatherContainer.style.zIndex = '9998';
// Apply z-index based on background/foreground settings
if (extensionSettings.weatherForeground) {
weatherContainer.style.zIndex = '9998'; // In front of chat
} else if (extensionSettings.weatherBackground) {
weatherContainer.style.zIndex = '1'; // Behind chat (default)
} else {
// Both disabled - don't show weather
return;
}
document.body.appendChild(weatherContainer);