- Added an option to ignore nicknames and always use character names.
- Enabling the display icon on title bar now makes the title text automatically move slightly to right. - Fixed issue with skin changing when the window has the statusbar enabled.
This commit is contained in:
@@ -45,6 +45,7 @@ _detalhes.instance_skin_ignored_values = {
|
||||
["grab_on_top"] = true,
|
||||
["libwindow"] = true,
|
||||
["ignore_mass_showhide"] = true,
|
||||
["window_scale"] = true,
|
||||
}
|
||||
|
||||
function _detalhes:ResetInstanceConfigKeepingValues (maintainsnap)
|
||||
|
||||
@@ -162,7 +162,9 @@
|
||||
--> é um player
|
||||
if (_bit_band (flag, OBJECT_TYPE_PLAYER) ~= 0) then
|
||||
|
||||
novo_objeto.displayName = _detalhes:GetNickname (serial, false, true) --> serial, default, silent
|
||||
if (not _detalhes.ignore_nicktag) then
|
||||
novo_objeto.displayName = _detalhes:GetNickname (serial, false, true) --> serial, default, silent
|
||||
end
|
||||
if (not novo_objeto.displayName) then
|
||||
|
||||
if (_IsInInstance() and _detalhes.remove_realm_from_name) then
|
||||
|
||||
+1
-1
@@ -1053,7 +1053,7 @@
|
||||
if (avatar [2] and avatar [4] and avatar [1]) then
|
||||
GameCooltip:SetBannerImage (1, avatar [2], 80, 40, avatarPoint, avatarTexCoord, nil) --> overlay [2] avatar path
|
||||
GameCooltip:SetBannerImage (2, avatar [4], 200, 55, backgroundPoint, avatar [5], avatar [6]) --> background
|
||||
GameCooltip:SetBannerText (1, avatar [1], textPoint) --> text [1] nickname
|
||||
GameCooltip:SetBannerText (1, (not _detalhes.ignore_nicktag and avatar [1]) or objeto.nome, textPoint) --> text [1] nickname
|
||||
end
|
||||
else
|
||||
if (_detalhes.remove_realm_from_name and objeto.displayName:find ("%*")) then
|
||||
|
||||
+38
-20
@@ -1483,10 +1483,21 @@ extraWindow:DisableGradient()
|
||||
window.textstyle:SetPoint (10, -15)
|
||||
|
||||
local onSelectTextStyle = function (_, child, style)
|
||||
child.options.textStyle = style
|
||||
if (child.Refresh and type (child.Refresh) == "function") then
|
||||
child:Refresh (child)
|
||||
|
||||
window.instance.StatusBar.left.options.textStyle = style
|
||||
window.instance.StatusBar.center.options.textStyle = style
|
||||
window.instance.StatusBar.right.options.textStyle = style
|
||||
|
||||
if (window.instance.StatusBar.left.Refresh and type (window.instance.StatusBar.left.Refresh) == "function") then
|
||||
window.instance.StatusBar.left:Refresh (window.instance.StatusBar.left)
|
||||
end
|
||||
if (window.instance.StatusBar.center.Refresh and type (window.instance.StatusBar.center.Refresh) == "function") then
|
||||
window.instance.StatusBar.center:Refresh (window.instance.StatusBar.center)
|
||||
end
|
||||
if (window.instance.StatusBar.right.Refresh and type (window.instance.StatusBar.right.Refresh) == "function") then
|
||||
window.instance.StatusBar.right:Refresh (window.instance.StatusBar.right)
|
||||
end
|
||||
|
||||
end
|
||||
local textStyle = {{value = 1, label = Loc ["STRING_PLUGINOPTIONS_ABBREVIATE"] .. " (105.5K)", onclick = onSelectTextStyle},
|
||||
{value = 2, label = Loc ["STRING_PLUGINOPTIONS_COMMA"] .. " (105.500)", onclick = onSelectTextStyle},
|
||||
@@ -1501,12 +1512,20 @@ extraWindow:DisableGradient()
|
||||
local selectedColor = function()
|
||||
local r, g, b, a = ColorPickerFrame:GetColorRGB()
|
||||
window.textcolortexture:SetTexture (r, g, b, a)
|
||||
_detalhes.StatusBar:ApplyOptions (window.child, "textcolor", {r, g, b, a})
|
||||
--_detalhes.StatusBar:ApplyOptions (window.child, "textcolor", {r, g, b, a})
|
||||
|
||||
local color = {r, g, b, a}
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textcolor", color)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textcolor", color)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textcolor", color)
|
||||
end
|
||||
local canceledColor = function()
|
||||
local r, g, b, a = unpack (ColorPickerFrame.previousValues)
|
||||
window.textcolortexture:SetTexture (r, g, b, a)
|
||||
_detalhes.StatusBar:ApplyOptions (window.child, "textcolor", {r, g, b, a})
|
||||
local color = {r, g, b, a}
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textcolor", color)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textcolor", color)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textcolor", color)
|
||||
end
|
||||
local colorpick = function()
|
||||
ColorPickerFrame.func = selectedColor
|
||||
@@ -1519,33 +1538,27 @@ extraWindow:DisableGradient()
|
||||
ColorPickerFrame:Show()
|
||||
end
|
||||
|
||||
_detalhes.gump:NewImage (window, nil, 150, 16, nil, nil, "textcolortexture", "$parentTextColorTexture")
|
||||
_detalhes.gump:NewImage (window, nil, 160, 16, nil, nil, "textcolortexture", "$parentTextColorTexture")
|
||||
window.textcolortexture:SetPoint ("left", window.textcolor, "right", 2)
|
||||
window.textcolortexture:SetTexture (1, 1, 1)
|
||||
|
||||
_detalhes.gump:NewButton (window, _, "$parentTextColorButton", "textcolorbutton", 150, 20, colorpick)
|
||||
_detalhes.gump:NewButton (window, _, "$parentTextColorButton", "textcolorbutton", 160, 20, colorpick)
|
||||
window.textcolorbutton:SetPoint ("left", window.textcolor, "right", 2)
|
||||
--window.textcolorbutton:InstallCustomTexture()
|
||||
|
||||
local applyToAll = function()
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textcolor", window.child.options.textColor)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textcolor", window.child.options.textColor)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textcolor", window.child.options.textColor)
|
||||
end
|
||||
_detalhes.gump:NewButton (window, _, "$parentTextColorApplyToAllButton", "applyToAll", 45, 16, applyToAll, nil, nil, nil, "->")
|
||||
window.applyToAll:InstallCustomTexture()
|
||||
window.applyToAll:SetPoint ("left", window.textcolorbutton, "right", 5)
|
||||
window.applyToAll.tooltip = "apply this color to all micro displays"
|
||||
|
||||
--> text size
|
||||
_detalhes.gump:NewLabel (window, _, "$parentFontSizeLabel", "fonsizeLabel", Loc ["STRING_PLUGINOPTIONS_TEXTSIZE"])
|
||||
window.fonsizeLabel:SetPoint (10, -55)
|
||||
--
|
||||
_detalhes.gump:NewSlider (window, _, "$parentSliderFontSize", "fonsizeSlider", 170, 20, 9, 15, .5, 1)
|
||||
_detalhes.gump:NewSlider (window, _, "$parentSliderFontSize", "fonsizeSlider", 170, 20, 7, 20, 1, 1)
|
||||
window.fonsizeSlider:SetPoint ("left", window.fonsizeLabel, "right", 2)
|
||||
window.fonsizeSlider:SetThumbSize (50)
|
||||
--window.fonsizeSlider.useDecimals = true
|
||||
window.fonsizeSlider:SetHook ("OnValueChange", function (self, child, amount)
|
||||
_detalhes.StatusBar:ApplyOptions (child, "textsize", amount)
|
||||
--_detalhes.StatusBar:ApplyOptions (child, "textsize", amount)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textsize", amount)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textsize", amount)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textsize", amount)
|
||||
end)
|
||||
|
||||
--> align
|
||||
@@ -1578,7 +1591,12 @@ extraWindow:DisableGradient()
|
||||
|
||||
--> text font
|
||||
local onSelectFont = function (_, child, fontName)
|
||||
_detalhes.StatusBar:ApplyOptions (child, "textface", fontName)
|
||||
--_detalhes.StatusBar:ApplyOptions (child, "textface", fontName)
|
||||
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.left, "textface", fontName)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.center, "textface", fontName)
|
||||
_detalhes.StatusBar:ApplyOptions (window.instance.StatusBar.right, "textface", fontName)
|
||||
|
||||
end
|
||||
|
||||
local fontObjects = SharedMedia:HashTable ("font")
|
||||
|
||||
@@ -957,6 +957,7 @@ local default_player_data = {
|
||||
last_instance_time = 0,
|
||||
--> nicktag cache
|
||||
nick_tag_cache = {},
|
||||
ignore_nicktag = false,
|
||||
--> plugin data
|
||||
plugin_database = {},
|
||||
--> information about this character
|
||||
|
||||
@@ -304,6 +304,7 @@ local _
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {3, 3},
|
||||
|
||||
--overwrites
|
||||
instance_cprops = {
|
||||
@@ -525,6 +526,7 @@ local _
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {5, 4},
|
||||
|
||||
--overwrites
|
||||
instance_cprops = {
|
||||
@@ -746,6 +748,7 @@ local _
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {1, 2},
|
||||
|
||||
instance_cprops = {
|
||||
["show_statusbar"] = false,
|
||||
@@ -1047,6 +1050,7 @@ local _
|
||||
control_script = nil,
|
||||
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {3, 4},
|
||||
|
||||
--instance overwrites
|
||||
--[[ when a skin is selected, all customized properties of the window is reseted and then the overwrites are applied]]
|
||||
@@ -1435,6 +1439,7 @@ local _
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {2, 5},
|
||||
|
||||
instance_cprops = {
|
||||
["menu_icons_size"] = 0.899999976158142,
|
||||
@@ -1681,6 +1686,7 @@ local _
|
||||
|
||||
icon_on_top = true,
|
||||
icon_ignore_alpha = true,
|
||||
icon_titletext_position = {2, 5},
|
||||
|
||||
instance_cprops = {
|
||||
["show_statusbar"] = false,
|
||||
|
||||
@@ -103,7 +103,7 @@ function _detalhes:AbreJanelaInfo (jogador, from_att_change)
|
||||
end
|
||||
|
||||
if (avatar and avatar [1]) then
|
||||
info.nome:SetText (avatar [1] or nome)
|
||||
info.nome:SetText ((not _detalhes.ignore_nicktag and avatar [1]) or nome)
|
||||
end
|
||||
|
||||
if (avatar and avatar [2]) then
|
||||
|
||||
@@ -3593,6 +3593,19 @@ function window:CreateFrame1()
|
||||
frame1.avatarNickname:SetDrawLayer ("overlay", 3)
|
||||
frame1.avatarPreview2:SetDrawLayer ("overlay", 2)
|
||||
|
||||
--> ignore nicknames --------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
g:NewLabel (frame1, _, "$parentIgnoreNicknamesLabel", "IgnoreNicknamesLabel", Loc ["STRING_OPTIONS_IGNORENICKNAME"], "GameFontHighlightLeft")
|
||||
g:NewSwitch (frame1, _, "$parentIgnoreNicknamesSlider", "IgnoreNicknamesSlider", 60, 20, _, _, _detalhes.ignore_nicktag)
|
||||
frame1.IgnoreNicknamesSlider:SetPoint ("left", frame1.IgnoreNicknamesLabel, "right", 2)
|
||||
|
||||
frame1.IgnoreNicknamesSlider.OnSwitch = function (self, _, value)
|
||||
_detalhes.ignore_nicktag = value
|
||||
_detalhes:SendOptionsModifiedEvent (DetailsOptionsWindow.instance)
|
||||
end
|
||||
|
||||
window:CreateLineBackground2 (frame1, "IgnoreNicknamesSlider", "IgnoreNicknamesLabel", Loc ["STRING_OPTIONS_IGNORENICKNAME_DESC"])
|
||||
|
||||
--> realm name --------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
g:NewLabel (frame1, _, "$parentRealmNameLabel", "realmNameLabel", Loc ["STRING_OPTIONS_REALMNAME"], "GameFontHighlightLeft")
|
||||
@@ -3917,7 +3930,8 @@ function window:CreateFrame1()
|
||||
frame1.avatarPreview2:SetPoint (avatar_x_anchor2+1, -159)
|
||||
frame1.avatarNickname:SetPoint (avatar_x_anchor2+109, -191)
|
||||
|
||||
frame1.realmNameLabel:SetPoint (avatar_x_anchor, -235)
|
||||
frame1.IgnoreNicknamesLabel:SetPoint (avatar_x_anchor, -235)
|
||||
frame1.realmNameLabel:SetPoint (avatar_x_anchor, -255)
|
||||
|
||||
--frame1.ToolsLabel:SetPoint (avatar_x_anchor, -265)
|
||||
--frame1.EraseDataLabel:SetPoint (avatar_x_anchor, -290)
|
||||
@@ -3935,7 +3949,7 @@ function window:CreateFrame1()
|
||||
{"CreateWindowButton", 6, true},
|
||||
}
|
||||
|
||||
window:arrange_menu (frame1, right_side, x, -265)
|
||||
window:arrange_menu (frame1, right_side, x, -285)
|
||||
|
||||
local left_side = {
|
||||
{"GeneralAnchorLabel", 1, true},
|
||||
@@ -7123,12 +7137,38 @@ function window:CreateFrame7()
|
||||
|
||||
frame7.hideIconSlider:SetPoint ("left", frame7.hideIconLabel, "right", 2)
|
||||
frame7.hideIconSlider.OnSwitch = function (self, instance, value)
|
||||
|
||||
instance:HideMainIcon (value)
|
||||
|
||||
if (not DetailsOptionsWindow.loading_settings and _detalhes.skins [instance.skin].icon_titletext_position) then
|
||||
if (not value and instance.attribute_text.enabled and instance.attribute_text.side == instance.toolbar_side) then
|
||||
instance.attribute_text.anchor [1] = _detalhes.skins [instance.skin].icon_titletext_position [1]
|
||||
instance.attribute_text.anchor [2] = _detalhes.skins [instance.skin].icon_titletext_position [2]
|
||||
instance:AttributeMenu()
|
||||
elseif (value and instance.attribute_text.enabled and instance.attribute_text.side == instance.toolbar_side) then
|
||||
instance.attribute_text.anchor [1] = _detalhes.skins [instance.skin].instance_cprops.attribute_text.anchor [1]
|
||||
instance.attribute_text.anchor [2] = _detalhes.skins [instance.skin].instance_cprops.attribute_text.anchor [2]
|
||||
instance:AttributeMenu()
|
||||
end
|
||||
end
|
||||
|
||||
if (_detalhes.options_group_edit and not DetailsOptionsWindow.loading_settings) then
|
||||
for _, this_instance in ipairs (instance:GetInstanceGroup()) do
|
||||
if (this_instance ~= instance) then
|
||||
this_instance:HideMainIcon (value)
|
||||
|
||||
if (not DetailsOptionsWindow.loading_settings and _detalhes.skins [this_instance.skin].icon_titletext_position) then
|
||||
if (not value and this_instance.attribute_text.enabled and this_instance.attribute_text.side == this_instance.toolbar_side) then
|
||||
this_instance.attribute_text.anchor [1] = _detalhes.skins [this_instance.skin].icon_titletext_position [1]
|
||||
this_instance.attribute_text.anchor [2] = _detalhes.skins [this_instance.skin].icon_titletext_position [2]
|
||||
this_instance:AttributeMenu()
|
||||
elseif (value and this_instance.attribute_text.enabled and this_instance.attribute_text.side == this_instance.toolbar_side) then
|
||||
this_instance.attribute_text.anchor [1] = _detalhes.skins [this_instance.skin].instance_cprops.attribute_text.anchor [1]
|
||||
this_instance.attribute_text.anchor [2] = _detalhes.skins [this_instance.skin].instance_cprops.attribute_text.anchor [2]
|
||||
this_instance:AttributeMenu()
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -6140,14 +6140,8 @@ function _detalhes:SetWindowScale (scale, from_options)
|
||||
if (not scale) then
|
||||
scale = self.window_scale
|
||||
end
|
||||
|
||||
self.window_scale = scale
|
||||
|
||||
self.baseframe:SetScale (scale)
|
||||
self.rowframe:SetScale (scale)
|
||||
|
||||
|
||||
if (from_options) then
|
||||
|
||||
local group = self:GetInstanceGroup()
|
||||
|
||||
for _, instance in _ipairs (group) do
|
||||
@@ -6164,6 +6158,12 @@ function _detalhes:SetWindowScale (scale, from_options)
|
||||
for _, instance in _ipairs (group) do
|
||||
instance:SaveMainWindowPosition()
|
||||
end
|
||||
|
||||
else
|
||||
self.window_scale = scale
|
||||
self.baseframe:SetScale (scale)
|
||||
self.rowframe:SetScale (scale)
|
||||
--self:SaveMainWindowPosition() -- skin was replacing window_scale
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user