diff --git a/DragonflightUI-Reforged.toc b/DragonflightUI-Reforged.toc index 297e12d..7e7d5c4 100644 --- a/DragonflightUI-Reforged.toc +++ b/DragonflightUI-Reforged.toc @@ -9,6 +9,8 @@ # CORE core\error.lua core\core.lua +core\debug.lua +core\locale.lua core\tools.lua core\statusbar.lua core\compat.lua diff --git a/core/core.lua b/core/core.lua index 605bbc0..cde3958 100644 --- a/core/core.lua +++ b/core/core.lua @@ -18,6 +18,7 @@ DFRL.callbacks = {} DFRL.performance = {} DFRL.activeScripts = {} DFRL.gui = {} +DFRL.debug = {} -- db version DFRL.DBversion = "1.0" @@ -180,6 +181,9 @@ end function DFRL:SetTempDB(mod, key, value) self.tempDB[mod][key] = value + if self.DebugLog then + self:DebugLog('db', 'SetTempDB', mod, key, value) + end local cb = mod .. "_" .. key .. "_changed" self:TriggerCallback(cb, value) end @@ -234,6 +238,9 @@ end function DFRL:SwitchProfile(name) local char = UnitName("player") local old = DFRL_CUR_PROFILE[char] + if self.DebugLog then + self:DebugLog('profile', 'SwitchProfile', old or 'nil', '->', name or 'nil') + end DFRL_PROFILES[old] = self.tempDB DFRL_CUR_PROFILE[char] = name self:LoadProfile(name) @@ -256,6 +263,9 @@ function DFRL:CopyProfile(from, tbl) end function DFRL:LoadProfile(name) + if self.DebugLog then + self:DebugLog('profile', 'LoadProfile', name or 'nil') + end self.tempDB = {} for mod, data in pairs(DFRL_PROFILES[name]) do self.tempDB[mod] = {} @@ -278,6 +288,10 @@ function DFRL:NewCallbacks(mod, callbacks) self.callbacks[cb] = {} tinsert(self.callbacks[cb], func) + if self.DebugLog then + self:DebugLog('callback', 'Register', cb) + end + self:TriggerCallback(cb, self.tempDB[mod][key]) count = count + 1 @@ -285,19 +299,53 @@ function DFRL:NewCallbacks(mod, callbacks) end function DFRL:TriggerCallback(cb, value) + if not self.callbacks[cb] then return end + if self.DebugLog then + self:DebugLog('callback', 'Trigger', cb, value) + end for _, func in ipairs(self.callbacks[cb]) do func(value) end end function DFRL:TriggerAllCallbacks() - for cb, callbacks in pairs(self.callbacks) do + local ordered = {} + for cb in pairs(self.callbacks) do + tinsert(ordered, cb) + end + + table.sort(ordered, function(a, b) + local aGrid = string.find(a, 'Grid_changed$') ~= nil + local bGrid = string.find(b, 'Grid_changed$') ~= nil + if aGrid ~= bGrid then + return aGrid + end + + local aSpacing = string.find(a, 'Spacing_changed$') ~= nil + local bSpacing = string.find(b, 'Spacing_changed$') ~= nil + if aSpacing ~= bSpacing then + return not aSpacing + end + + return a < b + end) + + if self.DebugLog then + self:DebugLog('callback', 'TriggerAllCallbacks', table.getn(ordered)) + end + + for _, cb in ipairs(ordered) do + local callbacks = self.callbacks[cb] local name = string.gsub(cb, "_changed$", "") local pos = string.find(name, "_[^_]*$") local mod = string.sub(name, 1, pos - 1) local key = string.sub(name, pos + 1) local value = self.tempDB[mod] and self.tempDB[mod][key] + if self.DebugLog then + self:DebugLog('callback', 'TriggerAll', cb, value) + end + for _, func in ipairs(callbacks) do func(value) end diff --git a/core/debug.lua b/core/debug.lua new file mode 100644 index 0000000..3fd33d0 --- /dev/null +++ b/core/debug.lua @@ -0,0 +1,146 @@ +-- debug system +DFRL.debug.enabled = false +DFRL.debug.maxEntries = 250 +DFRL.debug.buffer = {} +DFRL.debug.categories = { + callback = true, + profile = true, + bars = true, + db = true, + gui = true +} + +local function dbg_tostring(value) + if value == nil then return 'nil' end + local kind = type(value) + if kind == 'boolean' then + return value and 'true' or 'false' + elseif kind == 'number' then + return string.format('%.3f', value) + elseif kind == 'string' then + return value + elseif kind == 'table' then + return '' + elseif kind == 'function' then + return '' + end + return tostring(value) +end + +local function dbg_echo(msg) + if DEFAULT_CHAT_FRAME and DEFAULT_CHAT_FRAME.AddMessage then + DEFAULT_CHAT_FRAME:AddMessage('|cff33ff99DFRL DEBUG:|r ' .. msg) + end +end + +function DFRL:DebugStatusText() + local state = self.debug.enabled and 'ON' or 'OFF' + return 'debug=' .. state .. ', entries=' .. table.getn(self.debug.buffer) +end + +function DFRL:SetDebugEnabled(enabled) + self.debug.enabled = enabled and true or false + if not DFRL_DB_SETUP then DFRL_DB_SETUP = {} end + DFRL_DB_SETUP.debugEnabled = self.debug.enabled + dbg_echo(self:DebugStatusText()) +end + +function DFRL:SetDebugCategory(category, enabled) + if not category or category == '' then return end + self.debug.categories[category] = enabled and true or false + dbg_echo(category .. '=' .. (enabled and 'ON' or 'OFF')) +end + +function DFRL:ClearDebugLog() + self.debug.buffer = {} + dbg_echo('buffer cleared') +end + +function DFRL:DumpDebugLog(limit, category) + local total = table.getn(self.debug.buffer) + if total == 0 then + dbg_echo('buffer empty') + return + end + + local count = tonumber(limit) or 20 + if count < 1 then count = 1 end + if count > total then count = total end + + local startIndex = total - count + 1 + for i = startIndex, total do + local entry = self.debug.buffer[i] + if not category or category == '' or entry.category == category then + dbg_echo(string.format('#%d [%s] %s', i, entry.category, entry.message)) + end + end +end + +function DFRL:DebugLog(category, ...) + category = category or 'misc' + if self.debug.categories[category] == false then + return + end + + local parts = {} + for i = 1, select('#', ...) do + parts[i] = dbg_tostring(select(i, ...)) + end + + local message = table.concat(parts, ' | ') + local stamp = date('%H:%M:%S') + local entry = { + time = stamp, + category = category, + message = stamp .. ' | ' .. message + } + + tinsert(self.debug.buffer, entry) + while table.getn(self.debug.buffer) > self.debug.maxEntries do + tremove(self.debug.buffer, 1) + end + + if self.debug.enabled then + dbg_echo('[' .. category .. '] ' .. entry.message) + end +end + +local function handle_debug_command(msg) + local _, _, command, arg1, arg2 = string.find(msg or '', '^(%S*)%s*(%S*)%s*(.-)$') + command = string.lower(command or '') + + if command == '' or command == 'help' then + dbg_echo('/dfrldebug on | off | status | clear') + dbg_echo('/dfrldebug dump [count] [category]') + dbg_echo('/dfrldebug cat ') + return + elseif command == 'on' then + DFRL:SetDebugEnabled(true) + elseif command == 'off' then + DFRL:SetDebugEnabled(false) + elseif command == 'status' then + dbg_echo(DFRL:DebugStatusText()) + elseif command == 'clear' then + DFRL:ClearDebugLog() + elseif command == 'dump' then + DFRL:DumpDebugLog(arg1, arg2) + elseif command == 'cat' then + DFRL:SetDebugCategory(arg1, string.lower(arg2 or '') == 'on') + else + dbg_echo('unknown command: ' .. command) + end +end + +_G['SLASH_DFRLDEBUG1'] = '/dfrldebug' +_G['SLASH_DFRLDEBUG2'] = '/dfdebug' +_G.SlashCmdList['DFRLDEBUG'] = handle_debug_command + +local debugBootstrap = CreateFrame('Frame') +debugBootstrap:RegisterEvent('PLAYER_LOGIN') +debugBootstrap:SetScript('OnEvent', function() + if DFRL_DB_SETUP and DFRL_DB_SETUP.debugEnabled then + DFRL.debug.enabled = true + dbg_echo(DFRL:DebugStatusText()) + end + DFRL:DebugLog('gui', 'Debug system ready') +end) diff --git a/core/locale.lua b/core/locale.lua new file mode 100644 index 0000000..c684bff --- /dev/null +++ b/core/locale.lua @@ -0,0 +1,815 @@ +DFRL.locale = DFRL.locale or {} +DFRL.locale.translations = DFRL.locale.translations or {} +DFRL.locale.configLabels = DFRL.locale.configLabels or {} +DFRL.locale.wordMap = DFRL.locale.wordMap or {} + +DFRL.locale.translations.frFR = { + ["5 = 2 columns x 5 rows"] = "5 = 2 colonnes x 5 lignes", + ["Actionbars"] = "Barres d'action", + ["Activate 2D class portrait icons"] = "Active les portraits de classe 2D", + ["Active Modules:"] = "Modules actifs :", + ["Active Scripts"] = "Scripts actifs", + ["Addon"] = "Addon", + ["Addon Manager"] = "Gestionnaire d'addons", + ["Addon Version:"] = "Version addon :", + ["Adjust dark mode intensity"] = "Ajuste l'intensite du mode sombre", + ["Adjust frame size"] = "Ajuste la taille du cadre", + ["Adjust party frame size"] = "Ajuste la taille du cadre de groupe", + ["Adjust pet frame size"] = "Ajuste la taille du cadre du familier", + ["Adjust range indicator opacity"] = "Ajuste l'opacite de l'indicateur de portee", + ["Adjust target of target frame size"] = "Ajuste la taille du cadre de la cible de la cible", + ["Adjust the maximum alpha of the combat pulsing"] = "Ajuste l'alpha maximal de la pulsation de combat", + ["Adjust the maximum alpha of the resting pulsing"] = "Ajuste l'alpha maximal de la pulsation de repos", + ["Adjust the speed of the combat pulsing"] = "Ajuste la vitesse de la pulsation de combat", + ["Adjust the speed of the resting pulsing"] = "Ajuste la vitesse de la pulsation de repos", + ["Adjust X offset of the tooltip"] = "Ajuste le decalage X de l'infobulle", + ["Adjust Y offset of the tooltip"] = "Ajuste le decalage Y de l'infobulle", + ["Adjusts background alpha of XP and reputation bars"] = "Adjusts background alpha of XP and reputation bars", + ["Adjusts font size of the time display"] = "Ajuste la taille de police de l'affichage de l'heure", + ["Adjusts font size of the zone text"] = "Ajuste la taille de police de le texte de zone", + ["Adjusts horizontal position of gryphon/wyvern decorations"] = "Ajuste la position horizontale de gryphon/wyvern decorations", + ["Adjusts horizontal position of keybind text"] = "Ajuste la position horizontale de keybind text", + ["Adjusts horizontal position of macro text"] = "Ajuste la position horizontale de macro text", + ["Adjusts horizontal position of paging buttons"] = "Ajuste la position horizontale de les boutons de pagination", + ["Adjusts horizontal position of the time display"] = "Ajuste la position horizontale de l'affichage de l'heure", + ["Adjusts horizontal position of the zone text"] = "Ajuste la position horizontale de le texte de zone", + ["Adjusts horizontal position of zoom buttons"] = "Ajuste la position horizontale de les boutons de zoom", + ["Adjusts scale of bottom left action bar"] = "Ajuste l'echelle de la barre d'action bas gauche", + ["Adjusts scale of bottom right action bar"] = "Ajuste l'echelle de la barre d'action bas droite", + ["Adjusts scale of left action bar"] = "Ajuste l'echelle de la barre d'action gauche", + ["Adjusts scale of right action bar"] = "Ajuste l'echelle de la barre d'action droite", + ["Adjusts size of zoom buttons"] = "Ajuste la taille de les boutons de zoom", + ["Adjusts spacing between bottom left action bar buttons"] = "Ajuste l'espacement entre bottom left action bar buttons", + ["Adjusts spacing between bottom right action bar buttons"] = "Ajuste l'espacement entre bottom right action bar buttons", + ["Adjusts spacing between left action bar buttons"] = "Ajuste l'espacement entre left action bar buttons", + ["Adjusts spacing between main action bar buttons"] = "Ajuste l'espacement entre main action bar buttons", + ["Adjusts spacing between micro menu buttons"] = "Ajuste l'espacement entre micro menu buttons", + ["Adjusts spacing between pet action bar buttons"] = "Ajuste l'espacement entre les boutons de la barre du familier", + ["Adjusts spacing between right action bar buttons"] = "Ajuste l'espacement entre right action bar buttons", + ["Adjusts spacing between shapeshift buttons"] = "Ajuste l'espacement entre les boutons de metamorphose", + ["Adjusts the font size of the reputation bar text"] = "Ajuste la taille de police de the reputation bar text", + ["Adjusts the font size of the XP bar text"] = "Ajuste la taille de police de the XP bar text", + ["Adjusts the height of the reputation bar"] = "Ajuste la hauteur de la barre de reputation", + ["Adjusts the height of the top panel"] = "Ajuste la hauteur de le panneau superieur", + ["Adjusts the height of the XP bar"] = "Ajuste la hauteur de la barre d'XP", + ["Adjusts the overall size of the minimap"] = "Ajuste la taille generale de la mini-carte", + ["Adjusts the scale of the main action bar"] = "Ajuste l'echelle de la barre d'action principale", + ["Adjusts the scale of the main backpack"] = "Ajuste l'echelle de le sac principal", + ["Adjusts the scale of the micro menu"] = "Ajuste l'echelle de le micro-menu", + ["Adjusts the scale of the paging buttons"] = "Ajuste l'echelle de les boutons de pagination", + ["Adjusts the scale of the pet action bar"] = "Ajuste l'echelle de la barre d'actions du familier", + ["Adjusts the scale of the shapeshift bar"] = "Ajuste l'echelle de la barre de metamorphose", + ["Adjusts the size of keybind text on action buttons"] = "Ajuste la taille de le texte des raccourcis sur les boutons d'action", + ["Adjusts the size of macro text on action buttons"] = "Ajuste la taille de le texte des macros sur les boutons d'action", + ["Adjusts the size of the gryphon/wyvern decorations"] = "Ajuste la taille de les decorations gryphon/wyvern", + ["Adjusts the transparency of all bags"] = "Ajuste la transparence de tous les sacs", + ["Adjusts the transparency of the micro menu"] = "Ajuste la transparence de le micro-menu", + ["Adjusts the width of the reputation bar"] = "Ajuste la largeur de la barre de reputation", + ["Adjusts the width of the top panel"] = "Ajuste la largeur de le panneau superieur", + ["Adjusts the width of the XP bar"] = "Ajuste la largeur de la barre d'XP", + ["Adjusts transparency of bottom left action bar"] = "Ajuste la transparence de la barre d'action bas gauche", + ["Adjusts transparency of bottom right action bar"] = "Ajuste la transparence de la barre d'action bas droite", + ["Adjusts transparency of gryphon/wyvern decorations"] = "Ajuste la transparence de gryphon/wyvern decorations", + ["Adjusts transparency of left action bar"] = "Ajuste la transparence de la barre d'action gauche", + ["Adjusts transparency of main action bar"] = "Ajuste la transparence de la barre d'action principale", + ["Adjusts transparency of pet action bar"] = "Ajuste la transparence de la barre du familier", + ["Adjusts transparency of right action bar"] = "Ajuste la transparence de la barre d'action droite", + ["Adjusts transparency of shapeshift bar"] = "Ajuste la transparence de la barre de metamorphose", + ["Adjusts transparency of the entire minimap"] = "Ajuste la transparence de toute la mini-carte", + ["Adjusts transparency of the minimap shadow"] = "Ajuste la transparence de l'ombre de la mini-carte", + ["Adjusts transparency of the reputation bar"] = "Ajuste la transparence de la barre de reputation", + ["Adjusts transparency of the XP bar"] = "Ajuste la transparence de la barre d'XP", + ["Adjusts transparency of zoom buttons"] = "Ajuste la transparence de les boutons de zoom", + ["Adjusts vertical position of gryphon/wyvern decorations"] = "Ajuste la position verticale de gryphon/wyvern decorations", + ["Adjusts vertical position of keybind text"] = "Ajuste la position verticale de keybind text", + ["Adjusts vertical position of macro text"] = "Ajuste la position verticale de macro text", + ["Adjusts vertical position of the time display"] = "Ajuste la position verticale de l'affichage de l'heure", + ["Adjusts vertical position of the zone text"] = "Ajuste la position verticale de le texte de zone", + ["Adjusts vertical position of zoom buttons"] = "Ajuste la position verticale de les boutons de zoom", + ["appearance"] = "Apparence", + ["Appearance"] = "Apparence", + ["Automatically track reputation for factions you gain reputation with"] = "Suit automatiquement la reputation des factions avec lesquelles vous gagnez de la reputation", + ["bag basic"] = "Sacs", + ["Bags"] = "Sacs", + ["Bars"] = "Barres d'action", + ["boss"] = "boss", + ["BUG: blizzards highlight blinks at the wrong position - fix soon"] = "BUG : la surbrillance Blizzard clignote au mauvais endroit - correctif a venir", + ["Bug: move char after setting (unfixable)"] = "Bug : bouger le personnage apres reglage (non corrigible)", + ["BUG: slash commands not implemented yet - fix soon"] = "BUG : les commandes slash ne sont pas encore implementees - correctif a venir", + ["Build Number:"] = "Numero de build :", + ["Cast"] = "Barre de cast", + ["Castbar"] = "Barre de cast", + ["castbar Basic"] = "Castbar", + ["center"] = "centre", + ["CENTER"] = "CENTRE", + ["Change all fonts in the GUI"] = "Change toutes les polices de l'interface", + ["Change bag color"] = "Change la couleur des sacs", + ["Change bars color"] = "Change la couleur des barres", + ["Change cast color"] = "Change la couleur de la barre de cast", + ["Change castbar font size"] = "Change la taille de police de la barre de cast", + ["Change castbar font Y offset"] = "Change le decalage Y de la police de la barre de cast", + ["Change castbar height"] = "Change la hauteur de la barre de cast", + ["Change castbar width"] = "Change la largeur de la barre de cast", + ["Change casting time X offset"] = "Change le decalage X du temps d'incantation", + ["Change chat color"] = "Change la couleur du chat", + ["Change map color"] = "Change la couleur de la carte", + ["Change micro color"] = "Change la couleur du micro-menu", + ["Change mini color"] = "Change la couleur des mini-cadres", + ["Change player color"] = "Change la couleur du cadre joueur", + ["Change spell name X offset"] = "Change le decalage X du nom du sort", + ["Change spell text alignment"] = "Change l'alignement du texte du sort", + ["Change target color"] = "Change la couleur du cadre cible", + ["Change the font used for all smaller frames"] = "Change la police utilisee pour all smaller frames", + ["Change the font used for the castbar"] = "Change la police utilisee pour la barre de cast", + ["Change the font used for the experience and reputation bar"] = "Change la police utilisee pour les barres d'experience et de reputation", + ["Change the font used for the hotkeys and macros"] = "Change la police utilisee pour les raccourcis et macros", + ["Change the font used for the minimap"] = "Change la police utilisee pour la mini-carte", + ["Change the font used for the playerframe"] = "Change la police utilisee pour le cadre joueur", + ["Change the font used for the targetframe"] = "Change la police utilisee pour le cadre cible", + ["Change xprep color"] = "Change la couleur des barres XP/Reputation", + ["Changes take effect after reload:"] = "Les changements prennent effet apres rechargement :", + ["Changes the alpha of the side view"] = "Change la transparence du panneau lateral", + ["Changes the color of the close and min button"] = "Change la couleur des boutons Fermer/Mini", + ["Changes the color of the time on the home screen"] = "Change la couleur de l'heure sur l'ecran d'accueil", + ["Changes the colour of action button highlights"] = "Change la couleur de action button highlights", + ["Changes the colour of keybind text on action buttons"] = "Change la couleur de le texte des raccourcis sur les boutons d'action", + ["Changes the colour of macro text on action buttons"] = "Change la couleur de le texte des macros sur les boutons d'action", + ["Changes the colour of the resting glow animation"] = "Change la couleur de l'animation lumineuse de repos", + ["Changes the grid layout of bottom left action bar"] = "Change la disposition en grille de la barre d'action bas gauche", + ["Changes the grid layout of bottom right action bar"] = "Change la disposition en grille de la barre d'action bas droite", + ["Changes the grid layout of left action bar"] = "Change la disposition en grille de la barre d'action gauche", + ["Changes the grid layout of main action bar"] = "Change la disposition en grille de la barre d'action principale", + ["Changes the grid layout of pet action bar"] = "Change la disposition en grille de la barre du familier", + ["Changes the grid layout of right action bar"] = "Change la disposition en grille de la barre d'action droite", + ["Changes the scale of the mainframe"] = "Change l'echelle de la fenetre principale", + ["Changes the texture of the playerframe"] = "Change la texture de le cadre joueur", + ["Chat"] = "Chat", + ["chat basic"] = "Chat", + ["Client Version:"] = "Version client :", + ["close"] = "Fermer", + ["Collector"] = "Collecteur", + ["Color for cutout animation on all mini frames"] = "Couleur pour l'animation de decoupe sur tous les mini-cadres", + ["Color for damage cutout effect"] = "Couleur pour l'effet de decoupe des degats", + ["Color for pulse animation"] = "Couleur pour l'animation de pulsation", + ["Color for pulse animation on all mini frames"] = "Couleur pour l'animation de pulsation sur tous les mini-cadres", + ["Color health bar based on class"] = "Colore la barre de vie selon la classe", + ["Color health bar based on target class"] = "Colore la barre de vie selon la classe de la cible", + ["Color health bar based on target reaction"] = "Colore la barre de vie selon la reaction de la cible", + ["Color target of target and party health bars based on class"] = "Colore les barres de vie de la cible de la cible et du groupe selon la classe", + ["Color target of target health bars based on reaction"] = "Colore les barres de vie de la cible de la cible selon la reaction", + ["Color text based on health percentage"] = "Colore le texte selon le pourcentage de vie", + ["Color text based on health percentage from white to red"] = "Colore le texte selon le pourcentage de vie, du blanc au rouge", + ["Color text based on resource (mana/rage/energy) percentage"] = "Colore le texte selon le pourcentage de ressource (mana/rage/energie)", + ["Color text based on resource (mana/rage/energy) percentage from white to red"] = "Colore le texte selon le pourcentage de ressource (mana/rage/energie), du blanc au rouge", + ["Colorize the PizzaWorldBuffs Alliance/Horde text"] = "Colorise le texte Alliance/Horde de PizzaWorldBuffs", + ["Combat Effects"] = "Effets de combat", + ["Copy"] = "Copier", + ["Compact Horizontal"] = "Compact horizontal", + ["Compact Vertical"] = "Compact vertical", + ["Current profile reloaded"] = "Profil actuel recharge", + ["CURRENT PROFILE RELOADED"] = "PROFIL ACTUEL RECHARGE", + ["Custom"] = "Personnalise", + ["Choose how the pet bar grows when using a single row layout"] = "Choisit comment la barre du familier se deploie avec une disposition sur une seule ligne", + ["Default"] = "Defaut", + ["Grid 2x5"] = "Grille 2x5", + ["Horizontal"] = "Horizontal", + ["Reload Profile"] = "Recharger le profil", + ["Adjusts the size of pet action bar buttons"] = "Ajuste la taille des boutons de la barre du familier", + ["Adjusts the shine overlay of pet auto-cast visuals"] = "Ajuste la brillance de l'effet visuel d'auto-lancement du familier", + ["Adjusts the strength of the pet auto-cast glow"] = "Ajuste l'intensite de la lueur d'auto-lancement du familier", + ["Apply a quick preset for the pet bar"] = "Applique un preset rapide pour la barre du familier", + ["Vertical Down"] = "Vertical vers le bas", + ["Vertical Up"] = "Vertical vers le haut", + ["Vertical modes are especially useful for compact hunter layouts"] = "Les modes verticaux sont particulierement utiles pour les chasseurs avec une interface compacte", + ["Current"] = "Actuel", + ["CURRENT PROFILE RESET"] = "PROFIL ACTUEL REINITIALISE", + ["Dark Mode"] = "Mode sombre", + ["Database Version:"] = "Version base de donnees :", + ["Default"] = "Defaut", + ["Delete"] = "Supprimer", + ["deleted"] = "supprime", + ["dfrl evolved"] = "dfrl evolved", + ["dfrl nebula"] = "dfrl nebula", + ["Dragonflight Info"] = "Infos Dragonflight", + ["elite"] = "elite", + ["Enable combat pulse animation"] = "Active l'animation de pulsation en combat", + ["Enable cutout animation on bars"] = "Active cutout animation on bars", + ["Enable cutout animation on damage for all mini frames"] = "Active l'animation de decoupe sur les degats pour tous les mini-cadres", + ["Enable dark mode for the character panel"] = "Active le mode sombre pour la fiche du personnage", + ["Enable dark mode for the game menu"] = "Active le mode sombre pour le menu du jeu", + ["Enable dark mode for the questlog"] = "Active le mode sombre pour le journal de quetes", + ["Enable fade in/out animation"] = "Active l'animation de fondu entree/sortie", + ["Enable or disable addon modules. Changes require UI reload to take effect."] = "Active ou desactive les modules de l'addon. Rechargement de l'UI requis pour appliquer les changements.", + ["Enable pulse animation on bars"] = "Active l'animation de pulsation sur les barres", + ["Enable pulse animation on low health for all mini frames"] = "Active l'animation de pulsation a faible vie pour tous les mini-cadres", + ["Enable resting glow animation"] = "Active l'animation lumineuse de repos", + ["English"] = "Anglais", + ["enter profile name"] = "entrer le nom du profil", + ["Errors"] = "Erreurs", + ["Exit Game"] = "Quitter le jeu", + ["experience Bar"] = "Barre d'XP", + ["ext. PizzaWorldBuffs"] = "Ext. PizzaWorldBuffs", + ["Extended maximum camera distance"] = "Etend la distance maximale de la camera", + ["Fade out chat text after 10 seconds"] = "Fait disparaitre progressivement le texte du chat apres 10 secondes", + ["Flip the gryphon/wyvern textures"] = "Inverse les textures gryphon/wyvern", + ["font"] = "Police", + ["FPS:"] = "FPS :", + ["Francais"] = "Francais", + ["Français"] = "Francais", + ["GUI-Dragonflight"] = "Interface generale", + ["Health Bar"] = "Barre de vie", + ["Health Bars"] = "Barres de vie", + ["Health text font size"] = "Taille de police du texte de vie", + ["Health threshold for low HP warning"] = "Seuil de vie pour alerte de PV faibles", + ["Hide frame at full HP when not in combat"] = "Masque le cadre a PV pleins hors combat", + ["Hide party health and mana percent text"] = "Masque le pourcentage de vie et mana du groupe", + ["Hide pet health and mana percent text"] = "Masque le pourcentage de vie et mana du familier", + ["Hide target of target health and mana percent text"] = "Masque le pourcentage de vie et mana de la cible de la cible", + ["Hide the top UI error message (e.g. 'Spell is not ready')"] = "Masque le message d'erreur de l'UI en haut (ex. 'Le sort n'est pas pret')", + ["Home"] = "Accueil", + ["Home Screen"] = "Ecran d'accueil", + ["Info"] = "Infos", + ["Installed"] = "Installe", + ["Interface"] = "Interface", + ["Key Bindings"] = "Raccourcis clavier", + ["Last Update:"] = "Derniere mise a jour :", + ["left"] = "gauche", + ["LEFT"] = "GAUCHE", + ["Level text font size"] = "Taille de police du texte de niveau", + ["Light Mode"] = "Mode clair", + ["Locale:"] = "Langue :", + ["localization"] = "Langue", + ["Logout"] = "Deconnexion", + ["Macros"] = "Macros", + ["mainbar"] = "Barre principale", + ["mainbar deco"] = "Decors barre principale", + ["mainbar paging"] = "Pagination barre principale", + ["Mana text font size"] = "Taille de police du texte de mana", + ["Manage"] = "Gestion", + ["Map"] = "Mini-carte", + ["map basic"] = "Mini-carte", + ["map shadow"] = "Ombre mini-carte", + ["map zoom"] = "Zoom mini-carte", + ["MAX PROFILES REACHED"] = "LIMITE DE PROFILS ATTEINTE", + ["Memory (kb)"] = "Memoire (kb)", + ["Menu"] = "Menu", + ["Micro"] = "Micro-menu", + ["micro basic"] = "Micro-menu", + ["Micromenu"] = "Micro-menu", + ["min"] = "Mini", + ["Mini"] = "Mini-cadres", + ["mini text settings"] = "Texte mini-cadres", + ["Minimap"] = "Mini-carte", + ["Module"] = "Module", + ["Modules"] = "Modules", + ["multibar 1"] = "Multi-barre 1", + ["multibar 2"] = "Multi-barre 2", + ["multibar 3"] = "Multi-barre 3", + ["multibar 4"] = "Multi-barre 4", + ["Name text font size"] = "Taille de police du texte du nom", + ["Never"] = "Jamais", + ["New Profile"] = "Nouv. profil", + ["new profile created"] = "nouveau profil cree", + ["Not installed"] = "Non installe", + ["OFF"] = "OFF", + ["Okay"] = "OK", + ["ON"] = "ON", + ["Only for Blizzards version"] = "Uniquement pour la version Blizzard", + ["Options"] = "Options", + ["Party Text"] = "Texte groupe", + ["Performance"] = "Performance", + ["pet bar"] = "Barre du familier", + ["Pet Text"] = "Texte familier", + ["Player"] = "Joueur", + ["Profile"] = "Profil", + ["profile copied from"] = "profil copie depuis", + ["PROFILE RESET FAILED"] = "ECHEC DE LA REINITIALISATION", + ["profile saved"] = "profil sauvegarde", + ["Profiles"] = "Profils", + ["PVPIcon"] = "Icone JcJ", + ["RangeIndicator"] = "Indicateur de portee", + ["rare"] = "rare", + ["rare-elite"] = "rare-elite", + ["Realm:"] = "Royaume :", + ["Reload UI"] = "Recharger l'UI", + ["reputation Bar"] = "Barre de reputation", + ["Requires ShaguTweaks"] = "Necessite ShaguTweaks", + ["Reset"] = "Reinitialiser", + ["Resting Effects"] = "Effets de repos", + ["Resume Game"] = "Reprendre le jeu", + ["right"] = "droite", + ["RIGHT"] = "DROITE", + ["Save Profile"] = "Enregistrer le profil", + ["Script"] = "Script", + ["Select the language used in the configuration UI"] = "Choisit la langue utilisee dans l'interface de configuration", + ["Set fill direction"] = "Definit la direction de remplissage", + ["SHAGU TWEAKS EXTRAS MISSING\nINSTALL FOR MORE OPTIONS"] = "SHAGU TWEAKS EXTRAS MANQUANT\nINSTALLE-LE POUR PLUS D'OPTIONS", + ["ShaguTweaks"] = "ShaguTweaks", + ["shapeshift bar"] = "Barre de metamorphose", + ["Show Blzzards sun/moon indicator"] = "Affiche l'indicateur soleil/lune de Blizzard", + ["Show casting spell icon"] = "Affiche l'icone du sort en cours d'incantation", + ["Show casting time"] = "Affiche le temps d'incantation", + ["Show drop shadow below the castbar"] = "Affiche l'ombre portee sous la barre de cast", + ["Show energy and mana tick indicators"] = "Affiche les indicateurs de ticks d'energie et de mana", + ["Show health and mana text"] = "Affiche le texte de vie et de mana", + ["Show max health and mana text"] = "Affiche le texte de vie et mana max", + ["Show nameplates only in combat"] = "Affiche les plaques de nom uniquement en combat", + ["Show only current values without percentages"] = "Affiche uniquement les valeurs actuelles sans pourcentages", + ["Show or hide bags on mouse hover"] = "Affiche ou masque les sacs au survol de la souris", + ["Show or hide bottom left action bar"] = "Affiche ou masque la barre d'action bas gauche", + ["Show or hide bottom right action bar"] = "Affiche ou masque la barre d'action bas droite", + ["Show or hide chat buttons"] = "Affiche ou masque les boutons du chat", + ["Show or hide free bag slots"] = "Affiche ou masque les emplacements de sac libres", + ["Show or hide keybind text on action buttons"] = "Affiche ou masque le texte des raccourcis sur les boutons d'action", + ["Show or hide left side action bar"] = "Affiche ou masque la barre d'action laterale gauche", + ["Show or hide macro text on action buttons"] = "Affiche ou masque le texte des macros sur les boutons d'action", + ["Show or hide main action bar background"] = "Affiche ou masque le fond de la barre d'action principale", + ["Show or hide reputation text on the reputation bar"] = "Affiche ou masque le texte de reputation sur la barre de reputation", + ["Show or hide right side action bar"] = "Affiche ou masque la barre d'action laterale droite", + ["Show or hide the action bar paging buttons"] = "Affiche ou masque les boutons de pagination de la barre d'action", + ["Show or hide the bag frame"] = "Affiche ou masque le cadre des sacs", + ["Show or hide the bag toggle button"] = "Affiche ou masque le bouton de bascule des sacs", + ["Show or hide the gryphon/wyvern decorations"] = "Affiche ou masque les decorations gryphon/wyvern", + ["Show or hide the shadow inside the minimap"] = "Affiche ou masque l'ombre a l'interieur de la mini-carte", + ["Show or hide the small bag slots"] = "Affiche ou masque les petits emplacements de sac", + ["Show or hide the time display on the minimap"] = "Affiche ou masque l'affichage de l'heure sur la mini-carte", + ["Show or hide the top information panel"] = "Affiche ou masque le panneau d'information superieur", + ["Show or hide the XP bar"] = "Affiche ou masque la barre d'XP", + ["Show or hide XP text on the XP bar"] = "Affiche ou masque le texte d'XP sur la barre d'XP", + ["Show or hide zoom buttons on the minimap"] = "Affiche ou masque les boutons de zoom sur la mini-carte", + ["Show party max health and mana text"] = "Affiche le texte de vie et mana max du groupe", + ["Show pet max health and mana text"] = "Affiche le texte de vie et mana max du familier", + ["Show pet/target of target/party health and mana text"] = "Affiche le texte de vie et mana du familier / cible de la cible / groupe", + ["Show red border when health is low"] = "Affiche la bordure rouge quand la vie est basse", + ["Show reputation text for 5 seconds when gaining reputation"] = "Affiche le texte de reputation pendant 5 secondes lors d'un gain de reputation", + ["Show reputation text when hovering over the reputation bar"] = "Affiche le texte de reputation au survol de la barre de reputation", + ["Show smaller FPS/MS watcher (CTRL+R)"] = "Affiche smaller FPS/MS watcher (CTRL+R)", + ["Show spell name text"] = "Affiche le texte du nom du sort", + ["Show target of target max health and mana text"] = "Affiche le texte de vie et mana max de la cible de la cible", + ["Show the Minimap Square design"] = "Affiche le design carre de la mini-carte", + ["Show the tooltip above your cursor"] = "Affiche l'infobulle au-dessus du curseur", + ["Show XP text for 5 seconds when gaining XP"] = "Affiche le texte d'XP pendant 5 secondes lors d'un gain d'XP", + ["Show XP text when hovering over the XP bar"] = "Affiche le texte d'XP au survol de la barre d'XP", + ["standard"] = "standard", + ["Status"] = "Statut", + ["Supported Addons"] = "Addons pris en charge", + ["Swap the anchorpoint of the paging buttons"] = "Inverse le point d'ancrage des boutons de pagination", + ["Switch"] = "Activer", + ["Switch between gray and colorfull micro menu"] = "Bascule entre le micro-menu gris ou colore", + ["switched to"] = "profil actif :", + ["System"] = "Systeme", + ["Target"] = "Cible", + ["Target level text font size"] = "Taille de police du texte de niveau de la cible", + ["Target name text font size"] = "Taille de police du nom de la cible", + ["Target of Target Text"] = "Texte cible de la cible", + ["Text"] = "Texte", + ["text settings"] = "Texte", + ["Third Party"] = "Tiers", + ["Time (ms)"] = "Temps (ms)", + ["Tooltip"] = "Infobulles", + ["top panel"] = "Panneau superieur", + ["top panel time"] = "Heure mini-carte", + ["top panel zone"] = "Texte de zone", + ["TOTAL:"] = "TOTAL :", + ["tweaks"] = "Ajustements", + ["Ui"] = "Interface", + ["ui tweaks"] = "Ajustements UI", + ["Unitframes"] = "Cadres d'unite", + ["UpdateNotifier"] = "Notifications de maj", + ["Usage:\n\n\n1) new profile: create and switch to a new profile\n\n2) switch: change active profile\n\n3) copy: copies all settings into active profile\n\n4) delete: delete profile and switch back to default\n\n5)reset: reset active profile to the default settings\n\n\ndoes not affect shagutweaks\n\nBUG: DOUBLE CLICK DELETE AFTER NEW PROFILE\n\nBUG: ENTER PROFILE NAME STAYS"] = "Utilisation :\n\n\n1) nouveau profil : cree et active un nouveau profil\n\n2) activer : change le profil actif\n\n3) copier : copie tous les reglages dans le profil actif\n\n4) supprimer : supprime le profil et revient sur Defaut\n\n5) reinitialiser : remet le profil actif aux reglages par defaut\n\n\nn'affecte pas ShaguTweaks\n\nBUG : double clic sur supprimer apres un nouveau profil\n\nBUG : le nom du profil reste affiche", + ["Use 12-hour AM/PM time format instead of 24-hour"] = "Utilise le format horaire 12h AM/PM au lieu du 24h", + ["Use dark color for PvP icons"] = "Utilise la couleur sombre pour les icones JcJ", + ["Use dark color instead of red"] = "Utilise la couleur sombre au lieu du rouge", + ["Use original Blizzard chat buttons"] = "Utilise les boutons de chat Blizzard d'origine", + ["Use simple X instead of texture"] = "Utilise un X simple au lieu d'une texture", + ["Use the alternative gryphon/wyvern textures"] = "Utilise les textures alternatives gryphon/wyvern", + ["Xprep"] = "XP/Reputation", + + ["Navigation"] = "Navigation", + ["Drag to move - ESC to close"] = "Glisser pour deplacer - ECHAP pour fermer", + ["Profiles help text"] = "Utilisation :\n\n1) Nouveau profil : creer et activer un nouveau profil\n2) Activer : changer le profil actif\n3) Copier : copier tous les reglages vers le profil actif\n4) Supprimer : supprimer le profil et revenir sur Defaut\n5) Reinitialiser : restaurer les reglages du profil actif\n\nRemarque : n'affecte pas ShaguTweaks.", + ["Quick Actions"] = "Actions rapides", + ["Save Profile"] = "Enregistrer le profil", + ["Reload Profile"] = "Recharger le profil", + ["New Profile"] = "Nouveau profil", + ["Delete"] = "Supprimer", + ["Switch"] = "Activer", + ["Copy"] = "Copier", + ["Reset"] = "Reinitialiser", + ["Adjusts background alpha of XP and reputation bars"] = "Ajuste l'alpha de fond des barres d'XP et de reputation", + ["Adjusts font size of the zone text"] = "Ajuste la taille de police du texte de zone", + ["Adjusts horizontal position of gryphon/wyvern decorations"] = "Ajuste la position horizontale des decorations gryphon/wyvern", + ["Adjusts horizontal position of keybind text"] = "Ajuste la position horizontale du texte des raccourcis", + ["Adjusts horizontal position of macro text"] = "Ajuste la position horizontale du texte des macros", + ["Adjusts horizontal position of paging buttons"] = "Ajuste la position horizontale des boutons de pagination", + ["Adjusts horizontal position of the zone text"] = "Ajuste la position horizontale du texte de zone", + ["Adjusts horizontal position of zoom buttons"] = "Ajuste la position horizontale des boutons de zoom", + ["Adjusts size of zoom buttons"] = "Ajuste la taille des boutons de zoom", + ["Adjusts spacing between bottom left action bar buttons"] = "Ajuste l'espacement entre les boutons de la barre d'action bas gauche", + ["Adjusts spacing between bottom right action bar buttons"] = "Ajuste l'espacement entre les boutons de la barre d'action bas droite", + ["Adjusts spacing between left action bar buttons"] = "Ajuste l'espacement entre les boutons de la barre d'action gauche", + ["Adjusts spacing between main action bar buttons"] = "Ajuste l'espacement entre les boutons de la barre d'action principale", + ["Adjusts spacing between micro menu buttons"] = "Ajuste l'espacement entre les boutons du micro-menu", + ["Adjusts spacing between right action bar buttons"] = "Ajuste l'espacement entre les boutons de la barre d'action droite", + ["Adjusts the font size of the reputation bar text"] = "Ajuste la taille de police du texte de la barre de reputation", + ["Adjusts the font size of the XP bar text"] = "Ajuste la taille de police du texte de la barre d'XP", + ["Adjusts the height of the top panel"] = "Ajuste la hauteur du panneau superieur", + ["Adjusts the scale of the main backpack"] = "Ajuste l'echelle du sac principal", + ["Adjusts the scale of the micro menu"] = "Ajuste l'echelle du micro-menu", + ["Adjusts the scale of the paging buttons"] = "Ajuste l'echelle des boutons de pagination", + ["Adjusts the size of keybind text on action buttons"] = "Ajuste la taille du texte des raccourcis sur les boutons d'action", + ["Adjusts the size of macro text on action buttons"] = "Ajuste la taille du texte des macros sur les boutons d'action", + ["Adjusts the size of the gryphon/wyvern decorations"] = "Ajuste la taille des decorations gryphon/wyvern", + ["Adjusts the transparency of the micro menu"] = "Ajuste la transparence du micro-menu", + ["Adjusts the width of the top panel"] = "Ajuste la largeur du panneau superieur", + ["Adjusts transparency of gryphon/wyvern decorations"] = "Ajuste la transparence des decorations gryphon/wyvern", + ["Adjusts transparency of zoom buttons"] = "Ajuste la transparence des boutons de zoom", + ["Adjusts vertical position of gryphon/wyvern decorations"] = "Ajuste la position verticale des decorations gryphon/wyvern", + ["Adjusts vertical position of keybind text"] = "Ajuste la position verticale du texte des raccourcis", + ["Adjusts vertical position of macro text"] = "Ajuste la position verticale du texte des macros", + ["Adjusts vertical position of the zone text"] = "Ajuste la position verticale du texte de zone", + ["Adjusts vertical position of zoom buttons"] = "Ajuste la position verticale des boutons de zoom", + ["Changes the colour of action button highlights"] = "Change la couleur de surbrillance des boutons d'action", + ["Changes the colour of keybind text on action buttons"] = "Change la couleur du texte des raccourcis sur les boutons d'action", + ["Changes the colour of macro text on action buttons"] = "Change la couleur du texte des macros sur les boutons d'action", + ["Changes the texture of the playerframe"] = "Change la texture du cadre joueur", + + ["Change the font used for all smaller frames"] = "Change la police utilisee pour tous les petits cadres", +} +DFRL.locale.configLabels.frFR = { + ["Bags.bagAlpha"] = "Transparence sacs", + ["Bags.bagColor"] = "Couleur sacs", + ["Bags.bagDarkMode"] = "Mode sombre sacs", + ["Bags.bagScale"] = "Echelle sacs", + ["Bags.freeSlots"] = "Places libres", + ["Bags.hoverShow"] = "Afficher au survol", + ["Bags.showBags"] = "Afficher sacs", + ["Bags.showToggle"] = "Bouton sacs", + ["Bags.toggleBags"] = "Petits sacs", + ["barHeight"] = "Hauteur", + ["Bars.altGryphoon"] = "Textures alternatives gryphon", + ["Bars.barsColor"] = "Couleur des barres", + ["Bars.barsDarkMode"] = "Mode sombre barres", + ["Bars.flipGryphoon"] = "Inverser gryphon/wyvern", + ["Bars.gryphoonAlpha"] = "Transparence gryphon/wyvern", + ["Bars.gryphoonScale"] = "Taille gryphon/wyvern", + ["Bars.gryphoonX"] = "Position X gryphon/wyvern", + ["Bars.gryphoonY"] = "Position Y gryphon/wyvern", + ["Bars.highlightColor"] = "Couleur surbrillance", + ["Bars.hotkeyColour"] = "Couleur raccourcis", + ["Bars.hotkeyFont"] = "Police raccourcis", + ["Bars.hotkeyScale"] = "Taille raccourcis", + ["Bars.hotkeyShow"] = "Afficher raccourcis", + ["Bars.hotkeyX"] = "Position X raccourcis", + ["Bars.hotkeyY"] = "Position Y raccourcis", + ["Bars.macroColour"] = "Couleur macros", + ["Bars.macroScale"] = "Taille macros", + ["Bars.macroShow"] = "Afficher macros", + ["Bars.macroX"] = "Position X macros", + ["Bars.macroY"] = "Position Y macros", + ["Bars.mainBarAlpha"] = "Transparence barre principale", + ["Bars.mainBarBG"] = "Fond barre principale", + ["Bars.mainBarGrid"] = "Grille barre principale", + ["Bars.mainBarScale"] = "Echelle barre principale", + ["Bars.mainBarSpacing"] = "Espacement barre principale", + ["Bars.multiBarFourAlpha"] = "Transparence multi-barre 4", + ["Bars.multiBarFourGrid"] = "Grille multi-barre 4", + ["Bars.multiBarFourScale"] = "Echelle multi-barre 4", + ["Bars.multiBarFourShow"] = "Afficher multi-barre 4", + ["Bars.multiBarFourSpacing"] = "Espacement multi-barre 4", + ["Bars.multiBarOneAlpha"] = "Transparence multi-barre 1", + ["Bars.multiBarOneGrid"] = "Grille multi-barre 1", + ["Bars.multiBarOneScale"] = "Echelle multi-barre 1", + ["Bars.multiBarOneShow"] = "Afficher multi-barre 1", + ["Bars.multiBarOneSpacing"] = "Espacement multi-barre 1", + ["Bars.multiBarThreeAlpha"] = "Transparence multi-barre 3", + ["Bars.multiBarThreeGrid"] = "Grille multi-barre 3", + ["Bars.multiBarThreeScale"] = "Echelle multi-barre 3", + ["Bars.multiBarThreeShow"] = "Afficher multi-barre 3", + ["Bars.multiBarThreeSpacing"] = "Espacement multi-barre 3", + ["Bars.multiBarTwoAlpha"] = "Transparence multi-barre 2", + ["Bars.multiBarTwoGrid"] = "Grille multi-barre 2", + ["Bars.multiBarTwoScale"] = "Echelle multi-barre 2", + ["Bars.multiBarTwoShow"] = "Afficher multi-barre 2", + ["Bars.multiBarTwoSpacing"] = "Espacement multi-barre 2", + ["Bars.pagingScale"] = "Echelle pagination", + ["Bars.pagingShow"] = "Afficher pagination", + ["Bars.pagingSwap"] = "Inverser ancrage pagination", + ["Bars.pagingX"] = "Position X pagination", + ["Bars.petbarAlpha"] = "Transparence barre familier", + ["Bars.petbarGrid"] = "Grille barre familier", + ["Bars.petbarScale"] = "Echelle barre familier", + ["Bars.petbarSpacing"] = "Espacement barre familier", + ["Bars.petbarOrientation"] = "Orientation barre familier", + ["Bars.petbarButtonSize"] = "Taille boutons familier", + ["Bars.petbarPreset"] = "Preset barre familier", + ["Bars.petbarAutoCastAlpha"] = "Intensite glow auto-cast", + ["Bars.petbarShineAlpha"] = "Intensite shine auto-cast", + ["Bars.shapeshiftAlpha"] = "Transparence metamorphose", + ["Bars.shapeshiftScale"] = "Echelle metamorphose", + ["Bars.shapeshiftSpacing"] = "Espacement metamorphose", + ["Bars.showGryphoon"] = "Afficher gryphon/wyvern", + ["barWidth"] = "Largeur", + ["Cast.barHeight"] = "Hauteur castbar", + ["Cast.barWidth"] = "Largeur castbar", + ["Cast.castColor"] = "Couleur castbar", + ["Cast.castDarkMode"] = "Mode sombre castbar", + ["Cast.castFont"] = "Police castbar", + ["Cast.fontSize"] = "Taille police castbar", + ["Cast.fontY"] = "Position Y police", + ["Cast.setFillDirection"] = "Sens de remplissage", + ["Cast.showIcon"] = "Afficher icone", + ["Cast.showShadow"] = "Afficher ombre", + ["Cast.showSpell"] = "Afficher nom du sort", + ["Cast.showTime"] = "Afficher temps", + ["Cast.spellX"] = "Position X nom sort", + ["Cast.textAlign"] = "Alignement texte", + ["Cast.timeX"] = "Position X temps", + ["Chat.blizzardButtons"] = "Boutons Blizzard", + ["Chat.chatColor"] = "Couleur chat", + ["Chat.chatDarkMode"] = "Mode sombre chat", + ["Chat.fadeChat"] = "Fondu du chat", + ["Chat.showButtons"] = "Afficher boutons chat", + ["Collector.collectDarkMode"] = "Mode sombre collecte", + ["cutoutColor"] = "Couleur effet degats", + ["enableCutout"] = "Effet degats", + ["enablePulse"] = "Pulse", + ["Errors.hideErrors"] = "Masquer erreurs Lua", + ["fontSize"] = "Taille police", + ["frameScale"] = "Taille du cadre", + ["GUI-Dragonflight.globalFont"] = "Police globale", + ["GUI-Dragonflight.homeMinMaxColor"] = "Couleur Fermer/Mini", + ["GUI-Dragonflight.homeTimeColor"] = "Couleur horloge", + ["GUI-Dragonflight.language"] = "Langue", + ["GUI-Dragonflight.sideView"] = "Panneau lateral", + ["GUI-Dragonflight.smallerFrame"] = "Fenetre compacte", + ["Map.alphaShadow"] = "Transparence ombre", + ["Map.alphaZoom"] = "Transparence zoom", + ["Map.mapAlpha"] = "Transparence mini-carte", + ["Map.mapColor"] = "Couleur mini-carte", + ["Map.mapDarkMode"] = "Mode sombre mini-carte", + ["Map.mapShadow"] = "Afficher ombre", + ["Map.mapSize"] = "Taille mini-carte", + ["Map.mapSquare"] = "Style carre", + ["Map.mapTime"] = "Afficher heure", + ["Map.scaleZoom"] = "Taille zoom", + ["Map.showSunMoon"] = "Soleil/lune Blizzard", + ["Map.showTopPanel"] = "Afficher panneau haut", + ["Map.showZoom"] = "Afficher zoom", + ["Map.textColor"] = "Couleurs PizzaWB", + ["Map.timeFormat12h"] = "Format 12h", + ["Map.timeSize"] = "Taille heure", + ["Map.timeX"] = "Position X heure", + ["Map.timeY"] = "Position Y heure", + ["Map.topPanelFont"] = "Police mini-carte", + ["Map.topPanelHeight"] = "Hauteur panneau haut", + ["Map.topPanelWidth"] = "Largeur panneau haut", + ["Map.zoneTextSize"] = "Taille texte zone", + ["Map.zoneTextX"] = "Position X zone", + ["Map.zoneTextY"] = "Position Y zone", + ["Map.zoomX"] = "Position X zoom", + ["Map.zoomY"] = "Position Y zoom", + ["Micro.microAlpha"] = "Transparence micro-menu", + ["Micro.microColor"] = "Couleur micro-menu", + ["Micro.microDarkMode"] = "Mode sombre micro-menu", + ["Micro.microScale"] = "Echelle micro-menu", + ["Micro.microSpacing"] = "Espacement micro-menu", + ["Micro.smallFPS"] = "FPS/MS compacts", + ["Micro.switchColor"] = "Style gris/couleur", + ["Mini.colorClass"] = "Couleur par classe", + ["Mini.colorReaction"] = "Couleur par reaction", + ["Mini.cutoutColor"] = "Couleur effet degats", + ["Mini.enableCutout"] = "Effet degats", + ["Mini.enablePulse"] = "Pulse faible vie", + ["Mini.frameFont"] = "Police mini-cadres", + ["Mini.miniColor"] = "Couleur mini-cadres", + ["Mini.miniDarkMode"] = "Mode sombre mini-cadres", + ["Mini.miniPartyTextMaxShow"] = "Afficher max groupe", + ["Mini.miniPetTextMaxShow"] = "Afficher max familier", + ["Mini.miniTextShow"] = "Afficher texte vie/mana", + ["Mini.miniTotTextMaxShow"] = "Afficher max cible de cible", + ["Mini.noPartyPercent"] = "Masquer % groupe", + ["Mini.noPetPercent"] = "Masquer % familier", + ["Mini.noTotPercent"] = "Masquer % cible de cible", + ["Mini.partyFrameScale"] = "Taille cadre groupe", + ["Mini.petFrameScale"] = "Taille cadre familier", + ["Mini.pulseColor"] = "Couleur pulse", + ["Mini.totFrameScale"] = "Taille cadre cible de cible", + ["noPercent"] = "Masquer pourcentages", + ["Player.classColor"] = "Vie selon classe", + ["Player.classPortrait"] = "Portraits de classe 2D", + ["Player.combatGlow"] = "Pulse combat", + ["Player.cutoutColor"] = "Couleur effet degats", + ["Player.eliteBorder"] = "Texture du cadre", + ["Player.enableCutout"] = "Effet degats", + ["Player.enablePulse"] = "Pulse barres", + ["Player.energyTick"] = "Ticks energie/mana", + ["Player.frameFont"] = "Police joueur", + ["Player.frameHide"] = "Masquer a PV pleins", + ["Player.frameScale"] = "Taille du cadre", + ["Player.glowAlpha"] = "Alpha pulse combat", + ["Player.glowSpeed"] = "Vitesse pulse combat", + ["Player.healthSize"] = "Taille texte vie", + ["Player.levelSize"] = "Taille niveau", + ["Player.manaSize"] = "Taille texte mana", + ["Player.nameSize"] = "Taille nom", + ["Player.noPercent"] = "Masquer pourcentages", + ["Player.playerColor"] = "Couleur joueur", + ["Player.playerDarkMode"] = "Mode sombre joueur", + ["Player.pulseColor"] = "Couleur pulse", + ["Player.restingAlpha"] = "Alpha repos", + ["Player.restingColor"] = "Couleur repos", + ["Player.restingGlow"] = "Lueur repos", + ["Player.restingSpeed"] = "Vitesse repos", + ["Player.textColoringHealth"] = "Texte selon vie", + ["Player.textColoringResource"] = "Texte selon ressource", + ["Player.textMaxShow"] = "Afficher valeurs max", + ["Player.textShow"] = "Afficher texte vie/mana", + ["pulseColor"] = "Couleur pulse", + ["PVPIcon.pvpDark"] = "Icnes JcJ sombres", + ["RangeIndicator.indicatorAlpha"] = "Opacite indicateur", + ["RangeIndicator.indicatorDark"] = "Couleur sombre", + ["RangeIndicator.indicatorFade"] = "Fondu animation", + ["RangeIndicator.indicatorSimple"] = "X simple", + ["Target.colorClass"] = "Vie selon classe", + ["Target.colorReaction"] = "Vie selon reaction", + ["Target.cutoutColor"] = "Couleur effet degats", + ["Target.enableCutout"] = "Effet degats", + ["Target.enablePulse"] = "Pulse barres", + ["Target.frameFont"] = "Police cible", + ["Target.frameScale"] = "Taille du cadre", + ["Target.healthSize"] = "Taille texte vie", + ["Target.levelSize"] = "Taille niveau cible", + ["Target.manaSize"] = "Taille texte mana", + ["Target.nameSize"] = "Taille nom cible", + ["Target.noPercent"] = "Masquer pourcentages", + ["Target.pulseColor"] = "Couleur pulse", + ["Target.targetColor"] = "Couleur cible", + ["Target.targetDarkMode"] = "Mode sombre cible", + ["Target.textColoringHealth"] = "Texte selon vie", + ["Target.textColoringResource"] = "Texte selon ressource", + ["Target.textMaxShow"] = "Afficher valeurs max", + ["Target.textShow"] = "Afficher texte vie/mana", + ["textMaxShow"] = "Afficher valeurs max", + ["textShow"] = "Afficher texte", + ["Tooltip.toolTipMouse"] = "Infobulle au curseur", + ["Tooltip.toolTipX"] = "Decalage X infobulle", + ["Tooltip.toolTipY"] = "Decalage Y infobulle", + ["Ui.cameraDistanceFactor"] = "Distance camera max", + ["Ui.characterPanel"] = "Fiche personnage", + ["Ui.gameMenu"] = "Menu du jeu", + ["Ui.hideErrorMessage"] = "Masquer message d'erreur", + ["Ui.lowHpThreshold"] = "Seuil PV faibles", + ["Ui.lowHpWarn"] = "Alerte PV faibles", + ["Ui.questLog"] = "Journal de quetes", + ["Ui.showPlates"] = "Plaques de nom en combat", + ["Xprep.autoTrack"] = "Suivi auto reputation", + ["Xprep.barFont"] = "Police XP/Rep", + ["Xprep.bgAlpha"] = "Alpha du fond", + ["Xprep.hoverRep"] = "Texte rep au survol", + ["Xprep.hoverXP"] = "Texte XP au survol", + ["Xprep.repBarAlpha"] = "Transparence barre rep", + ["Xprep.repBarHeight"] = "Hauteur barre rep", + ["Xprep.repBarTextSize"] = "Taille texte rep", + ["Xprep.repBarWidth"] = "Largeur barre rep", + ["Xprep.showRepOnGain"] = "Texte rep au gain", + ["Xprep.showRepText"] = "Afficher texte reputation", + ["Xprep.showXpBar"] = "Afficher barre XP", + ["Xprep.showXpOnGain"] = "Texte XP au gain", + ["Xprep.showXpText"] = "Afficher texte XP", + ["Xprep.xpBarAlpha"] = "Transparence barre XP", + ["Xprep.xpBarHeight"] = "Hauteur barre XP", + ["Xprep.xpBarTextSize"] = "Taille texte XP", + ["Xprep.xpBarWidth"] = "Largeur barre XP", + ["Xprep.xprepColor"] = "Couleur XP/Rep", + ["Xprep.xprepDarkMode"] = "Mode sombre XP/Rep", +DFRL.locale.wordMap.frFR = { + ["alpha"] = "alpha", + ["bag"] = "sac", + ["bags"] = "sacs", + ["bar"] = "barre", + ["bars"] = "barres", + ["bg"] = "fond", + ["camera"] = "camera", + ["cast"] = "cast", + ["chat"] = "chat", + ["class"] = "classe", + ["color"] = "couleur", + ["colour"] = "couleur", + ["combat"] = "combat", + ["cutout"] = "decoupe", + ["dark"] = "sombre", + ["distance"] = "distance", + ["energy"] = "energie", + ["error"] = "erreur", + ["fade"] = "fondu", + ["font"] = "police", + ["fps"] = "fps", + ["frame"] = "cadre", + ["free"] = "libres", + ["glow"] = "lueur", + ["grid"] = "grille", + ["health"] = "vie", + ["hide"] = "masquer", + ["hotkey"] = "raccourcis", + ["icon"] = "icone", + ["indicator"] = "indicateur", + ["language"] = "langue", + ["level"] = "niveau", + ["macro"] = "macro", + ["mana"] = "mana", + ["map"] = "carte", + ["micro"] = "micro", + ["mini"] = "mini", + ["mode"] = "mode", + ["name"] = "nom", + ["panel"] = "panneau", + ["party"] = "groupe", + ["pet"] = "familier", + ["player"] = "joueur", + ["profile"] = "profil", + ["profiles"] = "profils", + ["pulse"] = "pulse", + ["pvp"] = "jcj", + ["quest"] = "quete", + ["reaction"] = "reaction", + ["rep"] = "rep", + ["resting"] = "repos", + ["scale"] = "echelle", + ["shadow"] = "ombre", + ["show"] = "afficher", + ["size"] = "taille", + ["slots"] = "emplacements", + ["spacing"] = "espacement", + ["target"] = "cible", + ["text"] = "texte", + ["threshold"] = "seuil", + ["time"] = "temps", + ["toggle"] = "bascule", + ["tooltip"] = "infobulle", + ["tot"] = "cible", + ["transparency"] = "transparence", + ["ui"] = "ui", + ["warn"] = "alerte", + ["width"] = "largeur", + ["x"] = "X", + ["xp"] = "XP", + ["y"] = "Y", + ["zoom"] = "zoom", +function DFRL:GetLanguage() + local language = nil + if self.tempDB and self.tempDB["GUI-Dragonflight"] and self.tempDB["GUI-Dragonflight"].language then + language = self.tempDB["GUI-Dragonflight"].language + end + if not language or language == "" then + if GetLocale and GetLocale() == "frFR" then + return "Francais" + end + return "English" + return language +end +function DFRL:IsFrench() + local language = self:GetLanguage() + return language == "Francais" or language == "Français" or language == "frFR" or language == "fr" +function DFRL:TR(text) + if text == nil then return text end + if not self:IsFrench() then return text end + local tbl = self.locale and self.locale.translations and self.locale.translations.frFR + if not tbl then return text end + return tbl[text] or text +function DFRL:HumanizeKey(key) + if not key then return "" end + local displayTxt = string.gsub(key, "(%l)(%u)", "%1 %2") + displayTxt = string.upper(string.sub(displayTxt, 1, 1)) .. string.sub(displayTxt, 2) + return displayTxt +function DFRL:TranslateWords(text) + if not text or text == "" then return text end + local map = self.locale and self.locale.wordMap and self.locale.wordMap.frFR + if not map then return text end + local result = {} + for token in string.gfind(text, "%S+") do + local core, punct = string.gsub(token, "([%.,:;!%?])$", ""), string.match(token, "([%.,:;!%?])$") + local lookup = string.lower(core or token) + local translated = map[lookup] or core + table.insert(result, translated .. (punct or "")) + return table.concat(result, " ") +function DFRL:GetOptionLabel(moduleName, key) + local fallback = self:HumanizeKey(key) + if not self:IsFrench() then + return fallback + local tbl = self.locale and self.locale.configLabels and self.locale.configLabels.frFR + if tbl then + local exactKey = (moduleName and key) and (moduleName .. "." .. key) or nil + if exactKey and tbl[exactKey] then + return tbl[exactKey] + if tbl[key] then + return tbl[key] + local translated = self:TR(fallback) + if translated ~= fallback then + return translated + return self:TranslateWords(fallback) +function DFRL:DisplayProfileName(name) + if not name then return "" end + if name == "Default" then + return self:TR("Default") + return name diff --git a/media/tex/micromenu/color_micro/instancejournal-faded.tga b/media/tex/micromenu/color_micro/instancejournal-faded.tga new file mode 100644 index 0000000..4c4489c Binary files /dev/null and b/media/tex/micromenu/color_micro/instancejournal-faded.tga differ diff --git a/media/tex/micromenu/color_micro/instancejournal-highlight.tga b/media/tex/micromenu/color_micro/instancejournal-highlight.tga new file mode 100644 index 0000000..639bd52 Binary files /dev/null and b/media/tex/micromenu/color_micro/instancejournal-highlight.tga differ diff --git a/media/tex/micromenu/color_micro/instancejournal-regular.tga b/media/tex/micromenu/color_micro/instancejournal-regular.tga new file mode 100644 index 0000000..b25b361 Binary files /dev/null and b/media/tex/micromenu/color_micro/instancejournal-regular.tga differ diff --git a/modules/bars/bars.lua b/modules/bars/bars.lua index e0b6441..a84216e 100644 --- a/modules/bars/bars.lua +++ b/modules/bars/bars.lua @@ -54,9 +54,15 @@ DFRL:NewDefaults("Bars", { petbarScale = {0.8, "slider", {0.2, 2}, nil, "pet bar", 51, "Adjusts the scale of the pet action bar", nil, nil}, petbarSpacing = {6, "slider", {0.1, 20}, nil, "pet bar", 52, "Adjusts spacing between pet action bar buttons", nil, nil}, petbarAlpha = {1, "slider", {0.1, 1}, nil, "pet bar", 53, "Adjusts transparency of pet action bar", nil, nil}, - shapeshiftScale = {0.8, "slider", {0.2, 2}, nil, "shapeshift bar", 54, "Adjusts the scale of the shapeshift bar", nil, nil}, - shapeshiftSpacing = {6, "slider", {0.1, 20}, nil, "shapeshift bar", 55, "Adjusts spacing between shapeshift buttons", nil, nil}, - shapeshiftAlpha = {1, "slider", {0.1, 1}, nil, "shapeshift bar", 56, "Adjusts transparency of shapeshift bar", nil, nil}, + petbarGrid = {1, "slider", {1, 6}, nil, "pet bar", 54, "Changes the grid layout of pet action bar", "5 = 2 columns x 5 rows", nil}, + petbarOrientation = {"Horizontal", "dropdown", {"Horizontal", "Vertical Down", "Vertical Up"}, nil, "pet bar", 55, "Choose how the pet bar grows when using a single row layout", "Vertical modes are especially useful for compact hunter layouts", nil}, + petbarButtonSize = {30, "slider", {20, 40}, nil, "pet bar", 56, "Adjusts the size of pet action bar buttons", nil, nil}, + petbarPreset = {"Custom", "dropdown", {"Custom", "Default", "Compact Vertical", "Compact Horizontal", "Grid 2x5"}, nil, "pet bar", 57, "Apply a quick preset for the pet bar", nil, nil}, + petbarAutoCastAlpha = {0.40, "slider", {0.1, 1}, nil, "pet bar", 58, "Adjusts the strength of the pet auto-cast glow", nil, nil}, + petbarShineAlpha = {0.28, "slider", {0.1, 1}, nil, "pet bar", 59, "Adjusts the shine overlay of pet auto-cast visuals", nil, nil}, + shapeshiftScale = {0.8, "slider", {0.2, 2}, nil, "shapeshift bar", 60, "Adjusts the scale of the shapeshift bar", nil, nil}, + shapeshiftSpacing = {6, "slider", {0.1, 20}, nil, "shapeshift bar", 61, "Adjusts spacing between shapeshift buttons", nil, nil}, + shapeshiftAlpha = {1, "slider", {0.1, 1}, nil, "shapeshift bar", 62, "Adjusts transparency of shapeshift bar", nil, nil}, }) DFRL:NewMod("Bars", 1, function() @@ -342,6 +348,62 @@ DFRL:NewMod("Bars", 1, function() button:ClearAllPoints() button:SetPoint("LEFT", self.newPetBar, "LEFT", (i-1)*36, 0) end + + self:PetBarAutoCastVisuals() + end + + function Setup:PetBarAutoCastVisuals() + if self.petBarAutoCastFrame then return end + + local function softenTexture(tex, alpha) + if tex and tex.SetAlpha then + tex:SetAlpha(alpha) + end + end + + local function applyPetAutoCastLook() + for i = 1, 10 do + local button = _G["PetActionButton" .. i] + if button then + local name = button:GetName() + local shine = button.Shine or _G[name .. "Shine"] + local autoCast = button.AutoCastable or _G[name .. "AutoCastable"] + local autoCast2 = button.AutoCast or _G[name .. "AutoCast"] + + local shineAlpha = DFRL:GetTempDB('Bars', 'petbarShineAlpha') or 0.28 + local autoCastAlpha = DFRL:GetTempDB('Bars', 'petbarAutoCastAlpha') or 0.40 + + softenTexture(shine, shineAlpha) + softenTexture(autoCast, autoCastAlpha) + softenTexture(autoCast2, autoCastAlpha) + end + end + end + + self.petBarAutoCastFrame = CreateFrame("Frame") + self.petBarAutoCastFrame:RegisterEvent("PLAYER_ENTERING_WORLD") + self.petBarAutoCastFrame:RegisterEvent("UNIT_PET") + self.petBarAutoCastFrame:RegisterEvent("PET_BAR_UPDATE") + self.petBarAutoCastFrame:RegisterEvent("PET_BAR_UPDATE_USABLE") + self.petBarAutoCastFrame:RegisterEvent("PET_UI_UPDATE") + self.petBarAutoCastFrame:SetScript("OnEvent", function() + if DFRL.DebugLog then + DFRL:DebugLog('bars', 'PetBarAutoCastEvent', event or 'nil', arg1 or 'nil') + end + applyPetAutoCastLook() + end) + + local refreshFrame = CreateFrame('Frame') + local elapsed = 0 + refreshFrame:SetScript('OnUpdate', function() + elapsed = elapsed + (arg1 or 0) + if elapsed > 1 then + this:SetScript('OnUpdate', nil) + applyPetAutoCastLook() + end + end) + + applyPetAutoCastLook() end function Setup:ShapeshiftBar() @@ -547,7 +609,8 @@ DFRL:NewMod("Bars", 1, function() -- callbacks local callbacks = {} - local helpers = { + local helpers = {} + helpers = { getFontPath = function(fontName) if fontName == 'Expressway' then return 'Interface\\AddOns\\DragonflightUI-Reforged\\media\\fnt\\Expressway.ttf' @@ -576,30 +639,130 @@ DFRL:NewMod("Bars", 1, function() end end, - setGridLayout = function(barFrame, buttonPrefix, value, spacingKey) - local layoutIndex = math.floor(value + 0.5) + normalizeLayoutIndex = function(value) + local layoutIndex = math.floor((value or 1) + 0.5) if layoutIndex < 1 then layoutIndex = 1 end if layoutIndex > 6 then layoutIndex = 6 end + return layoutIndex + end, + + setGridLayout = function(barFrame, buttonPrefix, value, spacingKey, maxButtons) + maxButtons = maxButtons or 12 + local layoutIndex = helpers.normalizeLayoutIndex(value) local layout = Setup.layouts[layoutIndex] if not layout then return end local spacing = DFRL:GetTempDB('Bars', spacingKey) - local buttonSize = _G[buttonPrefix .. '1']:GetWidth() + local firstButton = _G[buttonPrefix .. '1'] + if not firstButton then + if DFRL.DebugLog then + DFRL:DebugLog('bars', 'GridLayoutSkipped', buttonPrefix, 'button 1 missing') + end + return + end + local buttonSize = firstButton:GetWidth() local isReversed = buttonPrefix == 'MultiBarLeftButton' or buttonPrefix == 'MultiBarRightButton' + local isPetBar = buttonPrefix == 'PetActionButton' + local effectiveCols = math.min(layout.cols, maxButtons) + local effectiveRows = math.ceil(maxButtons / effectiveCols) + + if DFRL.DebugLog then + DFRL:DebugLog('bars', 'GridLayout', buttonPrefix, 'layout', layoutIndex, 'cols', effectiveCols, 'rows', effectiveRows, 'spacing', spacing) + end - for i = (isReversed and 12 or 1), (isReversed and 1 or 12), (isReversed and -1 or 1) do + for i = (isReversed and maxButtons or 1), (isReversed and 1 or maxButtons), (isReversed and -1 or 1) do local button = _G[buttonPrefix .. i] if button then button:ClearAllPoints() - local index = isReversed and (13 - i) or i - local row = math.floor((index - 1) / layout.cols) - local col = (index - 1) - (row * layout.cols) - button:SetPoint('BOTTOMLEFT', barFrame, 'BOTTOMLEFT', col * (buttonSize + spacing), row * (buttonSize + spacing)) + local index = isReversed and (maxButtons + 1 - i) or i + local row = math.floor((index - 1) / effectiveCols) + local col = (index - 1) - (row * effectiveCols) + + if isPetBar and effectiveRows > 1 then + button:SetPoint('TOPLEFT', barFrame, 'TOPLEFT', col * (buttonSize + spacing), -row * (buttonSize + spacing)) + else + button:SetPoint('BOTTOMLEFT', barFrame, 'BOTTOMLEFT', col * (buttonSize + spacing), row * (buttonSize + spacing)) + end end end - barFrame:SetHeight((buttonSize + spacing) * layout.rows - spacing) - barFrame:SetWidth((buttonSize + spacing) * layout.cols - spacing) + barFrame:SetHeight((buttonSize + spacing) * effectiveRows - spacing) + barFrame:SetWidth((buttonSize + spacing) * effectiveCols - spacing) + end, + + applyPetBarButtonSize = function(size) + local buttonSize = tonumber(size) or 30 + for i = 1, 10 do + local button = _G['PetActionButton' .. i] + if button then + button:SetWidth(buttonSize) + button:SetHeight(buttonSize) + end + end + end, + + applyPetBarLayout = function() + if not DFRL.newPetBar then return end + local firstButton = _G['PetActionButton1'] + if not firstButton then return end + + local spacing = DFRL:GetTempDB('Bars', 'petbarSpacing') or 6 + local layoutIndex = helpers.normalizeLayoutIndex(DFRL:GetTempDB('Bars', 'petbarGrid') or 1) + local orientation = DFRL:GetTempDB('Bars', 'petbarOrientation') or 'Horizontal' + local buttonSize = tonumber(DFRL:GetTempDB('Bars', 'petbarButtonSize')) or firstButton:GetWidth() or 30 + local layout = Setup.layouts[layoutIndex] + if not layout then return end + + helpers.applyPetBarButtonSize(buttonSize) + + local cols = math.min(layout.cols, 10) + local rows = math.ceil(10 / cols) + local anchor = 'BOTTOMLEFT' + local verticalDirection = 1 + + if layoutIndex == 1 then + if orientation == 'Vertical Down' then + cols = 1 + rows = 10 + anchor = 'TOPLEFT' + verticalDirection = -1 + elseif orientation == 'Vertical Up' then + cols = 1 + rows = 10 + anchor = 'BOTTOMLEFT' + verticalDirection = 1 + else + cols = 10 + rows = 1 + anchor = 'BOTTOMLEFT' + verticalDirection = 1 + end + else + if orientation == 'Vertical Up' then + anchor = 'BOTTOMLEFT' + verticalDirection = 1 + else + anchor = 'TOPLEFT' + verticalDirection = -1 + end + end + + for i = 1, 10 do + local button = _G['PetActionButton' .. i] + if button then + local row = math.floor((i - 1) / cols) + local col = (i - 1) - (row * cols) + button:ClearAllPoints() + button:SetPoint(anchor, DFRL.newPetBar, anchor, col * (buttonSize + spacing), row * (buttonSize + spacing) * verticalDirection) + end + end + + DFRL.newPetBar:SetWidth((buttonSize + spacing) * cols - spacing) + DFRL.newPetBar:SetHeight((buttonSize + spacing) * rows - spacing) + + if DFRL.DebugLog then + DFRL:DebugLog('bars', 'PetBarLayout', 'grid', layoutIndex, 'orientation', orientation, 'cols', cols, 'rows', rows, 'size', buttonSize, 'spacing', spacing) + end end, iterateButtons = function(callback) @@ -637,6 +800,9 @@ DFRL:NewMod("Bars", 1, function() end callbacks.multiBarOneSpacing = function(value) + local gridLayout = DFRL:GetTempDB('Bars', 'multiBarOneGrid') + if math.floor(gridLayout + 0.5) ~= 1 then return end + if DFRL.DebugLog then DFRL:DebugLog('bars', 'Spacing', 'MultiBarBottomLeftButton', value) end helpers.setSpacing('MultiBarBottomLeftButton', value) end @@ -651,6 +817,7 @@ DFRL:NewMod("Bars", 1, function() callbacks.multiBarTwoSpacing = function(value) local gridLayout = DFRL:GetTempDB('Bars', 'multiBarTwoGrid') if math.floor(gridLayout + 0.5) ~= 1 then return end + if DFRL.DebugLog then DFRL:DebugLog('bars', 'Spacing', 'MultiBarBottomRightButton', value) end helpers.setSpacing('MultiBarBottomRightButton', value) end @@ -663,6 +830,9 @@ DFRL:NewMod("Bars", 1, function() end callbacks.multiBarThreeSpacing = function(value) + local gridLayout = DFRL:GetTempDB('Bars', 'multiBarThreeGrid') + if math.floor(gridLayout + 0.5) ~= 1 then return end + if DFRL.DebugLog then DFRL:DebugLog('bars', 'Spacing', 'MultiBarLeftButton', value) end helpers.setSpacing('MultiBarLeftButton', value, 'vertical') end @@ -675,6 +845,9 @@ DFRL:NewMod("Bars", 1, function() end callbacks.multiBarFourSpacing = function(value) + local gridLayout = DFRL:GetTempDB('Bars', 'multiBarFourGrid') + if math.floor(gridLayout + 0.5) ~= 1 then return end + if DFRL.DebugLog then DFRL:DebugLog('bars', 'Spacing', 'MultiBarRightButton', value) end helpers.setSpacing('MultiBarRightButton', value, 'vertical') end @@ -963,7 +1136,7 @@ DFRL:NewMod("Bars", 1, function() end callbacks.petbarSpacing = function(value) - helpers.setSpacing('PetActionButton', value, 'horizontal', 10) + helpers.applyPetBarLayout() end callbacks.petbarAlpha = function(value) @@ -972,6 +1145,80 @@ DFRL:NewMod("Bars", 1, function() end end + callbacks.petbarOrientation = function(value) + helpers.applyPetBarLayout() + end + + callbacks.petbarButtonSize = function(value) + helpers.applyPetBarLayout() + end + + callbacks.petbarPreset = function(value) + if value == 'Custom' then return end + + local preset = { + ['Default'] = { + petbarGrid = 1, + petbarOrientation = 'Horizontal', + petbarButtonSize = 30, + petbarSpacing = 6, + petbarScale = 0.8, + }, + ['Compact Vertical'] = { + petbarGrid = 6, + petbarOrientation = 'Vertical Down', + petbarButtonSize = 28, + petbarSpacing = 4, + petbarScale = 0.8, + }, + ['Compact Horizontal'] = { + petbarGrid = 1, + petbarOrientation = 'Horizontal', + petbarButtonSize = 28, + petbarSpacing = 4, + petbarScale = 0.8, + }, + ['Grid 2x5'] = { + petbarGrid = 5, + petbarOrientation = 'Vertical Down', + petbarButtonSize = 28, + petbarSpacing = 4, + petbarScale = 0.8, + }, + } + + local cfg = preset[value] + if not cfg then return end + + for key, setting in pairs(cfg) do + DFRL:SetTempDBNoCallback('Bars', key, setting) + end + + callbacks.petbarScale(DFRL:GetTempDB('Bars', 'petbarScale')) + callbacks.petbarGrid(DFRL:GetTempDB('Bars', 'petbarGrid')) + callbacks.petbarOrientation(DFRL:GetTempDB('Bars', 'petbarOrientation')) + callbacks.petbarButtonSize(DFRL:GetTempDB('Bars', 'petbarButtonSize')) + callbacks.petbarSpacing(DFRL:GetTempDB('Bars', 'petbarSpacing')) + + if DFRL.gui and DFRL.gui.Base and DFRL.gui.Base.UpdateHandler then + DFRL.gui.Base:UpdateHandler() + end + end + + callbacks.petbarAutoCastAlpha = function(value) + if Setup and Setup.petBarAutoCastFrame and Setup.petBarAutoCastFrame:GetScript('OnEvent') then + local fn = Setup.petBarAutoCastFrame:GetScript('OnEvent') + fn() + end + end + + callbacks.petbarShineAlpha = function(value) + if Setup and Setup.petBarAutoCastFrame and Setup.petBarAutoCastFrame:GetScript('OnEvent') then + local fn = Setup.petBarAutoCastFrame:GetScript('OnEvent') + fn() + end + end + callbacks.shapeshiftSpacing = function(value) helpers.setSpacing('ShapeshiftButton', value, 'horizontal', 10) end @@ -1072,6 +1319,11 @@ DFRL:NewMod("Bars", 1, function() helpers.setGridLayout(MultiBarRight, 'MultiBarRightButton', value, 'multiBarFourSpacing') end + callbacks.petbarGrid = function(value) + if not DFRL.newPetBar then return end + helpers.applyPetBarLayout() + end + callbacks.mainBarScale = function(value) DFRL.mainBar:SetScale(value) DFRL.actionBarFrame:SetScale(value) @@ -1096,6 +1348,7 @@ DFRL:NewMod("Bars", 1, function() callbacks.mainBarSpacing = function(value) local gridLayout = DFRL:GetTempDB('Bars', 'mainBarGrid') if math.floor(gridLayout + 0.5) ~= 1 then return end + if DFRL.DebugLog then DFRL:DebugLog('bars', 'Spacing', 'ActionButton', value) end local buttonSize = ActionButton1:GetWidth() diff --git a/modules/gui/base.lua b/modules/gui/base.lua index 8f8e152..65f497f 100644 --- a/modules/gui/base.lua +++ b/modules/gui/base.lua @@ -11,21 +11,21 @@ DFRL:NewMod("Gui-base", 2, function() path = DFRL:GetInfoOrCons("media"), CONSTANTS = { - MAIN_FRAME_WIDTH = 900, - MAIN_FRAME_HEIGHT = 600, - TAB_FRAME_WIDTH = 130, + MAIN_FRAME_WIDTH = 980, + MAIN_FRAME_HEIGHT = 640, + TAB_FRAME_WIDTH = 150, TITLE_FRAME_HEIGHT = 30, SUB_FRAME_HEIGHT = 30, - SUB_FRAME_WIDTH = 400, - TAB_BUTTON_HEIGHT = 30, - TAB_BUTTON_WIDTH = 120, + SUB_FRAME_WIDTH = 460, + TAB_BUTTON_HEIGHT = 32, + TAB_BUTTON_WIDTH = 136, LEFT_PANEL_RATIO = 1.5, RIGHT_PANEL_RATIO = 3, - BACKGROUND_ALPHA = 0.8, - RIGHT_TEX_DIMMED_ALPHA = 0.4, + BACKGROUND_ALPHA = 0.9, + RIGHT_TEX_DIMMED_ALPHA = 0.55, - TAB_VERTICAL_SPACING = 35, + TAB_VERTICAL_SPACING = 33, TAB_GROUP_SEPARATOR = 20, TITLE_FRAME_OFFSET = 200, SUB_FRAME_OFFSET = 20, @@ -35,8 +35,8 @@ DFRL:NewMod("Gui-base", 2, function() PULSE_MIN_ALPHA = 0.1, PULSE_ALPHA_STEP = 0.02, - TITLE_FONT_SIZE = 16, - TAB_FONT_SIZE = 14, + TITLE_FONT_SIZE = 18, + TAB_FONT_SIZE = 15, SCROLL_SPEED = 15, SCROLL_STEP_SIZE = 250, @@ -89,6 +89,31 @@ DFRL:NewMod("Gui-base", 2, function() } } + function Setup:ApplyPanelStyle(frame, alpha) + if not frame then return end + frame:SetBackdrop({ + bgFile = "Interface\\Buttons\\WHITE8X8", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 8, edgeSize = 12, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + }) + frame:SetBackdropColor(0, 0, 0, alpha or self.CONSTANTS.BACKGROUND_ALPHA) + frame:SetBackdropBorderColor(1, 0.82, 0, 0.35) + end + + function Setup:StyleTabButton(tab, active) + if not tab then return end + if active then + tab.bg:SetVertexColor(0.14, 0.14, 0.14, 0.95) + tab.border:SetVertexColor(1, 0.82, 0, 0.75) + tab:GetFontString():SetTextColor(1, 0.95, 0.75, 1) + else + tab.bg:SetVertexColor(0.05, 0.05, 0.05, 0.75) + tab.border:SetVertexColor(1, 0.82, 0, 0.18) + tab:GetFontString():SetTextColor(0.82, 0.82, 0.82, 1) + end + end + function Setup:MainFrame() if not self.mainFrame then self.mainFrame = CreateFrame("Frame", "DFRLMainFrame", UIParent) @@ -102,6 +127,7 @@ DFRL:NewMod("Gui-base", 2, function() self.mainFrame:SetMovable(true) self.mainFrame:SetScript("OnMouseDown", function() this:StartMoving() end) self.mainFrame:SetScript("OnMouseUp", function() this:StopMovingOrSizing() end) + self:ApplyPanelStyle(self.mainFrame, self.CONSTANTS.BACKGROUND_ALPHA) tinsert(UISpecialFrames, self.mainFrame:GetName()) -- shagutweaks buggs this out, disable when debugging @@ -110,14 +136,14 @@ DFRL:NewMod("Gui-base", 2, function() leftTex:SetPoint("TOPLEFT", self.mainFrame, "TOPLEFT", 0, 0) leftTex:SetWidth(self.mainFrame:GetWidth() / self.CONSTANTS.LEFT_PANEL_RATIO) leftTex:SetHeight(self.mainFrame:GetHeight()) - leftTex:SetVertexColor(0, 0, 0, self.CONSTANTS.BACKGROUND_ALPHA) + leftTex:SetVertexColor(0.02, 0.02, 0.02, self.CONSTANTS.BACKGROUND_ALPHA) self.rightTex = self.mainFrame:CreateTexture(nil, "BACKGROUND") self.rightTex:SetTexture("Interface\\Buttons\\WHITE8X8") self.rightTex:SetPoint("TOPRIGHT", self.mainFrame, "TOPRIGHT", 0, 0) self.rightTex:SetWidth(self.mainFrame:GetWidth() / self.CONSTANTS.RIGHT_PANEL_RATIO) self.rightTex:SetHeight(self.mainFrame:GetHeight()) - self.rightTex:SetVertexColor(0, 0, 0, self.CONSTANTS.BACKGROUND_ALPHA) + self.rightTex:SetVertexColor(0.04, 0.04, 0.04, self.CONSTANTS.BACKGROUND_ALPHA) T.GradientLine(self.mainFrame, "TOP", 3) T.GradientLine(self.mainFrame, "BOTTOM", -3) @@ -131,10 +157,18 @@ DFRL:NewMod("Gui-base", 2, function() self.tabFrame:SetHeight(self.mainFrame:GetHeight() - self.CONSTANTS.TITLE_FRAME_HEIGHT) self.tabFrame:SetWidth(self.CONSTANTS.TAB_FRAME_WIDTH) + self:ApplyPanelStyle(self.tabFrame, self.CONSTANTS.BACKGROUND_ALPHA) + local tex = self.tabFrame:CreateTexture(nil, "BACKGROUND") tex:SetTexture("Interface\\Buttons\\WHITE8X8") tex:SetAllPoints(self.tabFrame) - tex:SetVertexColor(0, 0, 0, self.CONSTANTS.BACKGROUND_ALPHA) + tex:SetVertexColor(0.01, 0.01, 0.01, self.CONSTANTS.BACKGROUND_ALPHA) + + self.tabHeader = self.tabFrame:CreateFontString(nil, "OVERLAY") + self.tabHeader:SetFont(self.font.. "BigNoodleTitling.ttf", 14, "OUTLINE") + self.tabHeader:SetTextColor(1, .82, 0, 1) + self.tabHeader:SetPoint("TOP", self.tabFrame, "TOP", 0, -8) + self.tabHeader:SetText(DFRL:TR("Navigation")) end end @@ -147,10 +181,12 @@ DFRL:NewMod("Gui-base", 2, function() self.titleFrame:SetFrameStrata("DIALOG") self.titleFrame:SetClampedToScreen(true) self.titleFrame:SetToplevel(true) + self:ApplyPanelStyle(self.titleFrame, self.CONSTANTS.BACKGROUND_ALPHA) + local tex = self.titleFrame:CreateTexture(nil, "BACKGROUND") tex:SetTexture("Interface\\Buttons\\WHITE8X8") tex:SetAllPoints(self.titleFrame) - tex:SetVertexColor(0, 0, 0, self.CONSTANTS.BACKGROUND_ALPHA) + tex:SetVertexColor(0.02, 0.02, 0.02, self.CONSTANTS.BACKGROUND_ALPHA) tinsert(UISpecialFrames, self.titleFrame:GetName()) @@ -213,10 +249,12 @@ DFRL:NewMod("Gui-base", 2, function() self.subFrame:SetHeight(self.CONSTANTS.SUB_FRAME_HEIGHT) self.subFrame:SetWidth(self.CONSTANTS.SUB_FRAME_WIDTH) + self:ApplyPanelStyle(self.subFrame, self.CONSTANTS.BACKGROUND_ALPHA) + local tex = self.subFrame:CreateTexture(nil, "BACKGROUND") tex:SetTexture("Interface\\Buttons\\WHITE8X8") tex:SetAllPoints(self.subFrame) - tex:SetVertexColor(0, 0, 0, self.CONSTANTS.BACKGROUND_ALPHA) + tex:SetVertexColor(0.02, 0.02, 0.02, self.CONSTANTS.BACKGROUND_ALPHA) self.profileText = self.subFrame:CreateFontString(nil, "OVERLAY") self.profileText:SetFont(self.font.. "BigNoodleTitling.ttf", 14, "OUTLINE") @@ -225,19 +263,25 @@ DFRL:NewMod("Gui-base", 2, function() local charName = UnitName("player") local profileName = DFRL_CUR_PROFILE[charName] or "Default" - self.profileText:SetText("Profile: |cffffffff" .. profileName .. "|r") + self.profileText:SetText(DFRL:TR("Profile") .. ": |cffffffff" .. DFRL:DisplayProfileName(profileName) .. "|r") self.fpsText = self.subFrame:CreateFontString(nil, "OVERLAY") self.fpsText:SetFont(self.font.. "BigNoodleTitling.ttf", 14, "OUTLINE") self.fpsText:SetTextColor(1, .82, 0, 1) self.fpsText:SetPoint("RIGHT", self.subFrame, "RIGHT", -10, 0) + self.helpText = self.subFrame:CreateFontString(nil, "OVERLAY") + self.helpText:SetFont(self.font.. "BigNoodleTitling.ttf", 11, "OUTLINE") + self.helpText:SetTextColor(0.75, 0.75, 0.75, 1) + self.helpText:SetPoint("CENTER", self.subFrame, "CENTER", 0, 0) + self.helpText:SetText(DFRL:TR("Drag to move - ESC to close")) + self.subFrame:SetScript("OnUpdate", function() if (this.fpsTimer or 0) > GetTime() then return end this.fpsTimer = GetTime() + 0.5 DFRL.activeScripts["GUI SubFrame"] = true - self.fpsText:SetText("FPS: |cffffffff" .. format("%.1f", GetFramerate()) .. "|r") - self.profileText:SetText("Profile: |cffffffff" .. (DFRL_CUR_PROFILE[UnitName("player")] or "Default") .. "|r") + self.fpsText:SetText(DFRL:TR("FPS:") .. " |cffffffff" .. format("%.1f", GetFramerate()) .. "|r") + self.profileText:SetText(DFRL:TR("Profile") .. ": |cffffffff" .. DFRL:DisplayProfileName(DFRL_CUR_PROFILE[UnitName("player")] or "Default") .. "|r") end) self.subFrame:SetScript("OnShow", function() @@ -257,12 +301,23 @@ DFRL:NewMod("Gui-base", 2, function() tab:SetHeight(self.CONSTANTS.TAB_BUTTON_HEIGHT) tab:SetWidth(self.CONSTANTS.TAB_BUTTON_WIDTH) - local yOffset = -10 - (i - 1) * self.CONSTANTS.TAB_VERTICAL_SPACING + local yOffset = -30 - (i - 1) * self.CONSTANTS.TAB_VERTICAL_SPACING if i > 5 then yOffset = yOffset - self.CONSTANTS.TAB_GROUP_SEPARATOR end tab:SetPoint("TOP", self.tabFrame, "TOP", 0, yOffset) + local bg = tab:CreateTexture(nil, "BACKGROUND") + bg:SetTexture("Interface\\Buttons\\WHITE8X8") + bg:SetAllPoints(tab) + tab.bg = bg + + local border = tab:CreateTexture(nil, "BORDER") + border:SetTexture("Interface\\Buttons\\WHITE8X8") + border:SetPoint("TOPLEFT", tab, "TOPLEFT", 2, -2) + border:SetPoint("BOTTOMRIGHT", tab, "BOTTOMRIGHT", -2, 2) + tab.border = border + local highlight = tab:CreateTexture(nil, "OVERLAY") highlight:SetTexture("Interface\\QuestFrame\\UI-QuestTitleHighlight") highlight:SetAllPoints(tab) @@ -275,7 +330,7 @@ DFRL:NewMod("Gui-base", 2, function() text:SetTextColor(.7, .7, .7, 1) text:SetPoint("CENTER", tab, "CENTER") tab:SetFontString(text) - tab:SetText(Setup.tabs[i]) + tab:SetText(DFRL:TR(Setup.tabs[i])) local tabIndex = i tab:SetScript("OnClick", function() @@ -285,19 +340,24 @@ DFRL:NewMod("Gui-base", 2, function() tab:SetScript("OnEnter", function() if tabIndex ~= self.selectedTab then tab.highlight:Show() + tab.bg:SetVertexColor(0.10, 0.10, 0.10, 0.92) + tab.border:SetVertexColor(1, 0.82, 0, 0.45) end end) tab:SetScript("OnLeave", function() if tabIndex ~= self.selectedTab then tab.highlight:Hide() + self:StyleTabButton(tab, false) end end) + self:StyleTabButton(tab, false) self.tabButtons[i] = tab end self.tabButtons[13]:Disable() self.tabButtons[13]:GetFontString():SetTextColor(.4, .4, .4, 1) + if self.tabButtons[13].border then self.tabButtons[13].border:SetVertexColor(0.4, 0.4, 0.4, 0.1) end self.tabsCreated = true end end @@ -305,10 +365,11 @@ DFRL:NewMod("Gui-base", 2, function() function Setup:SelectTab(tabIndex) for i = 1, table.getn(self.tabs) do self.tabButtons[i].highlight:Hide() + self:StyleTabButton(self.tabButtons[i], false) end - self.tabButtons[tabIndex].highlight:Show() + self:StyleTabButton(self.tabButtons[tabIndex], true) self.selectedTab = tabIndex @@ -346,7 +407,7 @@ DFRL:NewMod("Gui-base", 2, function() self.slider:Show() end if tabIndex ~= 1 then - self.panelTitle:SetText(self.tabs[tabIndex]) + self.panelTitle:SetText(DFRL:TR(self.tabs[tabIndex])) else self.panelTitle:SetText("") end @@ -468,9 +529,9 @@ DFRL:NewMod("Gui-base", 2, function() function Setup:PanelTitles() if not self.panelTitle then self.panelTitle = self.mainFrame:CreateFontString(nil, "OVERLAY") - self.panelTitle:SetFont(self.font.. "BigNoodleTitling.ttf", 18, "OUTLINE") + self.panelTitle:SetFont(self.font.. "BigNoodleTitling.ttf", 22, "OUTLINE") self.panelTitle:SetTextColor(1, .82, 0, 1) - self.panelTitle:SetPoint("TOP", self.scrollFrame, "TOP", -20, 25) + self.panelTitle:SetPoint("TOP", self.scrollFrame, "TOP", -20, 28) end end diff --git a/modules/gui/elem.lua b/modules/gui/elem.lua index c3fba1e..04cb7e0 100644 --- a/modules/gui/elem.lua +++ b/modules/gui/elem.lua @@ -31,11 +31,11 @@ DFRL:NewMod("Gui-elem", 3, function() tabPositions = {}, configCache = {}, - DESCRIPTION_FONT_SIZE = 15, - EXTRA_DESCRIPTION_FONT_SIZE = 11, - VALUE_FONT_SIZE = 14, + DESCRIPTION_FONT_SIZE = 16, + EXTRA_DESCRIPTION_FONT_SIZE = 12, + VALUE_FONT_SIZE = 15, - MODULE_TOP_SPACING = 40, + MODULE_TOP_SPACING = 44, MODULE_BOTTOM_SPACING = 40, HEADER_TOP_SPACING = 40, HEADER_BOTTOM_SPACING = 25, @@ -287,14 +287,14 @@ DFRL:NewMod("Gui-elem", 3, function() local descLabel = scrollChild:CreateFontString(nil, "BACKGROUND") descLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.DESCRIPTION_FONT_SIZE, "OUTLINE") descLabel:SetPoint("TOPLEFT", scrollChild, "TOPLEFT", 10, currentY - 3) - descLabel:SetText(data.description or "") + descLabel:SetText(DFRL:TR(data.description or "")) descLabel:SetTextColor(.9,.9,.9) if data.extraDescription then local extraDescLabel = scrollChild:CreateFontString(nil, "BACKGROUND") extraDescLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.EXTRA_DESCRIPTION_FONT_SIZE, "OUTLINE") extraDescLabel:SetPoint("LEFT", descLabel, "RIGHT", 10, 0) - extraDescLabel:SetText(data.extraDescription) + extraDescLabel:SetText(DFRL:TR(data.extraDescription)) extraDescLabel:SetTextColor(1, 0.5, 0.5) self.extraDescriptionLabels[elementName] = extraDescLabel end @@ -348,14 +348,14 @@ DFRL:NewMod("Gui-elem", 3, function() local descLabel = scrollChild:CreateFontString(nil, "BACKGROUND") descLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.DESCRIPTION_FONT_SIZE, "OUTLINE") descLabel:SetPoint("TOPLEFT", scrollChild, "TOPLEFT", 10, currentY - 6) - descLabel:SetText(data.description or "") + descLabel:SetText(DFRL:TR(data.description or "")) descLabel:SetTextColor(.9,.9,.9) if data.extraDescription then local extraDescLabel = scrollChild:CreateFontString(nil, "BACKGROUND") extraDescLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.EXTRA_DESCRIPTION_FONT_SIZE, "OUTLINE") extraDescLabel:SetPoint("LEFT", descLabel, "RIGHT", 10, 0) - extraDescLabel:SetText(data.extraDescription) + extraDescLabel:SetText(DFRL:TR(data.extraDescription)) extraDescLabel:SetTextColor(1, 0.5, 0.5) self.extraDescriptionLabels[elementKey] = extraDescLabel end @@ -434,14 +434,14 @@ DFRL:NewMod("Gui-elem", 3, function() local descLabel = scrollChild:CreateFontString(nil, "BACKGROUND") descLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.DESCRIPTION_FONT_SIZE, "OUTLINE") descLabel:SetPoint("TOPLEFT", scrollChild, "TOPLEFT", 10, currentY - 10) - descLabel:SetText(data.description or "") + descLabel:SetText(DFRL:TR(data.description or "")) descLabel:SetTextColor(.9,.9,.9) if data.extraDescription then local extraDescLabel = scrollChild:CreateFontString(nil, "BACKGROUND") extraDescLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.EXTRA_DESCRIPTION_FONT_SIZE, "OUTLINE") extraDescLabel:SetPoint("LEFT", descLabel, "RIGHT", 10, 0) - extraDescLabel:SetText(data.extraDescription) + extraDescLabel:SetText(DFRL:TR(data.extraDescription)) extraDescLabel:SetTextColor(1, 0.5, 0.5) self.extraDescriptionLabels[elementKey] = extraDescLabel end @@ -495,14 +495,14 @@ DFRL:NewMod("Gui-elem", 3, function() local descLabel = scrollChild:CreateFontString(nil, "BACKGROUND") descLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.DESCRIPTION_FONT_SIZE, "OUTLINE") descLabel:SetPoint("TOPLEFT", scrollChild, "TOPLEFT", 10, currentY - 6) - descLabel:SetText(data.description or "") + descLabel:SetText(DFRL:TR(data.description or "")) descLabel:SetTextColor(.9,.9,.9) if data.extraDescription then local extraDescLabel = scrollChild:CreateFontString(nil, "BACKGROUND") extraDescLabel:SetFont(self.font .. "BigNoodleTitling.ttf", self.EXTRA_DESCRIPTION_FONT_SIZE, "OUTLINE") extraDescLabel:SetPoint("LEFT", descLabel, "RIGHT", 10, 0) - extraDescLabel:SetText(data.extraDescription) + extraDescLabel:SetText(DFRL:TR(data.extraDescription)) extraDescLabel:SetTextColor(1, 0.5, 0.5) self.extraDescriptionLabels[elementKey] = extraDescLabel end diff --git a/modules/gui/homeb.lua b/modules/gui/homeb.lua index 6735658..02c067b 100644 --- a/modules/gui/homeb.lua +++ b/modules/gui/homeb.lua @@ -18,6 +18,7 @@ DFRL:NewDefaults("GUI-Dragonflight", { sideView = {.3, "slider", {.1, .8}, nil, "Home Screen", 3, "Changes the alpha of the side view", "", nil}, homeMinMaxColor = {{1, .82, 0}, "colour", nil, nil, "Home Screen", 4, "Changes the color of the close and min button", nil, nil}, homeTimeColor = {{1, .82, 0}, "colour", nil, nil, "Home Screen", 5, "Changes the color of the time on the home screen", nil, nil}, + language = {(GetLocale() == "frFR" and "Francais" or "English"), "dropdown", {"English", "Francais"}, nil, "localization", 6, "Select the language used in the configuration UI", nil, nil}, }) DFRL:NewMod("GUI-Dragonflight", 4, function() @@ -313,6 +314,7 @@ DFRL:NewMod("GUI-Dragonflight", 4, function() -- callbacks local callbacks = {} + local lastAppliedLanguage = nil callbacks.homeTimeColor = function (value) Setup.timeText:SetTextColor(value[1], value[2], value[3]) @@ -351,6 +353,21 @@ DFRL:NewMod("GUI-Dragonflight", 4, function() end end + callbacks.language = function(value) + if not lastAppliedLanguage then + lastAppliedLanguage = value + return + end + + if lastAppliedLanguage == value then + return + end + + lastAppliedLanguage = value + DFRL:SaveTempDB() + ReloadUI() + end + callbacks.globalFont = function(value) local fontPath if value == 'Expressway' then diff --git a/modules/gui/info.lua b/modules/gui/info.lua index f32dc9b..a3ddcc1 100644 --- a/modules/gui/info.lua +++ b/modules/gui/info.lua @@ -264,7 +264,7 @@ self.grid:AddElement(6, 8, scriptText:SetText(scriptName) scriptText:SetTextColor(1, 1, 1) - statusText:SetText(DFRL.activeScripts[scriptName] and "ON" or "OFF") + statusText:SetText(DFRL:TR(DFRL.activeScripts[scriptName] and "ON" or "OFF")) statusText:SetTextColor(DFRL.activeScripts[scriptName] and 0 or 0.5, DFRL.activeScripts[scriptName] and 1 or 0.5, DFRL.activeScripts[scriptName] and 0 or 0.5) index = index + 1 @@ -294,7 +294,7 @@ self.grid:AddElement(6, 8, scriptText:SetText(scriptName) scriptText:SetTextColor(1, 1, 1) - statusText:SetText(DFRL.activeScripts[scriptName] and "ON" or "OFF") + statusText:SetText(DFRL:TR(DFRL.activeScripts[scriptName] and "ON" or "OFF")) statusText:SetTextColor(DFRL.activeScripts[scriptName] and 0 or 0.5, DFRL.activeScripts[scriptName] and 1 or 0.5, DFRL.activeScripts[scriptName] and 0 or 0.5) index = index + 1 diff --git a/modules/gui/mods.lua b/modules/gui/mods.lua index bae809d..7a951f1 100644 --- a/modules/gui/mods.lua +++ b/modules/gui/mods.lua @@ -49,7 +49,7 @@ DFRL:NewMod("Gui-mods", 3, function() local moduleName = modules[i] local checkbox = DFRL.tools.CreateCheckbox(nil, nil, moduleName, "enabled", true) - checkbox.label:SetText(moduleName) + checkbox.label:SetText(DFRL:TR(moduleName)) self.grid:AddElement(row, line, checkbox) line = line + 1 diff --git a/modules/gui/prof.lua b/modules/gui/prof.lua index 8427693..2f9ce2f 100644 --- a/modules/gui/prof.lua +++ b/modules/gui/prof.lua @@ -44,11 +44,11 @@ DFRL:NewMod("Gui-prof", 4, function() switchBtns = {}, newProfileBtn = nil, resetBtn = nil, + saveBtn = nil, warner = nil } } - function Setup:ListFrame() if not self.headers then self.grid:AddElement(2, 1, DFRL.tools.CreateCategoryHeader(nil, "Manage")) @@ -56,13 +56,13 @@ DFRL:NewMod("Gui-prof", 4, function() end if not self.ui.usageText then - self.ui.usageText = DFRL.tools.CreateFont(panel, 14, "Usage:\n\n\n1) new profile: create and switch to a new profile\n\n2) switch: change active profile\n\n3) copy: copies all settings into active profile\n\n4) delete: delete profile and switch back to default\n\n5)reset: reset active profile to the default settings\n\n\ndoes not affect shagutweaks\n\nBUG: DOUBLE CLICK DELETE AFTER NEW PROFILE\n\nBUG: ENTER PROFILE NAME STAYS", {.5, .5, .5}, "LEFT") + self.ui.usageText = DFRL.tools.CreateFont(panel, 14, "Profiles help text", {.65, .65, .65}, "LEFT") self.grid:AddElement(5, 4, self.ui.usageText) end if not self.ui.frame then self.ui.frame = CreateFrame("Frame", nil, panel) - self.ui.frame:SetWidth(300) - self.ui.frame:SetHeight(400) + self.ui.frame:SetWidth(320) + self.ui.frame:SetHeight(420) self.grid:AddElement(2, 3, self.ui.frame) T.GradientLine(self.ui.frame, "TOP", 20, 2) T.GradientLine(self.ui.frame, "TOP", 60, 2) @@ -76,7 +76,7 @@ DFRL:NewMod("Gui-prof", 4, function() self.ui.curText:SetFont(self.font .. "BigNoodleTitling.ttf", self.TEXT_SIZE, "OUTLINE") self.ui.curText:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 10, -10) end - self.ui.curText:SetText("Current: |cff80ff80" .. curProf .. "|r") + self.ui.curText:SetText(DFRL:TR("Current") .. ": |cff80ff80" .. DFRL:DisplayProfileName(curProf) .. "|r") for _, text in pairs(self.ui.texts) do text:Hide() end @@ -113,12 +113,12 @@ DFRL:NewMod("Gui-prof", 4, function() local text = self.ui.frame:CreateFontString(nil, "OVERLAY") text:SetFont(self.font .. "BigNoodleTitling.ttf", self.TEXT_SIZE, "OUTLINE") text:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 10, yOffset) - text:SetText(name) + text:SetText(DFRL:DisplayProfileName(name)) table.insert(self.ui.texts, text) if name ~= "Default" then local profName = name - local switchBtn = DFRL.tools.CreateButton(self.ui.frame, "Switch", 50, 20, true, {0.5, 1, 0.5}) - switchBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 125, yOffset) + local switchBtn = DFRL.tools.CreateButton(self.ui.frame, "Switch", 55, 20, true, {0.5, 1, 0.5}) + switchBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 135, yOffset) switchBtn.profName = profName switchBtn:SetScript("OnClick", function() local clickedName = this.profName @@ -132,13 +132,17 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(0, 1, 0) - Setup.ui.warner:SetText("switched to " .. clickedName) + if DFRL:IsFrench() then + Setup.ui.warner:SetText(DFRL:TR("switched to") .. " " .. clickedName) + else + Setup.ui.warner:SetText("switched to " .. clickedName) + end Setup.ui.warner:Show() Setup:RestartWarnerPulse() end) table.insert(self.ui.switchBtns, switchBtn) - local copyBtn = DFRL.tools.CreateButton(self.ui.frame, "Copy", 50, 20, true) - copyBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 180, yOffset) + local copyBtn = DFRL.tools.CreateButton(self.ui.frame, "Copy", 55, 20, true) + copyBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 195, yOffset) copyBtn.profName = profName copyBtn:SetScript("OnClick", function() local clickedName = this.profName @@ -152,13 +156,17 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(1, 1, 0) - Setup.ui.warner:SetText("profile copied from " .. clickedName) + if DFRL:IsFrench() then + Setup.ui.warner:SetText(DFRL:TR("profile copied from") .. " " .. clickedName) + else + Setup.ui.warner:SetText("profile copied from " .. clickedName) + end Setup.ui.warner:Show() Setup:RestartWarnerPulse() end) table.insert(self.ui.copyBtns, copyBtn) - local delBtn = DFRL.tools.CreateButton(self.ui.frame, "Delete", 50, 20, true, {1, 0.5, 0.5}) - delBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 235, yOffset) + local delBtn = DFRL.tools.CreateButton(self.ui.frame, "Delete", 55, 20, true, {1, 0.5, 0.5}) + delBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPLEFT", 255, yOffset) delBtn.profName = profName delBtn:SetScript("OnClick", function() local clickedName = this.profName @@ -171,7 +179,11 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(1, 0, 0) - Setup.ui.warner:SetText(clickedName .. " deleted") + if DFRL:IsFrench() then + Setup.ui.warner:SetText(clickedName .. " " .. DFRL:TR("deleted")) + else + Setup.ui.warner:SetText(clickedName .. " deleted") + end Setup.ui.warner:Show() Setup:RestartWarnerPulse() end) @@ -181,7 +193,6 @@ DFRL:NewMod("Gui-prof", 4, function() yOffset = yOffset - 20 end - end function Setup:RestartWarnerPulse() @@ -219,8 +230,13 @@ DFRL:NewMod("Gui-prof", 4, function() end function Setup:ExtraButtons() + if not self.ui.actionsHeader then + self.ui.actionsHeader = DFRL.tools.CreateCategoryHeader(panel, "Quick Actions", false, 150, 24, 14) + self.ui.actionsHeader:SetPoint("BOTTOMLEFT", self.ui.frame, "TOPRIGHT", 10, -22) + end + if not self.ui.newProfileBtn then - self.ui.newProfileBtn = DFRL.tools.CreateButton(panel, "New Profile", 100, 30, true) + self.ui.newProfileBtn = DFRL.tools.CreateButton(panel, "New Profile", 130, 30, true) self.ui.newProfileBtn:SetPoint("TOPLEFT", self.ui.frame, "TOPRIGHT", 20, -25) self.ui.newProfileBtn:SetScript("OnClick", function() local count = 0 @@ -233,7 +249,7 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(1, 0, 0) - Setup.ui.warner:SetText("MAX PROFILES REACHED") + Setup.ui.warner:SetText(DFRL:TR("MAX PROFILES REACHED")) Setup.ui.warner:Show() Setup:RestartWarnerPulse() return @@ -259,7 +275,7 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(0, 1, 0) - Setup.ui.warner:SetText("new profile created") + Setup.ui.warner:SetText(DFRL:TR("new profile created")) Setup.ui.warner:Show() Setup:RestartWarnerPulse() end @@ -275,7 +291,7 @@ DFRL:NewMod("Gui-prof", 4, function() end if not self.ui.resetBtn then - self.ui.resetBtn = DFRL.tools.CreateButton(panel, "Reset", 100, 30, true, {1, 0.5, 0.5}) + self.ui.resetBtn = DFRL.tools.CreateButton(panel, "Reset", 130, 30, true, {1, 0.5, 0.5}) self.ui.resetBtn:SetPoint("TOPLEFT", self.ui.newProfileBtn, "BOTTOMLEFT", 0, -10) self.ui.resetBtn:SetScript("OnClick", function() local success, _ = pcall(function() @@ -288,7 +304,7 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(0, 1, 0) - Setup.ui.warner:SetText("CURRENT PROFILE RESET") + Setup.ui.warner:SetText(DFRL:TR("CURRENT PROFILE RESET")) Setup.ui.warner:Show() Setup:RestartWarnerPulse() else @@ -297,13 +313,28 @@ DFRL:NewMod("Gui-prof", 4, function() Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) end Setup.ui.warner:SetTextColor(1, 0, 0) - Setup.ui.warner:SetText("PROFILE RESET FAILED") + Setup.ui.warner:SetText(DFRL:TR("PROFILE RESET FAILED")) Setup.ui.warner:Show() Setup:RestartWarnerPulse() end end) end + if not self.ui.saveBtn then + self.ui.saveBtn = DFRL.tools.CreateButton(panel, "Save Profile", 130, 30, true, {0.5, 1, 0.5}) + self.ui.saveBtn:SetPoint("TOPLEFT", self.ui.resetBtn, "BOTTOMLEFT", 0, -10) + self.ui.saveBtn:SetScript("OnClick", function() + DFRL:SaveTempDB() + if not Setup.ui.warner then + Setup.ui.warner = DFRL.tools.CreateFontWarner(panel, 14, "", {0, 1, 0}, true, 3) + Setup.ui.warner:SetPoint("TOP", Setup.ui.frame, "BOTTOM", 0, 25) + end + Setup.ui.warner:SetTextColor(0, 1, 0) + Setup.ui.warner:SetText(DFRL:TR("profile saved")) + Setup.ui.warner:Show() + Setup:RestartWarnerPulse() + end) + end end --================= diff --git a/modules/gui/shag.lua b/modules/gui/shag.lua index f4ade38..9f1a959 100644 --- a/modules/gui/shag.lua +++ b/modules/gui/shag.lua @@ -133,7 +133,7 @@ DFRL:NewMod("Gui-shag", 3, function() local desc = panel:CreateFontString(nil, "OVERLAY", "GameFontNormal") desc:SetFont(self.font .. "BigNoodleTitling.ttf", self.DESCRIPTION_FONT_SIZE, "OUTLINE") desc:SetPoint("TOPLEFT", panel, "TOPLEFT", 10, -yPos) - desc:SetText(element.data.description or element.key) + desc:SetText(DFRL:TR(element.data.description or element.key)) desc:SetTextColor(.9, .9, .9) self.descriptionLabels[element.key] = desc @@ -150,7 +150,7 @@ DFRL:NewMod("Gui-shag", 3, function() local txt = panel:CreateFontString(nil, "OVERLAY") txt:SetFont(self.font .. "BigNoodleTitling.ttf", 30, "OUTLINE") txt:SetPoint("TOP", panel, "TOP", 10, -yPos-50) - txt:SetText("SHAGU TWEAKS EXTRAS MISSING\nINSTALL FOR MORE OPTIONS") + txt:SetText(DFRL:TR("SHAGU TWEAKS EXTRAS MISSING\nINSTALL FOR MORE OPTIONS")) txt:SetTextColor(1, 0.5, 0.5) local f3 = CreateFrame("Frame") f3.t = 0 diff --git a/modules/gui/tools.lua b/modules/gui/tools.lua index 02b5cfd..bea2bb6 100644 --- a/modules/gui/tools.lua +++ b/modules/gui/tools.lua @@ -98,8 +98,15 @@ function DFRL.tools.CreateFont(parent, size, text, colour, align) font:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", size or 14, "OUTLINE") colour = colour or {1, 1, 1} font:SetTextColor(colour[1], colour[2], colour[3]) - font:SetText(text) + font.rawText = text + font:SetText(DFRL:TR(text or "")) font.align = align or "CENTER" + + function font:SetLocalizedText(newText) + self.rawText = newText + self:SetText(DFRL:TR(newText or "")) + end + return font end @@ -107,21 +114,37 @@ function DFRL.tools.CreateButton(parent, text, width, height, noBackdrop, textCo local btn = CreateFrame("Button", nil, parent or UIParent) btn:SetWidth(width or 140) btn:SetHeight(height or 30) + if not noBackdrop then btn:SetBackdrop({ bgFile = "Interface\\Buttons\\WHITE8X8", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", - tile = true, tileSize = 16, edgeSize = 16, + tile = true, tileSize = 16, edgeSize = 14, insets = { left = 4, right = 4, top = 4, bottom = 4 } }) - btn:SetBackdropColor(0, 0, 0, .5) - btn:SetBackdropBorderColor(0.5, 0.5, 0.5, 1) + btn:SetBackdropColor(0.04, 0.04, 0.04, .88) + btn:SetBackdropBorderColor(1, 0.82, 0, 0.35) + else + local bg = btn:CreateTexture(nil, "BACKGROUND") + bg:SetTexture("Interface\\Buttons\\WHITE8X8") + bg:SetPoint("TOPLEFT", btn, "TOPLEFT", 1, -1) + bg:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -1, 1) + bg:SetVertexColor(0.08, 0.08, 0.08, 0.28) + btn._bg = bg + + local border = btn:CreateTexture(nil, "BORDER") + border:SetTexture("Interface\\Buttons\\WHITE8X8") + border:SetPoint("TOPLEFT", btn, "TOPLEFT", 0, 0) + border:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", 0, 0) + border:SetVertexColor(1, 0.82, 0, 0.16) + btn._border = border end local btnTxt = btn:CreateFontString(nil, "OVERLAY") btnTxt:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 12, "OUTLINE") btnTxt:SetPoint("CENTER", btn, "CENTER", 0, 0) - btnTxt:SetText(text) + btn.rawText = text + btnTxt:SetText(DFRL:TR(text or "")) if textColor then btnTxt:SetTextColor(textColor[1], textColor[2], textColor[3]) @@ -131,6 +154,11 @@ function DFRL.tools.CreateButton(parent, text, width, height, noBackdrop, textCo btn.text = btnTxt + function btn:SetLocalizedText(newText) + self.rawText = newText + self.text:SetText(DFRL:TR(newText or "")) + end + local origEnable = btn.Enable local origDisable = btn.Disable @@ -141,11 +169,17 @@ function DFRL.tools.CreateButton(parent, text, width, height, noBackdrop, textCo else btnTxt:SetTextColor(1, 1, 1) end + if self.SetBackdropBorderColor and not noBackdrop then + self:SetBackdropBorderColor(1, 0.82, 0, 0.35) + end end btn.Disable = function(self) origDisable(self) btnTxt:SetTextColor(0.5, 0.5, 0.5) + if self.SetBackdropBorderColor and not noBackdrop then + self:SetBackdropBorderColor(0.4, 0.4, 0.4, 0.2) + end end local highlight = btn:CreateTexture(nil, "HIGHLIGHT") @@ -154,6 +188,24 @@ function DFRL.tools.CreateButton(parent, text, width, height, noBackdrop, textCo highlight:SetPoint("BOTTOMRIGHT", btn, "BOTTOMRIGHT", -2, 4) highlight:SetBlendMode("ADD") + btn:SetScript("OnEnter", function() + if noBackdrop then + if this._bg then this._bg:SetVertexColor(0.12, 0.12, 0.12, 0.45) end + if this._border then this._border:SetVertexColor(1, 0.82, 0, 0.45) end + else + this:SetBackdropBorderColor(1, 0.82, 0, 0.65) + end + end) + + btn:SetScript("OnLeave", function() + if noBackdrop then + if this._bg then this._bg:SetVertexColor(0.08, 0.08, 0.08, 0.28) end + if this._border then this._border:SetVertexColor(1, 0.82, 0, 0.16) end + else + this:SetBackdropBorderColor(1, 0.82, 0, 0.35) + end + end) + return btn end @@ -165,7 +217,7 @@ function DFRL.tools.CreateIndiCheckbox(parent, name, text) local label = checkbox:CreateFontString(nil, "BACKGROUND") label:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 12, "OUTLINE") label:SetPoint("LEFT", checkbox, "RIGHT", 5, 0) - label:SetText(text or "Checkbox") + label:SetText(DFRL:TR(text or "Checkbox")) label:SetTextColor(.9,.9,.9) checkbox.label = label @@ -194,18 +246,20 @@ function DFRL.tools.CreateIndiSlider(parent, name, text, minVal, maxVal, step) slider:SetOrientation("HORIZONTAL") slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Horizontal") slider:SetBackdrop({ - bgFile = "Interface\\Buttons\\UI-SliderBar-Background", - edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", - tile = true, tileSize = 8, edgeSize = 8, + bgFile = "Interface\\Buttons\\WHITE8X8", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 8, edgeSize = 10, insets = { left = 3, right = 3, top = 6, bottom = 6 } }) + slider:SetBackdropColor(0.03, 0.03, 0.03, 0.85) + slider:SetBackdropBorderColor(1, 0.82, 0, 0.18) slider:SetMinMaxValues(minVal or 0, maxVal or 5) slider:SetValueStep(step or 0.1) local label = slider:CreateFontString(nil, "OVERLAY", "GameFontNormal") label:SetPoint("BOTTOMLEFT", slider, "TOPLEFT", 0, -0) - label:SetText(text or "Slider") + label:SetText(DFRL:TR(text or "Slider")) label:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 12, "OUTLINE") label:SetTextColor(.9,.9,.9) slider.label = label @@ -279,13 +333,15 @@ function DFRL.tools.CreateIndiDropDown(parent, text, items, width, height) btn.popup = popup btn.selectedValue = items[1] + btn.text:SetText(DFRL:TR(btn.selectedValue)) for i = 1, table.getn(items) do local itemBtn = DFRL.tools.CreateButton(popup, items[i], popup:GetWidth() - 4, 20, true) + itemBtn.itemValue = items[i] itemBtn:SetPoint("TOP", popup, "TOP", 0, -(i - 1) * 22 - 5) itemBtn:SetScript("OnClick", function() - btn.text:SetText(this.text:GetText()) - btn.selectedValue = this.text:GetText() + btn.text:SetText(DFRL:TR(this.itemValue)) + btn.selectedValue = this.itemValue popup:Hide() end) end @@ -320,10 +376,12 @@ function DFRL.tools.CreateEditBox(parent, width, height, letters, numbers, max) box:SetHeight(height or 20) box:SetBackdrop({ bgFile = "Interface\\Buttons\\WHITE8X8", - insets = { left = -5, right = -5, top = 0, bottom = 0 } + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 8, edgeSize = 12, + insets = { left = 3, right = 3, top = 3, bottom = 3 } }) - box:SetBackdropColor(0, 0, 0, 0.8) - box:SetBackdropBorderColor(0.5, 0.5, 0.5, 1) + box:SetBackdropColor(0.02, 0.02, 0.02, 0.9) + box:SetBackdropBorderColor(1, 0.82, 0, 0.25) box:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 14, "OUTLINE") box:SetTextColor(1, 1, 1) box:SetTextInsets(5, 5, 5, 5) @@ -390,19 +448,31 @@ function DFRL.tools.CreateCategoryHeader(parent, categoryName, noBG, width, heig tile = true, tileSize = 16, edgeSize = 16, insets = { left = 4, right = 4, top = 4, bottom = 4 } }) - categoryBg:SetBackdropColor(0.1, 0.1, 0.1, 0.6) - categoryBg:SetBackdropBorderColor(0.1, 0.1, 0.1, 0.5) + categoryBg:SetBackdropColor(0.05, 0.05, 0.05, 0.78) + categoryBg:SetBackdropBorderColor(1, 0.82, 0, 0.22) end local categoryTitle = categoryBg:CreateFontString(nil, "OVERLAY") categoryTitle:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", txtSize or 14, "OUTLINE") categoryTitle:SetPoint("CENTER", categoryBg, "CENTER", 0, 1) - local words = string.gfind(categoryName, "%S+") - local capitalizedWords = {} - for word in words do - table.insert(capitalizedWords, string.upper(string.sub(word, 1, 1)) .. string.sub(word, 2)) + categoryBg.title = categoryTitle + categoryBg.rawCategoryName = categoryName + + function categoryBg:RefreshText() + local localizedName = DFRL:TR(self.rawCategoryName or "") + if DFRL:IsFrench() then + self.title:SetText(localizedName) + else + local words = string.gfind(localizedName, "%S+") + local capitalizedWords = {} + for word in words do + table.insert(capitalizedWords, string.upper(string.sub(word, 1, 1)) .. string.sub(word, 2)) + end + self.title:SetText(table.concat(capitalizedWords, " ")) + end end - categoryTitle:SetText(table.concat(capitalizedWords, " ")) + + categoryBg:RefreshText() categoryTitle:SetTextColor(1, 0.82, 0) return categoryBg @@ -416,8 +486,7 @@ function DFRL.tools.CreateCheckbox(parent, name, moduleName, key, noCall) local label = checkbox:CreateFontString(nil, "BACKGROUND") label:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 12, "OUTLINE") label:SetPoint("LEFT", checkbox, "RIGHT", 5, 0) - local displayTxt = string.gsub(key, "(%l)(%u)", "%1 %2") - displayTxt = string.upper(string.sub(displayTxt, 1, 1)) .. string.sub(displayTxt, 2) + local displayTxt = DFRL:GetOptionLabel(moduleName, key) label:SetText(displayTxt) label:SetTextColor(.9,.9,.9) checkbox.label = label @@ -445,7 +514,7 @@ function DFRL.tools.CreateShaguCheckbox(parent, name, key) local label = checkbox:CreateFontString(nil, "OVERLAY", "GameFontNormal") label:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 14, "OUTLINE") label:SetPoint("LEFT", checkbox, "RIGHT", 5, 0) - label:SetText(key) + label:SetText(DFRL:TR(key)) label:SetTextColor(.9,.9,.9) checkbox.label = label @@ -490,8 +559,7 @@ function DFRL.tools.CreateSlider(parent, name, moduleName, key, minVal, maxVal, local label = slider:CreateFontString(nil, "OVERLAY", "GameFontNormal") label:SetPoint("BOTTOMLEFT", slider, "TOPLEFT", 0, -0) - local displayTxt = string.gsub(key, "(%l)(%u)", "%1 %2") - displayTxt = string.upper(string.sub(displayTxt, 1, 1)) .. string.sub(displayTxt, 2) + local displayTxt = DFRL:GetOptionLabel(moduleName, key) label:SetText(displayTxt) label:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 12, "OUTLINE") label:SetTextColor(.9,.9,.9) @@ -591,19 +659,20 @@ function DFRL.tools.CreateColour(parent, name, moduleName, key) slider:SetOrientation("HORIZONTAL") slider:SetThumbTexture("Interface\\Buttons\\UI-SliderBar-Button-Horizontal") slider:SetBackdrop({ - bgFile = "Interface\\Buttons\\UI-SliderBar-Background", - edgeFile = "Interface\\Buttons\\UI-SliderBar-Border", - tile = true, tileSize = 8, edgeSize = 8, + bgFile = "Interface\\Buttons\\WHITE8X8", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 8, edgeSize = 10, insets = { left = 3, right = 3, top = 6, bottom = 6 } }) + slider:SetBackdropColor(0.03, 0.03, 0.03, 0.85) + slider:SetBackdropBorderColor(1, 0.82, 0, 0.18) slider:SetMinMaxValues(1, COLOR_COUNT) slider:SetValueStep(1) local label = slider:CreateFontString(nil, "OVERLAY", "GameFontNormal") label:SetPoint("BOTTOMLEFT", slider, "TOPLEFT", 0, -0) - local displayText = string.gsub(key, "(%l)(%u)", "%1 %2") - displayText = string.upper(string.sub(displayText, 1, 1)) .. string.sub(displayText, 2) + local displayText = DFRL:GetOptionLabel(moduleName, key) label:SetText(displayText) label:SetFont("Fonts\\FRIZQT__.TTF", 11, "") label:SetTextColor(.9,.9,.9) @@ -680,8 +749,7 @@ function DFRL.tools.CreateDropDown(parent, name, moduleName, key, items, noCall, local btnTxt = btn:CreateFontString(nil, "OVERLAY") btnTxt:SetFont(DFRL:GetInfoOrCons("font") .. "BigNoodleTitling.ttf", 12, "OUTLINE") btnTxt:SetPoint("CENTER", btn, "CENTER", 0, 0) - local displayTxt = string.gsub(key, "(%l)(%u)", "%1 %2") - displayTxt = string.upper(string.sub(displayTxt, 1, 1)) .. string.sub(displayTxt, 2) + local displayTxt = DFRL:GetOptionLabel(moduleName, key) btnTxt:SetText(displayTxt) btnTxt:SetTextColor(1, 1, 1) btn.text = btnTxt @@ -693,7 +761,7 @@ function DFRL.tools.CreateDropDown(parent, name, moduleName, key, items, noCall, local currentValue = DFRL:GetTempDB(moduleName, key) if currentValue then - btnTxt:SetText(currentValue) + btnTxt:SetText(DFRL:TR(currentValue)) end if not btn.popup then @@ -705,12 +773,20 @@ function DFRL.tools.CreateDropDown(parent, name, moduleName, key, items, noCall, popup:SetFrameStrata("DIALOG") popup:SetToplevel(true) popup:EnableMouse(true) + popup:SetBackdrop({ + bgFile = "Interface\\Buttons\\WHITE8X8", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 8, edgeSize = 12, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + }) + popup:SetBackdropColor(0.02, 0.02, 0.02, 0.95) + popup:SetBackdropBorderColor(1, 0.82, 0, 0.25) DFRL.tools.GradientLine(popup, "TOP", 2) local bg = popup:CreateTexture(nil, "BACKGROUND") bg:SetTexture("Interface\\Buttons\\WHITE8X8") bg:SetAllPoints(popup) - bg:SetVertexColor(0, 0, 0, .8) + bg:SetVertexColor(0.02, 0.02, 0.02, .92) popup:Hide() btn.popup = popup @@ -724,7 +800,7 @@ function DFRL.tools.CreateDropDown(parent, name, moduleName, key, items, noCall, itemBtn.itemText = items[i] itemBtn:SetScript("OnClick", function() - btn.text:SetText(this.itemText) + btn.text:SetText(DFRL:TR(this.itemText)) if noCall then DFRL:SetTempDBNoCallback(moduleName, key, this.itemText) else @@ -841,7 +917,13 @@ function DFRL.tools.CreateFontWarner(parent, size, text, colour, pulse, time) fontString:SetTextColor(1, 1, 1) end - fontString:SetText(text) + fontString.rawText = text + fontString:SetText(DFRL:TR(text or "")) + + function fontString:SetLocalizedText(newText) + self.rawText = newText + self:SetText(DFRL:TR(newText or "")) + end if pulse or time then local frame = CreateFrame("Frame") diff --git a/modules/micro/micro.lua b/modules/micro/micro.lua index 2ca753c..8fc76ff 100644 --- a/modules/micro/micro.lua +++ b/modules/micro/micro.lua @@ -20,6 +20,7 @@ DFRL:NewMod("Micro", 1, function() pvpButton = nil, lftButton = nil, ebcButton = nil, + ijStandaloneButton = nil, msText = nil, bwText = nil, @@ -157,6 +158,71 @@ DFRL:NewMod("Micro", 1, function() end) end + + function Setup:CreateInstanceJournalStandaloneButton() + if self.ijStandaloneButton then return end + + self.ijStandaloneButton = CreateFrame("Button", "DFRLIJStandaloneButton", self.microMenuContainer) + self.ijStandaloneButton:SetWidth(self.buttonWidth) + self.ijStandaloneButton:SetHeight(self.buttonHeight) + self.ijStandaloneButton:SetHitRectInsets(0, 0, 0, 0) + self.ijStandaloneButton:Show() + self.ijStandaloneButton:Enable() + + self.ijStandaloneButton:SetScript("OnClick", function() + if _G["InstanceJournal"] and InstanceJournal.ToggleInstanceJournal then + InstanceJournal:ToggleInstanceJournal() + elseif _G["ToggleInstanceJournal"] then + ToggleInstanceJournal() + end + end) + + self.ijStandaloneButton:SetScript("OnEnter", function() + GameTooltip:SetOwner(self.ijStandaloneButton, "ANCHOR_RIGHT") + GameTooltip:SetText("Instance Journal", 1, 1, 1) + GameTooltip:AddLine("Open the Instance Journal.") + GameTooltip:Show() + end) + + self.ijStandaloneButton:SetScript("OnLeave", function() + GameTooltip:Hide() + end) + end + + function Setup:PositionInstanceJournalStandaloneButton(spacing) + if not self.ijStandaloneButton or not self.buttons or not self.buttons[table.getn(self.buttons)] then return end + local lastButton = self.buttons[table.getn(self.buttons)] + self.ijStandaloneButton:ClearAllPoints() + self.ijStandaloneButton:SetPoint("TOPLEFT", lastButton, "TOPRIGHT", spacing or self.buttonSpacing, 0) + self.ijStandaloneButton:SetParent(self.microMenuContainer) + self.ijStandaloneButton:SetFrameStrata(lastButton:GetFrameStrata()) + self.ijStandaloneButton:SetFrameLevel(lastButton:GetFrameLevel()) + end + + function Setup:ApplyInstanceJournalStandaloneStyle(useColor) + if not self.ijStandaloneButton then return end + local colorpath = self.texpath .. "color_micro\\" + if useColor then + self.ijStandaloneButton:SetNormalTexture(colorpath .. "instancejournal-regular.tga") + self.ijStandaloneButton:SetPushedTexture(colorpath .. "instancejournal-faded.tga") + self.ijStandaloneButton:SetHighlightTexture(colorpath .. "instancejournal-highlight.tga") + else + self.ijStandaloneButton:SetNormalTexture(colorpath .. "instancejournal-faded.tga") + self.ijStandaloneButton:SetPushedTexture(colorpath .. "instancejournal-faded.tga") + self.ijStandaloneButton:SetHighlightTexture(colorpath .. "instancejournal-highlight.tga") + end + if self.ijStandaloneButton:GetNormalTexture() then + self.ijStandaloneButton:GetNormalTexture():SetTexCoord(36/128, 86/128, 29/128, 98/128) + self.ijStandaloneButton:GetNormalTexture():Show() + end + if self.ijStandaloneButton:GetPushedTexture() then + self.ijStandaloneButton:GetPushedTexture():SetTexCoord(36/128, 86/128, 29/128, 98/128) + end + if self.ijStandaloneButton:GetHighlightTexture() then + self.ijStandaloneButton:GetHighlightTexture():SetTexCoord(36/128, 86/128, 29/128, 98/128) + end + end + function Setup:LowLevelTalentButton() if not DFRL.lowLevelTalentsButton then local lowLevelTalentsButton = CreateFrame("Button", "DFRLLowLevelTalentsButton", Setup.microMenuContainer) @@ -365,6 +431,9 @@ DFRL:NewMod("Micro", 1, function() self:LFTButton() self:EBCButton() self:ArrangeButtons() + self:CreateInstanceJournalStandaloneButton() + self:PositionInstanceJournalStandaloneButton(self.buttonSpacing) + self:ApplyInstanceJournalStandaloneStyle(DFRL:GetTempDB("Micro", "switchColor")) self:HideOtherUI() self:DisableBlizzardFPS() @@ -443,6 +512,7 @@ DFRL:NewMod("Micro", 1, function() end DFRL.microMenuContainer:SetWidth((Setup.buttonWidth + value) * table.getn(Setup.buttons)) + Setup:PositionInstanceJournalStandaloneButton(value) end end @@ -635,6 +705,7 @@ DFRL:NewMod("Micro", 1, function() end end + Setup:ApplyInstanceJournalStandaloneStyle(value) callbacks.microColor(DFRL:GetTempDB("Micro", "microColor")) end diff --git a/modules/track/track.lua b/modules/track/track.lua index 9a9d472..1dc3e44 100644 --- a/modules/track/track.lua +++ b/modules/track/track.lua @@ -13,6 +13,7 @@ DFRL:NewMod("UpdateNotifier", 1, function() txt2 = nil, dd = nil, btn = nil, + closeBtn = nil, } function Setup:ParseDate(dateStr) @@ -102,6 +103,36 @@ DFRL:NewMod("UpdateNotifier", 1, function() DFRL.tools.MoveFrame(self.frame, 0, 1, .3, 120) end) end + + if not self.closeBtn then + self.closeBtn = CreateFrame("Button", nil, self.frame) + self.closeBtn:SetWidth(18) + self.closeBtn:SetHeight(18) + self.closeBtn:SetPoint("TOPRIGHT", self.frame, "TOPRIGHT", -6, -6) + self.closeBtn:SetFrameStrata(self.frame:GetFrameStrata()) + + self.closeBtn.text = self.closeBtn:CreateFontString(nil, "OVERLAY", "GameFontNormal") + self.closeBtn.text:SetAllPoints() + self.closeBtn.text:SetText("X") + + self.closeBtn:SetScript("OnEnter", function() + if self.closeBtn.text then + self.closeBtn.text:SetTextColor(1, 0.2, 0.2) + end + end) + + self.closeBtn:SetScript("OnLeave", function() + if self.closeBtn.text then + self.closeBtn.text:SetTextColor(1, 0.82, 0) + end + end) + + self.closeBtn:SetScript("OnClick", function() + DFRL.tools.MoveFrame(self.frame, 0, 1, .3, 120) + end) + + self.closeBtn.text:SetTextColor(1, 0.82, 0) + end end function Setup:Run()