Skip to content

Commit 4f00326

Browse files
committed
Merge branch 'development'
2 parents 1bf0890 + 0f2052a commit 4f00326

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+1871
-397
lines changed

CHANGELOG.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
### Changes ###
22

3-
* [TradeFrame]: Blizzard made the InputMoneyFrame secure, so no AddOn can change it anymore. Looks ugly, but hey
4-
* [Core]: Use xpcall to grab some more errors for the init of the Modules
5-
* [TradeTabs]: Display by default Herbalism and Tailoring tab
6-
* [CollectionJournal]: Fixed on of the Tabs at the bottom
3+
* [Armory]: More settings and visual improvements
4+
* [GameMenu]: Some more infos on the GameMenu
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
local MER = unpack(ElvUI_MerathilisUI)
2+
3+
MER.Changelog[660] = {
4+
RELEASE_DATE = "15.04.2025",
5+
FIXES = {},
6+
NEW = {},
7+
IMPROVEMENTS = {
8+
"[Armory]: More settings and visual improvements",
9+
"[GameMenu]: Some more infos on the GameMenu",
10+
},
11+
}

ElvUI_MerathilisUI/Core/Changelog/Load_Changelog.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,6 @@
4848
<Script file="Previous\6.56.lua"/>
4949
<Script file="Previous\6.57.lua"/>
5050
<Script file="Previous\6.58.lua"/>
51-
<Script file="6.59.lua"/>
51+
<Script file="Previous\6.59.lua"/>
52+
<Script file="6.60.lua"/>
5253
</Ui>
File renamed without changes.

ElvUI_MerathilisUI/Core/Functions/Colors.lua

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
local MER, F, E, I, V, P, G, L = unpack(ElvUI_MerathilisUI)
2+
F.Color = {}
23

34
local _G = _G
4-
local pairs, select, tonumber, unpack = pairs, select, tonumber, unpack
5+
local pairs, select = pairs, select
56
local abs = abs
67
local min = min
7-
local format = format
8-
local strsub = strsub
98

109
local CreateColor = CreateColor
1110
local GetClassColor = GetClassColor
@@ -403,6 +402,7 @@ end
403402

404403
function F.UnitColor(unit)
405404
local r, g, b = 1, 1, 1
405+
406406
if UnitIsPlayer(unit) then
407407
local class = select(2, UnitClass(unit))
408408
if class then
@@ -625,19 +625,49 @@ function F.GradientNameCustom(name, unitclass, isTarget)
625625
end
626626
end
627627

628-
function F.SetGradient(obj, orientation, minColor, maxColor)
628+
function F.Color.SetGradient(obj, orientation, minColor, maxColor)
629629
if not obj then
630630
return
631631
end
632632

633-
local min = minColor or "#000000"
634-
local max = maxColor or "#FFFFFF"
633+
if not minColor.r or not minColor.g or not minColor.b then
634+
return
635+
end
636+
if not maxColor.r or not maxColor.g or not maxColor.b then
637+
return
638+
end
639+
640+
obj:SetGradient(orientation, minColor, maxColor)
641+
end
635642

636-
obj:SetGradient(orientation, min, max)
643+
function F.Color.SetGradientRGB(obj, orientation, r1, g1, b1, a1, r2, g2, b2, a2)
644+
F.Color.SetGradient(obj, orientation, CreateColor(r1, g1, b1, a1), CreateColor(r2, g2, b2, a2))
637645
end
638646

639-
function F.SetGradientRGB(obj, orientation, r1, g1, b1, a1, r2, g2, b2, a2)
640-
F.SetGradient(obj, orientation, CreateColor(r1, g1, b1, a1), CreateColor(r2, g2, b2, a2))
647+
function F.Color.UpdateGradient(obj, perc, minColor, maxColor)
648+
if not minColor.r or not minColor.g or not minColor.b then
649+
return
650+
end
651+
if not maxColor.r or not maxColor.g or not maxColor.b then
652+
return
653+
end
654+
655+
if perc >= 1 then
656+
local r, g, b = maxColor:GetRGBA()
657+
obj:SetRGBA(r, g, b, 1)
658+
return
659+
elseif perc <= 0 then
660+
local r, g, b = minColor:GetRGBA()
661+
obj:SetRGBA(r, g, b, 1)
662+
return
663+
end
664+
665+
obj:SetRGBA(
666+
(maxColor.r * perc) + (minColor.r * (1 - perc)),
667+
(maxColor.g * perc) + (minColor.g * (1 - perc)),
668+
(maxColor.b * perc) + (minColor.b * (1 - perc)),
669+
1
670+
)
641671
end
642672

