api: use dynamic shortcut for string.gfind

This commit is contained in:
shagu
2018-09-28 22:53:16 +02:00
parent 0d993806e6
commit 7ecac458ac
8 changed files with 26 additions and 20 deletions
+1 -1
View File
@@ -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
View File
@@ -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
+1 -1
View File
@@ -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 )
+4 -4
View File
@@ -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