shagu / pfUI

A User Interface Replacement for World of Warcraft: Vanilla & TBC
https://shagu.org/pfUI
MIT License
339 stars 117 forks source link

Trueshot don‘t show in cast bar #1231

Closed foolishyx closed 5 months ago

foolishyx commented 8 months ago

The turtle hunter skill--trueshot cannot show in cast bar. Can it be fixed? Thank you very much. pfui-version castbar-location multishot-normal trueshot-abnormal

cache9527 commented 8 months ago

locales_enUS.lua

line37 add ["TRUESHOT"] = "Trueshot",

line3563 change ["Steady Shot"] = "Ability_Hunter_SteadyShot", to ["Trueshot"] = "Ability_Hunter_SteadyShot",

locales_zhCN.lua line37 add ["TRUESHOT"] = "稳固射击",

libcast.lua

line 292 add local trueshot = L["customcast"]["TRUESHOT"]

line 376 add

libcast.customcast[strlower(trueshot)] = function(begin, duration)
  if begin then
    local duration = duration or 1000

    for i=1,32 do
      if UnitBuff("player", i) == "Interface\\Icons\\Racial_Troll_Berserk" then
        local berserk = 0.3
        if((UnitHealth("player")/UnitHealthMax("player")) >= 0.40) then
          berserk = (1.30 - (UnitHealth("player") / UnitHealthMax("player"))) / 3
        end
        duration = duration / (1 + berserk)
      elseif UnitBuff("player", i) == "Interface\\Icons\\Ability_Hunter_RunningShot" then
        duration = duration / 1.4
      elseif UnitBuff("player", i) == "Interface\\Icons\\Ability_Warrior_InnerRage" then
        duration = duration / 1.3
      elseif UnitBuff("player", i) == "Interface\\Icons\\Inv_Trinket_Naxxramas04" then
        duration = duration / 1.2
      end
    end

    local _,_, lag = GetNetStats()
    local start = GetTime() + lag/1000

    -- add cast action to the database
    libcast.db[player].cast = trueshot
    libcast.db[player].rank = lastrank
    libcast.db[player].start = start
    libcast.db[player].casttime = duration
    libcast.db[player].icon = "Interface\\Icons\\Ability_Hunter_SteadyShot"
    libcast.db[player].channel = nil
  else
    -- remove cast action to the database
    libcast.db[player].cast = nil
    libcast.db[player].rank = nil
    libcast.db[player].start = nil
    libcast.db[player].casttime = nil
    libcast.db[player].icon = nil
    libcast.db[player].channel = nil
  end
end

![Uploading trueshot.jpg…]()

foolishyx commented 8 months ago

I download your merge request(patch-1 Repo) and test. I'm very happy to see that it has been fixed, hope it could be merged quickly. Hunters need this very much. 微信截图_20231130025942

github-actions[bot] commented 5 months ago

This issue is stale because it has been open for 30 days with no activity.

shagu commented 5 months ago

Fixed via https://github.com/shagu/pfUI/commit/24097d7d217b778f5928a2adf17e862a8d87f4a3