add background image name reporting for /bg with no args

This commit is contained in:
RossAscends 2024-04-12 08:21:17 +09:00
parent afeaca0fe0
commit 94f14340ae
1 changed files with 4 additions and 1 deletions

View File

@ -49,6 +49,7 @@ import { textgen_types, textgenerationwebui_settings } from './textgen-settings.
import { decodeTextTokens, getFriendlyTokenizerName, getTextTokens, getTokenCount } from './tokenizers.js'; import { decodeTextTokens, getFriendlyTokenizerName, getTextTokens, getTokenCount } from './tokenizers.js';
import { delay, isFalseBoolean, isTrueBoolean, stringToRange, trimToEndSentence, trimToStartSentence, waitUntilCondition } from './utils.js'; import { delay, isFalseBoolean, isTrueBoolean, stringToRange, trimToEndSentence, trimToStartSentence, waitUntilCondition } from './utils.js';
import { registerVariableCommands, resolveVariable } from './variables.js'; import { registerVariableCommands, resolveVariable } from './variables.js';
import { background_settings } from './backgrounds.js';
export { export {
executeSlashCommands, getSlashCommandsHelp, registerSlashCommand, executeSlashCommands, getSlashCommandsHelp, registerSlashCommand,
}; };
@ -1609,7 +1610,9 @@ $(document).on('click', '[data-displayHelp]', function (e) {
function setBackgroundCallback(_, bg) { function setBackgroundCallback(_, bg) {
if (!bg) { if (!bg) {
return; // allow reporting of the background name if called without args
// for use in ST Scripts via pipe
return background_settings.name;
} }
console.log('Set background to ' + bg); console.log('Set background to ' + bg);