mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-09 16:40:10 +01:00
Add option to use the old embedded WI toast
This commit is contained in:
parent
3f406dcdf0
commit
3eb8f56b00
@ -3027,6 +3027,10 @@
|
|||||||
<input id="relaxed_api_urls" type="checkbox" />
|
<input id="relaxed_api_urls" type="checkbox" />
|
||||||
<span data-i18n="Relaxed API URLS">Relaxed API URLs</span>
|
<span data-i18n="Relaxed API URLS">Relaxed API URLs</span>
|
||||||
</label>
|
</label>
|
||||||
|
<label data-newbie-hidden class="checkbox_label" for="world_import_dialog" title="Ask to import the World Info/Lorebook for every new character with one embedded. If unchecked, a brief message will be shown instead.">
|
||||||
|
<input id="world_import_dialog" type="checkbox" />
|
||||||
|
<span data-i18n="World Import Dialog">World Import Dialog</span>
|
||||||
|
</label>
|
||||||
<label data-newbie-hidden id="movingUIModeCheckBlock" for="movingUImode" class="checkbox_label">
|
<label data-newbie-hidden id="movingUIModeCheckBlock" for="movingUImode" class="checkbox_label">
|
||||||
<input id="movingUImode" type="checkbox" />
|
<input id="movingUImode" type="checkbox" />
|
||||||
<span data-i18n="Movable UI Panels">MovingUI</span>
|
<span data-i18n="Movable UI Panels">MovingUI</span>
|
||||||
|
@ -165,6 +165,7 @@ let power_user = {
|
|||||||
continue_on_send: false,
|
continue_on_send: false,
|
||||||
trim_spaces: true,
|
trim_spaces: true,
|
||||||
relaxed_api_urls: false,
|
relaxed_api_urls: false,
|
||||||
|
world_import_dialog: true,
|
||||||
disable_group_trimming: false,
|
disable_group_trimming: false,
|
||||||
|
|
||||||
default_instruct: '',
|
default_instruct: '',
|
||||||
@ -896,6 +897,7 @@ function loadPowerUserSettings(settings, data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#relaxed_api_urls').prop("checked", power_user.relaxed_api_urls);
|
$('#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);
|
$('#trim_spaces').prop("checked", power_user.trim_spaces);
|
||||||
$('#continue_on_send').prop("checked", power_user.continue_on_send);
|
$('#continue_on_send').prop("checked", power_user.continue_on_send);
|
||||||
$('#quick_continue').prop("checked", power_user.quick_continue);
|
$('#quick_continue').prop("checked", power_user.quick_continue);
|
||||||
@ -2307,6 +2309,12 @@ $(document).ready(() => {
|
|||||||
saveSettingsDebounced();
|
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 () {
|
$('#spoiler_free_mode').on('input', function () {
|
||||||
power_user.spoiler_free_mode = !!$(this).prop('checked');
|
power_user.spoiler_free_mode = !!$(this).prop('checked');
|
||||||
switchSpoilerMode();
|
switchSpoilerMode();
|
||||||
|
@ -6,6 +6,7 @@ import { registerSlashCommand } from "./slash-commands.js";
|
|||||||
import { getDeviceInfo } from "./RossAscends-mods.js";
|
import { getDeviceInfo } from "./RossAscends-mods.js";
|
||||||
import { FILTER_TYPES, FilterHelper } from "./filters.js";
|
import { FILTER_TYPES, FilterHelper } from "./filters.js";
|
||||||
import { getTokenCount } from "./tokenizers.js";
|
import { getTokenCount } from "./tokenizers.js";
|
||||||
|
import { power_user } from "./power-user.js";
|
||||||
|
|
||||||
export {
|
export {
|
||||||
world_info,
|
world_info,
|
||||||
@ -1713,17 +1714,26 @@ export function checkEmbeddedWorld(chid) {
|
|||||||
if (!localStorage.getItem(checkKey) && (!worldName || !world_names.includes(worldName))) {
|
if (!localStorage.getItem(checkKey) && (!worldName || !world_names.includes(worldName))) {
|
||||||
localStorage.setItem(checkKey, 1);
|
localStorage.setItem(checkKey, 1);
|
||||||
|
|
||||||
callPopup(`<h3>This character has an embedded World/Lorebook.</h3>
|
if(power_user.world_import_dialog) {
|
||||||
<h3>Would you like to import it now?</h3>
|
callPopup(`<h3>This character has an embedded World/Lorebook.</h3>
|
||||||
<div class="m-b-1">If you want to import it later, select "Import Card Lore" in the "More..." dropdown menu on the character panel.</div>`,
|
<h3>Would you like to import it now?</h3>
|
||||||
'confirm',
|
<div class="m-b-1">If you want to import it later, select "Import Card Lore" in the "More..." dropdown menu on the character panel.</div>`,
|
||||||
'',
|
'confirm',
|
||||||
{ okButton: 'Yes', })
|
'',
|
||||||
.then((result) => {
|
{ okButton: 'Yes', })
|
||||||
if (result) {
|
.then((result) => {
|
||||||
importEmbeddedWorldInfo(true);
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user