diff --git a/public/index.html b/public/index.html index 7e9b1d492..c51e9f784 100644 --- a/public/index.html +++ b/public/index.html @@ -3027,6 +3027,10 @@ Relaxed API URLs + + + World Import Dialog + MovingUI diff --git a/public/scripts/power-user.js b/public/scripts/power-user.js index da4849392..420c88076 100644 --- a/public/scripts/power-user.js +++ b/public/scripts/power-user.js @@ -165,6 +165,7 @@ let power_user = { continue_on_send: false, trim_spaces: true, relaxed_api_urls: false, + world_import_dialog: true, disable_group_trimming: false, default_instruct: '', @@ -896,6 +897,7 @@ function loadPowerUserSettings(settings, data) { } $('#relaxed_api_urls').prop("checked", power_user.relaxed_api_urls); + $('#world_import_dialog').prop("checked", power_user.world_import_dialog); $('#trim_spaces').prop("checked", power_user.trim_spaces); $('#continue_on_send').prop("checked", power_user.continue_on_send); $('#quick_continue').prop("checked", power_user.quick_continue); @@ -2307,6 +2309,12 @@ $(document).ready(() => { saveSettingsDebounced(); }); + $("#world_import_dialog").on("input", function () { + const value = !!$(this).prop('checked'); + power_user.world_import_dialog = value; + saveSettingsDebounced(); + }); + $('#spoiler_free_mode').on('input', function () { power_user.spoiler_free_mode = !!$(this).prop('checked'); switchSpoilerMode(); diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index cce3830e4..72f1c01f4 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -6,6 +6,7 @@ import { registerSlashCommand } from "./slash-commands.js"; import { getDeviceInfo } from "./RossAscends-mods.js"; import { FILTER_TYPES, FilterHelper } from "./filters.js"; import { getTokenCount } from "./tokenizers.js"; +import { power_user } from "./power-user.js"; export { world_info, @@ -1713,17 +1714,26 @@ export function checkEmbeddedWorld(chid) { if (!localStorage.getItem(checkKey) && (!worldName || !world_names.includes(worldName))) { localStorage.setItem(checkKey, 1); - callPopup(`This character has an embedded World/Lorebook. - Would you like to import it now? - If you want to import it later, select "Import Card Lore" in the "More..." dropdown menu on the character panel.`, - 'confirm', - '', - { okButton: 'Yes', }) - .then((result) => { - if (result) { - importEmbeddedWorldInfo(true); - } - }); + if(power_user.world_import_dialog) { + callPopup(`This character has an embedded World/Lorebook. + Would you like to import it now? + If you want to import it later, select "Import Card Lore" in the "More..." dropdown menu on the character panel.`, + 'confirm', + '', + { okButton: 'Yes', }) + .then((result) => { + if (result) { + importEmbeddedWorldInfo(true); + } + }); + } + else { + toastr.info( + 'To import and use it, select "Import Card Lore" in the "More..." dropdown menu on the character panel.', + `${characters[chid].name} has an embedded World/Lorebook`, + { timeOut: 5000, extendedTimeOut: 10000, positionClass: 'toast-top-center' }, + ); + } } return true; }