mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-05 05:00:02 +00:00
api: use dynamic shortcut for string.gfind
This commit is contained in:
@@ -7,7 +7,7 @@ pfUI:RegisterModule("autoshift", function ()
|
||||
pfUI.autoshift.scanString = string.gsub(SPELL_FAILED_ONLY_SHAPESHIFT, "%%s", "(.+)")
|
||||
|
||||
function pfUI.autoshift:SwitchStance()
|
||||
for stance in string.gfind(pfUI.autoshift.lastError, pfUI.autoshift.scanString) do
|
||||
for stance in gfind(pfUI.autoshift.lastError, pfUI.autoshift.scanString) do
|
||||
for _, stance in pairs({ strsplit(",", stance)}) do
|
||||
pfUI.autoshift.CastSpellByName(string.gsub(stance,"^%s*(.-)%s*$", "%1"))
|
||||
end
|
||||
|
||||
+1
-1
@@ -858,7 +858,7 @@ pfUI:RegisterModule("chat", function ()
|
||||
-- display class colors if already indexed
|
||||
if C.chat.text.classcolor == "1" then
|
||||
|
||||
for name in string.gfind(text, "|Hplayer:(.-)|h") do
|
||||
for name in gfind(text, "|Hplayer:(.-)|h") do
|
||||
local color = unknowncolorhex
|
||||
local match = false
|
||||
-- search player in database
|
||||
|
||||
@@ -16,7 +16,7 @@ pfUI:RegisterModule("pixelperfect", function ()
|
||||
-- apply pixel dependent scaling
|
||||
local resolution = GetCVar("gxResolution")
|
||||
|
||||
for screenwidth, screenheight in string.gfind(resolution, "(.+)x(.+)") do
|
||||
for screenwidth, screenheight in gfind(resolution, "(.+)x(.+)") do
|
||||
local screenheight = tonumber(screenheight) / 8
|
||||
local scale = 768 / ( screenheight * conf )
|
||||
|
||||
|
||||
@@ -278,25 +278,25 @@ pfUI:RegisterModule("prediction", function ()
|
||||
pfUI.prediction.sender:SetScript("OnEvent", function()
|
||||
if event == "CHAT_MSG_SPELL_SELF_BUFF" then
|
||||
-- "Your %s heals %s for %d.";
|
||||
for spell, _, heal in string.gfind(arg1, healedselfother) do
|
||||
for spell, _, heal in gfind(arg1, healedselfother) do
|
||||
if spell == spell_queue[1] then cache[spell_queue[2]] = tonumber(heal) end
|
||||
return
|
||||
end
|
||||
|
||||
-- "Your %s heals you for %d."
|
||||
for spell, heal in string.gfind(arg1, healedselfself) do
|
||||
for spell, heal in gfind(arg1, healedselfself) do
|
||||
if spell == spell_queue[1] then cache[spell_queue[2]] = tonumber(heal) end
|
||||
return
|
||||
end
|
||||
|
||||
-- "Your %s critically heals %s for %d."
|
||||
for spell, heal in string.gfind(arg1, healedcritselfother) do
|
||||
for spell, heal in gfind(arg1, healedcritselfother) do
|
||||
if spell == spell_queue[1] and not cache[spell_queue[2]] then cache[spell_queue[2]] = tonumber(heal)*2/3 end
|
||||
return
|
||||
end
|
||||
|
||||
-- "Your %s critically heals you for %d."
|
||||
for spell, _, heal in string.gfind(arg1, healedcritselfself) do
|
||||
for spell, _, heal in gfind(arg1, healedcritselfself) do
|
||||
if spell == spell_queue[1] and not cache[spell_queue[2]] then cache[spell_queue[2]] = tonumber(heal)*2/3 end
|
||||
return
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user