From 943db1de2fa8c88f4b831cc52cdca6d799fe905f Mon Sep 17 00:00:00 2001 From: Mikeprod Date: Fri, 4 Nov 2016 23:38:06 +0100 Subject: [PATCH] Locales added for the last developed features --- core.lua | 302 ++++++++++++++++++++++++---------------------- locales/deDE.lua | 23 +++- locales/enUS.lua | 23 +++- locales/frFR.lua | 25 +++- locales/ruRU.lua | 23 +++- modules/clock.lua | 2 +- modules/micromenu.lua | 77 +++++++----- settings.lua | 317 ------------------------------------------------- 8 files changed, 297 insertions(+), 495 deletions(-) delete mode 100644 settings.lua diff --git a/core.lua b/core.lua index 5d44bf0..a18b99c 100644 --- a/core.lua +++ b/core.lua @@ -8,6 +8,16 @@ local topOffsetBlizz XIVBar.L = L +XIVBar.constants = { + mediaPath = "Interface\\AddOns\\"..AddOnName.."\\media\\", + playerName = UnitName("player"), + playerClass = select(2, UnitClass("player")), + playerLevel = UnitLevel("player"), + playerFactionLocal = select(2, UnitFactionGroup("player")), + playerRealm = GetRealmName(), + popupPadding = 3 +} + XIVBar.defaults = { profile = { general = { @@ -41,11 +51,11 @@ XIVBar.defaults = { useTextCC = false, useHoverCC = true, hover = { - r = 1, - g = 1, - b = 1, - a = 1 - } + r = RAID_CLASS_COLORS[XIVBar.constants.playerClass].r, + g = RAID_CLASS_COLORS[XIVBar.constants.playerClass].g, + b = RAID_CLASS_COLORS[XIVBar.constants.playerClass].b, + a = RAID_CLASS_COLORS[XIVBar.constants.playerClass].a + } }, text = { fontSize = 12, @@ -58,16 +68,6 @@ XIVBar.defaults = { } }; -XIVBar.constants = { - mediaPath = "Interface\\AddOns\\"..AddOnName.."\\media\\", - playerName = UnitName("player"), - playerClass = select(2, UnitClass("player")), - playerLevel = UnitLevel("player"), - playerFactionLocal = select(2, UnitFactionGroup("player")), - playerRealm = GetRealmName(), - popupPadding = 3 -} - XIVBar.LSM = LibStub('LibSharedMedia-3.0'); function XIVBar:OnInitialize() @@ -86,10 +86,7 @@ function XIVBar:OnInitialize() name = GENERAL_LABEL, type = "group", args = { - general = self:GetGeneralOptions(), - text = self:GetTextOptions(), - textColors = self:GetTextColorOptions(), -- colors - positionOptions = self:GetPositionOptions(), + general = self:GetGeneralOptions() } }, -- general modules = { @@ -249,12 +246,8 @@ function XIVBar:Refresh() end self.frames.bar:SetHeight(self:GetHeight()) + self.frames.bgTexture:SetColorTexture(self:GetColor('barColor')) self.frames.bgTexture:SetAllPoints() - if self.db.profile.color.useCC then - self.frames.bgTexture:SetColorTexture(self:GetClassColors()) - else - self.frames.bgTexture:SetColorTexture(barColor.r, barColor.g, barColor.b, barColor.a) - end for name, module in self:IterateModules() do if module['Refresh'] == nil then return; end @@ -345,107 +338,129 @@ function XIVBar:GetGeneralOptions() return { name = GENERAL_LABEL, type = "group", - order = 3, inline = true, args = { - barPosition = { - name = L['Bar Position'], - type = "select", - order = 1, - values = {TOP = L['Top'], BOTTOM = L['Bottom']}, - style = "dropdown", - get = function() return self.db.profile.general.barPosition; end, - set = function(info, value) self.db.profile.general.barPosition = value; - if value == "TOP" and self.db.profile.general.ohHide then - LoadAddOn("Blizzard_OrderHallUI"); local b = OrderHallCommandBar; b:Hide(); - end - self:Refresh(); end, - }, - barCC = { - name = L['Use Class Colors for Bar'], - type = "toggle", - order = 2, - set = function(info, val) self.db.profile.color.useCC = val; self:Refresh(); end, - get = function() return self.db.profile.color.useCC end - }, -- normal - barColor = { - name = L['Bar Color'], - type = "color", - order = 3, - hasAlpha = true, - set = function(info, r, g, b, a) - XIVBar:SetColor('barColor', r, g, b, a) - end, - get = function() return XIVBar:GetColor('barColor') end, - disabled = function() return self.db.profile.color.useCC end - }, - barPadding = { - name = L['Bar Padding'], - type = 'range', - order = 4, - min = 0, - max = 10, - step = 1, - get = function() return self.db.profile.general.barPadding; end, - set = function(info, val) self.db.profile.general.barPadding = val; self:Refresh(); end - }, - moduleSpacing = { - name = L['Module Spacing'], - type = 'range', - order = 5, - min = 10, - max = 50, - step = 1, - get = function() return self.db.profile.general.moduleSpacing; end, - set = function(info, val) self.db.profile.general.moduleSpacing = val; self:Refresh(); end - }, - ohHide = { - name = L['Hide order hall bar'], - type = "toggle", - order = 2, - hidden = function() return self.db.profile.general.barPosition == "BOTTOM" end, - get = function() return self.db.profile.general.ohHide end, - set = function(_,val) self.db.profile.general.ohHide = val; if val then LoadAddOn("Blizzard_OrderHallUI"); local b = OrderHallCommandBar; b:Hide(); end self:Refresh(); end - } - } - } -end - -function XIVBar:GetPositionOptions() - return { - name = L['Positioning Options'], - type = "group", - order = 4, - inline = true, - args = { - fullScreen = { - name = VIDEO_OPTIONS_FULLSCREEN, - type = 'toggle', - order = 0, - get = function() return self.db.profile.general.barFullscreen; end, - set = function(info, value) self.db.profile.general.barFullscreen = value; self:Refresh(); end, - }, - barPosition = { - name = L['Horizontal Position'], - type = "select", - order = 1, - values = {LEFT = L['Left'], CENTER = L['Center'], RIGHT = L['Right']}, - style = "dropdown", - get = function() return self.db.profile.general.barHoriz; end, - set = function(info, value) self.db.profile.general.barHoriz = value; self:Refresh(); end, - disabled = function() return self.db.profile.general.barFullscreen; end - }, - barWidth = { - name = L['Bar Width'], - type = 'range', - order = 2, - min = 200, - max = GetScreenWidth(), - step = 1, - get = function() return self.db.profile.general.barWidth; end, - set = function(info, val) self.db.profile.general.barWidth = val; self:Refresh(); end, - disabled = function() return self.db.profile.general.barFullscreen; end - } + positioning = { + name = L["Positioning"], + type = "group", + order = 1, + inline = true, + args = { + barLocation = { + name = L['Bar Position'], + type = "select", + order = 1, + width = "full", + values = {TOP = L['Top'], BOTTOM = L['Bottom']}, + style = "dropdown", + get = function() return self.db.profile.general.barPosition; end, + set = function(info, value) self.db.profile.general.barPosition = value; + if value == "TOP" and self.db.profile.general.ohHide then + LoadAddOn("Blizzard_OrderHallUI"); local b = OrderHallCommandBar; b:Hide(); + end + self:Refresh(); end, + }, + ohHide = { + name = L['Hide order hall bar'], + type = "toggle", + order = 2, + hidden = function() return self.db.profile.general.barPosition == "BOTTOM" end, + get = function() return self.db.profile.general.ohHide end, + set = function(_,val) self.db.profile.general.ohHide = val; if val then LoadAddOn("Blizzard_OrderHallUI"); local b = OrderHallCommandBar; b:Hide(); end self:Refresh(); end + }, + fullScreen = { + name = VIDEO_OPTIONS_FULLSCREEN, + type = "toggle", + order = 3, + get = function() return self.db.profile.general.barFullscreen; end, + set = function(info, value) self.db.profile.general.barFullscreen = value; self:Refresh(); end, + }, + barPosition = { + name = L['Horizontal Position'], + type = "select", + hidden = function() return self.db.profile.general.barFullscreen; end, + order = 4, + values = {LEFT = L['Left'], CENTER = L['Center'], RIGHT = L['Right']}, + style = "dropdown", + get = function() return self.db.profile.general.barHoriz; end, + set = function(info, value) self.db.profile.general.barHoriz = value; self:Refresh(); end, + disabled = function() return self.db.profile.general.barFullscreen; end + }, + barWidth = { + name = L['Bar Width'], + type = 'range', + order = 5, + hidden = function() return self.db.profile.general.barFullscreen; end, + min = 200, + max = GetScreenWidth(), + step = 1, + get = function() return self.db.profile.general.barWidth; end, + set = function(info, val) self.db.profile.general.barWidth = val; self:Refresh(); end, + disabled = function() return self.db.profile.general.barFullscreen; end + } + } + }, + text = self:GetTextOptions(), + colors = { + name = L["Colors"], + type = "group", + inline = true, + order = 3, + args = { + barColor = { + name = L['Bar Color'], + type = "color", + order = 1, + hasAlpha = true, + set = function(info, r, g, b, a) + if not self.db.profile.color.useCC then + self:SetColor('barColor', r, g, b, a) + else + local cr,cg,cb,_ = self:GetClassColors() + self:SetColor('barColor',cr,cg,cb,a) + end + end, + get = function() return XIVBar:GetColor('barColor') end, + }, + barCC = { + name = L['Use Class Color for Bar'], + desc = L["Only the alpha can be set with the color picker"], + type = "toggle", + order = 2, + set = function(info, val) XIVBar:SetColor('barColor',self:GetClassColors()); self.db.profile.color.useCC = val; self:Refresh(); end, + get = function() return self.db.profile.color.useCC end + }, + textColors = self:GetTextColorOptions() + } + }, + miscellanelous = { + name = L["Miscellaneous"], + type = "group", + inline = true, + order = 3, + args = { + barPadding = { + name = L['Bar Padding'], + type = 'range', + order = 9, + min = 0, + max = 10, + step = 1, + get = function() return self.db.profile.general.barPadding; end, + set = function(info, val) self.db.profile.general.barPadding = val; self:Refresh(); end + }, + moduleSpacing = { + name = L['Module Spacing'], + type = 'range', + order = 10, + min = 10, + max = 50, + step = 1, + get = function() return self.db.profile.general.moduleSpacing; end, + set = function(info, val) self.db.profile.general.moduleSpacing = val; self:Refresh(); end + } + } + } } } end @@ -459,7 +474,7 @@ function XIVBar:GetTextOptions() return { name = LOCALE_TEXT_LABEL, type = "group", - order = 3, + order = 2, inline = true, args = { font = { @@ -519,7 +534,7 @@ function XIVBar:GetTextColorOptions() hasAlpha = true, set = function(info, r, g, b, a) if self.db.profile.color.useTextCC then - r,g,b,_=XIVBar:GetColor('normal') + r,g,b,_=self:GetClassColors() end XIVBar:SetColor('normal', r, g, b, a) end, @@ -532,23 +547,41 @@ function XIVBar:GetTextColorOptions() order = 2, set = function(_,val) if val then - XIVBar:SetColor("normal",RAID_CLASS_COLORS[self.constants.playerClass].r,RAID_CLASS_COLORS[self.constants.playerClass].g,RAID_CLASS_COLORS[self.constants.playerClass].b,select(4,XIVBar:GetColor('normal'))) + XIVBar:SetColor("normal",self:GetClassColors()) end self.db.profile.color.useTextCC = val end, get = function() return self.db.profile.color.useTextCC end }, + hover = { + name = L['Hover'], + type = "color", + order = 3, + width = "double", + hasAlpha = true, + set = function(info, r, g, b, a) + if self.db.profile.color.useHoverCC then + r,g,b,_=self:GetClassColors() + end + XIVBar:SetColor('hover', r, g, b, a) + end, + get = function() return XIVBar:GetColor('hover') end, + }, -- normal hoverCC = { name = L['Use Class Colors for Hover'], type = "toggle", - order = 3, - set = function(info, val) self.db.profile.color.useHoverCC = val; self:Refresh(); end, + order = 4, + set = function(_, val) + if val then + XIVBar:SetColor("hover",self:GetClassColors()) + end + self.db.profile.color.useHoverCC = val; self:Refresh(); end, get = function() return self.db.profile.color.useHoverCC end }, -- normal inactive = { name = L['Inactive'], type = "color", - order = 4, + order = 5, hasAlpha = true, width = "double", set = function(info, r, g, b, a) @@ -556,17 +589,6 @@ function XIVBar:GetTextColorOptions() end, get = function() return XIVBar:GetColor('inactive') end }, -- normal - hover = { - name = L['Hover'], - type = "color", - order = 5, - hasAlpha = true, - set = function(info, r, g, b, a) - XIVBar:SetColor('hover', r, g, b, a) - end, - get = function() return XIVBar:GetColor('hover') end, - disabled = function() return self.db.profile.color.useHoverCC end - }, -- normal } } end diff --git a/locales/deDE.lua b/locales/deDE.lua index fa48900..b54e478 100644 --- a/locales/deDE.lua +++ b/locales/deDE.lua @@ -8,11 +8,13 @@ L['Left-Click'] = "Links-Klick"; L['Right-Click'] = "Rechts-Klick"; -- General +L["Positioning"] = true; L['Bar Position'] = "Leistenposition"; L['Top'] = "Oben"; L['Bottom'] = "Unten"; L['Bar Color'] = "Leistenfarbe"; -L['Use Class Colors for Bar'] = "Benutze Klassenfarbe für Leiste"; +L['Use Class Color for Bar'] = "Benutze Klassenfarbe für Leiste"; +L["Miscellaneous"] = true; L['Bar Padding'] = "Leistenabstand"; L['Module Spacing'] = "Modulabstand"; L['Hide order hall bar'] = true; @@ -31,6 +33,7 @@ L['Small Font Size'] = "Kleine Schriftgröße"; L['Text Style'] = "Schriftstil"; -- Text Colors +L["Colors"] = "Farben"; L['Text Colors'] = "Textfarbe"; L['Normal'] = "Normal"; L['Inactive'] = "Inaktiv"; @@ -48,6 +51,24 @@ L['Icon Spacing'] = "Icon-Abstand"; L['Open Guild Page'] = true; L['No Tag'] = true; L['Hide Social Text'] = "Social Text verstecken"; +L["GMOTD in Tooltip"] = true; +L["Modifier for friend invite"] = true; +L['Show/Hide Buttons'] = true; +L['Show Menu Button'] = true; +L['Show Chat Button'] = true; +L['Show Guild Button'] = true; +L['Show Social Button'] = true; +L['Show Character Button'] = true; +L['Show Spellbook Button'] = true; +L['Show Talents Button'] = true; +L['Show Achievements Button'] = true; +L['Show Quests Button'] = true; +L['Show LFG Button'] = true; +L['Show Journal Button'] = true; +L['Show PVP Button'] = true; +L['Show Pets Button'] = true; +L['Show Shop Button'] = true; +L['Show Help Button'] = true; L['Always Show Item Level'] = "Rüstungslevel immer anzeigen"; L['Minimum Durability to Become Active'] = "Minimale Haltbarkeit für Anzeige"; diff --git a/locales/enUS.lua b/locales/enUS.lua index e503f27..8754fdd 100644 --- a/locales/enUS.lua +++ b/locales/enUS.lua @@ -7,11 +7,13 @@ L['Left-Click'] = true; L['Right-Click'] = true; -- General +L["Positioning"] = true; L['Bar Position'] = true; L['Top'] = true; L['Bottom'] = true; L['Bar Color'] = true; -L['Use Class Colors for Bar'] = true; +L['Use Class Color for Bar'] = true; +L["Miscellaneous"] = true; L['Bar Padding'] = true; L['Module Spacing'] = true; L['Hide order hall bar'] = true; @@ -30,6 +32,7 @@ L['Small Font Size'] = true; L['Text Style'] = true; -- Text Colors +L["Colors"] = true; L['Text Colors'] = true; L['Normal'] = true; L['Inactive'] = true; @@ -47,6 +50,24 @@ L['Icon Spacing'] = true; L['Open Guild Page'] = true; L['No Tag'] = true; L['Hide Social Text'] = true; +L["GMOTD in Tooltip"] = true; +L["Modifier for friend invite"] = true; +L['Show/Hide Buttons'] = true; +L['Show Menu Button'] = true; +L['Show Chat Button'] = true; +L['Show Guild Button'] = true; +L['Show Social Button'] = true; +L['Show Character Button'] = true; +L['Show Spellbook Button'] = true; +L['Show Talents Button'] = true; +L['Show Achievements Button'] = true; +L['Show Quests Button'] = true; +L['Show LFG Button'] = true; +L['Show Journal Button'] = true; +L['Show PVP Button'] = true; +L['Show Pets Button'] = true; +L['Show Shop Button'] = true; +L['Show Help Button'] = true; L['Always Show Item Level'] = true; L['Minimum Durability to Become Active'] = true; diff --git a/locales/frFR.lua b/locales/frFR.lua index e606bff..a5979bc 100644 --- a/locales/frFR.lua +++ b/locales/frFR.lua @@ -8,11 +8,13 @@ L['Left-Click'] = "Clic gauche"; L['Right-Click'] = "Clic droit"; -- General +L["Positioning"] = "Positionnement"; L['Bar Position'] = "Position de la barre"; L['Top'] = "Haut"; L['Bottom'] = "Bas"; L['Bar Color'] = "Couleur de la barre"; -L['Use Class Colors for Bar'] = "Utiliser la couleur de classe pour la barre"; +L['Use Class Color for Bar'] = "Utiliser la couleur de classe pour la barre"; +L["Miscellaneous"] = "Divers"; L['Bar Padding'] = "Décalage de la barre"; L['Module Spacing'] = "Espacement des modules"; L['Hide order hall bar'] = "Cacher la barre du hall de classe"; @@ -31,7 +33,8 @@ L['Small Font Size'] = "Taille de la petite police"; L['Text Style'] = "Style du texte"; -- Text Colors -L['Text Colors'] = "Couleur du texte"; +L["Colors"] = "Couleurs"; +L['Text Colors'] = "Couleurs du texte"; L['Normal'] = "Normale"; L['Use Class Color for Text'] = "Utiliser la couleur de classe pour le texte"; L['Only the alpha can be set with the color picker'] = "Seul l'alpha peut être réglé avec la sélection de couleur"; @@ -48,6 +51,24 @@ L['Icon Spacing'] = "Espacement des icônes"; L['Open Guild Page'] = "Ouvrir la page de guilde"; L['No Tag'] = "Aucun Tag"; L['Hide Social Text'] = "Cacher le texte des contacts"; +L["GMOTD in Tooltip"] = "Afficher le message de guilde dans la bulle"; +L["Modifier for friend invite"] = "Touche modifieuse pour inviter un contact"; +L['Show/Hide Buttons'] = "Montrer/Cacher les boutons"; +L['Show Menu Button'] = "Montrer le bouton Menu"; +L['Show Chat Button'] = "Montrer le bouton Tchat"; +L['Show Guild Button'] = "Montrer le bouton Guilde"; +L['Show Social Button'] = "Montrer le bouton Contacts"; +L['Show Character Button'] = "Montrer le bouton Personnage"; +L['Show Spellbook Button'] = "Montrer le bouton Grimoire"; +L['Show Talents Button'] = "Montrer le bouton Talents"; +L['Show Achievements Button'] = "Montrer le bouton Haut-faits"; +L['Show Quests Button'] = "Montrer le bouton Quêtes"; +L['Show LFG Button'] = "Montrer le bouton RDG"; +L['Show Journal Button'] = "Montrer le bouton Journal"; +L['Show PVP Button'] = "Montrer le bouton PVP"; +L['Show Pets Button'] = "Montrer le bouton Mascottes"; +L['Show Shop Button'] = "Montrer le bouton Boutique"; +L['Show Help Button'] = "Montrer le bouton Aide"; L['Always Show Item Level'] = "Toujours montrer le niveau d'objet"; L['Minimum Durability to Become Active'] = "Activation au minimum de durabilité"; diff --git a/locales/ruRU.lua b/locales/ruRU.lua index 43cb2c4..6f1873f 100644 --- a/locales/ruRU.lua +++ b/locales/ruRU.lua @@ -8,11 +8,13 @@ L['Left-Click'] = "Левая кнопка мыши"; L['Right-Click'] = "Правая кнопка мыши"; -- General +L["Positioning"] = true; L['Bar Position'] = "Положение полосы"; L['Top'] = "Вверху"; L['Bottom'] = "Внизу"; L['Bar Color'] = "Цвет полосы"; -L['Use Class Colors for Bar'] = "Использовать цвет класса для полосы"; +L['Use Class Colors= for Bar'] = "Использовать цвет класса для полосы"; +L["Miscellaneous"] = true; L['Bar Padding'] = "Заполнение"; L['Module Spacing'] = "Расстояние между модулями"; L['Hide order hall bar'] = true; @@ -31,6 +33,7 @@ L['Small Font Size'] = "Размер маленького шрифта"; L['Text Style'] = "Стиль текста"; -- Text Colors +L["Colors"] = true; L['Text Colors'] = "Цвета текста"; L['Normal'] = "Обычный"; L['Inactive'] = "Неактивно"; @@ -48,6 +51,24 @@ L['Icon Spacing'] = "Расстояние между кнопками"; L['Open Guild Page'] = true; L['No Tag'] = true; L['Hide Social Text'] = "Скрыть количество онлайна гильдии и друзей"; +L["GMOTD in Tooltip"] = true; +L["Modifier for friend invite"] = true; +L['Show/Hide Buttons'] = true; +L['Show Menu Button'] = true; +L['Show Chat Button'] = true; +L['Show Guild Button'] = true; +L['Show Social Button'] = true; +L['Show Character Button'] = true; +L['Show Spellbook Button'] = true; +L['Show Talents Button'] = true; +L['Show Achievements Button'] = true; +L['Show Quests Button'] = true; +L['Show LFG Button'] = true; +L['Show Journal Button'] = true; +L['Show PVP Button'] = true; +L['Show Pets Button'] = true; +L['Show Shop Button'] = true; +L['Show Help Button'] = true; L['Always Show Item Level'] = "Всегда показывать уровень предметов"; L['Minimum Durability to Become Active'] = "Прочность, до которой загораются цифры"; diff --git a/modules/clock.lua b/modules/clock.lua index 58dc06c..fff14c7 100644 --- a/modules/clock.lua +++ b/modules/clock.lua @@ -105,7 +105,7 @@ function ClockModule:RegisterFrameEvents() if ClockModule.elapsed >= 1 then local clockTime = nil if xb.db.profile.modules.clock.serverTime then - clockTime = GetServerTime() + clockTime = GetServerTime() -- GameTime_GetGameTime() ? else clockTime = time() end diff --git a/modules/micromenu.lua b/modules/micromenu.lua index 688cd7a..edb49ae 100644 --- a/modules/micromenu.lua +++ b/modules/micromenu.lua @@ -14,7 +14,7 @@ function MenuModule:OnInitialize() self.mediaFolder = xb.constants.mediaPath..'microbar\\' self.socialIconPath = "Interface\\FriendsFrame\\" self.icons = {} - self.modifiers={"SHIFT","ALT","CONTROL"} + self.modifiers={SHIFT_KEY_TEXT,ALT_KEY_TEXT,CTRL_KEY_TEXT} self.frames = {} self.text = {} self.bgTexture = {} @@ -119,6 +119,8 @@ function MenuModule:Refresh() self.bgTexture[name]:SetPoint('CENTER', frame, 'CENTER') if xb.db.profile.modules.microMenu.hideSocialText then frame:Hide() + else + frame:Show() end end @@ -567,11 +569,12 @@ function MenuModule:GuildHover(hoverFunc) GuildRoster() tooltip:SmartAnchorTo(MenuModule.frames.guild) - tooltip:AddHeader("[|cff6699FF"..GUILD.."|r]") + local gName, _, _, _ = GetGuildInfo('player') + tooltip:AddHeader("[|cff6699FF"..GUILD.."|r]",'|cff00ff00'..gName..'|r') tooltip:AddLine(" "," ") - local gName, _, _, _ = GetGuildInfo('player') - tooltip:AddLine('|cffffff00'..GUILD..':|r', '|cff00ff00'..gName..'|r') - tooltip:AddLine('|cff00ff00'..GetGuildRosterMOTD()..':|r', ' ') + if xb.db.profile.modules.microMenu.showGMOTD then + tooltip:AddLine('|cff00ff00'..GetGuildRosterMOTD()..':|r', ' ') + end local totalGuild, _ = GetNumGuildMembers() for i = 0, totalGuild do @@ -646,7 +649,7 @@ function MenuModule:CreateClickFunctions() if button == "LeftButton" then ToggleGuildFrame() if IsInGuild() then - GuildFrameTab2:Click()-- GuildFrame_Toggle(); to test + GuildFrameTab2:Click() end end end; --guild @@ -744,6 +747,7 @@ function MenuModule:GetDefaultOptions() iconSpacing = 2, hideSocialText = false, modifierTooltip = 1, + showGMOTD = false, menu = true, chat = true, guild = true, @@ -791,19 +795,11 @@ function MenuModule:GetConfig() hideSocialText = { name = L['Hide Social Text'], order = 2, + width = "double", type = "toggle", get = function() return xb.db.profile.modules.microMenu.hideSocialText; end, set = function(_, val) xb.db.profile.modules.microMenu.hideSocialText = val; self:Refresh(); end }, - modifierTooltip = { - name = "Modifier for friend invite", - order = 3, - type = "select", - values = {"SHIFT","ALT","CONTROL"}, - style = "dropdown", - get = function() return xb.db.profile.modules.microMenu.modifierTooltip; end, - set = function(info, val) xb.db.profile.modules.microMenu.modifierTooltip = val; self:Refresh(); end - }, mainMenuSpacing = { name = L['Main Menu Icon Right Spacing'], order = 3, @@ -824,14 +820,31 @@ function MenuModule:GetConfig() get = function() return xb.db.profile.modules.microMenu.iconSpacing; end, set = function(_, val) xb.db.profile.modules.microMenu.iconSpacing = val; self:Refresh(); end }, + showGMOTD = { + name = L["GMOTD in Tooltip"], + type = "toggle", + order = 5, + get = function() return xb.db.profile.modules.microMenu.showGMOTD end, + set = function(_,val) xb.db.profile.modules.microMenu.showGMOTD = val; self:Refresh(); end + }, + modifierTooltip = { + name = L["Modifier for friend invite"], + order = 6, + type = "select", + values = {SHIFT_KEY_TEXT,ALT_KEY_TEXT,CTRL_KEY_TEXT}, + style = "dropdown", + get = function() return xb.db.profile.modules.microMenu.modifierTooltip; end, + set = function(info, val) xb.db.profile.modules.microMenu.modifierTooltip = val; self:Refresh(); end, + disabled = function() return not xb.db.profile.modules.microMenu.guild and not xb.db.profile.modules.microMenu.social end + }, buttons = { type = 'group', - name = 'Show/Hide Buttons', - order = 5, + name = L['Show/Hide Buttons'], + order = 7, inline = true, args = { menu = { - name = 'Show Menu Button', + name = L['Show Menu Button'], disabled = true, order = 1, type = "toggle", @@ -839,98 +852,98 @@ function MenuModule:GetConfig() set = function(_, val) xb.db.profile.modules.microMenu.menu = val; self:Refresh(); end }, chat = { - name = 'Show Chat Button', + name = L['Show Chat Button'], order = 2, type = "toggle", get = function() return xb.db.profile.modules.microMenu.chat; end, set = function(_, val) xb.db.profile.modules.microMenu.chat = val; self:UpdateMenu(); self:Refresh(); end }, guild = { - name = 'Show Guild Button', + name = L['Show Guild Button'], order = 3, type = "toggle", get = function() return xb.db.profile.modules.microMenu.guild; end, set = function(_, val) xb.db.profile.modules.microMenu.guild = val; self:UpdateMenu(); self:Refresh(); end }, social = { - name = 'Show Social Button', + name = L['Show Social Button'], order = 4, type = "toggle", get = function() return xb.db.profile.modules.microMenu.social; end, set = function(_, val) xb.db.profile.modules.microMenu.social = val; self:UpdateMenu(); self:Refresh(); end }, char = { - name = 'Show Character Button', + name = L['Show Character Button'], order = 5, type = "toggle", get = function() return xb.db.profile.modules.microMenu.char; end, set = function(_, val) xb.db.profile.modules.microMenu.char = val; self:UpdateMenu(); self:Refresh(); end }, spell = { - name = 'Show Spellbook Button', + name = L['Show Spellbook Button'], order = 6, type = "toggle", get = function() return xb.db.profile.modules.microMenu.spell; end, set = function(_, val) xb.db.profile.modules.microMenu.spell = val; self:UpdateMenu(); self:Refresh(); end }, talent = { - name = 'Show Talents Button', + name = L['Show Talents Button'], order = 7, type = "toggle", get = function() return xb.db.profile.modules.microMenu.talent; end, set = function(_, val) xb.db.profile.modules.microMenu.talent = val; self:UpdateMenu(); self:Refresh(); end }, ach = { - name = 'Show Achievements Button', + name = L['Show Achievements Button'], order = 8, type = "toggle", get = function() return xb.db.profile.modules.microMenu.ach; end, set = function(_, val) xb.db.profile.modules.microMenu.ach = val; self:UpdateMenu(); self:Refresh(); end }, quest = { - name = 'Show Quests Button', + name = L['Show Quests Button'], order = 9, type = "toggle", get = function() return xb.db.profile.modules.microMenu.quest; end, set = function(_, val) xb.db.profile.modules.microMenu.quest = val; self:UpdateMenu(); self:Refresh(); end }, lfg = { - name = 'Show LFG Button', + name = L['Show LFG Button'], order = 10, type = "toggle", get = function() return xb.db.profile.modules.microMenu.lfg; end, set = function(_, val) xb.db.profile.modules.microMenu.lfg = val; self:UpdateMenu(); self:Refresh(); end }, journal = { - name = 'Show Journal Button', + name = L['Show Journal Button'], order = 11, type = "toggle", get = function() return xb.db.profile.modules.microMenu.journal; end, set = function(_, val) xb.db.profile.modules.microMenu.journal = val; self:UpdateMenu(); self:Refresh(); end }, pvp = { - name = 'Show PVP Button', + name = L['Show PVP Button'], order = 12, type = "toggle", get = function() return xb.db.profile.modules.microMenu.pvp; end, set = function(_, val) xb.db.profile.modules.microMenu.pvp = val; self:UpdateMenu(); self:Refresh(); end }, pet = { - name = 'Show Pets Button', + name = L['Show Pets Button'], order = 13, type = "toggle", get = function() return xb.db.profile.modules.microMenu.pet; end, set = function(_, val) xb.db.profile.modules.microMenu.pet = val; self:UpdateMenu(); self:Refresh(); end }, shop = { - name = 'Show Shop Button', + name = L['Show Shop Button'], order = 14, type = "toggle", get = function() return xb.db.profile.modules.microMenu.shop; end, set = function(_, val) xb.db.profile.modules.microMenu.shop = val; self:UpdateMenu(); self:Refresh(); end }, help = { - name = 'Show Help Button', + name = L['Show Help Button'], order = 15, type = "toggle", get = function() return xb.db.profile.modules.microMenu.help; end, diff --git a/settings.lua b/settings.lua deleted file mode 100644 index c0f25c2..0000000 --- a/settings.lua +++ /dev/null @@ -1,317 +0,0 @@ ------------------------------------------------------------------ --- CONFIGURATION FILE DO NOT TOUCH ANYTHING BELLOW HERE ------------------------------------------------------------------ -local addon, ns = ... -local cfg = {} -ns.cfg = cfg - - -cfg.NAME = UnitName("player") -cfg.CLASS = select(2, UnitClass("player")) -cfg.cc = (CUSTOM_CLASS_COLORS or RAID_CLASS_COLORS)[cfg.CLASS] --CLASS COLOR - ---media path -cfg.mediaFolder = "Interface\\AddOns\\"..addon.."\\media\\" - ---------------------------------------------- --- DO NOT TOUCH ANYTHING ABOVE HERE ---------------------------------------------- - -cfg.color = { - normal = {1,1,1,.75}, -- SETS THE SAME COLOR FOR THE TEXT - inactive = {1,1,1,.25}, -- SET THE COLOR FOR THE INACTICE ICONS - hover = {cfg.cc.r,cfg.cc.g,cfg.cc.b,.75}, -- DOES NOT CHANGE THE TEXTCOLOR - barcolor = {.094,.094,.094,.75}, -- THE COLOR OF THE BAR - --barcolor = {.05,.05,.05,0}, -- THE COLOR OF THE BAR -} -if cfg.CLASS == "PRIEST" then cfg.color.hover = {.5,.5,0,.75} end -- ADDED BEACUSE NORMALY THE PRIEST COLOR IS THE SAME AS THE NORMAL COLOR - -cfg.text = { - font = cfg.mediaFolder.."homizio_bold.ttf", -- SETS THE FONT - normalFontSize = 12, -- SET THE SIZE OF THE TEXTS - smallFontSize = 11, -- SETS THE SIZE OF THE SMALLER TEXTS -} - -cfg.core = { - height = 35, - position = "BOTTOM", -- THE POSITION OF THE BAR USE "BOTTOM" OR "TOP" - scale = 0.83, -- SCALE BAR TO GET ROOM FOR ALL THE ICONS AND TEXT - strata = "HIGH", -- AT WHAT STRATA THE BAR SHOULD BE AT -} - -cfg.micromenu = { - show = true, -- USES THIS MODULE - showTooltip = true, -- ADDS TOOLTIPS FOR THE SOSIAL FRAMES -} - -cfg.armor = { - show = true, -- USES THIS MODULE - minArmor = 20, -- WHEN THE ANVIL GOES FROM INACTIVE TO ACTIVE - maxArmor = 75, -- AT WHAT % IT WILL SHOW ARMORTEXT INSTEAD OF ILVL -} - -cfg.talent = { - show = true, -- USES THIS MODULE -} - -cfg.clock = { - show = true, -- USES THIS MODULE - showTooltip = true, -- SHOWS SOME INFO AND REALMTIME OR LOCAL TIME -} - -cfg.tradeSkill = { - show = true, -- USES THIS MODULE - showTooltip = true, -- SHOW WHAT TRADESKILLS THAT ARE ON COOLDOWN -} - -cfg.currency = { - show = true, -- USES THIS MODULE - showXPbar = true, -- SHOW A XP-BAR ON YOUR CHARACTERS THAT HAS NOT REACHED MAX LVL - showTooltip = true, -- SHOWS YOUR RECOURCES ACCORING TO THE DESCRIPTION OR YOUR XP INFO - textOnRight = true, -} - -cfg.system = { - show = true, -- USES THIS MODULE - showTooltip = true, -- SHOWS A LIST OF ADDONS AND HOW MUCH SYSTEM THEY USE - addonList = 10, -- SHOW HOW MANY ADDONS TO SHOW ON HOVER - addonListShift = 25, -- SHOW HOW MANY ADDONS TO SHOW ON HOVER WHILE SHIFT IS DOWN - showWorldPing = true, -} - -cfg.gold = { - showTooltip = true, -- SHOWS THE GOLD OF YOUR OTHER CHARACTERS ON THE SAME SERVER AND SAME SIDE - show = true, -- USES THIS MODULE - firstWeekday = 2, -- 1 is Sunday, 2 is Monday, different countries have different first day of the week - showFreeBagSpace = false, -} - -cfg.heartstone = { - show = true, -- USES THIS MODULE - showTooltip = true, -- SHOWS THE COOLDOWN ON MOUSEOVER -} - -cfg.useConfig = false -- !! DO NOT TOUCH !! ---------------------------------------------- --- DO NOT TOUCH ANYTHING BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING !! ---------------------------------------------- --- CREATE THE CORE FRAME ---------------------------------------------- - -local unpack = unpack -local SX_bottombar = CreateFrame("Frame","SX_bottombar", UIParent) -SX_bottombar:SetSize(0, cfg.core.height) -SX_bottombar:SetScale(cfg.core.scale) -SX_bottombar:SetFrameStrata(cfg.core.strata) - -SX_bottombar:SetPoint(cfg.core.position) -SX_bottombar:SetPoint("LEFT") -SX_bottombar:SetPoint("RIGHT") - -cfg.SXframe = SX_bottombar - -local coreTexture = SX_bottombar:CreateTexture(nil,"BACKGROUND",nil,-8) -coreTexture:SetAllPoints() -coreTexture:SetColorTexture(unpack(cfg.color.barcolor)) - -cfg.tooltipPos = "ANCHOR_TOP" -if cfg.core.position ~= "BOTTOM" then - cfg.tooltipPos = "ANCHOR_BOTTOM",0,-20 -end - - -local SX_databarConfig = CreateFrame("Frame",nil, UIParent) - -SX_databarConfig:SetPoint("CENTER") ---SX_databarConfig:Hide() - -cfg.SXconfigFrame = nil -if cfg.useConfig then - cfg.SXconfigFrame = SX_databarConfig -end - -local eventframe = CreateFrame("Frame",nil, UIParent) -eventframe:RegisterEvent("PET_BATTLE_OPENING_START") -eventframe:RegisterEvent("PET_BATTLE_CLOSE") -eventframe:SetScript("OnEvent", function(self,event, ...) - if (event == "PET_BATTLE_OPENING_START") then - SX_bottombar:Hide() - elseif (event == "PET_BATTLE_CLOSE") then - SX_bottombar:Show() - end -end) ---------------------------------------------- --- SAVED VARIABLES TABLE ---------------------------------------------- - --- copies missing fields from source table -function CopyTable(src, dest) - if type(dest) ~= "table" then - dest = {} - end - - for k, v in pairs(src) do - if type(v) == "table" then - dest[k] = CopyTable(v, dest[k]) - elseif type(v) ~= type(dest[k]) then - dest[k] = v - end - end - - return dest -end - --- removes everything that is present in source table from another table -function DiffTable(src, dest) - if type(dest) ~= "table" then - return {} - end - - if type(src) ~= "table" then - return dest - end - - for k, v in pairs(dest) do - if type(v) == "table" then - if not next(DiffTable(src[k], v)) then - dest[k] = nil - end - elseif v == src[k] then - dest[k] = nil - end - end - - return dest -end - -local function ConvertDateToNumber(month, day, year) - month = gsub(month, "(%d)(%d?)", function(d1, d2) return d2 == "" and "0"..d1 or d1..d2 end) -- converts M to MM - day = gsub(day, "(%d)(%d?)", function(d1, d2) return d2 == "" and "0"..d1 or d1..d2 end) -- converts D to DD - - return tonumber(year..month..day) -end - --------------- --- DEFAULTS -- --------------- - -local D = { - ["money_related_stuff"] = {} -} - ------------ --- STUFF -- ------------ - -local function Controller_OnEvent(self, event, arg) - if event == "ADDON_LOADED" and arg == addon then -- "test" is addon name -local CONFIG = CopyTable(D, TEST_CONFIG) -ns.CONFIG = CONFIG -- makes this table available throughout addon - -local playerName, playerFaction, playerRealm = UnitName("player"), UnitFactionGroup("player"), GetRealmName() - -if not CONFIG["money_related_stuff"][playerRealm] then - CONFIG["money_related_stuff"][playerRealm] = {} -- creates a table if it doesn't exist -end - -local realmData = CONFIG["money_related_stuff"][playerRealm] -- just an alias -ns.realmData = realmData - -if not realmData[playerFaction] then - realmData[playerFaction] = {} -- creates a table if it doesn't exist -end - -local factionData = realmData[playerFaction] -ns.factionData = factionData - -if not factionData[playerName] then - factionData[playerName] = {} -- creates a table if it doesn't exist -end - -ns.playerData = factionData[playerName] - -self:UnregisterEvent("ADDON_LOADED") - elseif event == "PLAYER_LOGIN" then - local playerData = ns.playerData - - if not playerData["CLASS"] then - playerData["CLASS"] = cfg.CLASS - end - - local weekday, month, day, year = CalendarGetDate() - local today = ConvertDateToNumber(month, day, year) - local updateData - - if playerData.lastLoginDate then - if playerData.lastLoginDate < today then -- is true, if last time player logged in was the day before or even earlier - playerData.lastLoginDate = today - updateData = true - end - else - playerData.lastLoginDate = today - updateData = true - end - - if updateData then -- daily updates - if playerData["money_on_first_weekday"] then - if weekday == cfg.gold.firstWeekday then -- 1 is Sunday, 2 is Monday, different countries have different first day of the week - playerData["money_on_first_weekday"] = GetMoney() - end - else - playerData["money_on_first_weekday"] = GetMoney() - end - - playerData["money_on_first_login_today"] = GetMoney() - end - - playerData["money_on_session_start"] = GetMoney() -- this one resets on every single login or UI reload - - self:UnregisterEvent("PLAYER_LOGIN") - elseif event == "PLAYER_LOGOUT" then - TEST_CONFIG = DiffTable(D, ns.CONFIG) -- writes data into TEST_CONFIG table - end -end - -local Controller = CreateFrame("Frame") -Controller:RegisterEvent("ADDON_LOADED") -Controller:RegisterEvent("PLAYER_LOGIN") -Controller:RegisterEvent("PLAYER_LOGOUT") -Controller:SetScript("OnEvent", Controller_OnEvent) - ---------------------------------------------- --- SHORTENER FUNCTIONS ---------------------------------------------- -cfg.specCoords = { --- index left right top bottom - [ 1] = { 0.00, 0.25, 0.00, 1 }, - [ 2] = { 0.25, 0.50, 0.00, 1 }, - [ 3] = { 0.50, 0.75, 0.00, 1 }, - [ 4] = { 0.75, 1.00, 0.00, 1 }, -} - -cfg.SVal = function(val) - if val > 1E10 then - return (floor(val/1E9)).."b" - elseif val > 1E9 then - return (floor((val/1E9)*10)/10).."b" - elseif val > 1E7 then - return (floor(val/1E6)).."m" - elseif val > 1E6 then - return (floor((val/1E6)*10)/10).."m" - elseif val > 1E4 then - return (floor(val/1E3)).."k" - elseif val >= 1E3 then - return (floor(val/1E3)) .. (" %03d"):format(val % 1E3) - else - return val - end -end - -function cfg.hex(r, g, b) - if r then - if (type(r) == "table") then - if(r.r) then r, g, b = r.r, r.g, r.b else r, g, b = unpack(r) end - end - return ("|cff%02x%02x%02x"):format(r * 255, g * 255, b * 255) - end -end -- 1.7.9.5