Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds the option to rename spells in the options. Renames are done using
:SetSpellRename
to set the value in thespells
table, then the renaming happens in the CLEU handler. The module doesn't have to do anything special, ie,args.spellName
will be the renamed text. This also means:SpellName
returns the renamed value, with a new optional second arg (:SpellName(id, true)
) to return the value from GetSpellInfo/EJ_GetSectionInfo directly.The rename values are stored in a new
Rename
plugin with a simple getter/setter. Initial setup is done in the module's:SetupOptions
, so on module enable or when opening the config. Setting a value in the Rename plugin will run:SetSpellRename
in the associated module to handle user updates in the config.Preset renames are set using the altNames table in
:GetOptions
. This can be the current[spellId] = L.string
mapping or an indexed table for additional settings. The first table entry is always the rename string. Any tables entries that are a number will be treated as spell ids that should also get the same rename string. Any table entries that are a string will be treated as a key in the locale table to be overwritten with the rename string.Example: TheBloodboundHorror.lua
This results in
:Log
callbacks for spell id 452237 havingargs.spellName
renamed to the value inL.bloodcurdle
and any call to:SpellName(452237)
returning the renamed value. In the options this will show up like it does currently with the name in parentheses next to the spell name. Including thebloodcurdle_singular
locale key will also add that value to config as something you can rename. This is indicated in the config by including a "+X" value next to or inplace of the rename value to indicate there are additional strings you can rename. The locale table entry gets overwritten by the user-set value, so any usage ofL.bloodcurdle_singular
will reflect the user value.Ability options:
The
Reset
button enables when the text isn't the default (module preset value or empty) and theSpell Name
button enables when there is a module preset value to easily rename it back to the actual spell name. TheSpell Name
button is always there to keep the layout code simple, but it should probably not show if there isn't a module preset rename.How the title of the locale strings shows in the config is unfinished. Right now it just title cases the string without underscores, but my idea was to use suffixes to show a localized generic title, ie,
_singular
-> "Singular Form (Target Message/Bar)".Since this is all driven from the current altNames table, we'd need to rework how to show "labels" in the config, as LittleWigs uses the altName to show mythic only spells and such. An idea is to add a flag to the ability options like "MYTHIC" (that isn't an actual bit flag) to show the difficulty icon, and/or add a helper function to prepend the blue text "label" to the description text.