/castfocus, /pfcastfocus: Optimize castfocus using superwow; also side-optimize and enhance /pfcast to employ memoization under the hood and support passing raw-lua-functions to it#1609
Closed
dsidirop wants to merge 156 commits intoshagu:masterfrom
Conversation
- pfUI.uf.mouseover now gets cached the first time the hook is triggered and if the mouseover module is disabled we set the cache to the empty object {} as a safety net
- we now detect attempts to get the player's name via UnitName("player") and we simply return the 'player' variable we already have to save ourselves a function call
- also removed a duplicate call to UnitName("target") which was unnecessary
…seAction" with that of "CastSpellByName" in terms of getting the proper unit-name
these two post-hook functions now take the mouse-over value (if any) into account just like we do in the "CastSpellByName" post-hook
…libpredict-spell-cast-hooks #1283 optimize and align libpredict spell cast hooks
…time and range components in the spell tooltip to fix this bug we had to pass 'false' as the 2nd argument to scanner:Find() to disable "exact matching" in it
…llinfo-for-ranges-and-casting-time fix (libspell.lua): GetSpellInfo() now properly spots the spell-cast-time and range components in the spell tooltip
… of the spell and its book-type
…rn-spell-id-and-book-type feat (libspell): GetSpellInfo() now also returns the numeric-spell-id of the spell and its book-type
mapcolors: rewrite module implementation
we intentionally differentiated the name as 'GetPlayerBuffX' (note the 'X' at the end) so as to ensure that we won't accidentally break 3rd party pfui-addons that import the pfUI environment expecting GetPlayerBuff() to work exactly like in vanilla in terms of its 1st parameter (which is not the case with GetPlayerBuffX())
…rBuffX() instead of GetPlayerBuff(PLAYER_BUFF_START_ID+...)
…uff-into-an-api-method #6 Consolidate getplayerbuff into an api method
…uff-into-an-api-method docs (api.lua): trivial doc-comment tweaks
…all GetTime() twice
…(this.id,"HELPFUL")
…at the top of the call
… in the 'buffs' section of :RefreshUnit()
… per iteration inside the 'debuff' section of :RefreshUnit()
…side the for-each-debuff loop of :RefreshUnit()
…uff-into-an-api-method dsidirop/6 consolidate getplayerbuff into an api method
…ript("OnUpdate", ...)
…ipt("OnUpdate", ...)
… that the underlying action is a macro
…ects macro-scriptlets
…in pfUI.uf:EnableClickCast() for the sake of performance/readability
unitframes.lua: optimize a bit the way macro-scripts are detected in :ClickAction() (and to a minor degree in :EnableClickCast())
# Conflicts: # api/api.lua
# Conflicts: # api/api.lua
…List.PFFOCUSCAST() defined in focus.lua and employ it when the caller specifies a hard-coded spell
if scriptlet/function is passed we fallback to the original approach considering that superwow doesn't (and probably will never) support func-scriptlets
…fUI.api.RunOOC() to resolve some static-analysis warnings about var-names
…ich is meant to be used in order to memoize lua-func-strings passed on to various spell-casting utilities in the next few commits (/pfcast, /castfocus etc)
…STFOCUS() just like we did with SlashCmdList.PFFOCUS this allows us to employ unit-guid-targeting to side-step the complex target-swapping tricks we would resort to when superwow wasn't available this is a much more care-free and lightweight approach
…alls in _G.SlashCmdList.PFCAST() and SlashCmdList.PFCASTFOCUS() with pfUI.api.TryMemoizedFuncLoadstringForSpellCasts() to enjoy better runtime performance when the user passes a lua-func-string
as an added bonus this commit also adds seamless support for passing actual raw functions to SlashCmdList.PFCASTFOCUS() ala:
SlashCmdList.PFCASTFOCUS(function() CastspellByName("Renew", 1); end)
which is extremely useful for advanced pure-lua macros.
Old was: Before this commit we would have to write this kind of stuff as a string
SlashCmdList.PFCASTFOCUS( 'function() CastspellByName("Renew", 1); end' )
this was both 10x slower and was extremely cumbersome and error-prone for the user if he wanted to pass some variable-state inside the string-func-callback.
…bout unused variables
Contributor
Author
|
This PR was based on the wrong branch. Closed it and re-opened it using the correct branch in #1610 so have a look at that one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This allows us to employ unit-guid-targeting to side-step the complex target-swapping tricks we would resort to when superwow wasn't available.
This is a much more care-free and lightweight approach.
As an added bonus this commit also adds seamless support for passing actual raw functions to SlashCmdList.PFCASTFOCUS() ala:
This is extremely useful for advanced pure-lua macros (p.e. via SuperMacro) as it simplifies the invocation-style tremendously.
Old was: Before this commit we would have to write this kind of stuff as a string
This was both 10x slower and was extremely cumbersome and error-prone for the user if he wanted to pass some variable-state inside the string-func-callback (god help him in that case!)