643673
local progressColor = {

ElvUI_MerathilisUI/Core/Functions/Core.lua

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,103 @@ function F:Interval(value, minValue, maxValue)
278278
return max(minValue, min(maxValue, value))
279279
end
280280

281+
function F.RemoveFontTemplate(fs)
282+
E.texts[fs] = nil
283+
end
284+
285+
function F.GetFontColorFromDB(db, prefix)
286+
-- Vars
287+
if prefix == nil then
288+
prefix = ""
289+
end
290+
local fontColor
291+
local useDB = (db and prefix) and true or false
292+
local colorSwitch = (useDB and db[prefix .. "color"]) or I.General.DefaultFontColor
293+
294+
-- Switch
295+
if colorSwitch == "CUSTOM" then
296+
fontColor = (useDB and db[prefix .. "color"]) or I.General.DefaultFontCustomColor
297+
elseif colorSwitch == "MER" then
298+
fontColor = I.Strings.Branding.ColorRGBA
299+
elseif colorSwitch == "CLASS" then
300+
local classColor = E:ClassColor(E.myclass, true)
301+
fontColor = {
302+
r = classColor.r,
303+
g = classColor.g,
304+
b = classColor.b,
305+
a = 1,
306+
}
307+
elseif colorSwitch == "VALUE" then
308+
fontColor = {
309+
r = E.media.rgbvaluecolor[1],
310+
g = E.media.rgbvaluecolor[2],
311+
b = E.media.rgbvaluecolor[3],
312+
a = 1,
313+
}
314+
else
315+
fontColor = {
316+
r = 1,
317+
g = 1,
318+
b = 1,
319+
a = 1,
320+
}
321+
end
322+
323+
return fontColor
324+
end
325+
326+
function F.SetFontColorFromDB(db, prefix, fs)
327+
local fontColor = F.GetFontColorFromDB(db, prefix)
328+
F.RemoveFontTemplate(fs)
329+
fs:SetTextColor(fontColor.r, fontColor.g, fontColor.b, fontColor.a)
330+
end
331+
332+
function F.SetFontScaledFromDB(db, prefix, fs, color, fontOverwrite)
333+
F.SetFontFromDB(db, prefix, fs, color, fontOverwrite, true)
334+
end
335+
336+
function F.GetFontPath(font)
337+
font = font or I.General.DefaultFont
338+
339+
local lsmFont = LSM:Fetch("font", F.FontOverride(font))
340+
if not lsmFont then
341+
lsmFont = LSM:Fetch("font", font)
342+
end -- backup to non-override font
343+
if not lsmFont then
344+
lsmFont = LSM:Fetch("font", I.General.DefaultFont)
345+
end -- backup to normal font if not found
346+
if not lsmFont then
347+
lsmFont = E.media.normFont
348+
end -- backup to elvui font if not found
349+
350+
return lsmFont
351+
end
352+
353+
function F.SetFontFromDB(db, prefix, fs, color, fontOverwrite, useScaling)
354+
local useDB = (db and prefix) and true or false
355+
local font = (useDB and db[prefix .. "name"]) or I.General.DefaultFont
356+
local size = (useDB and db[prefix .. "size"]) or I.General.DefaultFontSize
357+
local outline = (useDB and db[prefix .. "style"]) or I.General.DefaultFontOutline
358+
359+
if fontOverwrite then
360+
font = fontOverwrite
361+
end
362+
local lsmFont = F.GetFontPath(font)
363+
364+
outline = F.FontStyleOverride(font, outline)
365+
366+
if outline == "NONE" then
367+
outline = ""
368+
end
369+
370+
F.RemoveFontTemplate(fs)
371+
fs:SetFont(lsmFont, useScaling and F.FontSizeScaled(size) or size, (not shadow and outline) or "")
372+
373+
if (color == nil) or (color == true) then
374+
F.SetFontColorFromDB(db, prefix, fs)
375+
end
376+
end
377+
281378
function F.SetFontDB(text, db)
282379
if not text or not text.GetFont then
283380
F.Developer.LogDebug("Functions.SetFontDB: text not found")

ElvUI_MerathilisUI/Core/Functions/Developer.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local MER, F, E, I, V, P, G, L = unpack(ElvUI_MerathilisUI)
2+
F.Developer = {}
23

34
local _G = _G
45
local format, pairs, print, type = format, pairs, print, type
@@ -7,8 +8,6 @@ local tostring = tostring
78

89
local IsAddOnLoaded = C_AddOns.IsAddOnLoaded
910

10-
F.Developer = {}
11-
1211
MER.IsDev = {
1312
["Asragoth"] = true,
1413
["Anonia"] = true,

ElvUI_MerathilisUI/Core/Functions/Event.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local MER, F, E, I, V, P, G, L = unpack(ElvUI_MerathilisUI)
2+
F.Event = {}
23

34
local next, pairs, select, type, unpack = next, pairs, select, type, unpack
45
local rawset = rawset
@@ -10,8 +11,6 @@ local C_Timer_After = C_Timer.After
1011
local InCombatLockdown = InCombatLockdown
1112
local EventUtil = EventUtil
1213

13-
F.Event = {}
14-
1514
do
1615
local closureGeneration = {
1716
function(f)

ElvUI_MerathilisUI/Core/Functions/Strings.lua

Lines changed: 38 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
local MER, F, E, I, V, P, G, L = unpack(ElvUI_MerathilisUI)
2+
F.String = {}
23

34
local error = error
45
local type, unpack = type, unpack
@@ -7,8 +8,6 @@ local strbyte, strfind, strlen, strsub = strbyte, strfind, strlen, strsub
78
local utf8len, utf8lower, utf8sub, utf8upper = string.utf8len, string.utf8lower, string.utf8sub, string.utf8upper
89
local tinsert = tinsert
910

10-
F.String = {}
11-
1211
function F.String.Color(msg, color)
1312
if not msg then
1413
F.Developer.Print(msg)
@@ -196,6 +195,43 @@ function F.String.RGB(msg, colors)
196195
end
197196
end
198197

198+
function F.String.Uppercase(text)
199+
if type(text) ~= "string" then
200+
return text
201+
end
202+
return utf8upper(text)
203+
end
204+
205+
function F.String.Lowercase(text)
206+
if type(text) ~= "string" then
207+
return text
208+
end
209+
return utf8lower(text)
210+
end
211+
212+
function F.String.UppercaseFirstLetter(text)
213+
if type(text) ~= "string" then
214+
return text
215+
end
216+
return utf8upper(utf8sub(text, 1, 1)) .. utf8sub(text, 2)
217+
end
218+
219+
function F.String.UppercaseFirstLetterOnly(text)
220+
if type(text) ~= "string" then
221+
return text
222+
end
223+
return utf8upper(utf8sub(text, 1, 1)) .. utf8lower(utf8sub(text, 2))
224+
end
225+
226+
function F.String.LowercaseEnum(text)
227+
if type(text) ~= "string" then
228+
return text
229+
end
230+
return strtrim(text):gsub("_", " "):gsub("(%a)([%w_']*)", function(a, b)
231+
return F.String.Uppercase(a) .. F.String.Lowercase(b)
232+
end)
233+
end
234+
199235
function F.String.ColorFirstLetter(text)
200236
if type(text) ~= "string" then
201237
return text

ElvUI_MerathilisUI/Core/Functions/Table.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
local MER, F, E, I, V, P, G, L = unpack(ElvUI_MerathilisUI)
2+
F.Table = {}
23

34
local pairs, next, type, select, unpack = pairs, next, type, select, unpack
45
local tinsert, tsort = table.insert, table.sort
56
local setmetatable = setmetatable
67

7-
F.Table = {}
8-
98
function F.Table.Print(tbl, indent)
109
if not indent then
1110
indent = 0

0 commit comments

Comments
 (0)