Skip to content

Commit

Permalink
Replace reset button with an icon, add shortcut button to options panel
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbs committed Aug 22, 2024
1 parent 0af1e80 commit f21e5eb
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 5 deletions.
1 change: 1 addition & 0 deletions Localization/deDE.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000Semantischer Fehler im Filterausdruck
L["message.noplaystylefix"] = "Premade Groups Filter: Der Fehler 'Interface-Aktion auf Grund eines Addons fehlgeschlagen' wird nicht automatisch behoben, da du anscheinend keinen vollständig gesicherten Account hast und ansonsten keine organisierten Gruppen erstellen kannst. Siehe Addon-FAQ für weitere Informationen und wie man dieses Problem behebt."
L["message.settingsupgraded"] = "Premade Groups Filter: Einstellungen auf Version %s migriert"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "Zurücksetzen"
L["dialog.reset.confirm"] = "Wirklich alle Felder zurücksetzen?"
L["dialog.refresh"] = "Suchen"
Expand Down
1 change: 1 addition & 0 deletions Localization/enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ L["error.semantic.protected"] = "|cffff0000Semantic error in filter expression|r
L["message.noplaystylefix"] = "Premade Groups Filter: Will not apply fix for 'Interface action failed because of an AddOn' errors because you don't seem to have a fully secured account and otherwise can't create premade groups. See addon FAQ for more information and how to fix this issue."
L["message.settingsupgraded"] = "Premade Groups Filter: Migrated settings to version %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "Reset"
L["dialog.reset.confirm"] = "Really reset all fields?"
L["dialog.refresh"] = "Search"
Expand Down
1 change: 1 addition & 0 deletions Localization/esES.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000Error Semántico en la expresión|r\n
L["message.noplaystylefix"] = "Premade Groups Filter: Will not apply fix for 'Interface action failed because of an AddOn' errors because you don't seem to have a fully secured account and otherwise can't create premade groups. See addon FAQ for more information and how to fix this issue."
L["message.settingsupgraded"] = "Premade Groups Filter: Configuración migrada a la versión %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "Restablecer"
L["dialog.reset.confirm"] = "¿Realmente restablecer todos los campos?"
L["dialog.refresh"] = "Buscar"
Expand Down
1 change: 1 addition & 0 deletions Localization/frFR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000Erreur sémantique dans le filtre d
L["message.noplaystylefix"] = "Premade Groups Filter n’appliquera pas de correctif pour les erreurs liées à « L’action d'interface a échoué en raison d'un Adddon » car vous ne semblez pas disposer d'un compte entièrement sécurisé et ne pouvez pas créer de groupes prédéfinis. Consultez la FAQ de l’addon pour plus d’informations et comment résoudre ce problème."
L["message.settingsupgraded"] = "Premade Groups Filter : paramètres migrés vers la version %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "Réinitialiser"
L["dialog.reset.confirm"] = "Souhaitez-vous vraiment réinitialiser tous les champs ?"
L["dialog.refresh"] = "Rechercher"
Expand Down
1 change: 1 addition & 0 deletions Localization/itIT.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000Errore semantico nell'espressione del
L["message.noplaystylefix"] = "Premade Groups Filter: Non verrà applicata la correzione per gli errori 'Azione interfaccia non riuscita a causa di un componente aggiuntivo' perché non sembra che tu disponga di un account completamente protetto e altrimenti non puoi creare gruppi predefiniti. Consulta le domande frequenti sui componenti aggiuntivi per ulteriori informazioni e come risolvere questo problema."
L["message.settingsupgraded"] = "Premade Groups Filter: Impostazioni trasferite alla versione %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "Ripristina"
L["dialog.reset.confirm"] = "Resettare davvero tutti i campi?"
L["dialog.refresh"] = "Ricerca"
Expand Down
1 change: 1 addition & 0 deletions Localization/koKR.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000필터 표현에 의미 오류|r\n\n'
L["message.noplaystylefix"] = "Premade Groups Filter: Will not apply fix for 'Interface action failed because of an AddOn' errors because you don't seem to have a fully secured account and otherwise can't create premade groups. See addon FAQ for more information and how to fix this issue."
L["message.settingsupgraded"] = "Premade Groups Filter: 버전 %s로 마이그레이션된 설정"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "초기화"
L["dialog.reset.confirm"] = "모든 필드를 재설정하시겠습니까?"
L["dialog.refresh"] = "검색"
Expand Down
1 change: 1 addition & 0 deletions Localization/ruRU.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000Семантическая ошибк
L["message.noplaystylefix"] = "Premade Groups Filter: Не будет применяться исправление для ошибки 'Interface action failed because of an AddOn', потому что, похоже, у Вас нет полностью защищенной учетной записи, и Вы не можете создавать заранее собранные группы. См. FAQ по аддону для получения дополнительной информации и способов решения этой проблемы."
L["message.settingsupgraded"] = "Premade Groups Filter: Настройки перенесены в версию %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "Сброс"
L["dialog.reset.confirm"] = "Действительно сбросить все поля?"
L["dialog.refresh"] = "Поиск"
Expand Down
1 change: 1 addition & 0 deletions Localization/zhCN.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000过滤语法的语义错误|r\n\n不
L["message.noplaystylefix"] = "预创建队伍过滤: 不会修复“接口操作因AddOn而失败”错误,因为您似乎没有完全安全的帐户,否则无法创建预制队伍。请参阅插件常见问题解答以获取更多信息以及如何解决此问题。"
L["message.settingsupgraded"] = "预创建队伍过滤: 设置迁移到版本 %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "重置"
L["dialog.reset.confirm"] = "重置所有字段?"
L["dialog.refresh"] = "搜索"
Expand Down
1 change: 1 addition & 0 deletions Localization/zhTW.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ L["error.semantic.protected"] = "|cffff0000過濾語法的語意錯誤|r\n\n不
L["message.noplaystylefix"] = "預組隊伍過濾: 不會修復“接口操作因AddOn而失敗”錯誤,因為您似乎沒有完全安全的帳戶,否則無法創建預製隊伍。請參閱插件常見問題解答以獲取更多信息以及如何解決此問題。"
L["message.settingsupgraded"] = "預組隊伍過濾: 設置遷移到版本 %s"

