Fix Save Roll button centering in dice popup

- Added margin-left and margin-right auto to center the button in desktop view
- Button now properly centers within the popup window when max-width is applied
This commit is contained in:
Spicy_Marinara
2025-10-17 00:11:24 +02:00
parent 84d2bad5ef
commit cc53c69af8
2 changed files with 12 additions and 9 deletions
+9 -8
View File
@@ -2275,7 +2275,7 @@ function generateTrackerInstructions(includeHtmlPrompt = true, includeContinuati
// Only add tracker instructions if at least one tracker is enabled // Only add tracker instructions if at least one tracker is enabled
if (hasAnyTrackers) { if (hasAnyTrackers) {
// Universal instruction header // Universal instruction header
instructions += `\nYou must start your response with an appropriate update to the trackers in EXACTLY the same format as below, enclosed in separate Markdown code fences. Replace X with proper numbers and placeholders in [brackets] with in-world details ${userName} perceives about the current scene and the present characters. Consider the last trackers in the conversation (if they exist). Manage them accordingly and realistically; raise, lower, change, or keep the values unchanged based on the user's actions, the passage of time, and logical consequences:\n`; instructions += `\nYou must start your response with an appropriate update to the trackers in EXACTLY the same format as below, enclosed in separate Markdown code fences. Replace X with proper numbers and placeholders in [brackets] (while removing the brackets themselves) with in-world details ${userName} perceives about the current scene and the present characters. Consider the last trackers in the conversation (if they exist). Manage them accordingly and realistically; raise, lower, change, or keep the values unchanged based on the user's actions, the passage of time, and logical consequences:\n`;
// Add format specifications for each enabled tracker // Add format specifications for each enabled tracker
if (extensionSettings.showUserStats) { if (extensionSettings.showUserStats) {
@@ -4151,6 +4151,7 @@ function onGenerationStarted(type, data) {
// console.log('[RPG Companion] enabled:', extensionSettings.enabled); // console.log('[RPG Companion] enabled:', extensionSettings.enabled);
// console.log('[RPG Companion] generationMode:', extensionSettings.generationMode); // console.log('[RPG Companion] generationMode:', extensionSettings.generationMode);
// console.log('[RPG Companion] ⚡ EVENT: onGenerationStarted - lastActionWasSwipe =', lastActionWasSwipe, '| isGenerating =', isGenerating); // console.log('[RPG Companion] ⚡ EVENT: onGenerationStarted - lastActionWasSwipe =', lastActionWasSwipe, '| isGenerating =', isGenerating);
// console.log('[RPG Companion] Committed Prompt:', committedTrackerData);
// Skip tracker injection for image generation requests // Skip tracker injection for image generation requests
if (data?.quietImage) { if (data?.quietImage) {
@@ -4215,7 +4216,7 @@ function onGenerationStarted(type, data) {
committedTrackerData.infoBox = lastGeneratedData.infoBox; committedTrackerData.infoBox = lastGeneratedData.infoBox;
committedTrackerData.characterThoughts = lastGeneratedData.characterThoughts; committedTrackerData.characterThoughts = lastGeneratedData.characterThoughts;
} else { } else {
// console.log('[RPG Companion] 🔄 TOGETHER MODE SWIPE: Using existing committedTrackerData (no commit)'); //console.log('[RPG Companion] 🔄 TOGETHER MODE SWIPE: Using existing committedTrackerData (no commit)');
} }
} }
@@ -4488,7 +4489,7 @@ async function onMessageReceived(data) {
// Note: No need to clear extension prompt since we used quiet_prompt option // Note: No need to clear extension prompt since we used quiet_prompt option
if (isPlotProgression) { if (isPlotProgression) {
isPlotProgression = false; isPlotProgression = false;
console.log('[RPG Companion] Plot progression generation completed'); // console.log('[RPG Companion] Plot progression generation completed');
} }
} }
@@ -4653,7 +4654,7 @@ async function ensureHtmlCleaningRegex() {
function updatePersonaAvatar() { function updatePersonaAvatar() {
const portraitImg = document.querySelector('.rpg-user-portrait'); const portraitImg = document.querySelector('.rpg-user-portrait');
if (!portraitImg) { if (!portraitImg) {
console.log('[RPG Companion] Portrait image element not found in DOM'); // console.log('[RPG Companion] Portrait image element not found in DOM');
return; return;
} }
@@ -4661,7 +4662,7 @@ function updatePersonaAvatar() {
const context = getContext(); const context = getContext();
const currentUserAvatar = context.user_avatar || user_avatar; const currentUserAvatar = context.user_avatar || user_avatar;
console.log('[RPG Companion] Attempting to update persona avatar:', currentUserAvatar); // console.log('[RPG Companion] Attempting to update persona avatar:', currentUserAvatar);
// Try to get a valid thumbnail URL using our safe helper // Try to get a valid thumbnail URL using our safe helper
if (currentUserAvatar) { if (currentUserAvatar) {
@@ -4670,14 +4671,14 @@ function updatePersonaAvatar() {
if (thumbnailUrl) { if (thumbnailUrl) {
// Only update the src if we got a valid URL // Only update the src if we got a valid URL
portraitImg.src = thumbnailUrl; portraitImg.src = thumbnailUrl;
console.log('[RPG Companion] Persona avatar updated successfully'); // console.log('[RPG Companion] Persona avatar updated successfully');
} else { } else {
// Don't update the src if we couldn't get a valid URL // Don't update the src if we couldn't get a valid URL
// This prevents 400 errors and keeps the existing image // This prevents 400 errors and keeps the existing image
console.warn('[RPG Companion] Could not get valid thumbnail URL for persona avatar, keeping existing image'); // console.warn('[RPG Companion] Could not get valid thumbnail URL for persona avatar, keeping existing image');
} }
} else { } else {
console.log('[RPG Companion] No user avatar configured, keeping existing image'); // console.log('[RPG Companion] No user avatar configured, keeping existing image');
} }
} }
+3 -1
View File
@@ -639,7 +639,7 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
} }
.rpg-inventory-items { .rpg-inventory-items {
font-size: clamp(0.4vw, 0.5vw, 0.6vw); font-size: clamp(0.7vw, 0.5vw, 0.6vw);
color: var(--rpg-text); color: var(--rpg-text);
line-height: 1.3; line-height: 1.3;
overflow-y: auto; overflow-y: auto;
@@ -2542,6 +2542,8 @@ body:has(.rpg-panel.rpg-position-left) #sheld {
.rpg-dice-save-btn { .rpg-dice-save-btn {
max-width: 200px; max-width: 200px;
margin-left: auto;
margin-right: auto;
} }
} }