Even more enum refactorings (not done yet)

- Add common enum icons
- enum def for existing enum types, with color description
This commit is contained in:
Wolfsblvt
2024-06-20 20:33:45 +02:00
parent 7f7ecdcca8
commit 461b1a9d87
18 changed files with 462 additions and 137 deletions

View File

@ -46,7 +46,8 @@ import { PARSER_FLAG, SlashCommandParser } from './slash-commands/SlashCommandPa
import { SlashCommand } from './slash-commands/SlashCommand.js';
import { ARGUMENT_TYPE, SlashCommandArgument } from './slash-commands/SlashCommandArgument.js';
import { AUTOCOMPLETE_WIDTH } from './autocomplete/AutoComplete.js';
import { SlashCommandEnumValue } from './slash-commands/SlashCommandEnumValue.js';
import { SlashCommandEnumValue, enumTypes } from './slash-commands/SlashCommandEnumValue.js';
import { enumIcons } from './slash-commands/SlashCommandCommonEnumsProvider.js';
export {
loadPowerUserSettings,
@ -3890,7 +3891,7 @@ $(document).ready(() => {
SlashCommandArgument.fromProps({
description: 'optional tag name',
typeList: [ARGUMENT_TYPE.STRING],
enumProvider: () => tags.filter(tag => Object.values(tag_map).some(x => x.includes(tag.id))).map(tag => new SlashCommandEnumValue(tag.name)),
enumProvider: () => tags.filter(tag => Object.values(tag_map).some(x => x.includes(tag.id))).map(tag => new SlashCommandEnumValue(tag.name, null, enumTypes.enum, enumIcons.tag)),
}),
],
helpString: 'Start a new chat with a random character. If an argument is provided, only considers characters that have the specified tag.',