update and locale

This commit is contained in:
Crum
2019-01-12 14:33:27 -06:00
parent aaf50317e5
commit 41336b0adf
23 changed files with 5241 additions and 3964 deletions
+100 -81
View File
@@ -1,19 +1,21 @@
local E, L, V, P, G = unpack(ElvUI); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
local TT = E:GetModule("Tooltip");
local LSM = E.LSM
--Cache global variables
--Lua functions
local _G = _G
local tonumber, tostring = tonumber, tostring
local getn = table.getn
--WoW API / Variables
local ACTIONBAR_LABEL, FONT_SIZE, GENERAL, NONE, OPACITY = ACTIONBAR_LABEL, FONT_SIZE, GENERAL, NONE, OPACITY
local GameTooltipStatusBar = _G["GameTooltipStatusBar"]
E.Options.args.tooltip = {
type = "group",
name = L["Tooltip"],
childGroups = "tab",
get = function(info) return E.db.tooltip[ info[getn(info)] ]; end,
set = function(info, value) E.db.tooltip[ info[getn(info)] ] = value; end,
get = function(info) return E.db.tooltip[ info[getn(info)] ] end,
set = function(info, value) E.db.tooltip[ info[getn(info)] ] = value end,
args = {
intro = {
order = 1,
@@ -30,46 +32,46 @@ E.Options.args.tooltip = {
general = {
order = 3,
type = "group",
name = GENERAL,
disabled = function() return not E.Tooltip; end,
name = L["General"],
disabled = function() return not E.Tooltip end,
args = {
header = {
order = 0,
order = 1,
type = "header",
name = GENERAL
name = L["General"]
},
cursorAnchor = {
order = 1,
order = 2,
type = "toggle",
name = L["Cursor Anchor"],
desc = L["Should tooltip be anchored to mouse cursor"]
},
targetInfo = {
order = 2,
order = 3,
type = "toggle",
name = L["Target Info"],
desc = L["When in a raid group display if anyone in your raid is targeting the current tooltip unit."]
},
playerTitles = {
order = 3,
order = 4,
type = "toggle",
name = L["Player Titles"],
desc = L["Display player titles."]
},
guildRanks = {
order = 4,
order = 5,
type = "toggle",
name = L["Guild Ranks"],
desc = L["Display guild ranks if a unit is guilded."]
},
inspectInfo = {
order = 5,
order = 6,
type = "toggle",
name = L["Inspect Info"],
desc = L["Display the players talent spec and item level in the tooltip, this may not immediately update when mousing over a unit."],
},
itemPrice = {
order = 6,
order = 7,
type = "toggle",
name = L["Item Price"],
desc = L["Display vendor sell value on item tooltips."],
@@ -79,13 +81,24 @@ E.Options.args.tooltip = {
end
},
spellID = {
order = 7,
order = 8,
type = "toggle",
name = L["Spell/Item IDs"],
desc = L["Display the spell or item ID when mousing over a spell or item tooltip."]
},
itemLevel = {
order = 9,
type = "toggle",
name = L["Item Level"],
desc = L["Display the item level when mousing over a item."]
},
spacer = {
order = 10,
type = "description",
name = ""
},
itemCount = {
order = 8,
order = 11,
type = "select",
name = L["Item Count"],
desc = L["Display how many of a certain item you have in your possession."],
@@ -97,38 +110,38 @@ E.Options.args.tooltip = {
}
},
colorAlpha = {
order = 9,
order = 12,
type = "range",
name = OPACITY,
name = L["Opacity"],
isPercent = true,
min = 0, max = 1, step = 0.01
},
fontGroup = {
order = 10,
order = 13,
type = "group",
guiInline = true,
name = L["Tooltip Font Settings"],
guiInline = true,
args = {
font = {
order = 1,
type = "select", dialogControl = "LSM30_Font",
name = L["Font"],
values = AceGUIWidgetLSMlists.font,
get = function(info) return E.db.tooltip.font; end,
set = function(info, value) E.db.tooltip.font = value; TT:SetTooltipFonts(); end
get = function(info) return E.db.tooltip.font end,
set = function(info, value) E.db.tooltip.font = value TT:SetTooltipFonts() end
},
fontOutline = {
order = 2,
name = L["Font Outline"],
type = "select",
name = L["Font Outline"],
values = {
["NONE"] = L["None"],
["OUTLINE"] = "OUTLINE",
["MONOCHROMEOUTLINE"] = "MONOCROMEOUTLINE",
["THICKOUTLINE"] = "THICKOUTLINE"
},
get = function(info) return E.db.tooltip.fontOutline; end,
set = function(info, value) E.db.tooltip.fontOutline = value; TT:SetTooltipFonts(); end,
get = function(info) return E.db.tooltip.fontOutline end,
set = function(info, value) E.db.tooltip.fontOutline = value TT:SetTooltipFonts() end,
},
spacer = {
order = 3,
@@ -140,8 +153,8 @@ E.Options.args.tooltip = {
type = "range",
name = L["Header Font Size"],
min = 4, max = 33, step = 1,
get = function(info) return E.db.tooltip.headerFontSize; end,
set = function(info, value) E.db.tooltip.headerFontSize = value; TT:SetTooltipFonts(); end
get = function(info) return E.db.tooltip.headerFontSize end,
set = function(info, value) E.db.tooltip.headerFontSize = value TT:SetTooltipFonts() end
},
textFontSize = {
order = 5,
@@ -149,7 +162,7 @@ E.Options.args.tooltip = {
name = L["Text Font Size"],
min = 4, max = 33, step = 1,
get = function(info) return E.db.tooltip.textFontSize end,
set = function(info, value) E.db.tooltip.textFontSize = value; TT:SetTooltipFonts() end
set = function(info, value) E.db.tooltip.textFontSize = value TT:SetTooltipFonts() end
},
smallTextFontSize = {
order = 6,
@@ -157,13 +170,13 @@ E.Options.args.tooltip = {
name = L["Comparison Font Size"],
desc = L["This setting controls the size of text in item comparison tooltips."],
min = 4, max = 33, step = 1,
get = function(info) return E.db.tooltip.smallTextFontSize; end,
set = function(info, value) E.db.tooltip.smallTextFontSize = value; TT:SetTooltipFonts(); end
get = function(info) return E.db.tooltip.smallTextFontSize end,
set = function(info, value) E.db.tooltip.smallTextFontSize = value TT:SetTooltipFonts() end
}
}
},
factionColors = {
order = 11,
order = 13,
type = "group",
name = L["Custom Faction Colors"],
guiInline = true,
@@ -172,18 +185,18 @@ E.Options.args.tooltip = {
order = 0,
type = "toggle",
name = L["Custom Faction Colors"],
get = function(info) return E.db.tooltip.useCustomFactionColors; end,
set = function(info, value) E.db.tooltip.useCustomFactionColors = value; end
get = function(info) return E.db.tooltip.useCustomFactionColors end,
set = function(info, value) E.db.tooltip.useCustomFactionColors = value end
}
},
get = function(info)
local t = E.db.tooltip.factionColors[ tonumber(info[getn(info)]) ];
local d = P.tooltip.factionColors[ tonumber(info[getn(info)]) ];
return t.r, t.g, t.b, t.a, d.r, d.g, d.b;
local t = E.db.tooltip.factionColors[tonumber(info[getn(info)])]
local d = P.tooltip.factionColors[tonumber(info[getn(info)])]
return t.r, t.g, t.b, t.a, d.r, d.g, d.b
end,
set = function(info, r, g, b)
local t = E.db.tooltip.factionColors[ tonumber(info[getn(info)]) ];
t.r, t.g, t.b = r, g, b;
local t = E.db.tooltip.factionColors[tonumber(info[getn(info)])]
t.r, t.g, t.b = r, g, b
end
}
}
@@ -192,53 +205,59 @@ E.Options.args.tooltip = {
order = 4,
type = "group",
name = L["Visibility"],
get = function(info) return E.db.tooltip.visibility[ info[getn(info)] ]; end,
set = function(info, value) E.db.tooltip.visibility[ info[getn(info)] ] = value; end,
disabled = function() return not E.Tooltip; end,
get = function(info) return E.db.tooltip.visibility[ info[getn(info)] ] end,
set = function(info, value) E.db.tooltip.visibility[ info[getn(info)] ] = value end,
disabled = function() return not E.Tooltip end,
args = {
header = {
order = 0,
order = 1,
type = "header",
name = L["Visibility"]
},
actionbars = {
order = 1,
order = 2,
type = "select",
name = ACTIONBAR_LABEL,
name = L["ActionBars"],
desc = L["Choose when you want the tooltip to show. If a modifer is chosen, then you need to hold that down to show the tooltip."],
values = {
["ALL"] = L["Always Hide"],
["NONE"] = L["Never Hide"],
--["SHIFT"] = SHIFT_KEY,
--["ALT"] = ALT_KEY,
--["CTRL"] = CTRL_KEY
["SHIFT"] = L["Shift Key"],
["ALT"] = L["ALT-Key"],
["CTRL"] = L["CTRL-Key"]
}
},
bags = {
order = 2,
order = 3,
type = "select",
name = L["Bags/Bank"],
desc = L["Choose when you want the tooltip to show. If a modifer is chosen, then you need to hold that down to show the tooltip."],
values = {
["ALL"] = L["Always Hide"],
["NONE"] = L["Never Hide"],
--["SHIFT"] = SHIFT_KEY,
--["ALT"] = ALT_KEY,
--["CTRL"] = CTRL_KEY
["SHIFT"] = L["Shift Key"],
["ALT"] = L["ALT-Key"],
["CTRL"] = L["CTRL-Key"]
}
},
unitFrames = {
order = 3,
order = 4,
type = "select",
name = L["Unitframes"],
name = L["UnitFrames"],
desc = L["Choose when you want the tooltip to show. If a modifer is chosen, then you need to hold that down to show the tooltip."],
values = {
["ALL"] = L["Always Hide"],
["NONE"] = L["Never Hide"],
--["SHIFT"] = SHIFT_KEY,
--["ALT"] = ALT_KEY,
--["CTRL"] = CTRL_KEY
["SHIFT"] = L["Shift Key"],
["ALT"] = L["ALT-Key"],
["CTRL"] = L["CTRL-Key"]
}
},
combat = {
order = 5,
type = "toggle",
name = L["Combat"],
desc = L["Hide tooltip while in combat."]
}
}
},
@@ -246,24 +265,24 @@ E.Options.args.tooltip = {
order = 5,
type = "group",
name = L["Health Bar"],
get = function(info) return E.db.tooltip.healthBar[ info[getn(info)] ]; end,
set = function(info, value) E.db.tooltip.healthBar[ info[getn(info)] ] = value; end,
disabled = function() return not E.Tooltip; end,
get = function(info) return E.db.tooltip.healthBar[ info[getn(info)] ] end,
set = function(info, value) E.db.tooltip.healthBar[ info[getn(info)] ] = value end,
disabled = function() return not E.Tooltip end,
args = {
header = {
order = 0,
order = 1,
type = "header",
name = L["Health Bar"]
},
height = {
order = 1,
order = 2,
type = "range",
name = L["Height"],
min = 1, max = 15, step = 1,
set = function(info, value) E.db.tooltip.healthBar.height = value; GameTooltipStatusBar:Height(value); end
set = function(info, value) E.db.tooltip.healthBar.height = value GameTooltipStatusBar:Height(value) end
},
statusPosition = {
order = 2,
order = 3,
type = "select",
name = L["Position"],
values = {
@@ -272,35 +291,35 @@ E.Options.args.tooltip = {
}
},
text = {
order = 3,
order = 4,
type = "toggle",
name = L["Text"],
set = function(info, value) E.db.tooltip.healthBar.text = value; if(value) then GameTooltipStatusBar.text:Show(); else GameTooltipStatusBar.text:Hide() end end
set = function(info, value) E.db.tooltip.healthBar.text = value if(value) then GameTooltipStatusBar.text:Show(); else GameTooltipStatusBar.text:Hide() end end
},
font = {
order = 4,
order = 5,
type = "select", dialogControl = "LSM30_Font",
name = L["Font"],
values = AceGUIWidgetLSMlists.font,
set = function(info, value)
E.db.tooltip.healthBar.font = value;
E:FontTemplate(GameTooltipStatusBar.text, E.LSM:Fetch("font", E.db.tooltip.healthBar.font), E.db.tooltip.healthBar.fontSize, E.db.tooltip.healthBar.fontOutline);
E.db.tooltip.healthBar.font = value
E:FontTemplate(GameTooltipStatusBar.text, LSM:Fetch("font", E.db.tooltip.healthBar.font), E.db.tooltip.healthBar.fontSize, E.db.tooltip.healthBar.fontOutline)
end,
disabled = function() return not E.db.tooltip.healthBar.text end
},
fontSize = {
order = 5,
order = 6,
type = "range",
name = FONT_SIZE,
min = 6, max = 500, step = 1,
name = L["Font Size"],
min = 4, max = 33, step = 1,
set = function(info, value)
E.db.tooltip.healthBar.fontSize = value;
E:FontTemplate(GameTooltipStatusBar.text, E.LSM:Fetch("font", E.db.tooltip.healthBar.font), E.db.tooltip.healthBar.fontSize, E.db.tooltip.healthBar.fontOutline);
E.db.tooltip.healthBar.fontSize = value
E:FontTemplate(GameTooltipStatusBar.text, LSM:Fetch("font", E.db.tooltip.healthBar.font), E.db.tooltip.healthBar.fontSize, E.db.tooltip.healthBar.fontOutline)
end,
disabled = function() return not E.db.tooltip.healthBar.text end
},
fontOutline = {
order = 6,
order = 7,
type = "select",
name = L["Font Outline"],
values = {
@@ -310,22 +329,22 @@ E.Options.args.tooltip = {
["THICKOUTLINE"] = "THICKOUTLINE"
},
set = function(info, value)
E.db.tooltip.healthBar.fontOutline = value;
E:FontTemplate(GameTooltipStatusBar.text, E.LSM:Fetch("font", E.db.tooltip.healthBar.font), E.db.tooltip.healthBar.fontSize, E.db.tooltip.healthBar.fontOutline);
E.db.tooltip.healthBar.fontOutline = value
E:FontTemplate(GameTooltipStatusBar.text, LSM:Fetch("font", E.db.tooltip.healthBar.font), E.db.tooltip.healthBar.fontSize, E.db.tooltip.healthBar.fontOutline)
end,
disabled = function() return not E.db.tooltip.healthBar.text end
}
}
}
}
};
}
for i = 1, 8 do
E.Options.args.tooltip.args.general.args.factionColors.args[tostring(i)] = {
E.Options.args.tooltip.args.general.args.factionColors.args[""..i] = {
order = i,
type = "color",
hasAlpha = false,
name = _G["FACTION_STANDING_LABEL" .. i],
disabled = function() return not E.Tooltip or not E.db.tooltip.useCustomFactionColors; end,
};
end
name = _G["FACTION_STANDING_LABEL"..i],
disabled = function() return not E.Tooltip or not E.db.tooltip.useCustomFactionColors end,
}
end