This commit is contained in:
tercio
2014-10-18 14:33:43 -03:00
parent 8ff60f5fba
commit 44cdcf50c1
9 changed files with 160 additions and 139 deletions
+7 -4
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -83,7 +83,7 @@ _detalhes.instance_defaults = {
--blackwhiite icons
desaturated_menu = false, --mode segment attribute report
--icons on menu
menu_icons = {true, true, true, true, true, true}, --mode segment attribute report reset close
menu_icons = {true, true, true, true, true, true, space = -4, shadow = false}, --mode segment attribute report reset close
--menu icons size multiplicator factor
menu_icons_size = 1.0, --mode segment attribute report
--auto hide menu buttons
+1
View File
@@ -580,6 +580,7 @@
esta_instancia.consolidateButtonTexture = nil
esta_instancia.consolidateButton = nil
esta_instancia.lastIcon = nil
esta_instancia.firstIcon = nil
esta_instancia.menu_attribute_string = nil
+23 -17
View File
@@ -310,24 +310,30 @@ function _detalhes:ApplyProfile (profile_name, nosave, is_copy)
break
end
--> fix for the old flat skin
if (skin.skin == "Flat Color") then
skin.skin = "Serenity"
end
--> fix for old left and right menus
if (skin.menu_icons and type (skin.menu_icons[5]) ~= "boolean") then
skin.menu_icons[5] = true
skin.menu_icons[6] = true
local skin_profile = _detalhes.skins [skin.skin] and _detalhes.skins [skin.skin].instance_cprops
if (skin_profile) then
skin.menu_icons_size = skin_profile.menu_icons_size
skin.menu_anchor = table_deepcopy (skin_profile.menu_anchor)
--print (skin.menu_anchor[1], skin.menu_anchor[2], skin.menu_anchor.side)
skin.menu_anchor_down = table_deepcopy (skin_profile.menu_anchor_down)
--> fix for the old flat skin (10-10)
if (skin.skin == "Flat Color") then
skin.skin = "Serenity"
end
--> fix for old left and right menus (15-10)
if (skin.menu_icons and type (skin.menu_icons[5]) ~= "boolean") then
skin.menu_icons[5] = true
skin.menu_icons[6] = true
local skin_profile = _detalhes.skins [skin.skin] and _detalhes.skins [skin.skin].instance_cprops
if (skin_profile) then
skin.menu_icons_size = skin_profile.menu_icons_size
skin.menu_anchor = table_deepcopy (skin_profile.menu_anchor)
--print (skin.menu_anchor[1], skin.menu_anchor[2], skin.menu_anchor.side)
skin.menu_anchor_down = table_deepcopy (skin_profile.menu_anchor_down)
end
end
if (skin.menu_icons and not skin.menu_icons.space) then
skin.menu_icons.space = -4
end
if (skin.menu_icons and not skin.menu_icons.shadow) then
skin.menu_icons.shadow = false
end
end
--> get the instance
local instance = _detalhes:GetInstance (index)
+43 -7
View File
@@ -5904,6 +5904,36 @@ function window:CreateFrame7()
window:CreateLineBackground2 (frame7, "menuIconSizeSlider", "menuIconSizeLabel", Loc ["STRING_OPTIONS_MENU_BUTTONSSIZE_DESC"])
--icon spacement
local s = g:NewSlider (frame7, _, "$parentMenuIconSpaceSlider", "MenuIconSpaceSlider", SLIDER_WIDTH, 20, -5, 10, 1, instance.menu_icons.space)
s:SetBackdrop (slider_backdrop)
s:SetBackdropColor (unpack (slider_backdrop_color))
g:NewLabel (frame7, _, "$parentMenuIconSpaceLabel", "MenuIconSpaceLabel", Loc ["STRING_OPTIONS_MENUS_SPACEMENT"], "GameFontHighlightLeft")
frame7.MenuIconSpaceSlider:SetPoint ("left", frame7.MenuIconSpaceLabel, "right", 2, -1)
frame7.MenuIconSpaceSlider:SetHook ("OnValueChange", function (self, instance, value)
instance:ToolbarMenuSetButtonsOptions (value)
end)
window:CreateLineBackground2 (frame7, "MenuIconSpaceSlider", "MenuIconSpaceLabel", Loc ["STRING_OPTIONS_MENUS_SPACEMENT_DESC"])
--icon shadow
g:NewSwitch (frame7, _, "$parentMenuIconShadowSlider", "MenuIconShadowSlider", 60, 20, _, _, instance.menu_icons.shadow)
g:NewLabel (frame7, _, "$parentMenuIconShadowLabel", "MenuIconShadowLabel", Loc ["STRING_OPTIONS_MENUS_SHADOW"], "GameFontHighlightLeft")
frame7.MenuIconShadowSlider:SetPoint ("left", frame7.MenuIconShadowLabel, "right", 2)
frame7.MenuIconShadowSlider.OnSwitch = function (self, instance, value)
instance:ToolbarMenuSetButtonsOptions (nil, value)
end
window:CreateLineBackground2 (frame7, "MenuIconShadowSlider", "MenuIconShadowLabel", Loc ["STRING_OPTIONS_MENUS_SHADOW_DESC"])
--auto hide menus
--text anchor on options menu
--g:NewLabel (frame7, _, "$parentAutoHideLabelAnchor", "autoHideLabel", Loc ["STRING_OPTIONS_MENU_AUTOHIDE_ANCHOR"], "GameFontNormal")
@@ -5935,13 +5965,15 @@ function window:CreateFrame7()
{label_icons, 2},
{"menuIconSizeLabel", 3},
{"desaturateMenuLabel", 4},
{"menuAnchorXLabel", 5},
{"menuAnchorYLabel", 6},
{"MenuIconShadowLabel", 5},
{"menuAnchorXLabel", 6},
{"menuAnchorYLabel", 7},
{"MenuIconSpaceLabel", 8},
{"hideIconLabel", 7, true},
{"autoHideLeftMenuLabel", 8},
{"menuAnchorSideLabel", 9},
{"pluginIconsDirectionLabel", 10},
{"hideIconLabel", 9, true},
{"autoHideLeftMenuLabel", 10},
{"menuAnchorSideLabel", 11},
{"pluginIconsDirectionLabel", 12},
}
window:arrange_menu (frame7, left_side, x, -90)
@@ -8066,7 +8098,11 @@ end --> if not window
_G.DetailsOptionsWindow6WindowScaleSlider.MyObject:SetValue (editing_instance.window_scale)
--> window 7
_G.DetailsOptionsWindow7MenuIconShadowSlider.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow7MenuIconShadowSlider.MyObject:SetValue (editing_instance.menu_icons.shadow)
_G.DetailsOptionsWindow7MenuIconSpaceSlider.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow7MenuIconSpaceSlider.MyObject:SetValue (editing_instance.menu_icons.space)
_G.DetailsOptionsWindow7AutoHideLeftMenuSwitch.MyObject:SetFixedParameter (editing_instance)
_G.DetailsOptionsWindow7AutoHideLeftMenuSwitch.MyObject:SetValue (editing_instance.auto_hide_menu.left)
+62 -102
View File
@@ -4193,6 +4193,21 @@ function _detalhes:SetIconAlpha (alpha, hide, no_animations)
end
end
function _detalhes:ToolbarMenuSetButtonsOptions (spacement, shadow)
if (type (spacement) ~= "number") then
spacement = self.menu_icons.space
end
if (type (shadow) ~= "boolean") then
shadow = self.menu_icons.shadow
end
self.menu_icons.space = spacement
self.menu_icons.shadow = shadow
return self:ToolbarMenuSetButtons()
end
local tbuttons = {}
function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report, _reset, _close)
@@ -4233,21 +4248,26 @@ function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report,
local anchor_frame, point1, point2 = self:GetMenuAnchorPoint()
local got_anchor = false
self.lastIcon = nil
self.firstIcon = nil
local size = self.menu_icons_size
local space = self.menu_icons.space
local shadow = self.menu_icons.shadow
--> normal buttons
if (self.menu_anchor.side == 1) then
for index, button in _ipairs (tbuttons) do
if (self.menu_icons [index]) then
button:ClearAllPoints()
if (got_anchor) then
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right", -3, 0)
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right", space, 0)
else
button:SetPoint (point1, anchor_frame, point2)
got_anchor = button
self.firstIcon = button
end
self.lastIcon = button
button:SetParent (self.baseframe)
@@ -4255,6 +4275,16 @@ function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report,
button:Show()
button:SetSize (16*size, 16*size)
if (shadow) then
button:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons_shadow]])
button:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons_shadow]])
button:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons_shadow]])
else
button:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
button:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
button:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
end
else
button:Hide()
end
@@ -4267,10 +4297,11 @@ function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report,
if (self.menu_icons [index]) then
button:ClearAllPoints()
if (got_anchor) then
button:SetPoint ("right", self.lastIcon.widget or self.lastIcon, "left", 3, 0)
button:SetPoint ("right", self.lastIcon.widget or self.lastIcon, "left", -space, 0)
else
button:SetPoint (point1, anchor_frame, point2)
got_anchor = button
self.firstIcon = button
end
self.lastIcon = button
button:SetParent (self.baseframe)
@@ -4278,6 +4309,16 @@ function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report,
button:Show()
button:SetSize (16*size, 16*size)
if (shadow) then
button:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons_shadow]])
button:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons_shadow]])
button:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons_shadow]])
else
button:SetNormalTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
button:SetHighlightTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
button:SetPushedTexture ([[Interface\AddOns\Details\images\toolbar_icons]])
end
else
button:Hide()
end
@@ -4287,27 +4328,35 @@ function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report,
--> plugins buttons
if (self:IsLowerInstance()) then
if (#_detalhes.ToolBar.Shown > 0) then
local last_plugin_icon
for index, button in ipairs (_detalhes.ToolBar.Shown) do
button:ClearAllPoints()
if (got_anchor) then
if (self.plugins_grow_direction == 2) then --right (default)
if (self.lastIcon == buttons[4]) then
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right", 2, 0) --, button.x, button.y
else
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right") --, button.x, button.y
if (self.plugins_grow_direction == 2) then --right
if (self.menu_anchor.side == 1) then --left
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right")
elseif (self.menu_anchor.side == 2) then --right
button:SetPoint ("left", last_plugin_icon or self.firstIcon.widget or self.firstIcon, "right")
end
elseif (self.plugins_grow_direction == 1) then --left
if (index == 1) then
button:SetPoint ("right", got_anchor.widget or got_anchor, "left") --, button.x, button.y
else
button:SetPoint ("right", self.lastIcon.widget or self.lastIcon, "left") --, button.x, button.y
if (self.menu_anchor.side == 1) then --left
button:SetPoint ("right", last_plugin_icon or self.firstIcon.widget or self.firstIcon, "left")
elseif (self.menu_anchor.side == 2) then --right
button:SetPoint ("right", self.lastIcon.widget or self.lastIcon, "left")
end
end
else
button:SetPoint (point1, anchor_frame, point2)
self.firstIcon = button
got_anchor = button
end
self.lastIcon = button
last_plugin_icon = button
button:SetParent (self.baseframe)
button:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1)
button:Show()
@@ -4322,96 +4371,7 @@ function _detalhes:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report,
end
function _detalhes:ToolbarMenuButtons (_mode, _segment, _attributes, _report)
if (true) then
return self:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report)
end
if (_mode == nil) then
_mode = self.menu_icons[1]
end
if (_segment == nil) then
_segment = self.menu_icons[2]
end
if (_attributes == nil) then
_attributes = self.menu_icons[3]
end
if (_report == nil) then
_report = self.menu_icons[4]
end
self.menu_icons[1] = _mode
self.menu_icons[2] = _segment
self.menu_icons[3] = _attributes
self.menu_icons[4] = _report
local buttons = {self.baseframe.cabecalho.modo_selecao, self.baseframe.cabecalho.segmento, self.baseframe.cabecalho.atributo, self.baseframe.cabecalho.report}
local anchor_frame, point1, point2 = self:GetMenuAnchorPoint()
local got_anchor = false
self.lastIcon = nil
local size = self.menu_icons_size
--> normal buttons
for index, button in _ipairs (buttons) do
if (self.menu_icons [index]) then
button:ClearAllPoints()
if (got_anchor) then
button:SetPoint ("left", self.lastIcon, "right")
else
button:SetPoint (point1, anchor_frame, point2)
got_anchor = button
end
self.lastIcon = button
button:SetParent (self.baseframe)
button:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1)
button:Show()
if (buttons[4] == button) then
button:SetSize (8*size, 16*size)
else
button:SetSize (16*size, 16*size)
end
else
button:Hide()
end
end
--> plugins buttons
if (self:IsLowerInstance()) then
if (#_detalhes.ToolBar.Shown > 0) then
for index, button in ipairs (_detalhes.ToolBar.Shown) do
button:ClearAllPoints()
if (got_anchor) then
if (self.plugins_grow_direction == 2) then --right (default)
if (self.lastIcon == buttons[4]) then
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right", 2, 0) --, button.x, button.y
else
button:SetPoint ("left", self.lastIcon.widget or self.lastIcon, "right") --, button.x, button.y
end
elseif (self.plugins_grow_direction == 1) then --left
if (index == 1) then
button:SetPoint ("right", got_anchor.widget or got_anchor, "left") --, button.x, button.y
else
button:SetPoint ("right", self.lastIcon.widget or self.lastIcon, "left") --, button.x, button.y
end
end
else
button:SetPoint (point1, anchor_frame, point2)
got_anchor = button
end
self.lastIcon = button
button:SetParent (self.baseframe)
button:SetFrameLevel (self.baseframe.UPFrame:GetFrameLevel()+1)
button:Show()
button:SetSize (16*size, 16*size)
end
end
end
return true
return self:ToolbarMenuSetButtons (_mode, _segment, _attributes, _report)
end
local parameters_table = {}
Binary file not shown.
Binary file not shown.
@@ -212,6 +212,8 @@ local function CreatePluginFrames (data)
local Threater = function()
local options = ThreatMeter.options
if (ThreatMeter.Actived and UnitExists ("target") and not _UnitIsFriend ("player", "target")) then
if (_IsInRaid()) then
for i = 1, _GetNumGroupMembers(), 1 do
@@ -370,9 +372,6 @@ local function CreatePluginFrames (data)
local role = threat_actor [4]
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
--local color = RAID_CLASS_COLORS [threat_actor [5]]
--thisRow.textleft:SetTextColor (color.r, color.g, color.b)
thisRow:SetLeftText (threat_actor [1])
local pct = threat_actor [2]
@@ -380,8 +379,16 @@ local function CreatePluginFrames (data)
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", pct) .. "%)")
thisRow:SetValue (pct)
if (ThreatMeter.options.useplayercolor and threat_actor [1] == player) then
thisRow:SetColor (_unpack (ThreatMeter.options.playercolor))
if (options.useplayercolor and threat_actor [1] == player) then
thisRow:SetColor (_unpack (options.playercolor))
elseif (options.useclasscolors) then
local color = RAID_CLASS_COLORS [threat_actor [5]]
if (color) then
thisRow:SetColor (color.r, color.g, color.b)
else
thisRow:SetColor (1, 1, 1, 1)
end
else
if (index == 2) then
thisRow:SetColor (pct*0.01, _math_abs (pct-100)*0.01, 0, 1)
@@ -418,8 +425,8 @@ local function CreatePluginFrames (data)
thisRow._icon:SetTexCoord (_unpack (RoleIconCoord [role]))
thisRow:SetRightText (ThreatMeter:ToK2 (threat_actor [6]) .. " (" .. _cstr ("%.1f", threat_actor [2]) .. "%)")
thisRow:SetValue (threat_actor [2])
if (ThreatMeter.options.useplayercolor) then
thisRow:SetColor (_unpack (ThreatMeter.options.playercolor))
if (options.useplayercolor) then
thisRow:SetColor (_unpack (options.playercolor))
else
thisRow:SetColor (threat_actor [2]*0.01, _math_abs (threat_actor [2]-100)*0.01, 0, .3)
end
@@ -562,6 +569,13 @@ local build_options_panel = function()
desc = "If Player Color is enabled, your bar have this color.",
name = "Color"
},
{
type = "toggle",
get = function() return ThreatMeter.saveddata.useclasscolors end,
set = function (self, fixedparam, value) ThreatMeter.saveddata.useclasscolors = value end,
desc = "When enabled, threat bars uses the class color of the character.",
name = "Use Class Colors"
},
}
_detalhes.gump:BuildMenu (options_frame, menu, 15, -65, 260)
@@ -602,7 +616,7 @@ function ThreatMeter:OnEvent (_, event, ...)
local MINIMAL_DETAILS_VERSION_REQUIRED = 1
--> Install
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.06")
local install, saveddata = _G._detalhes:InstallPlugin ("RAID", Loc ["STRING_PLUGIN_NAME"], "Interface\\Icons\\Ability_Paladin_ShieldofVengeance", ThreatMeter, "DETAILS_PLUGIN_TINY_THREAT", MINIMAL_DETAILS_VERSION_REQUIRED, "Details! Team", "v1.07")
if (type (install) == "table" and install.error) then
print (install.error)
end
@@ -627,6 +641,7 @@ function ThreatMeter:OnEvent (_, event, ...)
ThreatMeter.saveddata.showamount = ThreatMeter.saveddata.showamount or false
ThreatMeter.saveddata.useplayercolor = ThreatMeter.saveddata.useplayercolor or false
ThreatMeter.saveddata.playercolor = ThreatMeter.saveddata.playercolor or {1, 1, 1}
ThreatMeter.saveddata.useclasscolors = ThreatMeter.saveddata.useclasscolors or false
ThreatMeter.options = ThreatMeter.saveddata