diff --git a/bot/static/index.html b/bot/static/index.html index 6b3b492..badec3a 100644 --- a/bot/static/index.html +++ b/bot/static/index.html @@ -690,20 +690,7 @@
@@ -1408,19 +1395,6 @@
Choose Miku's emotional state for this conversation @@ -1990,6 +1964,7 @@ document.addEventListener('DOMContentLoaded', function() { // Load initial data loadStatus(); loadServers(); + populateMoodDropdowns(); // Populate DM and chat mood dropdowns immediately loadLastPrompt(); loadLogs(); checkEvilModeStatus(); @@ -2465,8 +2440,35 @@ async function populateMoodDropdowns() { if (data.moods) { console.log(`🎭 Found ${data.moods.length} moods:`, data.moods); + const emojiMap = evilMode ? EVIL_MOOD_EMOJIS : MOOD_EMOJIS; - // Clear existing mood options from all dropdowns (keep "Select Mood..." option) + // Populate the DM mood dropdown (#mood on tab1) + const dmMoodSelect = document.getElementById('mood'); + if (dmMoodSelect) { + dmMoodSelect.innerHTML = ''; + data.moods.forEach(mood => { + const opt = document.createElement('option'); + opt.value = mood; + opt.textContent = `${emojiMap[mood] || ''} ${mood}`.trim(); + if (mood === 'neutral') opt.selected = true; + dmMoodSelect.appendChild(opt); + }); + } + + // Populate the chat mood dropdown (#chat-mood-select on tab7) + const chatMoodSelect = document.getElementById('chat-mood-select'); + if (chatMoodSelect) { + chatMoodSelect.innerHTML = ''; + data.moods.forEach(mood => { + const opt = document.createElement('option'); + opt.value = mood; + opt.textContent = `${emojiMap[mood] || ''} ${mood}`.trim(); + if (mood === 'neutral') opt.selected = true; + chatMoodSelect.appendChild(opt); + }); + } + + // Populate per-server mood dropdowns (mood-select-{guildId}) document.querySelectorAll('[id^="mood-select-"]').forEach(select => { // Keep only the first option ("Select Mood...") while (select.children.length > 1) { @@ -2474,19 +2476,17 @@ async function populateMoodDropdowns() { } }); - // Update all mood dropdowns data.moods.forEach(mood => { const moodOption = document.createElement('option'); moodOption.value = mood; - moodOption.textContent = `${mood} ${MOOD_EMOJIS[mood] || ''}`; + moodOption.textContent = `${mood} ${emojiMap[mood] || ''}`; - // Add to all mood dropdowns document.querySelectorAll('[id^="mood-select-"]').forEach(select => { select.appendChild(moodOption.cloneNode(true)); }); }); - console.log('🎭 Mood dropdowns populated successfully'); + console.log('🎭 All mood dropdowns populated successfully'); } else { console.warn('🎭 No moods found in response'); }