L["dialog.settings"] = GAMEMENU_OPTIONS
L["dialog.reset"] = "重置"
L["dialog.reset.confirm"] = "重置所有字段?"
L["dialog.refresh"] = "搜尋"
Expand Down
8 changes: 7 additions & 1 deletion Settings/Settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ function PGFSettings:OnLoad()
view:SetElementFactory(function(factory, elementData) self.CreateListItem(factory, elementData) end)
ScrollUtil.InitScrollBoxListWithScrollBar(self.ScrollBox, self.ScrollBar, view)

Settings.RegisterAddOnCategory(Settings.RegisterCanvasLayoutCategory(self, L["addon.name.long"]))
local category, layout = Settings.RegisterCanvasLayoutCategory(self, L["addon.name.long"])
Settings.RegisterAddOnCategory(category)
PGF.settingsCategory = category
end

function PGFSettings.CreateListItem(factory, elementData)
Expand Down Expand Up @@ -176,5 +178,9 @@ function PGFSettings:OnRefresh()
-- Options dialog opened
end

function PGF.OpenSettings()
Settings.OpenToCategory(PGF.settingsCategory.ID)
end

PGFSettings:SetScript("OnShow", PGFSettings.OnShow)
PGFSettings:OnLoad()
20 changes: 19 additions & 1 deletion UI/Dialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,26 @@ function PGFDialog:OnLoad()
self.MaximizeMinimizeFrame:SetOnMinimizedCallback(function () self:OnMinimize() end)
end

self.ResetButton:SetText(L["dialog.reset"])
self.ResetButton:SetScript("OnClick", function () self:OnResetButtonClick() end)
self.ResetButton:SetScript("OnEnter", function (self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(L["dialog.reset"], nil, nil, nil, nil, true)
GameTooltip:Show()
end)
self.ResetButton:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)

self.SettingsButton:SetScript("OnClick", function () PGF.OpenSettings() end)
self.SettingsButton:SetScript("OnEnter", function (self)
GameTooltip:SetOwner(self, "ANCHOR_RIGHT")
GameTooltip:SetText(L["dialog.settings"], nil, nil, nil, nil, true)
GameTooltip:Show()
end)
self.SettingsButton:SetScript("OnLeave", function(self)
GameTooltip:Hide()
end)

self.RefreshButton:SetText(L["dialog.refresh"])
self.RefreshButton:SetScript("OnClick", function () self:OnRefreshButtonClick() end)
end
Expand Down
22 changes: 19 additions & 3 deletions UI/Dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,26 @@
<Anchor point="RIGHT" relativeKey="$parent.CloseButton" relativePoint="LEFT" x="-1" y="0"/>
</Anchors>
</Frame>
<Button parentKey="ResetButton" inherits="MagicButtonTemplate">
<Size x="135" y="22"/>
<Button parentKey="ResetButton" inherits="IconButtonTemplate">
<KeyValues>
<KeyValue key="iconAtlas" value="talents-button-reset" type="string"/>
<KeyValue key="useAtlasSize" value="true" type="boolean"/>
<KeyValue key="useIconAsHighlight" value="true" type="boolean"/>
</KeyValues>
<Size x="25" y="25"/>
<Anchors>
<Anchor point="BOTTOMLEFT" x="7" y="4"/>
</Anchors>
</Button>
<Button parentKey="SettingsButton" inherits="IconButtonTemplate">
<KeyValues>
<KeyValue key="icon" value="Interface\Icons\Pet_Type_Mechanical" type="string"/>
<KeyValue key="iconSize" value="22" type="number"/>
<KeyValue key="useIconAsHighlight" value="true" type="boolean"/>
</KeyValues>
<Size x="25" y="25"/>
<Anchors>
<Anchor point="BOTTOMLEFT" x="3" y="4"/>
<Anchor point="TOPLEFT" relativeKey="$parent.ResetButton" relativePoint="TOPRIGHT"/>
</Anchors>
</Button>
<Button parentKey="RefreshButton" inherits="MagicButtonTemplate">
Expand Down

0 comments on commit f21e5eb

Please sign in to comment.