Skip to content

Commit

Permalink
Merge pull request #218 from TheKrowi/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
TheKrowi authored Jun 27, 2024
2 parents 2b9cd4f + 6fd5602 commit 2e1b98b
Show file tree
Hide file tree
Showing 22 changed files with 167 additions and 35 deletions.
17 changes: 9 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@
"GetAchievementCriteriaInfoByID",
"PLAYER_FACTION_GROUP",
"C_AddOns",
"AchievementFrameFilterDropDown"
"AchievementFrameFilterDropDown",
"WorldMapShowLegendButtonMixin"
],
"Lua.diagnostics.disable": [
"deprecated",
Expand All @@ -535,13 +536,13 @@
"exclude":"**/{.git,.vscode,Changelogs,Descriptions}/**",
"deleteTargetOnDeploy": true
},
// {
// "source":"E:\\World of Warcraft Addon Development\\Krowi_AchievementFilter",
// "target":"F:\\World of Warcraft\\_classic_\\Interface\\AddOns\\Krowi_AchievementFilter",
// "include":"**/*.{lua,toc,blp,tga,xml,md}",
// "exclude":"**/{.git,.vscode,Changelogs,Descriptions}/**",
// "deleteTargetOnDeploy": true
// },
{
"source":"E:\\World of Warcraft Addon Development\\Krowi_AchievementFilter",
"target":"F:\\World of Warcraft\\_classic_\\Interface\\AddOns\\Krowi_AchievementFilter",
"include":"**/*.{lua,toc,blp,tga,xml,md}",
"exclude":"**/{.git,.vscode,Changelogs,Descriptions}/**",
"deleteTargetOnDeploy": true
},
{
"source":"E:\\World of Warcraft Addon Development\\Krowi_AchievementFilter",
"target":"F:\\World of Warcraft\\_beta_\\Interface\\AddOns\\Krowi_AchievementFilter",
Expand Down
4 changes: 2 additions & 2 deletions Api/API.lua
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@ do --[[ KrowiAF_RegisterTabOptions ]]
end

local function InjectTabsOrderOptionsTable(index)
addon.InjectOptions:AddTable("Layout.args.Tabs.args.Order.args.Order.args", tostring(OrderPP()), {
order = OrderPP(), type = "select", width = AdjustedWidth(1.95),
addon.InjectOptions:AddTable("Layout.args.Tabs.args.Order.args.Order.args", tostring(index), {
order = index, type = "select", width = AdjustedWidth(1.95),
name = "",
values = function() return addon.Gui:TabsOrderGetActiveKeys(); end,
get = function() return GetOrder(index); end,
Expand Down
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,24 @@
# Changelog
All notable changes to this project will be documented in this file.

## 73.6 - 2024-06-27
### Fixed
- Several bugs in preperation for The War Within (Beta) changes

## 73.5 - 2024-06-25
### Fixed
- Fate of Nathria and Fate of Domination chains should now be correct
- Most progress section in the achievement tooltip will no longer show for past achievements that are now unobtainable

## 73.4 - 2024-06-23
### Fixed
- GW2 UI skin
- Tabs order options

## 73.3 - 2024-06-23
### Cata Classic
- Fixed hooksecurefunc error

## 73.2 - 2024-06-22
### Added
- Temporary obtainable achievements now have the option to show an extra icon indicating if it is / was / will be obtainable
Expand Down
14 changes: 14 additions & 0 deletions Changelogs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@
- Temporary obtainable achievements header color can now be removed

### Fixed (73.2)
- Several bugs in preperation for The War Within (Beta) changes

### Cata Classic (73.3)
- Fixed hooksecurefunc error

### Fixed (73.4)
- GW2 UI skin
- Tabs order options

### Fixed (73.5)
- Fate of Nathria and Fate of Domination chains should now be correct
- Most progress section in the achievement tooltip will no longer show for past achievements that are now unobtainable

### Fixed (73.6)
- Several bugs in preperation for The War Within (Beta) changes
18 changes: 18 additions & 0 deletions Changelogs/CurseForge.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,22 @@
<p><h3>Fixed (73.2)</h3></p>
<ul>
<li>Several bugs in preperation for The War Within (Beta) changes</li>
</ul>
<p><h3>Cata Classic (73.3)</h3></p>
<ul>
<li>Fixed hooksecurefunc error</li>
</ul>
<p><h3>Fixed (73.4)</h3></p>
<ul>
<li>GW2 UI skin</li>
<li>Tabs order options</li>
</ul>
<p><h3>Fixed (73.5)</h3></p>
<ul>
<li>Fate of Nathria and Fate of Domination chains should now be correct</li>
<li>Most progress section in the achievement tooltip will no longer show for past achievements that are now unobtainable</li>
</ul>
<p><h3>Fixed (73.6)</h3></p>
<ul>
<li>Several bugs in preperation for The War Within (Beta) changes</li>
</ul>
14 changes: 14 additions & 0 deletions Changelogs/Wago.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,18 @@
- Temporary obtainable achievements header color can now be removed

### Fixed (73.2)
- Several bugs in preperation for The War Within (Beta) changes

### Cata Classic (73.3)
- Fixed hooksecurefunc error

### Fixed (73.4)
- GW2 UI skin
- Tabs order options

### Fixed (73.5)
- Fate of Nathria and Fate of Domination chains should now be correct
- Most progress section in the achievement tooltip will no longer show for past achievements that are now unobtainable

### Fixed (73.6)
- Several bugs in preperation for The War Within (Beta) changes
22 changes: 22 additions & 0 deletions Changelogs/WowInterface.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,26 @@
[B]Fixed (73.2)[/B]
[LIST]
[*]Several bugs in preperation for The War Within (Beta) changes
[/LIST]

[B]Cata Classic (73.3)[/B]
[LIST]
[*]Fixed hooksecurefunc error
[/LIST]

[B]Fixed (73.4)[/B]
[LIST]
[*]GW2 UI skin
[*]Tabs order options
[/LIST]

[B]Fixed (73.5)[/B]
[LIST]
[*]Fate of Nathria and Fate of Domination chains should now be correct
[*]Most progress section in the achievement tooltip will no longer show for past achievements that are now unobtainable
[/LIST]

[B]Fixed (73.6)[/B]
[LIST]
[*]Several bugs in preperation for The War Within (Beta) changes
[/LIST]
2 changes: 1 addition & 1 deletion Data/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ end

local function LinkChainAchievements()
for i = 1, #data.AchievementIds do
local prevId = GetPreviousAchievement(data.AchievementIds[i]);
local prevId = addon.GetPreviousAchievement(data.AchievementIds[i]);
if prevId and data.Achievements[prevId] then
data.Achievements[prevId]:AddNext(data.Achievements[data.AchievementIds[i]]);
end
Expand Down
6 changes: 3 additions & 3 deletions Filters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ local validations = {
if nextCompleted then
return true;
end
local prevID = GetPreviousAchievement(achievement.Id);
local prevID = addon.GetPreviousAchievement(achievement.Id);
if prevID ~= nil then
local _, _, _, prevCompleted = addon.GetAchievementInfo(prevID);
if not prevCompleted then
Expand Down Expand Up @@ -370,13 +370,13 @@ local function ComparePoints(a, b, reverse, default)
local pointsA, pointsB = false, false;
if a then
pointsA = select(3, addon.GetAchievementInfo(a.Id));
if GetPreviousAchievement(a.Id) and pointsA > 0 then
if addon.GetPreviousAchievement(a.Id) and pointsA > 0 then
pointsA = AchievementButton_GetProgressivePoints(a.Id);
end
end
if b then
pointsB = select(3, addon.GetAchievementInfo(b.Id));
if GetPreviousAchievement(b.Id) and pointsB > 0 then
if addon.GetPreviousAchievement(b.Id) and pointsB > 0 then
pointsB = AchievementButton_GetProgressivePoints(b.Id);
end
end
Expand Down
15 changes: 14 additions & 1 deletion Globals.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
local addonName, addon = ...;

local customPreviousAchievements = {};
customPreviousAchievements[15664] = 15663;
customPreviousAchievements[15665] = 15664;
customPreviousAchievements[15668] = 15667;
customPreviousAchievements[15669] = 15668;

function addon.GetPreviousAchievement(achievementId)
if customPreviousAchievements[achievementId] then
return customPreviousAchievements[achievementId];
end
return GetPreviousAchievement(achievementId);
end

function addon.GetFirstAchievementId(id)
local firstId;
while id do
firstId = id;
id = GetPreviousAchievement(id);
id = addon.GetPreviousAchievement(id);
end
return firstId;
end
Expand Down
10 changes: 9 additions & 1 deletion Gui/AchievementTooltip/MostProgress.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ function section:CheckAdd(achievement)
if achievement.IsCompleted or achievement.IsAccountWide or achievement.TransmogSets or addon.Options.db.profile.Tooltip.Achievements.MostProgress.Characters <= 0 then
return;
end
numCriteria = GetAchievementNumCriteria(achievement.Id);
local state;
if achievement.TemporaryObtainable then
state = achievement.TemporaryObtainable.Obtainable();
end
local pastObtainable = state and (not state or state == "Past");
if not addon.Options.db.profile.Tooltip.Achievements.ObjectivesProgress.Show or pastObtainable then
return;
end
numCriteria = addon.GetAchievementNumCriteria(achievement.Id);
return numCriteria > 0;
end

Expand Down
14 changes: 12 additions & 2 deletions Gui/Gui.lua
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,20 @@ local function ShowSubFrame(self, ...)
end
end

local function HookShowSubFrame(self)
local function LoadHooks(self)
hooksecurefunc("AchievementFrame_ShowSubFrame", function(...)
ShowSubFrame(self, ...);
end);

AchievementFrameComparison:HookScript("OnHide", function()
if gui.SelectedTab then
gui:SetAchievementFrameWidth();
gui:SetAchievementFrameHeight();
else
gui:ResetAchievementFrameWidth();
gui:ResetAchievementFrameHeight();
end
end);
end

local defaultAchievementFrameWidth;
Expand Down Expand Up @@ -121,7 +131,7 @@ function gui:LoadWithBlizzard_AchievementUI()
self:ResetAchievementFrameHeight();

self:RegisterFrameForClosing(AchievementFrame);
HookShowSubFrame(self);
LoadHooks(self);
end

function gui:SetAchievementFrameWidth()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ end
function factory.GetNew(self)
self.ExtraIcons = self.ExtraIcons or {};
local extraIconId = #self.ExtraIcons + 1;
local extraIcon = CreateFrame("Frame", nil, self, "KrowiAF_AchievementButtonExtraIcon_Template");
local extraIcon = CreateFrame("Frame", "ExtraIcon" .. extraIconId, self, "KrowiAF_AchievementButtonExtraIcon_Template");
self.ExtraIcons[extraIconId] = extraIcon;

if extraIconId == 1 then
Expand Down
6 changes: 3 additions & 3 deletions Gui/WindowFrames/AchievementButton/AchievementButtonMixin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ function KrowiAF_AchievementButtonMixin:DisplayObjectives(forced)
local id = self.Achievement.Id;
if objectives.Id == id and cachedWidthDisplayObjectives == objectives:GetWidth() and not forced then
-- Cached, nothing to do
elseif self.Completed and GetPreviousAchievement(id) then
elseif self.Completed and addon.GetPreviousAchievement(id) then
objectives:SetHeight(1);
objectives:ResetAll();
objectives:DisplayProgressiveAchievement(id);
Expand Down Expand Up @@ -320,7 +320,7 @@ local function GetSaturatedStyle(self, achievement, flags)
end

local function SetShield(self, id, points)
if GetPreviousAchievement(id) and points > 0 then
if addon.GetPreviousAchievement(id) and points > 0 then
points = AchievementButton_GetProgressivePoints(id);
end
local normalFont = self.Compact and GameFontHighlight or AchievementPointsFontHighlight;
Expand All @@ -337,7 +337,7 @@ local function UpdatePlusMinusTexture(self)
end

local id = self.Achievement.Id;
local display = self.Compact or GetAchievementNumCriteria(id) ~= 0 or (self.Completed and GetPreviousAchievement(id));
local display = self.Compact or GetAchievementNumCriteria(id) ~= 0 or (self.Completed and addon.GetPreviousAchievement(id));
if not display then
self.PlusMinus:Hide();
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ function KrowiAF_AchievementsObjectivesMixin:DisplayProgressiveAchievement(id)
end

tinsert(achievements, 1, id);
local prevId = GetPreviousAchievement(id);
local prevId = addon.GetPreviousAchievement(id);
while prevId do
tinsert(achievements, 1, prevId);
prevId = GetPreviousAchievement(prevId);
prevId = addon.GetPreviousAchievement(prevId);
end

local miniAchievementWidth = self:GetMiniAchievement(1):GetWidth();
Expand Down
2 changes: 1 addition & 1 deletion Krowi_AchievementFilter.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Krowi's |cFF1D92C2Achievement Filter|r
## X-Prefix: KrowiAF
## X-Acronym: KAF
## Version: 73.2
## Version: 73.6
## Author: Krowi-Frostmane EU
## SavedVariables: Options, SavedData, Filters, DebugTable, KrowiAF_Options, KrowiAF_SavedData, KrowiAF_Filters, KrowiAF_SearchOptions, KrowiAF_Achievements
## Notes: Filters your achievements.
Expand Down
2 changes: 1 addition & 1 deletion Krowi_AchievementFilter_Cata.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Krowi's |cFF1D92C2Achievement Filter|r
## X-Prefix: KrowiAF
## X-Acronym: KAF
## Version: 73.2
## Version: 73.6
## Author: Krowi-Frostmane EU
## SavedVariables: Options, SavedData, Filters, DebugTable, KrowiAF_Options, KrowiAF_SavedData, KrowiAF_Filters, KrowiAF_SearchOptions, KrowiAF_Achievements
## Notes: Filters your achievements.
Expand Down
2 changes: 1 addition & 1 deletion Krowi_AchievementFilter_Wrath.toc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Title: Krowi's |cFF1D92C2Achievement Filter|r
## X-Prefix: KrowiAF
## X-Acronym: KAF
## Version: 73.2
## Version: 73.6
## Author: Krowi-Frostmane EU
## SavedVariables: Options, SavedData, Filters, DebugTable, KrowiAF_Options, KrowiAF_SavedData, KrowiAF_Filters, KrowiAF_SearchOptions, KrowiAF_Achievements
## Notes: Filters your achievements.
Expand Down
2 changes: 1 addition & 1 deletion Libs/Krowi_Util
Submodule Krowi_Util updated 1 files
+2 −2 Krowi_Util-1.0.lua
2 changes: 1 addition & 1 deletion Libs/Krowi_WorldMapButtons
2 changes: 1 addition & 1 deletion Objects/Achievement.lua
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function achievement:GetPartOfAChainIDs(validate, filters)
if self.Id == 15077 or self.Id == 15078 then -- Issue #49 : Fix
return self.PartOfAChainIDs;
end
if not addon.GetNextAchievement(self) and not GetPreviousAchievement(self.Id) then
if not addon.GetNextAchievement(self) and not addon.GetPreviousAchievement(self.Id) then
return self.PartOfAChainIDs;
end
local id = addon.GetFirstAchievementId(self.Id);
Expand Down
Loading

0 comments on commit 2e1b98b

Please sign in to comment.