Scaling fixes; Added player bar color
This commit is contained in:
@@ -6,11 +6,12 @@ local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details")
|
||||
|
||||
--> config bookmarks
|
||||
function Details:OpenBookmarkConfig()
|
||||
|
||||
|
||||
if (not _G.DetailsBookmarkManager) then
|
||||
DF:CreateSimplePanel (UIParent, 465, 460, Loc ["STRING_OPTIONS_MANAGE_BOOKMARKS"], "DetailsBookmarkManager")
|
||||
local panel = _G.DetailsBookmarkManager
|
||||
DF:ApplyStandardBackdrop (panel)
|
||||
DF:ApplyStandardBackdrop(panel)
|
||||
panel:SetBackdropColor(.1, .1, .1, .9)
|
||||
panel.blocks = {}
|
||||
|
||||
local clear_func = function (self, button, id)
|
||||
@@ -139,6 +140,14 @@ function Details:OpenBookmarkConfig()
|
||||
end
|
||||
end
|
||||
|
||||
_G.DetailsBookmarkManager:Show()
|
||||
_G.DetailsBookmarkManager:Refresh()
|
||||
local bookmarkFrame = _G.DetailsBookmarkManager
|
||||
bookmarkFrame:Show()
|
||||
bookmarkFrame:Refresh()
|
||||
|
||||
local optionsFrame = _G.DetailsOptionsWindow
|
||||
if (optionsFrame) then
|
||||
--parent is the plugin container
|
||||
local currentOptionsScale = optionsFrame:GetParent():GetScale()
|
||||
bookmarkFrame:SetScale(currentOptionsScale)
|
||||
end
|
||||
end
|
||||
@@ -9,15 +9,16 @@ function Details:OpenClassColorsConfig()
|
||||
if (not _G.DetailsClassColorManager) then
|
||||
DF:CreateSimplePanel (UIParent, 300, 425, Loc ["STRING_OPTIONS_CLASSCOLOR_MODIFY"], "DetailsClassColorManager")
|
||||
local panel = _G.DetailsClassColorManager
|
||||
|
||||
DF:ApplyStandardBackdrop (panel)
|
||||
|
||||
|
||||
DF:ApplyStandardBackdrop(panel)
|
||||
panel:SetBackdropColor(.1, .1, .1, .9)
|
||||
|
||||
local upper_panel = CreateFrame ("frame", nil, panel,"BackdropTemplate")
|
||||
upper_panel:SetAllPoints (panel)
|
||||
upper_panel:SetFrameLevel (panel:GetFrameLevel()+3)
|
||||
|
||||
|
||||
local y = -50
|
||||
|
||||
|
||||
local callback = function (button, r, g, b, a, self)
|
||||
self.MyObject.my_texture:SetVertexColor (r, g, b)
|
||||
Details.class_colors [self.MyObject.my_class][1] = r
|
||||
@@ -50,40 +51,45 @@ function Details:OpenClassColorsConfig()
|
||||
local on_leave = function (self, capsule)
|
||||
--GameCooltip:Hide()
|
||||
end
|
||||
|
||||
local reset = DF:NewLabel (panel, panel, nil, nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:" .. 20 .. ":" .. 20 .. ":0:1:512:512:8:70:328:409|t " .. Loc ["STRING_OPTIONS_CLASSCOLOR_RESET"])
|
||||
reset:SetPoint ("bottomright", panel, "bottomright", -23, 08)
|
||||
local reset_texture = DF:CreateImage (panel, [[Interface\MONEYFRAME\UI-MONEYFRAME-BORDER]], 138, 45, "border")
|
||||
reset_texture:SetPoint ("center", reset, "center", 0, -7)
|
||||
reset_texture:SetDesaturated (true)
|
||||
|
||||
|
||||
local reset = DF:NewLabel(panel, panel, nil, nil, "|TInterface\\TUTORIALFRAME\\UI-TUTORIAL-FRAME:" .. 20 .. ":" .. 20 .. ":0:1:512:512:8:70:328:409|t " .. Loc ["STRING_OPTIONS_CLASSCOLOR_RESET"])
|
||||
reset:SetPoint("bottomright", panel, "bottomright", -23, 08)
|
||||
|
||||
local reset_texture = DF:CreateImage(panel, [[Interface\MONEYFRAME\UI-MONEYFRAME-BORDER]], 138, 45, "border")
|
||||
reset_texture:SetPoint("center", reset, "center", 0, -7)
|
||||
reset_texture:SetDesaturated(true)
|
||||
|
||||
panel.buttons = {}
|
||||
|
||||
for index, class_name in ipairs (CLASS_SORT_ORDER) do
|
||||
|
||||
local icon = DF:CreateImage (upper_panel, [[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]], 32, 32, nil, CLASS_ICON_TCOORDS [class_name], "icon_" .. class_name)
|
||||
|
||||
|
||||
for index, className in ipairs(CLASS_SORT_ORDER) do
|
||||
local icon = DF:CreateImage (upper_panel, [[Interface\Glues\CHARACTERCREATE\UI-CHARACTERCREATE-CLASSES]], 32, 32, nil, CLASS_ICON_TCOORDS [className], "icon_" .. className)
|
||||
|
||||
if (index%2 ~= 0) then
|
||||
icon:SetPoint (10, y)
|
||||
icon:SetPoint(10, y)
|
||||
else
|
||||
icon:SetPoint (150, y)
|
||||
icon:SetPoint(150, y)
|
||||
y = y - 33
|
||||
end
|
||||
|
||||
local bg_texture = DF:CreateImage (panel, [[Interface\AddOns\Details\images\bar_skyline]], 135, 30, "artwork")
|
||||
bg_texture:SetPoint ("left", icon, "right", -32, 0)
|
||||
|
||||
local button = DF:CreateButton (panel, set_color, 135, 30, "set color", class_name, index)
|
||||
button:SetPoint ("left", icon, "right", -32, 0)
|
||||
button:InstallCustomTexture (nil, nil, nil, nil, true)
|
||||
|
||||
local backgroundTexture = DF:CreateImage(panel, [[Interface\AddOns\Details\images\bar_skyline]], 135, 30, "artwork")
|
||||
backgroundTexture:SetPoint("left", icon, "right", -32, 0)
|
||||
|
||||
local button = DF:CreateButton(panel, set_color, 135, 30, className, className, index)
|
||||
button:SetPoint("left", icon, "right", -32, 0)
|
||||
button:InstallCustomTexture(nil, nil, nil, nil, true)
|
||||
button:SetFrameLevel (panel:GetFrameLevel()+1)
|
||||
|
||||
button.text_overlay:ClearAllPoints()
|
||||
button.text_overlay:SetPoint("left", icon.widget, "right", 2, 0)
|
||||
button.text_overlay.textsize = 10
|
||||
|
||||
button.my_icon = icon
|
||||
button.my_texture = bg_texture
|
||||
button.my_class = class_name
|
||||
button.my_texture = backgroundTexture
|
||||
button.my_class = className
|
||||
button:SetHook ("OnEnter", on_enter)
|
||||
button:SetHook ("OnLeave", on_leave)
|
||||
button:SetClickFunction (reset_color, nil, nil, "RightClick")
|
||||
panel.buttons [class_name] = button
|
||||
panel.buttons [className] = button
|
||||
end
|
||||
|
||||
--make color options for death log bars
|
||||
@@ -177,15 +183,32 @@ function Details:OpenClassColorsConfig()
|
||||
desc = "Debuff",
|
||||
},
|
||||
}
|
||||
DetailsFramework:BuildMenu(panel, deathLogOptions, 5, -285, 700, true)
|
||||
|
||||
--templates
|
||||
local options_text_template = DF:GetTemplate ("font", "OPTIONS_FONT_TEMPLATE")
|
||||
local options_dropdown_template = DF:GetTemplate ("dropdown", "OPTIONS_DROPDOWN_TEMPLATE")
|
||||
local options_switch_template = DF:GetTemplate ("switch", "OPTIONS_CHECKBOX_TEMPLATE")
|
||||
local options_slider_template = DF:GetTemplate ("slider", "OPTIONS_SLIDER_TEMPLATE")
|
||||
local options_button_template = DF:GetTemplate ("button", "OPTIONS_BUTTON_TEMPLATE")
|
||||
|
||||
DetailsFramework:BuildMenu(panel, deathLogOptions, 5, -285, 700, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template)
|
||||
|
||||
local deathLogColorsLabel = DF:CreateLabel(panel, "Colors on Death Log:", 12, "yellow")
|
||||
deathLogColorsLabel:SetPoint("topleft", panel, "topleft", 5, -265)
|
||||
end
|
||||
|
||||
|
||||
for class, button in pairs (_G.DetailsClassColorManager.buttons) do
|
||||
button.my_texture:SetVertexColor (unpack (Details.class_colors [class]))
|
||||
end
|
||||
|
||||
_G.DetailsClassColorManager:Show()
|
||||
|
||||
|
||||
local colorWindow = _G.DetailsClassColorManager
|
||||
colorWindow:Show()
|
||||
|
||||
local optionsFrame = _G.DetailsOptionsWindow
|
||||
if (optionsFrame) then
|
||||
--parent is the plugin container
|
||||
local currentOptionsScale = optionsFrame:GetParent():GetScale()
|
||||
colorWindow:SetScale(currentOptionsScale)
|
||||
end
|
||||
end
|
||||
@@ -6,14 +6,14 @@ end
|
||||
local Details = _G.Details
|
||||
local DF = _G.DetailsFramework
|
||||
local Loc = _G.LibStub("AceLocale-3.0"):GetLocale("Details")
|
||||
local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0")
|
||||
local LDB = _G.LibStub ("LibDataBroker-1.1", true)
|
||||
local LDBIcon = LDB and _G.LibStub("LibDBIcon-1.0", true)
|
||||
--local SharedMedia = _G.LibStub:GetLibrary("LibSharedMedia-3.0")
|
||||
--local LDB = _G.LibStub ("LibDataBroker-1.1", true)
|
||||
--local LDBIcon = LDB and _G.LibStub("LibDBIcon-1.0", true)
|
||||
|
||||
--options panel namespace
|
||||
Details.options = {}
|
||||
|
||||
local tinsert = _G.tinsert
|
||||
--local tinsert = _G.tinsert
|
||||
local unpack = _G.unpack
|
||||
local CreateFrame = _G.CreateFrame
|
||||
local UIParent = _G.UIParent
|
||||
@@ -48,40 +48,27 @@ function Details.options.InitializeOptionsWindow(instance)
|
||||
f.__name = "Options"
|
||||
f.real_name = "DETAILS_OPTIONS"
|
||||
f.__icon = [[Interface\Scenarios\ScenarioIcon-Interact]]
|
||||
_G.DetailsPluginContainerWindow.EmbedPlugin (f, f, true)
|
||||
_G.DetailsPluginContainerWindow.EmbedPlugin(f, f, true)
|
||||
f.sectionFramesContainer = {}
|
||||
Details:FormatBackground(f)
|
||||
|
||||
DF:ApplyStandardBackdrop (f)
|
||||
DF:ApplyStandardBackdrop(f)
|
||||
local titleBar = DF:CreateTitleBar(f, "Options Panel")
|
||||
titleBar.Text:Hide()
|
||||
|
||||
local titleText = DF:NewLabel(titleBar, nil, "$parentTitleLabel", "title", "Details! " .. Loc ["STRING_OPTIONS_WINDOW"], "GameFontHighlightLeft", 12, {227/255, 186/255, 4/255})
|
||||
titleText:SetPoint("center", titleBar, "center")
|
||||
--titleText:SetPoint("top", f, "top", 0, -8)
|
||||
|
||||
f:Hide()
|
||||
|
||||
DF:CreateScaleBar(DetailsOptionsWindow, Details.options_window)
|
||||
DetailsOptionsWindow:SetScale (Details.options_window.scale)
|
||||
|
||||
--[=[]]
|
||||
local closeButton = CreateFrame("button", "DetailsOptionsWindowCloseButton", DetailsOptionsWindow.widget, "UIPanelCloseButton")
|
||||
closeButton:SetWidth(32)
|
||||
closeButton:SetHeight(32)
|
||||
--closeButton:SetPoint("TOPRIGHT", DetailsOptionsWindow.widget, "TOPRIGHT", 0, 0)
|
||||
closeButton:SetText("X")
|
||||
closeButton:SetFrameLevel(closeButton:GetFrameLevel()+2)
|
||||
--]=]
|
||||
|
||||
--select the instance to edit
|
||||
local onSelectInstance = function (_, _, instanceId)
|
||||
local instance = _detalhes.tabela_instancias[instanceId]
|
||||
|
||||
|
||||
if (not instance:IsEnabled() or not instance:IsStarted()) then
|
||||
_detalhes.CriarInstancia (_, _, instance.meu_id)
|
||||
end
|
||||
|
||||
|
||||
Details.options.SetCurrentInstance(instance)
|
||||
f.updateMicroFrames()
|
||||
end
|
||||
|
||||
@@ -561,6 +561,8 @@ do
|
||||
desc = Loc ["STRING_OPTIONS_WC_BOOKMARK_DESC"],
|
||||
},
|
||||
|
||||
{type = "blank"},
|
||||
|
||||
{--click through
|
||||
type = "toggle",
|
||||
get = function() return currentInstance.clickthrough_window end,
|
||||
@@ -583,6 +585,32 @@ do
|
||||
},
|
||||
|
||||
{type = "blank"},
|
||||
|
||||
{type = "label", get = function() return "Immersion" end, text_template = subSectionTitleTextTemplate}, --localize-me
|
||||
{--show pets when solo
|
||||
type = "toggle",
|
||||
get = function() return Details.immersion_pets_on_solo_play end,
|
||||
set = function (self, fixedparam, value)
|
||||
Details.immersion_pets_on_solo_play = value
|
||||
afterUpdate()
|
||||
end,
|
||||
name = "Show pets when solo", --localize-me
|
||||
desc = "Show pets when solo",
|
||||
},
|
||||
|
||||
{--always show players even on stardard mode
|
||||
type = "toggle",
|
||||
get = function() return _detalhes.all_players_are_group end,
|
||||
set = function (self, fixedparam, value)
|
||||
_detalhes.all_players_are_group = value
|
||||
afterUpdate()
|
||||
end,
|
||||
name = Loc ["STRING_OPTIONS_ALWAYSSHOWPLAYERS"],
|
||||
desc = Loc ["STRING_OPTIONS_ALWAYSSHOWPLAYERS_DESC"],
|
||||
},
|
||||
|
||||
|
||||
{type = "breakline"},
|
||||
{type = "label", get = function() return Loc ["STRING_OPTIONS_SOCIAL"] end, text_template = subSectionTitleTextTemplate},
|
||||
{--nickname
|
||||
type = "textentry",
|
||||
@@ -632,28 +660,33 @@ do
|
||||
},
|
||||
|
||||
{type = "blank"},
|
||||
{type = "label", get = function() return "Your Self" end, text_template = subSectionTitleTextTemplate},
|
||||
|
||||
{type = "label", get = function() return "Immersion" end, text_template = subSectionTitleTextTemplate}, --localize-me
|
||||
{--show pets when solo
|
||||
{--player bar color toggle
|
||||
type = "toggle",
|
||||
get = function() return Details.immersion_pets_on_solo_play end,
|
||||
get = function() return Details.use_self_color end,
|
||||
set = function (self, fixedparam, value)
|
||||
Details.immersion_pets_on_solo_play = value
|
||||
Details.use_self_color = value
|
||||
afterUpdate()
|
||||
end,
|
||||
name = "Show pets when solo", --localize-me
|
||||
desc = "Show pets when solo",
|
||||
name = "Use Different Color for You",
|
||||
desc = "Use a different color on your own bar",
|
||||
},
|
||||
|
||||
{--always show players even on stardard mode
|
||||
type = "toggle",
|
||||
get = function() return _detalhes.all_players_are_group end,
|
||||
set = function (self, fixedparam, value)
|
||||
_detalhes.all_players_are_group = value
|
||||
{--player bar color
|
||||
type = "color",
|
||||
get = function()
|
||||
local r, g, b = unpack(Details.class_colors.SELF)
|
||||
return {r, g, b, 1}
|
||||
end,
|
||||
set = function (self, r, g, b, a)
|
||||
Details.class_colors.SELF[1] = r
|
||||
Details.class_colors.SELF[2] = g
|
||||
Details.class_colors.SELF[3] = b
|
||||
afterUpdate()
|
||||
end,
|
||||
name = Loc ["STRING_OPTIONS_ALWAYSSHOWPLAYERS"],
|
||||
desc = Loc ["STRING_OPTIONS_ALWAYSSHOWPLAYERS_DESC"],
|
||||
end,
|
||||
name = "Your Bar Color",
|
||||
desc = "Your Bar Color",
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
self.totalStatusBar:SetMinMaxValues(0, topResult)
|
||||
self.totalStatusBar:SetValue(self.playerObject.total)
|
||||
end
|
||||
|
||||
|
||||
local createPlayerLine = function(self, index)
|
||||
--create a new line
|
||||
local line = _G.CreateFrame("button", "$parentLine" .. index, self, "BackdropTemplate")
|
||||
@@ -132,20 +132,22 @@
|
||||
line:SetPoint("topleft", self, "topleft", 1, -((index-1) * (player_line_height+1)) - 1)
|
||||
line:SetSize(scrollbox_size[1]-19, player_line_height)
|
||||
line:RegisterForClicks("LeftButtonDown", "RightButtonDown")
|
||||
|
||||
|
||||
line:SetScript("OnEnter", lineOnEnter)
|
||||
line:SetScript("OnLeave", lineOnLeave)
|
||||
line:SetScript("OnClick", lineOnClick)
|
||||
|
||||
|
||||
line:SetBackdrop({bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true, edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1})
|
||||
line:SetBackdropColor(unpack (scrollbox_line_backdrop_color))
|
||||
line:SetBackdropBorderColor(0, 0, 0, 1)
|
||||
|
||||
|
||||
local specIcon = line:CreateTexture("$parentSpecIcon", "artwork")
|
||||
specIcon:SetSize (player_line_height, player_line_height)
|
||||
specIcon:SetSize(player_line_height, player_line_height)
|
||||
specIcon:SetAlpha(0.71)
|
||||
local roleIcon = line:CreateTexture("$parentRoleIcon", "overlay")
|
||||
roleIcon:SetSize ((player_line_height-2) / 2, (player_line_height-2) / 2)
|
||||
|
||||
roleIcon:SetSize((player_line_height-2) / 2, (player_line_height-2) / 2)
|
||||
roleIcon:SetAlpha(0.71)
|
||||
|
||||
local playerName = DF:CreateLabel(line, "", "GameFontNormal")
|
||||
playerName.textcolor = {1, 1, 1, .9}
|
||||
playerName.textsize = 11
|
||||
|
||||
Reference in New Issue
Block a user