diff --git a/CHANGELOG.md b/CHANGELOG.md index e022045..97cd242 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,17 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Upcoming] Version 0.7.1-beta - 2020-06-08 +## [Upcoming] Version 0.8.0-beta - 2020-06-08 ### Added - handle replacement via slash command +## Version 0.7.1-beta - 2020-06-07 +### Added +- user reporting capabilities +- ignore Battle.net contacts +### Changed +- graphical move arrows + ## Version 0.7.0-beta - 2020-06-07 ### Added - order buttons diff --git a/Grichelde.lua b/Grichelde.lua index 25f4495..1a5dd07 100644 --- a/Grichelde.lua +++ b/Grichelde.lua @@ -56,16 +56,22 @@ end --- Register slash commands 'gri' and 'grichelde' function Grichelde:SetupSlashCommands() - local function HandleSlashCommand(input) - -- Show the GUI if no input is supplied, otherwise handle the chat input. - if self.functions.nilOrEmpty(input) then - LibStub("AceConfigDialog-3.0"):Open(self.name) - else - -- handle slash ourselves - self:Print("Handle slash command: " .. input) + self:RegisterChatCommand("grichelde", "HandleSlashCommand") + self:RegisterChatCommand("gri", "HandleSlashCommand") +end + +function Grichelde:HandleSlashCommand(input) + -- Show the GUI if no input is supplied, otherwise handle the chat input. + if self.functions.nilOrEmpty(input) then + LibStub("AceConfigDialog-3.0"):Open(self.name) + else + -- handle slash ourselves + self:DebugPrint("Handle slash command: " .. input) + if input == "mappings" then + self:ShowMappings() + end + if input == "options" then + self:PrintOptions() end end - - self:RegisterChatCommand("grichelde", HandleSlashCommand) - self:RegisterChatCommand("gri", HandleSlashCommand) end \ No newline at end of file diff --git a/Grichelde.toc b/Grichelde.toc index e08c5b3..340c47c 100644 --- a/Grichelde.toc +++ b/Grichelde.toc @@ -3,7 +3,7 @@ ## Title: Grichelde ## Notes: Replaces characters from the chat box ## Notes-de: Ersetzt eingegebene Zeichen in der Chat-Zeile -## Version: 0.7.0-beta +## Version: 0.7.1-beta ## Author: Teilzeit-Jedi ## eMail: tj@teilzeit-jedi.de diff --git a/GricheldeChat.lua b/GricheldeChat.lua index 8664e86..9f78052 100644 --- a/GricheldeChat.lua +++ b/GricheldeChat.lua @@ -153,6 +153,7 @@ function Grichelde:CheckForPreversableText(text) "|[Cc]%x%x%x%x%x%x%x%x.-|r", -- colored items (or links) "|H.-|h", -- item links (http://www.wowwiki.com/ItemLink) "|T.-|t", -- textures + "|K.-|k", -- Battle.net "|n", -- newline "{rt[1-8]}", -- rumbered raid target icons diff --git a/GricheldeOptions.lua b/GricheldeOptions.lua index 382b859..00855d5 100644 --- a/GricheldeOptions.lua +++ b/GricheldeOptions.lua @@ -184,16 +184,20 @@ function Grichelde:CreateMapping(offset) moveUp = { order = 10, type = "execute", - name = self.L.Options_Mapping_MoveUp_Name, + --name = self.L.Options_Mapping_MoveUp_Name, + name = "", desc = self.L.Options_Mapping_MoveUp_Desc, + image = "Interface\\ChatFrame\\UI-ChatIcon-ScrollUp-Up", width = 0.25, func = function(info) self:MoveUp(info) end }, moveDown = { order = 11, type = "execute", - name = self.L.Options_Mapping_MoveDown_Name, + --name = self.L.Options_Mapping_MoveDown_Name, + name = "", desc = self.L.Options_Mapping_MoveDown_Desc, + image = "Interface\\ChatFrame\\UI-ChatIcon-ScrollDown-Up", width = 0.25, func = function(info) self:MoveDown(info) end }, @@ -217,6 +221,14 @@ function Grichelde:CreateMapping(offset) } end +--dropButton:SetWidth(24) +--dropButton:SetHeight(24) +--dropButton:SetPoint("TOPRIGHT", DRight, "TOPRIGHT", -16, -18) +--dropButton:SetNormalTexture([[Interface\ChatFrame\UI-ChatIcon-ScrollDown-Up]]) +--dropButton:SetPushedTexture([[Interface\ChatFrame\UI-ChatIcon-ScrollDown-Down]]) +--dropButton:SetDisabledTexture([[Interface\ChatFrame\UI-ChatIcon-ScrollDown-Disabled]]) +--dropButton:SetHighlightTexture([[Interface\Buttons\UI-Common-MouseHilight]], "ADD") + function Grichelde:SetupOptions() -- add DB-backed profiles to UI options local options = self:CreateOptionsUI() diff --git a/GricheldeUtils.lua b/GricheldeUtils.lua index d7d6d83..2344df7 100644 --- a/GricheldeUtils.lua +++ b/GricheldeUtils.lua @@ -164,10 +164,58 @@ function Grichelde:LogPrint(logLevel, printFunc, obj, ...) end end +--- Print UI options to chat frame function Grichelde:PrintOptions() - self:DebugPrint(self.options.args.replacements.args) + self:PrefixedPrint(self.COLOR_CODES.PREFIX .. self.L.Debug_Options .. self.COLOR_CODES.CLOSE) + self:LogPrint(-1, function(...) + print(self.COLOR_CODES.PREFIX .. self.L.AddonName .. self.COLOR_CODES.CLOSE .. ":", self:Format(...)) + end, self.options.args.replacements.args) end +--- Print DB replacements to chat frame function Grichelde:PrintMappings() - self:DebugPrint(self.db.profile.replacements) + self:PrefixedPrint(self.COLOR_CODES.PREFIX .. self.L.Debug_Mappings .. self.COLOR_CODES.CLOSE) + self:LogPrint(-1, function(...) + print(self.COLOR_CODES.PREFIX .. self.L.AddonName .. self.COLOR_CODES.CLOSE .. ":", self:Format(...)) + end, self.db.profile.replacements) +end + +--- Open UI windows with replacements in it +function Grichelde:ShowMappings() + if self.debugFrame and self.debugFrame:IsShown() then + self.debugFrame:Release(self.debugFrame) + self.debugFrame = nil + else + local replacements = self.db.profile.replacements or {} + local repls = 0 + for k, _ in pairs(replacements) do + if k and find(k, "^replacement_") then + repls = repls + 1 + end + end + + local AceGUI = LibStub("AceGUI-3.0") + local frame = AceGUI:Create("Frame"); + frame:SetTitle(self.L.Debug_Mappings); + frame:SetStatusText(self:Format(self.L.Debug_Mappings_Found, repls)) + frame:SetWidth(400); + frame:SetHeight(600); + frame:SetLayout("Fill"); + + local function closeFrame() frame:Release(frame) end + frame:SetCallback("OnClose", closeFrame) + + local configBox = AceGUI:Create("MultiLineEditBox"); + local text = "" + tPrint(replacements, 0, {}, function(s) text = text .. s .. "|n" end) + configBox:SetLabel("") + configBox:SetText(text) + configBox:DisableButton(true) + --configBox:SetDisabled(true) + configBox:SetNumLines(30); + configBox:SetFocus() + + frame:AddChild(configBox); + self.debugFrame = frame + end end \ No newline at end of file diff --git a/localisation/deDE.lua b/localisation/deDE.lua index 6385213..ab7c57e 100644 --- a/localisation/deDE.lua +++ b/localisation/deDE.lua @@ -7,6 +7,9 @@ L.VersionAbbr = "v" L.AddonLoaded = "%s hilft Euch jetzt bei euren Sprachschwierigkeiten." L.Upgrade_ToVersion = "Hebe Databank auf Version %s an." L.Upgrade_Successful = "Upgrade erfolgreich." +L.Debug_Options = "Optionen" +L.Debug_Mappings = "Ersetzungen" +L.Debug_Mappings_Found = "%d Ersetzungen gefunden" -- profiles L.Profiles_Available = "Verf\195\188gbare Profile:" @@ -63,7 +66,7 @@ L.Options_Replacements_DeleteAll_Name = "Alle L\195\182schen" L.Options_Replacements_DeleteAll_Desc = "L\195\182scht alle Zuweisungen." L.Options_Replacements_DeleteAll_ConfirmText="Wirklich ALLE Zuweisungen l\195\182schen?" L.Options_Replacements_Header = "Die Vorkommen links vom Pfeil ( => ) werden in den aktivierten Kan\195\164len gesucht und durch den Text rechts vom Pfeil ersetzt." - .."|nWird die Groß\195\159- und Kleinschreibung ignoriert, wird die Groß\195\159schreibung jedes Zeichens wird bei der Ersetzung \195\188bernommen." + .."|nWird die Gro\195\159- und Kleinschreibung ignoriert, wird die Gro\195\159schreibung jedes Zeichens wird bei der Ersetzung \195\188bernommen." .."|nDas Zusammenfassen aufeinanderfolgender Treffer vermeidet unsch\195\182ne Wiederholungen, die durch die Ersetzung entstehen k\195\182nnen." .."|nMit den beiden Standard-Ersetzung wird so aus \"Tasse\" => \"Ckache\"." L.Options_Mapping_Group_Name = "%s => %s" @@ -74,7 +77,7 @@ L.Options_Mapping_SearchText_Desc = "Dieser Text wird in der Chateingabe gesucht L.Options_Mapping_ReplaceText_Name = "Ersetzung:" L.Options_Mapping_ReplaceText_Desc = "Jeder Suchtreffer wird mit diesem Text ersetzt." L.Options_Mapping_ExactCase_Name = "exakte Gro\195\159- und Kleinschreibung" -L.Options_Mapping_ExactCase_Desc = "Wenn gesetzt, muss die Groß\195\159- und Kleinschreibung des Suchtextes exakt \195\188berein stimmen. Anderfalls wird die Groß\195\159schreibung jedes Zeichens bei der Ersetzung \195\188bernommen." +L.Options_Mapping_ExactCase_Desc = "Wenn gesetzt, muss die Gro\195\159- und Kleinschreibung des Suchtextes exakt \195\188berein stimmen. Anderfalls wird die Gro\195\159schreibung jedes Zeichens bei der Ersetzung \195\188bernommen." L.Options_Mapping_Consolidate_Name = "Fa\195\159e aufeinanderfolgende Treffer zusammen" L.Options_Mapping_Consolidate_Desc = "Wenn durch die Ersetzung die Zeichenfolge mehrfach hintereinander steht,|nfasse sie zu einem Vorkommen zusammen." L.Options_Mapping_MoveUp_Name = "^" diff --git a/localisation/enUS.lua b/localisation/enUS.lua index 5ca6bdf..635fd2f 100644 --- a/localisation/enUS.lua +++ b/localisation/enUS.lua @@ -7,6 +7,9 @@ L.VersionAbbr = "v" L.AddonLoaded = "%s now helps you with your spelling disabilities." L.Upgrade_ToVersion = "Upgrade database to version %s." L.Upgrade_Successful = "Upgrade successful." +L.Debug_Options = "Options" +L.Debug_Mappings = "Mappings" +L.Debug_Mappings_Found = "%d Mappings found" -- profiles L.Profiles_Available = "Available profiles:" diff --git a/twitch/channels-de.png b/twitch/channels-de.png new file mode 100644 index 0000000..2400534 Binary files /dev/null and b/twitch/channels-de.png differ diff --git a/twitch/channels-en.png b/twitch/channels-en.png new file mode 100644 index 0000000..215dc2f Binary files /dev/null and b/twitch/channels-en.png differ diff --git a/twitch/example-de.png b/twitch/example-de.png new file mode 100644 index 0000000..6259b9d Binary files /dev/null and b/twitch/example-de.png differ diff --git a/twitch/example-en.png b/twitch/example-en.png new file mode 100644 index 0000000..d097973 Binary files /dev/null and b/twitch/example-en.png differ diff --git a/twitch/profiles-de.png b/twitch/profiles-de.png new file mode 100644 index 0000000..93f16d8 Binary files /dev/null and b/twitch/profiles-de.png differ diff --git a/twitch/profiles-en.png b/twitch/profiles-en.png new file mode 100644 index 0000000..d8fe99d Binary files /dev/null and b/twitch/profiles-en.png differ diff --git a/twitch/replacements-de.png b/twitch/replacements-de.png new file mode 100644 index 0000000..ff9bcc4 Binary files /dev/null and b/twitch/replacements-de.png differ diff --git a/twitch/replacements-en.png b/twitch/replacements-en.png new file mode 100644 index 0000000..96eb82c Binary files /dev/null and b/twitch/replacements-en.png differ diff --git a/twitch/send-errors.png b/twitch/send-errors.png new file mode 100644 index 0000000..48d84e0 Binary files /dev/null and b/twitch/send-errors.png differ diff --git a/twitch/show-mappings.png b/twitch/show-mappings.png new file mode 100644 index 0000000..3324c9c Binary files /dev/null and b/twitch/show-mappings.png differ