mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Customizable sorting order for characters list
This commit is contained in:
@ -42,6 +42,7 @@ import {
|
||||
collapseNewlines,
|
||||
loadPowerUserSettings,
|
||||
playMessageSound,
|
||||
sortCharactersList,
|
||||
power_user,
|
||||
} from "./scripts/power-user.js";
|
||||
|
||||
@ -609,7 +610,7 @@ function printCharacters() {
|
||||
//console.log('printcharacters() -- printing -- ChID '+i+' ('+item.name+')');
|
||||
});
|
||||
printGroups();
|
||||
sortCharactersList('name', 'asc');
|
||||
sortCharactersList();
|
||||
}
|
||||
|
||||
async function getCharacters() {
|
||||
@ -3066,14 +3067,6 @@ function setGenerationProgress(progress) {
|
||||
}
|
||||
}
|
||||
|
||||
function sortCharactersList(field, order) {
|
||||
let orderedList = characters.slice().sort((a, b) => order == 'asc' ? a[field].localeCompare(b[field]) : b[field].localeCompare(a[field]));
|
||||
|
||||
for (let i = 0; i < characters.length; i++) {
|
||||
$(`.character_select[chid="${i}"]`).css({ 'order': orderedList.indexOf(characters[i]) });
|
||||
}
|
||||
}
|
||||
|
||||
function isHordeGenerationNotAllowed() {
|
||||
if (main_api == "kobold" && horde_settings.use_horde && preset_settings == "gui") {
|
||||
callPopup('GUI Settings preset is not supported for Horde. Please select another preset.', 'text');
|
||||
|
Reference in New Issue
Block a user