From 4882b39a2c370ec196ab4e759acda140c68e2e36 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Wed, 19 May 2021 20:23:16 -0300 Subject: [PATCH] Added option for arena colors --- frames/window_currentdps.lua | 3 +++ frames/window_options2_sections.lua | 35 ++++++++++++++++++++++++++++- startup.lua | 5 ----- 3 files changed, 37 insertions(+), 6 deletions(-) diff --git a/frames/window_currentdps.lua b/frames/window_currentdps.lua index e1490766..792f00f0 100644 --- a/frames/window_currentdps.lua +++ b/frames/window_currentdps.lua @@ -389,6 +389,9 @@ function Details:CreateCurrentDpsFrame(parent, name) labelYellowTeam_DPS:SetPoint ("right", barFrame.splitBar.widget, "right", -4, 0) function f.SwapArenaTeamColors() + green_team_color = Details.class_colors.ARENA_GREEN + yellow_team_color = Details.class_colors.ARENA_YELLOW + if (f.PlayerTeam == 0) then labelPlayerTeam:SetTextColor (unpack (yellow_team_color)) labelYellowTeam:SetTextColor (unpack (green_team_color)) diff --git a/frames/window_options2_sections.lua b/frames/window_options2_sections.lua index a6b18c35..b3a7fdfa 100644 --- a/frames/window_options2_sections.lua +++ b/frames/window_options2_sections.lua @@ -1327,6 +1327,39 @@ do desc = Loc ["STRING_OPTIONS_BAR_COLORBYCLASS_DESC"], }, + {type = "blank"}, + {type = "label", get = function() return "Arena Team Color" end, text_template = subSectionTitleTextTemplate}, + {--team 1 color + type = "color", + get = function() + local r, g, b = unpack(Details.class_colors.ARENA_GREEN) + return {r, g, b, 1} + end, + set = function (self, r, g, b, a) + Details.class_colors.ARENA_GREEN[1] = r + Details.class_colors.ARENA_GREEN[2] = g + Details.class_colors.ARENA_GREEN[3] = b + afterUpdate() + end, + name = Loc ["STRING_COLOR"], + desc = "Arena team color", + }, + {--team 2 color + type = "color", + get = function() + local r, g, b = unpack(Details.class_colors.ARENA_YELLOW) + return {r, g, b, 1} + end, + set = function (self, r, g, b, a) + Details.class_colors.ARENA_YELLOW[1] = r + Details.class_colors.ARENA_YELLOW[2] = g + Details.class_colors.ARENA_YELLOW[3] = b + afterUpdate() + end, + name = Loc ["STRING_COLOR"], + desc = "Arena team color", + }, + {type = "breakline"}, {type = "label", get = function() return Loc ["STRING_OPTIONS_TEXT_ROWICONS_ANCHOR"] end, text_template = subSectionTitleTextTemplate}, @@ -1530,7 +1563,7 @@ do }, } - DF:BuildMenu(sectionFrame, sectionOptions, startX, startY-20, heightSize, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) + DF:BuildMenu(sectionFrame, sectionOptions, startX, startY-20, heightSize+20, true, options_text_template, options_dropdown_template, options_switch_template, true, options_slider_template, options_button_template) end tinsert(Details.optionsSection, buildSection) diff --git a/startup.lua b/startup.lua index c8f45c5a..77ec15f5 100644 --- a/startup.lua +++ b/startup.lua @@ -465,11 +465,6 @@ function Details:StartMeUp() --I'll never stop! --coach feature startup Details.Coach.StartUp() - --make the green color in arena be purple - Details.class_colors.ARENA_GREEN[1] = 175/255 --r - Details.class_colors.ARENA_GREEN[2] = 98/255 --g - Details.class_colors.ARENA_GREEN[3] = 255/255 --b - --force the group edit be always enabled when Details! starts _detalhes.options_group_edit = true