Skip to content

Commit

Permalink
Add reputation filter + show legacy reputation options
Browse files Browse the repository at this point in the history
  • Loading branch information
DJScias committed Sep 7, 2024
1 parent ad368af commit a501d66
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [6.2.0] - Unreleased

### Added
- Add two new options introduced to reputations in The War Within (also found in the upper right corner on the reputations panel):
- "Reputation Filter" lets you filter your reputations between All, Warband and your Character.
- "Show Legacy Reputation" toggles all the reputations prior to The War Within.

### Changed
- Rewrote the behavior of "Auto add to Recent Reputations list" and "Auto switch bar to last gained reputation".
- Auto-add has no noticeable end-user changes that are worth mentioning.
Expand Down
8 changes: 1 addition & 7 deletions core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1125,24 +1125,18 @@ function Addon:OpenContextMenu(clickedModuleIndex)
local splitOneOption = rootDescription:CreateRadio("Split into one", function() return self.db.char.NumSplits == 1; end, function()
Addon:SetSplits(1);
end);
splitOneOption:SetShouldRespondIfSubmenu(true);
splitOneOption:SetResponse(MenuResponse.CloseAll);
local splitTwoOption = rootDescription:CreateRadio("Split into two", function() return self.db.char.NumSplits == 2; end, function()
Addon:SetSplits(2);
end);
splitTwoOption:SetShouldRespondIfSubmenu(true);
splitTwoOption:SetResponse(MenuResponse.CloseAll);
if numTotalEnabled < 2 then
splitTwoOption:SetEnabled(false);
end
local splitThreeOption = rootDescription:CreateRadio("Split into three", function() return self.db.char.NumSplits == 3; end, function()
Addon:SetSplits(3);
end);
splitThreeOption:SetShouldRespondIfSubmenu(true);
splitThreeOption:SetResponse(MenuResponse.CloseAll);
splitThreeOption:SetTooltip(function(tooltip, elementDescription)
GameTooltip_SetTitle(tooltip, MenuUtil.GetElementText(elementDescription));
GameTooltip_AddNormalLine(tooltip, "When splitting into three the text is shortened and you can hover over the bar to view full text.|n|nYou will see a plus symbol (+) when some information is hidden.");
GameTooltip_AddNormalLine(tooltip, "When the bar is split into three, the text is truncated and you can hover over the bar to see the full text.|n|nYou will see a plus symbol (+) when some information is hidden.");
end);
if numTotalEnabled < 3 then
splitThreeOption:SetEnabled(false);
Expand Down
30 changes: 30 additions & 0 deletions modules/reputation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,36 @@ function module:GetOptionsMenu(currentMenu)

currentMenu:CreateDivider();

local reputationSortType = currentMenu:CreateButton("Reputation Filter");
reputationSortType:CreateTitle("Reputation Filter");
reputationSortType:SetTooltip(function(tooltip, elementDescription)
GameTooltip_SetTitle(tooltip, MenuUtil.GetElementText(elementDescription));
GameTooltip_AddNormalLine(tooltip, "Filters your reputation list by chosen type.|n|n|cnWARNING_FONT_COLOR:Note: This option can also be found in the reputations panel in the upper right corner.|r");
end);
local sortTypeAll = reputationSortType:CreateRadio("All", function() return C_Reputation.GetReputationSortType() == 0; end, function()
C_Reputation.SetReputationSortType(0)
end);

local sortTypeWarband = reputationSortType:CreateRadio("Warband", function() return C_Reputation.GetReputationSortType() == 1; end, function()
C_Reputation.SetReputationSortType(1)
end);

local sortTypeChar = reputationSortType:CreateRadio(UnitName("PLAYER"), function() return C_Reputation.GetReputationSortType() == 2; end, function()
C_Reputation.SetReputationSortType(2)
end);

local legacyOption = currentMenu:CreateCheckbox("Show Legacy Reputations", function() return C_Reputation.AreLegacyReputationsShown(); end, function()
C_Reputation.SetLegacyReputationsShown(not C_Reputation.AreLegacyReputationsShown());
module:RefreshText();
end);
legacyOption:SetTooltip(function(tooltip, elementDescription)
GameTooltip_SetTitle(tooltip, MenuUtil.GetElementText(elementDescription));
GameTooltip_AddNormalLine(tooltip, "This option will toggle all reputations prior to |cnWHITE_FONT_COLOR:The War Within|r.|n|n|cnWARNING_FONT_COLOR:Note: This option can also be found in the reputations panel in the upper right corner.|r");
end);
legacyOption:SetResponse(MenuResponse.CloseAll);

currentMenu:CreateDivider();

currentMenu:CreateCheckbox("Show gained reputation", function() return self.db.global.ShowGainedRep; end, function()
self.db.global.ShowGainedRep = not self.db.global.ShowGainedRep;
module:RefreshText();
Expand Down

0 comments on commit a501d66

Please sign in to comment.