Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bob-schumaker/fishing-ace
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.9.12
Choose a base ref
...
head repository: bob-schumaker/fishing-ace
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
  • 3 commits
  • 2 files changed
  • 2 contributors

Commits on Oct 14, 2024

  1. Latest APIs in fishing library.

    Bob Schumaker committed Oct 14, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    igordanilcenko Igor Danilčenko
    Copy the full SHA
    b20c314 View commit details
  2. Update TOC and version.

    Bob Schumaker committed Oct 14, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    igordanilcenko Igor Danilčenko
    Copy the full SHA
    3a09d6f View commit details
  3. Merge pull request #10 from bob-schumaker/retail-update

    Retail update
    bob-schumaker authored Oct 14, 2024
    Copy the full SHA
    9ad5ce3 View commit details
Showing with 45 additions and 17 deletions.
  1. +2 −2 FishingAce.toc
  2. +43 −15 LibFishing-1.0.lua
4 changes: 2 additions & 2 deletions FishingAce.toc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Interface: 100205
## Interface: 110002
## Title: Fishing Ace! |cff7fff7f -Ace3-|r
## Version: 0.9.12
## Version: 0.9.13
## Notes: Simple right click casting.
## Notes-zhCN: ����˫�����㡣
## Notes-zhTW: �����p����~��
58 changes: 43 additions & 15 deletions LibFishing-1.0.lua
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ Licensed under a Creative Commons "Attribution Non-Commercial Share Alike" Licen
local _

local MAJOR_VERSION = "LibFishing-1.0"
local MINOR_VERSION = 101109
local MINOR_VERSION = 101110

if not LibStub then error(MAJOR_VERSION .. " requires LibStub") end

@@ -56,6 +56,29 @@ local function IsWrath()
return not IsRetail() and WOW.interface >= 30400 and WOW.interface < 40000
end

function FishLib:CurrentVersionName()
if self.IsRetail() then
return "Retail"
end

if self.IsClassic() then
return "Classic"
end

if self.IsVanilla() then
return "Classic Era"
end

if self.IsCrusade() then
return "Crusade"
end

if self.IsWrath() then
return "Wrath"
end

return "Unknown ".._G.WOW_PROJECT_ID
end

function FishLib:WOWVersion()
return WOW.major, WOW.minor, WOW.dot, IsClassic();
@@ -160,13 +183,18 @@ end
-- support finding the fishing skill in classic
local function FindSpellID(thisone)
local id = 1;
local spellTexture = GetSpellTexture(id);
if IsVanilla() then
getSpellTexture = C_Spell.GetSpellTexture;
else
getSpellTexture = GetSpellTexture;
end
local spellTexture = getSpellTexture(id);
while (spellTexture) do
if (spellTexture and spellTexture == thisone) then
return id;
end
id = id + 1;
spellTexture = GetSpellTexture(id);
spellTexture = getSpellTexture(id);
end
return nil;
end
@@ -175,7 +203,7 @@ function FishLib:GetFishingSpellInfo()
if self:IsClassic() then
local spell = FindSpellID("Interface\\Icons\\Trade_Fishing");
if spell then
local name, _, _ = GetSpellInfo(spell);
local name, _, _ = C_Spell.GetSpellInfo(spell);
return spell, name;
end
return 9, PROFESSIONS_FISHING;
@@ -187,11 +215,11 @@ function FishLib:GetFishingSpellInfo()
end
local name, _, _, _, count, offset, _ = GetProfessionInfo(fishing);
local id = nil;
local spellbank = Enum.SpellBookSpellBank.Player;
for i = 1, count do
local _, spellId = GetSpellLink(offset + i, "spell");
local spellName = GetSpellInfo(spellId);
local spellName, _ = C_SpellBook.GetSpellBookItemName(offset + i, spellbank);
if (spellName == name) then
id = spellId;
_, _, id = C_SpellBook.GetSpellBookItemType(offset + i, spellbank);
break;
end
end
@@ -326,8 +354,8 @@ function FishLib:GetTradeSkillData()
end
local btn = _G[SABUTTONNAME];
if btn then
if (not IsAddOnLoaded(BlizzardTradeSkillUI)) then
LoadAddOn(BlizzardTradeSkillUI);
if (not C_AddOns.IsAddOnLoaded(BlizzardTradeSkillUI)) then
C_AddOns.LoadAddOn(BlizzardTradeSkillUI);
end
btn.skillupdate:SetScript("OnUpdate", SkillInitialize);
btn.skillupdate:Show()
@@ -662,9 +690,9 @@ local spellidx = nil;
function FishLib:GetBuff(buffId)
if ( buffId ) then
for idx=1,40 do
local current_buff = UnitBuff("player", idx);
local current_buff = C_UnitAuras.GetAuraDataByIndex("player", idx);
if current_buff then
local info = {UnitBuff("player", idx)}
local info = {C_UnitAuras.GetAuraDataByIndex("player", idx)};
local spellid = select(10, unpack(info));
if (buffId == spellid) then
return idx, info
@@ -1523,8 +1551,8 @@ end
function FishLib:GetTrackingID(tex)
if ( tex ) then
for id=1,C_Minimap.GetNumTrackingTypes() do
local _, texture, _, _ = C_Minimap.GetTrackingInfo(id);
texture = texture.."";
local info = C_Minimap.GetTrackingInfo(id);
texture = info.texture.."";
if ( texture == tex) then
return id;
end
@@ -2791,9 +2819,9 @@ local function LoadTranslation(source, lang, target, record)
end

function FishLib:AddonVersion(addon)
local addonCount = GetNumAddOns();
local addonCount = C_AddOns.GetNumAddOns();
for addonIndex = 1, addonCount do
local name, title, notes, loadable, reason, security = GetAddOnInfo(addonIndex);
local name, title, notes, loadable, reason, security = C_AddOns.GetAddOnInfo(addonIndex);
if name == addon then
return C_AddOns.GetAddOnMetadata(addonIndex, "Version");
end