mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-06 13:40:00 +00:00
cleanup: use plain string.find where possible
This commit is contained in:
@@ -93,8 +93,8 @@ pfUI:RegisterModule("autoshift", function ()
|
||||
currBuffTex = GetPlayerBuffTexture(i)
|
||||
if (currBuffTex) then
|
||||
for id, bufftype in pairs(pfUI.autoshift.buffs) do
|
||||
if string.find(string.lower(currBuffTex), bufftype) then
|
||||
if string.find(string.lower(currBuffTex), "spell_shadow_shadowform") then
|
||||
if string.find(string.lower(currBuffTex), bufftype, 1) then
|
||||
if string.find(string.lower(currBuffTex), "spell_shadow_shadowform", 1) then
|
||||
CancelLater = i
|
||||
else
|
||||
CancelPlayerBuff(i)
|
||||
|
||||
+1
-1
@@ -554,7 +554,7 @@ pfUI:RegisterModule("chat", function ()
|
||||
text = string.gsub(text, "|Hplayer:(.-)|h%[.-%]|h(.-:-)", "[|Hplayer:%1|h" .. Name .. "|h]" .. "%2")
|
||||
|
||||
-- make incoming whispers lighter than outgoing
|
||||
if string.find(text, '|cff'..wcol) == 1 then
|
||||
if string.find(text, '|cff'..wcol, 1) == 1 then
|
||||
text = string.gsub(text, "|r", "|cff" .. wcol)
|
||||
end
|
||||
|
||||
|
||||
@@ -204,11 +204,11 @@ pfUI:RegisterModule("nameplates", function ()
|
||||
|
||||
-- show indicator for elite/rare mobs
|
||||
if level:GetText() ~= nil then
|
||||
if pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "elite" and not string.find(level:GetText(), "+") then
|
||||
if pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "elite" and not string.find(level:GetText(), "+", 1) then
|
||||
level:SetText(level:GetText() .. "+")
|
||||
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rareelite" and not string.find(level:GetText(), "R+") then
|
||||
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rareelite" and not string.find(level:GetText(), "R+", 1) then
|
||||
level:SetText(level:GetText() .. "R+")
|
||||
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rare" and not string.find(level:GetText(), "R") then
|
||||
elseif pfUI.nameplates.mobs[name:GetText()] and pfUI.nameplates.mobs[name:GetText()] == "rare" and not string.find(level:GetText(), "R", 1) then
|
||||
level:SetText(level:GetText() .. "R")
|
||||
end
|
||||
end
|
||||
|
||||
+1
-1
@@ -305,7 +305,7 @@ pfUI:RegisterModule("panel", function ()
|
||||
local tmpText = getglobal("repairToolTipTextLeft"..i)
|
||||
if (tmpText ~= nil) and (tmpText:GetText()) then
|
||||
local searchstr = string.gsub(DURABILITY_TEMPLATE, "%%[^%s]+", "(.+)")
|
||||
local _, _, lval, rval = string.find(tmpText:GetText(), searchstr)
|
||||
local _, _, lval, rval = string.find(tmpText:GetText(), searchstr, 1)
|
||||
if (lval and rval) then
|
||||
repPercent = math.floor(lval / rval * 100)
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user