Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Alternative spell names #655

Open
nastye opened this issue Apr 25, 2019 · 2 comments
Open

[Suggestion] Alternative spell names #655

nastye opened this issue Apr 25, 2019 · 2 comments

Comments

@nastye
Copy link

nastye commented Apr 25, 2019

Allow users to give spells an alternative name, and show that name on bars instead.

AlternativeNames

@fisken1991
Copy link

This would be a massive improvement.

@coup321
Copy link

coup321 commented Jan 7, 2023

It looks like this functionality is somewhat build into the API.
If you go to /Addons/BigWigs_Core/BossPrototype.lua line 2382 (for me) see the following boss api function definition.

...
	--- Display a bar.
	-- @param key the option key
	-- @param length the bar duration in seconds, or a table containing {remaining duration, max duration}
	-- @param[opt] text the bar text (if nil, key is used)
	-- @param[opt] icon the bar icon (spell id or texture name)
	function boss:Bar(key, length, text, icon)
		local lengthType = type(length)
...

I believe when key is used, it's directly getting the spell name from the parsed combat log event - not 100% sure - but it is certainly just the "default spell name".

Then, in each boss file, for example /Addons/LittleWigs/Dragonflight/AlgetharAcademy/OvergrownAncient.lua
Each event handler function uses the boss:CDBar api as follows for example:

function mod:Germinate(args)
    germinateCount = germinateCount + 1
    self:Message(args.spellId, "yellow")
    self:PlaySound(args.spellId, "long")
    self:Bar(args.spellId, germinateCount % 2 == 0 and 25.5 or 34)
end

As you can see, the self:Bar function takes additional optional parameters including custom bar text.

I found that if I changed the above function as shown below (adding "GERMINATE" to the bar call) and tested in game, it correctly overwrote the bar text.

function mod:Germinate(args)
    germinateCount = germinateCount + 1
    self:Message(args.spellId, "yellow")
    self:PlaySound(args.spellId, "long")
    self:Bar(args.spellId, germinateCount % 2 == 0 and 25.5 or 34, "GERMINATE")
end

I'm not sure how to implement this more broadly, I think it would require adding an entry box/log/variable to the addon and then passing an additional argument that defaults to nul for every single module event handler. I'm not really much of a developer so not sure a better way, but this work around actually makes this customization possible and a reality with some effort. If any more experienced devs were interested in helping me work on this I'd be happy to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants