Fix A/N and CFG menus on first in the list
| @@ -389,7 +389,11 @@ export function setFloatingPrompt() { | ||
| 389 | 389 | } |
| 390 | 390 | |
| 391 | 391 | function onANMenuItemClick() { |
| 392 | 392 | if (!selected_group ||&& this_chid === undefined) { |
| 393 | + toastr.warning(t`Select a character before trying to use Author's Note`, '', { timeOut: 2000 }); | |
| 394 | + return; | |
| 395 | + } | |
| 396 | + | |
| 393 | 397 | //show AN if it's hidden |
| 394 | 398 | if ($('#floatingPrompt').css('display') !== 'flex') { |
| 395 | 399 | $('#floatingPrompt').addClass('resizing'); |
| @@ -416,22 +420,18 @@ function onANMenuItemClick() { | ||
| 416 | 420 | $('#floatingPrompt').transition({ |
| 417 | 421 | opacity: 0.0, |
| 418 | 422 | duration: animation_duration, |
| 419 | - }, | |
| 423 | + }, async function () { | |
| 420 | - async function () { | |
| 421 | 424 | await delay(50); |
| 422 | 425 | $('#floatingPrompt').removeClass('resizing'); |
| 423 | 426 | }); |
| 424 | 427 | setTimeout(function () { |
| 425 | 428 | $('#floatingPrompt').hide(); |
| 426 | 429 | }, animation_duration); |
| 427 | - | |
| 428 | 430 | } |
| 431 | + | |
| 429 | 432 | //duplicate options menu close handler from script.js |
| 430 | 433 | //because this listener takes priority |
| 431 | 434 | $('#options').stop().fadeOut(animation_duration); |
| 432 | - } else { | |
| 433 | - toastr.warning(t`Select a character before trying to use Author's Note`, '', { timeOut: 2000 }); | |
| 434 | - } | |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | async function onChatChanged() { |
| @@ -69,8 +69,7 @@ function setCharCfg(tempValue, setting) { | ||
| 69 | 69 | if (!existingCharaCfg.useChara && |
| 70 | 70 | (tempAssign.guidance_scale ?? 1.00) === 1.00 && |
| 71 | 71 | (tempAssign.negative_prompt?.length ?? 0) === 0 && |
| 72 | 72 | (tempAssign.positive_prompt?.length ?? 0) === 0) { |
| 73 | - { | |
| 74 | 73 | extension_settings.cfg.chara.splice(existingCharaCfgIndex, 1); |
| 75 | 74 | } |
| 76 | 75 | } else if (avatarName && tempValue.length > 0) { |
| @@ -113,7 +112,11 @@ function setChatCfg(tempValue, setting) { | ||
| 113 | 112 | |
| 114 | 113 | // TODO: Only change CFG when character is selected |
| 115 | 114 | function onCfgMenuItemClick() { |
| 116 | 115 | if (!selected_group ||&& this_chid === undefined) { |
| 116 | + toastr.warning('Select a character before trying to configure CFG', '', { timeOut: 2000 }); | |
| 117 | + return; | |
| 118 | + } | |
| 119 | + | |
| 117 | 120 | //show CFG config if it's hidden |
| 118 | 121 | if ($('#cfgConfig').css('display') !== 'flex') { |
| 119 | 122 | $('#cfgConfig').addClass('resizing'); |
| @@ -140,8 +143,7 @@ function onCfgMenuItemClick() { | ||
| 140 | 143 | $('#cfgConfig').transition({ |
| 141 | 144 | opacity: 0.0, |
| 142 | 145 | duration: animation_duration, |
| 143 | - }, | |
| 146 | + }, async function () { | |
| 144 | - async function () { | |
| 145 | 147 | await delay(50); |
| 146 | 148 | $('#cfgConfig').removeClass('resizing'); |
| 147 | 149 | }); |
| @@ -153,9 +155,6 @@ function onCfgMenuItemClick() { | ||
| 153 | 155 | //duplicate options menu close handler from script.js |
| 154 | 156 | //because this listener takes priority |
| 155 | 157 | $('#options').stop().fadeOut(animation_duration); |
| 156 | - } else { | |
| 157 | - toastr.warning('Select a character before trying to configure CFG', '', { timeOut: 2000 }); | |
| 158 | - } | |
| 159 | 158 | } |
| 160 | 159 | |
| 161 | 160 | async function onChatChanged() { |