Skip to content

Commit

Permalink
Enhance settings with little preview images
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbs committed Sep 28, 2024
1 parent 0915c82 commit 245424a
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Settings/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ local PGFSettingsTable = {
type = "checkbox",
title = L["settings.ratingInfo.title"],
tooltip = L["settings.ratingInfo.tooltip"],
image = "Interface\\AddOns\\PremadeGroupsFilter\\Textures\\SettingsRatingInfo",
visible = true,
},
{
key = "specIcon",
type = "checkbox",
title = L["settings.specIcon.title"],
tooltip = L["settings.specIcon.tooltip"],
image = "Interface\\AddOns\\PremadeGroupsFilter\\Textures\\SettingsSpecIcon",
visible = PGF.SupportsSpecializations(),
},
{
Expand All @@ -76,20 +78,23 @@ local PGFSettingsTable = {
type = "checkbox",
title = L["settings.classBar.title"],
tooltip = L["settings.classBar.tooltip"],
image = "Interface\\AddOns\\PremadeGroupsFilter\\Textures\\SettingsClassBar",
visible = true,
},
{
key = "leaderCrown",
type = "checkbox",
title = L["settings.leaderCrown.title"],
tooltip = L["settings.leaderCrown.tooltip"],
image = "Interface\\AddOns\\PremadeGroupsFilter\\Textures\\SettingsLeaderCrown",
visible = true,
},
{
key = "missingRoles",
type = "checkbox",
title = L["settings.missingRoles.title"],
tooltip = L["settings.missingRoles.tooltip"],
image = "Interface\\AddOns\\PremadeGroupsFilter\\Textures\\SettingsMissingRoles",
visible = true,
},
{
Expand Down Expand Up @@ -165,6 +170,9 @@ function PGFSettings.CreateListItem(factory, elementData)
elementData.callback(button:GetChecked())
end
end)
if elementData.image then
item.Image:SetTexture(elementData.image)
end
end)
elseif elementData.type == "header" then
factory("PremadeGroupsFilterSettingsListSectionHeaderTemplate", function(item, elementData)
Expand Down
9 changes: 9 additions & 0 deletions Settings/Settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@
</Frame>

<Frame name="PremadeGroupsFilterSettingsCheckBoxTemplate" inherits="PremadeGroupsFilterSettingsListItemTemplate" virtual="true">
<Layers>
<Layer level="BACKGROUND">
<Texture parentKey="Image">
<Anchors>
<Anchor point="LEFT" relativePoint="CENTER" x="-30"/>
</Anchors>
</Texture>
</Layer>
</Layers>
<Frames>
<CheckButton parentKey="CheckBox" motionScriptsWhileDisabled="true" virtual="true">
<Size x="30" y="29"/>
Expand Down
Binary file added Textures/SettingsClassBar.blp
Binary file not shown.
Binary file added Textures/SettingsLeaderCrown.blp
Binary file not shown.
Binary file added Textures/SettingsMissingRoles.blp
Binary file not shown.
Binary file added Textures/SettingsRatingInfo.blp
Binary file not shown.
Binary file added Textures/SettingsSpecIcon.blp
Binary file not shown.

0 comments on commit 245424a

Please sign in to comment.