diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua index 15a5621..e86f091 100644 --- a/Titan/TitanConfig.lua +++ b/Titan/TitanConfig.lua @@ -27,11 +27,21 @@ Highlight - notes. tips. and details --]] local notes = "" - ..TitanUtils_GetRedText("NOTE : ") ..TitanUtils_GetNormalText("" - .."The menu & bag frame and the status / xp frame ARE adjustable via edit mode in 10.00.05. The ability to adjust the menu & bag frame and the status / xp frame *vertically only* will be removed soon.\n" + .."- Adjusting the menu & bag frame and the status / xp frame have been removed.\n" + .."\n" + .."- Titan Bag : Opening bags is still an option until taint issue is resolved.\n" ) local changes = "" +do -- recent change history +changes = changes + ..TitanUtils_GetGoldText("7.00.02.100007 : 2023/03/31\n") + ..TitanUtils_GetGreenText("Titan : \n") + ..TitanUtils_GetHighlightText("" + .."- Beta Release\n" + .."- Update for API changes in 10.1.\n" + ) + .."\n\n" ..TitanUtils_GetGoldText("6.00.16.100100 : 2023/05/03\n") ..TitanUtils_GetGreenText("Titan : \n") ..TitanUtils_GetHighlightText("" @@ -46,12 +56,39 @@ local changes = "" .."- Update for changes Blizzard made API routine which get Addon meta data.\n" ) .."\n\n" - ..TitanUtils_GetGoldText("6.00.14.100007 : 2023/03/29\n") - ..TitanUtils_GetGoldText("6.00.13.100007 : 2023/03/20\n") + ..TitanUtils_GetGoldText("7.00.02.100007 : 2023/03/31\n") ..TitanUtils_GetGreenText("Titan : \n") ..TitanUtils_GetHighlightText("" + .."- Beta on Discord\n" + .."- Update / fix for events appearing before Bars are initialized.\n" + ) + .."\n\n" + ..TitanUtils_GetGoldText("7.00.01.100007 : 2023/03/31\n") + ..TitanUtils_GetGreenText("Titan : \n") + ..TitanUtils_GetHighlightText("" + .."- NEW : 10 Short bars! See new consolidated Configuration > Titan Panel Help for enabling and using.\n" + .."- NEW : Skins OR solid color selectable in Config - Global or per bar. \n" + .."- NEW : Can Hide any Titan bar by right click on the Titan bar (not a plugin) then click Hide.\n" + .."- NEW : Hide in Combat is now selectable in Config - Global or per bar.\n" + .."- NOTE : Solid colors are done via the default color picker. Download an enhanced color picker for more options.\n" + .."- NOTE : Downgrading from Titan 7.xx to 6.xx - Prior to downgrading, move any plugins on a Short bar to one of the original full width Titan Bars or Hide the plugin.\n" + .."--- Titan 6.xx will throw an error IF any plugin is assigned to ANY Short Bar. If Titan throws an error, wipe the Titan saved variables.\n" + .."- Configuration > Bars has a new consolidated config for each Titan bar.\n" + .."- Configuration > Bars All has a new config for options across all Titan bars.\n" + .."- Configuration > Transparency moved into Bars.\n" + .."- Configuration > Titan Panel Help has details on using Titan bars.\n" + .."- Configuration > Skins shows available skins.\n" + .."- Remove adjustment of XP & status bars and Bag & Menu buttons.\n" + .."- Remove unused timers; only LDB timer left.\n" + .."- Internal code cleanup.\n" .."- Update TOC\n" - .."- Back out Short Bar release.\n" + ) + .."\n\n" + ..TitanUtils_GetGoldText("6.00.14.100007 : 2023/03/29\n") + ..TitanUtils_GetGoldText("6.00.13.100005 : 2023/03/20\n") + ..TitanUtils_GetGreenText("Titan : \n") + ..TitanUtils_GetHighlightText("" + .."- Update TOC only to 10.00.07\n" ) .."\n\n" ..TitanUtils_GetGoldText("6.00.12.100005 : 2023/01/31\n") @@ -91,27 +128,29 @@ local changes = "" .."- Labels : Extend custom labels to 2 (second) through 4 (fourth). Plugins should be used / shown at least once, especially if more than one label / value pair is shown by that plugin.\n" ) .."\n\n" +end TITAN_PANEL_CONFIG = { topic = { About = L["TITAN_PANEL"], - top = L["TITAN_PANEL_MENU_TOP_BARS"], + top = L["TITAN_PANEL_MENU_OPTIONS_BARS"], + globals = L["TITAN_PANEL_MENU_OPTIONS_BARS_ALL"], bottom = L["TITAN_PANEL_MENU_BOTTOM_BARS"], plugins = L["TITAN_PANEL_MENU_PLUGINS"], profiles = L["TITAN_PANEL_MENU_PROFILES"], tooltips = L["TITAN_PANEL_MENU_OPTIONS_SHORT"], scale = L["TITAN_UISCALE_MENU_TEXT_SHORT"], - trans = L["TITAN_TRANS_MENU_TEXT_SHORT"], + trans = L["TITAN_TRANS_MENU_TEXT_SHORT"], skins = L["TITAN_PANEL_MENU_TEXTURE_SETTINGS"], skinscust = L["TITAN_SKINS_OPTIONS_CUSTOM"], extras = L["TITAN_PANEL_EXTRAS_SHORT"], attempts = L["TITAN_PANEL_ATTEMPTS_SHORT"], advanced = L["TITAN_PANEL_MENU_ADV"], - changes = (CHANGE or "Change").." "..(HISTORY or "History"), - slash = ("/").." "..(COMMAND or "Command"), + changes = L["TITAN_PANEL_MENU_CHANGE_HISTORY"], + slash = L["TITAN_PANEL_MENU_SLASH_COMMAND"], + help = L["TITAN_PANEL_MENU_HELP"], } } --- TITAN_PANEL_CONFIG.topic.trans -- Titan local helper funcs local function TitanPanel_GetTitle() @@ -142,41 +181,7 @@ local function TitanPanel_GetLicense() return TitanUtils_GetAddOnMetadata(TITAN_ID, "X-License") or L["TITAN_NA"]; end ---[[ local -NAME: TitanAdjustPanelScale -DESC: Set the Titan bars and plugins to the selected scale then adjust other frames as needed. -VAR: scale - the scale the user has selected for Titan -OUT: None ---]] -local function TitanAdjustPanelScale(scale) - TitanPanel_SetScale() - TitanPanel_AdjustFrames(true, "AdjustPanelScale") -end - -- helper functions ---[[ local -NAME: TitanPanel_TicketReload -DESC: When the user changes the option to adjust for the Blizz ticket frame the UI must be reloaded. Ask the user if they want to do it now. -VAR: None -OUT: None ---]] -local function TitanPanel_TicketReload() - StaticPopupDialogs["TITAN_RELOAD"] = { - text = TitanUtils_GetNormalText(L["TITAN_PANEL_MENU_TITLE"]).."\n\n" - ..L["TITAN_PANEL_RELOAD"], - button1 = ACCEPT, - button2 = CANCEL, - OnAccept = function(self) - TitanPanelToggleVar("TicketAdjust"); - ReloadUI(); - end, - showAlert = 1, - timeout = 0, - whileDead = 1, - hideOnEscape = 1 - }; - StaticPopup_Show("TITAN_RELOAD"); -end ------------- -- about config section @@ -190,14 +195,24 @@ local optionsControl = { type = "group", args = { confgendesc = { + name = "About", order = 1, - type = "description", --- name = L["TITAN_PANEL_CONFIG_MAIN_LABEL"].."\n\n", - name = "" - .."Titan Panel is an Interface Enhancement addon." - .."\n" - .."This addon does not interfere with, enhance, or replace any of your actual gameplay within the game. Titan Panel is meant to give you a quick visual point or click-on access to see the data related to your character without having to open other dialog boxes in the game or, in some cases, other addons. There are points we allow you to customize these features, but they do not relate directly to your gameplay. Our main program allows you to add bars to the top and bottom of your game screen. Over the years, we have been able to add some other features, but only if they do not interfere with your actual game experience.", - cmdHidden = true + type = "group", inline = true, + args = { + confdesc = { + order = 1, + type = "description", + name = "" + .."Titan Panel is an Interface Enhancement addon which allows you to add short display bars to the UI as well as the top and bottom of your game screen." + .."\n\n" + .."This addon does not interfere with, enhance, or replace any of your actual gameplay within the game. Titan Panel is meant to give you a quick visual point or click-on access to see the data related to your character without having to open other dialog boxes in the game or, in some cases, other addons." + .."\n\n" + .."Our main program allows you to add bars to the UI as well as the top and bottom of your game screen." + .."\n\n" + .."Over the years, we have been able to add some other features, but only if they do not interfere with your actual game experience.", + cmdHidden = true + }, + } }, confnotes = { name = "Notes", @@ -293,84 +308,95 @@ local optionsControl = { ------------- ------------- --- transparency config section --[[ local -NAME: optionsTrans -DESC: Local table to hold the Titan transparency options. Each bar and the tooltip can be set to a different transparancy setting. -This is the starting shell -- the option description -- add the tooltip transparency (at the bottom of the options screen) -- the code for each bar will be added via another routine. -:DESC +NAME: optionsSkins +DESC: Local table to hold the Titan skins options. Shows default Titan and any custom skins the user has added. --]] -local optionsTrans = { - name = TITAN_PANEL_CONFIG.topic.trans, --L["TITAN_TRANS_MENU_TEXT"], - type = "group", - args = { - confdesc = { - order = 1, - type = "description", - name = L["TITAN_TRANS_MENU_DESC"].."\n", - cmdHidden = true - }, - }, - } +local optionsSkins = { + name = TITAN_PANEL_CONFIG.topic.skins, + type = "group", + args = { + } +} ---[[ local -NAME: TitanPanel_TransOptions -DESC: This will add each Titan bar to the transparency option table so it can be adjusted by the user. Each bar is shown whether ot not the user has them displayed. -VAR: args - the table holding the Titan option data -OUT: None +-- skins config section + +local function Show_Skins(t, position) +--[[ + table.sort(TitanSkins, function(a, b) + return string.lower(TitanSkins[a].name) + < string.lower(TitanSkins[b].name) + end) --]] -local function TitanPanel_TransOptions(args) - local bar = "" - local bar_name = "" - local var = "" - local vert = nil - local position - for idx,v in pairs (TitanBarData) do - bar = TitanBarData[idx].name - vert = TitanBarData[idx].vert - position = TitanBarData[idx].order + 10 - var = bar.."_Transparency" - bar_name = TITAN_PANEL_DISPLAY_PREFIX..bar - args[bar_name] = { - name = TitanBarData[idx].locale_name, - desc = "", - order = position, type = "range", width = "full", - min = 0, max = 1, step = 0.01, - get = function(info) - local bar = TitanBarData[info[1]].name - return TitanPanelGetVar(bar.."_Transparency") - end, - set = function(info, a) - local bar = TitanBarData[info[1]].name - _G[info[1]]:SetAlpha(a) - TitanPanelSetVar(bar.."_Transparency", a); - end, + local skin = "Skin" + for idx, v in pairs (TitanSkins) do + + position = position + 1 -- spacer + t[skin..position] = { + type = "header", + name = "", + order = position, width = "full", + } + + position = position + 1 -- Name of skin (col 1) + t[skin..position] = { + type = "description", + name = "|cff19ff19"..v.name.."|r", + order = position, width = "30", + } + + position = position + 1 -- Top image (col 2) + t[skin..position] = { + type = "description", + name = "", + image = v.path.."TitanPanelBackgroundTop0", + imageWidth = 256, + order = position, width = "50", + } + + position = position + 1 -- spacer + t[skin..position] = { + type = "description", + name = "", imageHeight = 0, + order = position, width = "full", + } + + position = position + 1 -- Bottom (col 1) + t[skin..position] = { + type = "description", + name = "", + order = position, width = "30", + } + position = position + 1 -- Bottom image (col 2) + t[skin..position] = { + type = "description", + name = "", + image = v.path.."TitanPanelBackgroundBottom0", + imageWidth = 256, + order = position, width = "50", + } + + position = position + 1 -- final spacer - bottom of config + t[skin..position] = { + type = "description", + name = "", imageHeight = 0, + order = position, width = "full", } - position = position + 1 end + + position = position + 1 -- final spacer - bottom of config + t[skin..position] = { + type = "description", + name = "", + order = position, width = "full", + } end -------------- -------------- --- skins config section ---[[ local -NAME: TitanPanel_SetCustomTexture -DESC: Update the skin when the user changes it. -VAR: path - the file path to the skin -OUT: None ---]] -local function TitanPanel_SetCustomTexture(path) - if path ~= TitanPanelGetVar("TexturePath") then - TitanPanelSetVar("TexturePath", path); - for idx,v in pairs (TitanBarData) do - TitanPanel_SetTexture( - TITAN_PANEL_DISPLAY_PREFIX..TitanBarData[idx].name, - TITAN_PANEL_PLACE_TOP); - end - end +local function BuildSkins() + optionsSkins.args = {} + + Show_Skins(optionsSkins.args, 100) -- the current list of skins with images + AceConfigRegistry:NotifyChange("Titan Panel Skin Control") end --[[ local @@ -406,69 +432,11 @@ local function TitanPanel_AddNewSkin(skinname, skinpath) if not found then table.insert(TitanSkins, {name = skinname, path = skinpath }) end + + BuildSkins() + end ---[[ local -NAME: optionsSkins -DESC: Local table to hold the Titan skins options. Shows default Titan and any custom skins the user has added. ---]] -local optionsSkins = { - name = TITAN_PANEL_CONFIG.topic.skins, --L["TITAN_SKINS_TITLE"], - type = "group", - args = { - setskinhdear = { - order = 2, - type = "header", - name = L["TITAN_SKINS_SET_HEADER"], - }, - setskinlist = { - order = 3, type = "select", - name = L["TITAN_SKINS_LIST_TITLE"], - desc = L["TITAN_SKINS_SET_DESC"], - get = function() return TitanPanelGetVar("TexturePath") end, - set = function(_,v) - TitanPanel_SetCustomTexture(v) - if TitanSkinToRemove == TitanPanelGetVar("TexturePath") then - TitanSkinToRemove = "None" - end - end, - values = function() - local Skinlist = {} - local v; - for _,v in pairs (TitanSkins) do - if v.path ~= TitanPanelGetVar("TexturePath") then - Skinlist[v.path] = "|cff19ff19"..v.name.."|r" - else - Skinlist[v.path] = "|cffffff9a"..v.name.."|r" - end - end - table.sort(Skinlist, function(a, b) - return string.lower(TitanSkins[a].name) - < string.lower(TitanSkins[b].name) - end) - return Skinlist - end, - }, - nulloption1 = { - order = 5, - type = "description", - name = " ", - cmdHidden = true - }, - resetskinhdear = { - order = 20, - type = "header", - name = L["TITAN_SKINS_RESET_HEADER"], - }, - defaultskins = { - order = 21, - name = L["TITAN_SKINS_RESET_DEFAULTS_TITLE"], type = "execute", - desc = L["TITAN_SKINS_RESET_DEFAULTS_DESC"], - func = function() - TitanSkins = TitanSkinsDefault; - end, - }, - } -} + --[[ local NAME: optionsSkinsCustom DESC: Local table to hold the Titan custom skins options that allow a user to add or delete skins. @@ -592,18 +560,32 @@ local optionsSkinsCustom = { end end, }, - notes_delete = { - order = 23, - type = "description", - name = L["TITAN_SKINS_REMOVE_NOTES"].."\n", - cmdHidden = true - }, nulloption4 = { order = 24, type = "description", name = " ", cmdHidden = true }, + resetskinhdear = { + order = 200, + type = "header", + name = L["TITAN_SKINS_RESET_HEADER"], + }, + defaultskins = { + order = 201, + name = L["TITAN_SKINS_RESET_DEFAULTS_TITLE"], type = "execute", + desc = L["TITAN_SKINS_RESET_DEFAULTS_DESC"], + func = function() + TitanSkins = TitanSkinsDefault; + BuildSkins() + end, + }, + notes_delete = { + order = 999, + type = "description", + name = "\n\n"..L["TITAN_SKINS_REMOVE_NOTES"].."\n", + cmdHidden = true + }, } } ------------- @@ -652,16 +634,16 @@ local optionsUIScale = { min = 0.75, max = 1.25, step = 0.01, get = function() return TitanPanelGetVar("Scale") end, set = function(_, a) - if not InCombatLockdown() then - TitanPanelSetVar("Scale", a) - TitanAdjustPanelScale(a) - end + TitanPanelSetVar("Scale", a) +-- TitanPanel_SetScale() + TitanPanel_InitPanelBarButton("Config scale change "..a) end, disabled = function() if InCombatLockdown() then return true + else + return false end - return false end, }, buttonspacing = { @@ -686,10 +668,20 @@ local optionsUIScale = { TitanPanel_InitPanelButtons(); end, }, + spacer01 = { + type = "description", + name = "\n\n", imageHeight = 0, + order = 10, width = "full", + }, + tooltipdesc = { + order = 20, width = "full", + type = "header", + name = "Tooltip", --L["TITAN_PANEL_MENU_GLOBAL_SKIN_TITLE"], + }, tooltipfont = { name = L["TITAN_UISCALE_CONTROL_TOOLTIP_TOOLTIPFONT"], desc = L["TITAN_UISCALE_TOOLTIP_SLIDER_DESC"], - order = 10, type = "range", width = "full", + order = 21, type = "range", width = "full", min = 0.5, max = 1.3, step = 0.01, get = function() return TitanPanelGetVar("TooltipFont") end, set = function(_, a) @@ -699,16 +691,21 @@ local optionsUIScale = { tooltipfontdisable = { name = L["TITAN_UISCALE_TOOLTIP_DISABLE_TEXT"], desc = L["TITAN_UISCALE_DISABLE_TOOLTIP_DESC"], - order = 11, type = "toggle", width = "full", + order = 22, type = "toggle", width = "full", get = function() return TitanPanelGetVar("DisableTooltipFont") end, set = function() TitanPanelToggleVar("DisableTooltipFont"); end, }, + fontdesc = { + order = 30, width = "full", + type = "header", + name = "Font", --L["TITAN_PANEL_MENU_GLOBAL_SKIN_TITLE"], + }, fontselection = { name = L["TITAN_PANEL_MENU_LSM_FONTS"], desc = L["TITAN_PANEL_MENU_LSM_FONTS_DESC"], - order = 12, type = "select", + order = 31, type = "select", width = "40", dialogControl = "LSM30_Font", get = function() return TitanPanelGetVar("FontName") @@ -719,10 +716,14 @@ local optionsUIScale = { end, values = AceGUIWidgetLSMlists.font, }, + fontspacer = { + order = 32, type = "description", width = "20", + name = " ", + }, fontsize = { name = L["TITAN_PANEL_MENU_FONT_SIZE"], desc = L["TITAN_PANEL_MENU_FONT_SIZE_DESC"], - order = 13, type = "range", + order = 33, type = "range", width = "40", min = 7, max = 15, step = 1, get = function() return TitanPanelGetVar("FontSize") end, set = function(_, v) @@ -730,10 +731,15 @@ local optionsUIScale = { TitanSetPanelFont(TitanPanelGetVar("FontName"), v) end, }, + paneldesc = { + order = 40, width = "full", + type = "header", + name = "Strata", --L["TITAN_PANEL_MENU_GLOBAL_SKIN_TITLE"], + }, panelstrata = { name = L["TITAN_PANEL_MENU_FRAME_STRATA"], desc = L["TITAN_PANEL_MENU_FRAME_STRATA_DESC"], - order = 14, type = "select", + order = 41, type = "select", get = function() return TitanPanelGetVar("FrameStrata") end, @@ -770,252 +776,402 @@ Main (top) controls: :DESC --]] local optionsBars = { - name = TITAN_PANEL_CONFIG.topic.top, --L["TITAN_PANEL_MENU_OPTIONS_MAIN_BARS"], + name = TITAN_PANEL_CONFIG.topic.top, type = "group", args = { - confdesc1 = { - order = 100, - type = "header", - name = L["TITAN_PANEL_MENU_TOP"], - }, - optiontop = { - name = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - desc = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - order = 101, type = "toggle", width = "full", - get = function() return (TitanPanelGetVar("Bar_Show")) end, - set = function() - TitanPanelToggleVar("Bar_Show") - TitanPanelBarButton_DisplayBarsWanted("Bar_Show "..tostring(TitanPanelGetVar("Bar_Show"))) - end, - }, - optiontophide = { - name = L["TITAN_PANEL_MENU_AUTOHIDE"], - desc = L["TITAN_PANEL_MENU_AUTOHIDE"], - order = 103, type = "toggle", width = "full", - get = function() return TitanPanelGetVar("Bar_Hide") end, - set = function() - TitanPanelBarButton_ToggleAutoHide(TITAN_PANEL_DISPLAY_PREFIX.."Bar") - end, - }, - optiontopcenter = { - name = L["TITAN_PANEL_MENU_CENTER_TEXT"], - desc = L["TITAN_PANEL_MENU_CENTER_TEXT"], - order = 104, type = "toggle", width = "full", - get = function() - return (TitanPanelGetVar("Bar_Align") == TITAN_PANEL_BUTTONS_ALIGN_CENTER) - end, - set = function() - local tmp = TitanPanelGetVar("Bar_Align"); - TitanPanelBarButton_ToggleAlign("Bar_Align"); --- TitanDebug("Bar c: "..tmp.." "..TitanPanelGetVar("Bar_Align")); - end, - }, - confdesc2 = { - order = 200, - type = "header", - name = L["TITAN_PANEL_MENU_TOP2"], - }, - optionbottom = { - name = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - desc = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - order = 201, type = "toggle", width = "full", - get = function() return TitanPanelGetVar("Bar2_Show") end, - set = function() - TitanPanelToggleVar("Bar2_Show") - TitanPanelBarButton_DisplayBarsWanted("Bar2_Show "..tostring(TitanPanelGetVar("Bar2_Show"))) - end, - }, - optionbottomhide = { - name = L["TITAN_PANEL_MENU_AUTOHIDE"], - desc = L["TITAN_PANEL_MENU_AUTOHIDE"], - order = 203, type = "toggle", width = "full", - get = function() return TitanPanelGetVar("Bar2_Hide") end, - set = function() - TitanPanelBarButton_ToggleAutoHide(TITAN_PANEL_DISPLAY_PREFIX.."Bar2"); - end, - }, - optionbottomcenter = { - name = L["TITAN_PANEL_MENU_CENTER_TEXT"], - desc = L["TITAN_PANEL_MENU_CENTER_TEXT"], - order = 204, type = "toggle", width = "full", - get = function() - return (TitanPanelGetVar("Bar2_Align") == TITAN_PANEL_BUTTONS_ALIGN_CENTER) - end, - set = function() TitanPanelBarButton_ToggleAlign("Bar2_Align"); end, - }, } } +local function ColorShown(bar) + local res = bar.locale_name + local frame_str = bar.frame_name + if TitanBarDataVars[frame_str].show then + -- leave as is + else + res = "|cff808080"..res.._G["FONT_COLOR_CODE_CLOSE"] + end + + return res +end + --[[ local -NAME: optionsAuxBars -DESC: Bar control for the aux (bottom) bars: -Each bar: -- Show -- Auto hide -- Center text (plugins) -Main (top) controls: -- Disable screen adjust - allows action button bar to be 'over' the Titan bars -- Log adjust - move the chat frame to be 'above' the Titan bars -- Bag adjust - move the bag frames to be 'above' the Titan bars +NAME: TitanUpdateConfigBars +DESC: Allow the user to control each Titan bar. :DESC +VAR: None +OUT: None --]] -local optionsAuxBars = { - name = TITAN_PANEL_CONFIG.topic.bottom, --L["TITAN_PANEL_MENU_OPTIONS_AUX_BARS"], - type = "group", - args = { - confdesc1 = { - order = 100, +local function TitanUpdateConfigBars(t, pos) + local args = t + local position = pos + + -- sort the bar data by their intended order + local bar_list = {} + for _,v in pairs (TitanBarData) do + bar_list[v.order] = v + end + table.sort(bar_list, function(a, b) + return a.order < b.order + end) + + local label = "Bar" + + wipe(args) + + for idx = 1, #bar_list do + -- ====== + -- Build the bar list in order (left side) + -- NOTE: v.name is the 'group' name which is the table passed to callbacks : info[1] + local v = bar_list[idx] -- process this bar + position = position + 1 + args[v.name] = { + type = "group", + name = ColorShown(v), + order = position, + } + -- ====== + -- Build bar options (right side) + args[v.name].args = {} -- ,args caused the nesting / right side + position = position + 1 -- Title divider + args[v.name].args.title = { type = "header", - name = L["TITAN_PANEL_MENU_BOTTOM"], - }, - optiontop = { + name = v.locale_name, + order = position, width = "full", + } + position = position + 1 -- Show toggle + args[v.name].args.show = { + type = "toggle", width = .75, --"fill", name = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - desc = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - order = 101, type = "toggle", width = "full", - get = function() return (TitanPanelGetVar("AuxBar_Show")) end, - set = function() - TitanPanelToggleVar("AuxBar_Show") - TitanPanelBarButton_DisplayBarsWanted("AuxBar_Show "..tostring(TitanPanelGetVar("AuxBar_Show"))) - end, - }, - optiontophide = { + order = position, + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return TitanBarDataVars[frame_str].show + end, + set = function(info, val) + local frame_str = TitanVariables_GetFrameName(info[1]) + TitanBarDataVars[frame_str].show = not TitanBarDataVars[frame_str].show + TitanPanelBarButton_DisplayBarsWanted(info[1].."Show "..tostring(val)) + TitanUpdateConfigBars(optionsBars.args, 1000) + end, + } + position = position + 1 -- Auto hide toggle + args[v.name].args.autohide = { + type = "toggle", width = .75, --"fill", name = L["TITAN_PANEL_MENU_AUTOHIDE"], - desc = L["TITAN_PANEL_MENU_AUTOHIDE"], - order = 103, type = "toggle", width = "full", - get = function() return TitanPanelGetVar("AuxBar_Hide") end, - set = function() - TitanPanelBarButton_ToggleAutoHide(TITAN_PANEL_DISPLAY_PREFIX.."AuxBar"); - end, - }, - optiontopcenter = { + order = position, + disabled = (v.hider == nil), + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return TitanBarDataVars[frame_str].auto_hide + end, + set = function(info, val) + Titan_AutoHide_ToggleAutoHide(info[1]) -- short bar name + end, + } + position = position + 1 -- Center toggle + args[v.name].args.center = { + type = "toggle", width = .75, --"fill", name = L["TITAN_PANEL_MENU_CENTER_TEXT"], - desc = L["TITAN_PANEL_MENU_CENTER_TEXT"], - order = 104, type = "toggle", width = "full", - get = function() - return (TitanPanelGetVar("AuxBar_Align") == TITAN_PANEL_BUTTONS_ALIGN_CENTER) + order = position, + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return (TitanBarDataVars[frame_str].align == TITAN_PANEL_BUTTONS_ALIGN_CENTER) + end, + set = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + if (TitanBarDataVars[frame_str].align == TITAN_PANEL_BUTTONS_ALIGN_CENTER ) then + TitanBarDataVars[frame_str].align = TITAN_PANEL_BUTTONS_ALIGN_LEFT + else + TitanBarDataVars[frame_str].align = TITAN_PANEL_BUTTONS_ALIGN_CENTER + end + + -- Justify button position + TitanPanelButton_Justify(); + end, + } + position = position + 1 -- Combat hide toggle + args[v.name].args.hideincombat = { + type = "toggle", width = .75, --"fill", + name = L["TITAN_PANEL_MENU_HIDE_IN_COMBAT"], + order = position, + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return TitanBarDataVars[frame_str].hide_in_combat + end, + set = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + TitanBarDataVars[frame_str].hide_in_combat = + not TitanBarDataVars[frame_str].hide_in_combat + end, + } + position = position + 1 -- spacer + args[v.name].args.transpacer1 = { + order = position, type = "description", width = "full", + name = " ", + } + position = position + 1 -- spacer + args[v.name].args.resetposspacer = { + order = position, type = "description", width = "full", + name = " ", + } + position = position + 1 -- reset pos + args[v.name].args.resetbar = { + type = "execute", width = "Full", + name = L["TITAN_PANEL_MENU_RESET_POSITION"], + order = position, + disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), + func = function(info, arg1) + local frame_str = TitanVariables_GetFrameName(info[1]) + TitanVariables_SetBarPos(_G[frame_str], true) + TitanPanelBarButton_DisplayBarsWanted("Bar reset to default position - "..tostring(info[1])) end, - set = function() TitanPanelBarButton_ToggleAlign("AuxBar_Align"); end, - }, - confdesc2 = { - order = 200, + } + -- ====== + -- Background group + position = position + 1 -- background + args[v.name].args.back = { type = "header", - name = L["TITAN_PANEL_MENU_BOTTOM2"], - }, - optionbottom = { - name = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - desc = L["TITAN_PANEL_MENU_DISPLAY_BAR"], - order = 201, type = "toggle", width = "full", - get = function() return TitanPanelGetVar("AuxBar2_Show") end, - set = function() - TitanPanelToggleVar("AuxBar2_Show") - TitanPanelBarButton_DisplayBarsWanted("AuxBar2_Show "..tostring(TitanPanelGetVar("AuxBar2_Show"))) - end, - }, - optionbottomhide = { - name = L["TITAN_PANEL_MENU_AUTOHIDE"], - desc = L["TITAN_PANEL_MENU_AUTOHIDE"], - order = 203, type = "toggle", width = "full", - get = function() return TitanPanelGetVar("AuxBar2_Hide") end, - set = function() - TitanPanelBarButton_ToggleAutoHide(TITAN_PANEL_DISPLAY_PREFIX.."AuxBar2"); - end, - }, - optionbottomcenter = { - name = L["TITAN_PANEL_MENU_CENTER_TEXT"], - desc = L["TITAN_PANEL_MENU_CENTER_TEXT"], - order = 204, type = "toggle", width = "full", - get = function() - return (TitanPanelGetVar("AuxBar2_Align") == TITAN_PANEL_BUTTONS_ALIGN_CENTER) - end, - set = function() TitanPanelBarButton_ToggleAlign("AuxBar2_Align"); end, - }, - confdesc3 = { - order = 400, + name = "=== "..BACKGROUND.." ===", + order = position, + } + position = position + 1 -- select background + args[v.name].args.settextousebar = { + name = "", --L["TITAN_PANEL_MENU_GLOBAL_SKIN"], + desc = "", --L["TITAN_PANEL_MENU_GLOBAL_SKIN_TIP"], + order = position, type = "select", width = "full", + style = "radio", + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return TitanBarDataVars[frame_str].texure end, + set = function(info, val) + local frame_str = TitanVariables_GetFrameName(info[1]) + TitanBarDataVars[frame_str].texure = val + TitanPanel_SetBarTexture(frame_str) + end, + values = { + [TitanVars.SKIN] = L["TITAN_SKINS_TITLE"], + [TitanVars.COLOR] = COLOR, + }, + } + position = position + 1 -- Title divider + args[v.name].args.skintitle = { type = "header", - name = "Vertical Adjustment", --L["TITAN_PANEL_MENU_BOTTOM2"], - }, - confmainmenudesc = { - name = "Menu and Bag Buttons", - type = "group", inline = true, - order = 401, - args = { - confbuffdesc = { - order = 110, - type = "description", - name = "Adjust Micro menu and Bag Buttons Vertically", --L["TITAN_PANEL_MENU_ADV_DESC"], - cmdHidden = true - }, - optionadjon = { - name = USE, -- "On.", --["TITAN_PANEL_MENU_CENTER_TEXT"], - desc = "Adjust Menu and Bag Bar", --L["TITAN_PANEL_MENU_CENTER_TEXT"], - order = 115, type = "toggle", width = "full", - get = function() - return TitanPanelGetVar("MenuAndBagVerticalAdjOn") - end, - set = function(_, a) - TitanPanelSetVar("MenuAndBagVerticalAdjOn", a) --- DF switch to sliding menu & bag bar since 10.0 allows user to adjust most frames - TitanPanel_AdjustFrames(true, "MenuAndBagVerticalAdj") + name = L["TITAN_SKINS_TITLE"], + order = position, width = "full", + } + position = position + 1 -- Skin select + args[v.name].args.skinselect = { + type = "select", width = "normal", + name = "", --v.locale_name, + order = position, + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return TitanBarDataVars[frame_str].skin.path end, - }, - advbuffadj = { - name = "Menu and Bags", --L["TITAN_PANEL_MENU_ADV_PEW"], - desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], - order = 120, type = "range", width = "full", - min = -100, max = 500, step = 1, - get = function() return TitanPanelGetVar("MenuAndBagVerticalAdj") end, - set = function(_, a) - TitanPanelSetVar("MenuAndBagVerticalAdj", a); - -- Adjust frame positions --- DF switch to sliding menu & bag bar since 10.0 allows user to adjust most frames - TitanPanel_AdjustFrames(true, "MenuAndBagVerticalAdj") + set = function(info,val) + local frame_str = TitanVariables_GetFrameName(info[1]) + TitanBarDataVars[frame_str].skin.path = val + TitanPanel_SetBarTexture(frame_str) + if TitanSkinToRemove == TitanPanelGetVar("Texture"..info[1]) then + TitanSkinToRemove = "None" + end + end, + values = function(info) + local Skinlist = {} + local frame_str = TitanVariables_GetFrameName(info[1]) + for _, val in pairs (TitanSkins) do + if val.path ~= TitanBarDataVars[frame_str].skin.path then + -- if val.path ~= TitanPanelGetVar("Texture"..v.name) then + Skinlist[val.path] = "|cff19ff19"..val.name.."|r" + else + Skinlist[val.path] = "|cffffff9a"..val.name.."|r" + end + end + table.sort(Skinlist, function(a, b) + return string.lower(TitanSkins[a].name) + < string.lower(TitanSkins[b].name) + end) + return Skinlist end, - }, - }, - }, - confxpbardesc = { - name = "Status Bar", - type = "group", inline = true, - order = 410, - args = { - confbuffdesc = { - order = 110, - type = "description", - name = "Adjust XP Bar Vertically", --L["TITAN_PANEL_MENU_ADV_DESC"], - cmdHidden = true - }, - optionadjon = { - name = USE, -- "On.", --["TITAN_PANEL_MENU_CENTER_TEXT"], - desc = "Adjust Status Bar", --L["TITAN_PANEL_MENU_CENTER_TEXT"], - order = 115, type = "toggle", width = "full", - get = function() - return TitanPanelGetVar("XPBarVerticalAdjOn") + } + position = position + 1 -- spacer + args[v.name].args.skinspacer = { + order = position, type = "description", width = "5", + name = " ", + } + position = position + 1 -- selected skin + args[v.name].args.skinselected = { + name = "", + image = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + local vert = TitanBarData[frame_str].vert + if vert == TITAN_SHORT then + vert = TITAN_TOP + else + -- Use it as is + end + return TitanBarDataVars[frame_str].skin.path.."TitanPanelBackground"..vert.."0" end, - set = function(_, a) - TitanPanelSetVar("XPBarVerticalAdjOn", a) --- DF switch to sliding menu & bag bar since 10.0 allows user to adjust most frames - TitanPanel_AdjustFrames(true, "XPBarVerticalAdj") + imageWidth = 256, + order = position, type = "description", width = .5, --"60", + } + position = position + 1 -- transparency + args[v.name].args.trans = { + type = "range", width = "full", + name = L["TITAN_TRANS_MENU_TEXT_SHORT"], + order = position, + min = 0, max = 1, step = 0.01, + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + return TitanBarDataVars[frame_str].skin.alpha end, - }, - advbuffadj = { - name = "XP and Status", --L["TITAN_PANEL_MENU_ADV_PEW"], - desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], - order = 120, type = "range", width = "full", - min = -20, max = 500, step = 1, - get = function() return TitanPanelGetVar("XPBarVerticalAdj") end, - set = function(_, a) - TitanPanelSetVar("XPBarVerticalAdj", a); - -- Adjust frame positions --- DF switch to sliding menu & bag bar since 10.0 allows user to adjust most frames - TitanPanel_AdjustFrames(true, "XPBarVerticalAdj") + set = function(info, a) + local frame_str = TitanVariables_GetFrameName(info[1]) + _G[frame_str]:SetAlpha(a) + TitanBarDataVars[frame_str].skin.alpha = a end, + } + position = position + 1 -- Title divider + args[v.name].args.colortitle = { + type = "header", + name = COLOR, + order = position, width = "full", + } + position = position + 1 -- spacer + args[v.name].args.colorspacer = { + order = position, type = "description", width = "full", + name = " ", + } + position = position + 1 -- reset pos + args[v.name].args.colorselect = { + type = "color", width = "Full", + name = "Select Bar Color", -- L["TITAN_PANEL_MENU_RESET_POSITION"], + order = position, + -- disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), + hasAlpha = true, + get = function(info) + local frame_str = TitanVariables_GetFrameName(info[1]) + local color = TitanBarDataVars[frame_str].color + return color.r, + color.g, + color.b, + color.alpha + end, + set = function(info, r, g, b, a) + local frame_str = TitanVariables_GetFrameName(info[1]) + + TitanBarDataVars[frame_str].color.r = r + TitanBarDataVars[frame_str].color.g = g + TitanBarDataVars[frame_str].color.b = b + TitanBarDataVars[frame_str].color.alpha = a + TitanPanel_SetBarTexture(frame_str) + end, + } + end + + -- Config Tables changed! + AceConfigRegistry:NotifyChange("Titan Panel Bars") +--[===[ +print("Color new:" +.." "..tostring(format("%0.1f", r)).."" +.." "..tostring(format("%0.1f", g)).."" +.." "..tostring(format("%0.1f", b)).."" +.." "..tostring(format("%0.1f", a)).."" +) +--]===] +end + +local function BuildBars() + TitanUpdateConfigBars(optionsBars.args, 1000) + AceConfigRegistry:NotifyChange("Titan Panel Bars") +end + +------------- +-- Help config section + +local help_text = "" +do -- set help_text +help_text = "" + ..TitanUtils_GetGreenText("Short Bars: \n") + ..TitanUtils_GetHighlightText("" + .."Short bars are 10 shorter Titan bars that the user can place and change width.\n" + .."- Short bars are independent. They may be used with or without the full width Titan bars.\n" + .."- Open Configuration > Bars to enable and change Bar options.\n" + .."- The default position is the top center under the full width bars. They will be stacked to not overlap.\n" + .."- Move : Use Shift + left mouse and dragging.\n" + .."- Change width by 1 : Use Shift + mouse wheel.\n" + .."- Change width by 10: Use Shift + Ctrl + mouse wheel.\n" + .."- When dragging, best to place your mouse over the left side padding before moving or changing width.\n" + .."- When dragging stops, if the Short Bar is beyond the screen edge the Short Bar should 'snap' to the edge.\n" + .."- Skin : Can select Skin per Short bar BUT only the 'top' skin is used; some skins have a different top & bottom.\n" + .."- Reset : In case a Short bar gets messed up, use Reset Position to place it at original position and width. This does not move plugins.\n" + .."- Min width : Left side padding plus one icon width.\n" + .."- Max width : Screen width.\n" + .."Limitations\n" + .."- There is no 'snap together' or grid for placing Short Bars.\n" + ) + .."\n\n" + ..TitanUtils_GetGreenText("All Bars: \n") + ..TitanUtils_GetHighlightText("" + .."- Bar Right click menu shows the name of the Bar in the menu title corresponding to configuration options.\n" + .."- Hide any Titan bar by using the Bar Right click menu then click Hide.\n" + .."- Titan does not restrict plugins to fit within the visible width. Using Configuration, plugins can be assigned well beyond the visible side. This may be desirable for some users.\n" + .."- Setting a plugin to right-side will use the visible right side; and may overlap with left or center aligned plugins.\n" + .."- Skins : \n" + .."--- Select per Titan bar.\n" + .."--- Select a skin for all Titan bars. This does NOT change the individual Titan bar skin settings.\n" + .."- Hide in Combat : \n" + .."--- Select per Titan bar.\n" + .."--- Hide all Titan bars during combat. This does NOT change the individual Titan bar hide in combat settings.\n" + .."- Bar Order (English): Configuration > Bars shows localized Bar names.\n" + .."--- Top : Always top of screen\n" + .."--- Top 2 : Always under Top Bar\n" + .."--- Bottom 2 : Always above Bottom Bar\n" + .."--- Bottom : Always bottom of screen\n" + .."--- Short 01 - 10 : User placed\n" + ) + .."\n\n" + ..TitanUtils_GetGreenText("Plugins: \n") + ..TitanUtils_GetHighlightText("" + .."Show / Hide Plugins - use one of the methods below:\n" + .."--- Open the right-click Bar menu; find the plugin in a category then click to show / hide the plugin.\n" + .."--- Open Titan Configuration > Plugins then select the plugin by name then check / uncheck Show. If needed, use the Bar dropdown to select the Bar the plugin should be on.\n" + ) + ..TitanUtils_GetHighlightText("" + .."Moving Plugins - use one of the methods below:\n" + .."--- Open the right-click menu; find the plugin in a category then hide then show.\n" + .."--- Drag and drop on another bar or on the same bar.\n" + .."--- Drag and drop on another plugin to swap the plugins.\n" + .."--- Open Titan Configuration > Plugins then check / uncheck Show then use the Bar dropdown and Right / Left buttons.\n" + ) + .."\n\n" +end +--[[ local +NAME: helpBars +DESC: Help for the Titan Panel user +:DESC +--]] +local helpBars = { + name = TITAN_PANEL_CONFIG.topic.help, + type = "group", + args = { + confgendesc = { + name = "Help", + order = 1, + type = "group", inline = true, + args = { + confdesc = { + order = 1, + type = "description", + name = help_text, + cmdHidden = true }, - }, + } }, } } - ------------- + -- General Titan config section --[[ local NAME: optionsFrames @@ -1067,8 +1223,8 @@ local optionsFrames = { cmdHidden = true, }, advname = { - name = "Use Modifier to Show Tooltip", --L["TITAN_PANEL_MENU_ADV_PEW"], - desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + name = L["TITAN_PANEL_MENU_TOOLTIP_MOD"], + desc = "", -- L[""], order = 120, type = "toggle", width = "full", get = function() return TitanAllGetVar("UseTooltipModifer") end, set = function(_, a) @@ -1081,8 +1237,8 @@ local optionsFrames = { order = 140, args = { alt_key = { - name = ALT_KEY_TEXT, - desc = ALT_KEY, + name = L["TITAN_KEY_ALT"], + desc = L["TITAN_KEY_ALT_DESC"], order = 110, type = "toggle", --width = "full", get = function() return TitanAllGetVar("TooltipModiferAlt") end, set = function(_, a) @@ -1090,8 +1246,8 @@ local optionsFrames = { end, }, ctrl_key = { - name = CTRL_KEY_TEXT, - desc = CTRL_KEY, + name = L["TITAN_KEY_CTRL"], + desc = L["TITAN_KEY_CTRL_DESC"], order = 120, type = "toggle", --width = "full", get = function() return TitanAllGetVar("TooltipModiferCtrl") end, set = function(_, a) @@ -1099,8 +1255,8 @@ local optionsFrames = { end, }, shift_key = { - name = SHIFT_KEY_TEXT, - desc = SHIFT_KEY, + name = L["TITAN_KEY_SHIFT"], + desc = L["TITAN_KEY_SHIFT_DESC"], order = 130, type = "toggle", --width = "full", get = function() return TitanAllGetVar("TooltipModiferShift") end, set = function(_, a) @@ -1118,21 +1274,18 @@ local optionsFrames = { }, optionlock = { name = L["TITAN_PANEL_MENU_LOCK_BUTTONS"], - desc = L["TITAN_PANEL_MENU_LOCK_BUTTONS"], order = 301, type = "toggle", width = "full", get = function() return TitanPanelGetVar("LockButtons") end, set = function() TitanPanelToggleVar("LockButtons") end, }, optionversions = { name = L["TITAN_PANEL_MENU_VERSION_SHOWN"], --- desc = L["TITAN_PANEL_MENU_VERSION_SHOWN"], order = 302, type = "toggle", width = "full", get = function() return TitanPanelGetVar("VersionShown") end, set = function() TitanPanelToggleVar("VersionShown") end, }, autohidelock = { name = L["TITAN_PANEL_MENU_AUTOHIDE_IN_COMBAT"], - desc = "Lock_auto_hide", order = 303, type = "toggle", width = "full", get = function() return TitanPanelGetVar("LockAutoHideInCombat") end, set = function() TitanPanelToggleVar("LockAutoHideInCombat") end, @@ -1178,6 +1331,172 @@ local optionsFrames = { ------------- ------------- +-- Bars Global config section +------------- +local optionsGlobals = { + name = TITAN_PANEL_CONFIG.topic.globals, + type = "group", + args = { + confdesc = { + order = 10, width = "full", + type = "header", + name = L["TITAN_PANEL_MENU_GLOBAL_SKIN_TITLE"], + }, + setskinuseglobal = { + name = "", --L["TITAN_PANEL_MENU_GLOBAL_SKIN"], + desc = "", --L["TITAN_PANEL_MENU_GLOBAL_SKIN_TIP"], + order = 15, type = "select", width = "full", + style = "radio", + get = function() return TitanBarDataVars["Global"].texure end, + set = function(_, v) + TitanBarDataVars["Global"].texure = v + for idx, val in pairs (TitanBarData) do + TitanPanel_SetBarTexture(idx) + end + end, + values = { + [TitanVars.SKIN] = L["TITAN_SKINS_TITLE"], + [TitanVars.COLOR] = COLOR, + [TitanVars.NONE] = NONE, + }, + }, + confskindesc = { + order = 20, width = "full", + type = "description", + name = L["TITAN_SKINS_TITLE"], + }, + setskinglobal = { + order = 21, type = "select", width = "30", + name = " ", --L["TITAN_SKINS_LIST_TITLE"], + desc = L["TITAN_SKINS_SET_DESC"], + get = function() return TitanBarDataVars["Global"].skin.path end, + set = function(_,v) + TitanBarDataVars["Global"].skin.path = v --TitanPanelSetVar("TexturePath", v); + if TitanBarDataVars["Global"].texure == TitanVars.SKIN then + for idx, val in pairs (TitanBarData) do + TitanPanel_SetBarTexture(idx) + end + end + end, + values = function() + local Skinlist = {} + local v; + for _,v in pairs (TitanSkins) do + if v.path ~= TitanBarDataVars["Global"].skin.path then --TitanPanelGetVar("TexturePath") then + Skinlist[v.path] = "|cff19ff19"..v.name.."|r" + else + Skinlist[v.path] = "|cffffff9a"..v.name.."|r" + end + end + table.sort(Skinlist, function(a, b) + return string.lower(TitanSkins[a].name) + < string.lower(TitanSkins[b].name) + end) + return Skinlist + end, + }, + show_skin_top_desc = { + type = "description", + name = "", + order = 30, width = "10", + }, + show_skin_global_top = { + type = "description", + name = "", + image = function() + return TitanBarDataVars["Global"].skin.path.."TitanPanelBackgroundTop0" +-- return TitanPanelGetVar("TexturePath").."TitanPanelBackgroundTop0" + end, + imageWidth = 256, + order = 31, width = "60", + }, + confcolorspacer = { -- spacer + order = 50, type = "description", width = "full", + name = " ", + }, + confcolordesc = { + order = 51, width = "full", + type = "description", + name = COLOR, + }, + show_skin_color_picker = { + type = "color", width = "Full", + name = "Select Bar Color", -- L["TITAN_PANEL_MENU_RESET_POSITION"], + order = 55, +-- disabled = (v.vert == TITAN_TOP or v.vert == TITAN_BOTTOM), + hasAlpha = true, + get = function() + local color = TitanBarDataVars["Global"].color + return color.r, + color.g, + color.b, + color.alpha + end, + set = function(info, r, g, b, a) +--[===[ +print("Color new:" +.." "..tostring(format("%0.1f", r)).."" +.." "..tostring(format("%0.1f", g)).."" +.." "..tostring(format("%0.1f", b)).."" +.." "..tostring(format("%0.1f", a)).."" +) +--]===] + TitanBarDataVars["Global"].color.r = r + TitanBarDataVars["Global"].color.g = g + TitanBarDataVars["Global"].color.b = b + TitanBarDataVars["Global"].color.alpha = a + if TitanBarDataVars["Global"].texure == TitanVars.COLOR then + for idx, val in pairs (TitanBarData) do + TitanPanel_SetBarTexture(idx) + end + end + end, + }, + hidecombatspacer = { -- spacer + order = 100, type = "description", width = "full", + name = " ", + }, + confcombatdesc = { + order = 101, width = "full", + type = "header", + name = L["TITAN_PANEL_MENU_COMMAND"], + }, + setcombatuseglobal = { + name = L["TITAN_PANEL_MENU_HIDE_IN_COMBAT"], + desc = L["TITAN_PANEL_MENU_HIDE_IN_COMBAT_DESC"], + order = 105, type = "toggle", width = "full", + get = function() return TitanPanelGetVar("HideBarsInCombat") end, + set = function() TitanPanelToggleVar("HideBarsInCombat"); end, + }, + arenaspacer = { -- spacer + order = 200, type = "description", width = "full", + name = " ", + }, + confarenadesc = { + order = 201, width = "full", + type = "header", + name = BATTLEGROUND.." / "..ARENA, + }, + setarenauseglobal = { + name = HIDE.." "..L["TITAN_PANEL_MENU_TOP_BARS"] + .." - "..BATTLEGROUND.." / "..ARENA , + desc = "Hide" + .." "..TitanBarData[TitanVariables_GetFrameName("Bar")].locale_name + .." and" + .." "..TitanBarData[TitanVariables_GetFrameName("Bar2")].locale_name + .." in "..BATTLEGROUND.." / "..ARENA, + order = 205, type = "toggle", width = "full", + get = function() return TitanPanelGetVar("HideBarsInPVP") end, + set = function() + TitanPanelToggleVar("HideBarsInPVP") + TitanPanelBarButton_DisplayBarsWanted("HideBarsInPVP" + .." "..tostring(TitanPanelGetVar("HideBarsInPVP"))) + end, + }, + } +} + +------------- -- attempted plugins config section --[[ local NAME: optionsAddonAttempts @@ -1188,6 +1507,7 @@ local optionsAddonAttempts = { type = "group", args = {} } + --[[ local NAME: TitanUpdateAddonAttempts DESC: Show the each plugin that attempted to register with Titan. This can be used by plugin developers as the create / update plugins (Titan or LDB). It can also be used by user to attempt to figure out why a plugin is not shown or to report an issue to Titan. @@ -1316,7 +1636,8 @@ local optionsExtras = { name = TITAN_PANEL_CONFIG.topic.extras, --L["TITAN_PANEL_EXTRAS"], type = "group", args = {} - } +} + --[[ local NAME: TitanUpdateAddonAttempts DESC: Show plugins that are not registered (loaded) but have config data. The data can be deleted by the user. @@ -1387,6 +1708,7 @@ local optionsChars = { type = "group", args = {} } + --[[ local NAME: TitanUpdateChars DESC: Allow the user to delete toon data (just not the one they are logged into). @@ -1624,6 +1946,7 @@ local optionsAddons = { type = "group", args = {} } + local function ColorVisible(id, name) local res = "?" if TitanPanel_IsPluginShown(id) then @@ -1634,6 +1957,7 @@ local function ColorVisible(id, name) return res end + --[[ local NAME: TitanUpdateConfigAddons DESC: Allow the user to control each plugin registered to Titan. @@ -1824,7 +2148,8 @@ local function TitanUpdateConfigAddons() local Locationlist = {} local v for idx,v in pairs (TitanBarData) do - if TitanPanelGetVar(TitanBarData[idx].name.."_Show") then + if TitanBarDataVars[idx].show then +-- if TitanPanelGetVar(TitanBarData[idx].name.."_Show") then Locationlist[TitanBarData[idx].name] = TitanBarData[idx].locale_name end end @@ -1849,12 +2174,12 @@ local function TitanUpdateConfigAddons() args[plug_in.id].args.custom_notes = { order = 60, type = "header", - name = "Notes", + name = L["TITAN_PANEL_MENU_ADV_NOTES_PLUGIN"], } if plug_in.notes then args[plug_in.id].args.notes = { type = "description", - name = "Notes", + name = L["TITAN_PANEL_MENU_ADV_NOTES"], order = 61, name = "" .._G["GREEN_FONT_COLOR_CODE"]..plug_in.notes.."|r", @@ -1863,9 +2188,9 @@ local function TitanUpdateConfigAddons() else args[plug_in.id].args.notes = { type = "description", - name = "Notes", + name = L["TITAN_PANEL_MENU_ADV_NOTES"], order = 61, - name = _G["GREEN_FONT_COLOR_CODE"]..NONE.."|r", + name = _G["GREEN_FONT_COLOR_CODE"]..L["TITAN_NONE"].."|r", cmdHidden = true, } end @@ -1877,11 +2202,11 @@ local function TitanUpdateConfigAddons() args[plug_in.id].args.custom_labels = { order = 70, type = "header", - name = SHOW.." "..CUSTOM.." ".."Labels", + name = L["TITAN_PANEL_MENU_ADV_LABEL"], } args[plug_in.id].args.custom_label_show = { type = "toggle", - name = SHOW, + name = L["TITAN_PANEL_MENU_ADV_LABEL_SHOW"].." 1", order = 71, get = function(info) return (TitanGetVar(info[1], "CustomLabelTextShow") or false) end, set = function(info, v) @@ -1891,8 +2216,8 @@ local function TitanUpdateConfigAddons() } args[plug_in.id].args.custom_label_text = { order = 72, - name = CUSTOM, - desc = "Custom label text to show", + name = L["TITAN_PANEL_MENU_ADV_CUSTOM"], + desc = L["TITAN_PANEL_MENU_ADV_CUSTOM_DESC"], type = "input", width = "full", get = function(info) return (TitanGetVar(info[1], "CustomLabelText") or "") end, set = function(info,v) @@ -1904,7 +2229,7 @@ local function TitanUpdateConfigAddons() if num_labels >= 2 then args[plug_in.id].args.custom_label2_show = { type = "toggle", - name = SHOW.." 2", + name = L["TITAN_PANEL_MENU_ADV_LABEL_SHOW"].." 2", order = 73, get = function(info) return (TitanGetVar(info[1], "CustomLabel2TextShow") or false) end, set = function(info, v) @@ -1914,8 +2239,8 @@ local function TitanUpdateConfigAddons() } args[plug_in.id].args.custom_label2_text = { order = 74, - name = CUSTOM, - desc = "Custom label text to show", + name = L["TITAN_PANEL_MENU_ADV_CUSTOM"], + desc = L["TITAN_PANEL_MENU_ADV_CUSTOM_DESC"], type = "input", width = "full", get = function(info) return (TitanGetVar(info[1], "CustomLabel2Text") or "") end, set = function(info,v) @@ -1927,7 +2252,7 @@ local function TitanUpdateConfigAddons() if num_labels >= 3 then args[plug_in.id].args.custom_label3_show = { type = "toggle", - name = SHOW.." 3", + name = L["TITAN_PANEL_MENU_ADV_LABEL_SHOW"].." 3", order = 75, get = function(info) return (TitanGetVar(info[1], "CustomLabel3TextShow") or false) end, set = function(info, v) @@ -1937,8 +2262,8 @@ local function TitanUpdateConfigAddons() } args[plug_in.id].args.custom_label3_text = { order = 76, - name = CUSTOM, - desc = "Custom label text to show", + name = L["TITAN_PANEL_MENU_ADV_CUSTOM"], + desc = L["TITAN_PANEL_MENU_ADV_CUSTOM_DESC"], type = "input", width = "full", get = function(info) return (TitanGetVar(info[1], "CustomLabel3Text") or "") end, set = function(info,v) @@ -1950,7 +2275,7 @@ local function TitanUpdateConfigAddons() if num_labels >= 4 then args[plug_in.id].args.custom_label4_show = { type = "toggle", - name = SHOW.." 4", + name = L["TITAN_PANEL_MENU_ADV_LABEL_SHOW"].." 4", order = 77, get = function(info) return (TitanGetVar(info[1], "CustomLabel4TextShow") or false) end, set = function(info, v) @@ -1960,8 +2285,8 @@ local function TitanUpdateConfigAddons() } args[plug_in.id].args.custom_label4_text = { order = 78, - name = CUSTOM, - desc = "Custom label text to show", + name = L["TITAN_PANEL_MENU_ADV_CUSTOM"], + desc = L["TITAN_PANEL_MENU_ADV_CUSTOM_DESC"], type = "input", width = "full", get = function(info) return (TitanGetVar(info[1], "CustomLabel4Text") or "") end, set = function(info,v) @@ -1976,6 +2301,7 @@ local function TitanUpdateConfigAddons() -- Config Tables changed! AceConfigRegistry:NotifyChange("Titan Panel Addon Control") end + ------------- --[[ local NAME: optionsAdvanced @@ -1997,12 +2323,12 @@ local optionsAdvanced = { confdesc = { order = 110, type = "description", - name = "Output Various Titan Info At Startup.", --L["TITAN_PANEL_MENU_ADV_DESC"], + name = L["TITAN_PANEL_MENU_ADV_DESC"], cmdHidden = true }, advname = { - name = "Name and Version", --L["TITAN_PANEL_MENU_ADV_PEW"], - desc = "", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + name = L["TITAN_PANEL_MENU_ADV_NAME"], + desc = L["TITAN_PANEL_MENU_ADV_NAME_DESC"], order = 120, type = "toggle", width = "full", get = function() return not TitanAllGetVar("Silenced") end, -- yes, we did it to ourselves... set = function(_, a) @@ -2010,8 +2336,8 @@ local optionsAdvanced = { end, }, advplugins = { - name = "Plugin Registration process", --L["TITAN_PANEL_MENU_ADV_PEW"], - desc = "Shows start and end of Registration process and number of registered plugins", -- L["TITAN_PANEL_MENU_ADV_PEW_DESC"], + name = L["TITAN_PANEL_MENU_ADV_PLUGINS"], + desc = L["TITAN_PANEL_MENU_ADV_PLUGINS_DESC"], order = 120, type = "toggle", width = "full", get = function() return TitanAllGetVar("Registered") end, set = function(_, a) @@ -2024,7 +2350,7 @@ local optionsAdvanced = { } --[[ local -NAME: change history +NAME: Recent change history DESC: Show change history of releases :DESC --]] @@ -2034,14 +2360,13 @@ local changeHistory = { args = { confchanges = { order = 7, - name = CHANGES_COLON, + name = " ", --CHANGES_COLON, type = "group", inline = true, args = { confversiondesc = { order = 1, type = "description", - name = "" - ..changes, + name = ""..changes, cmdHidden = true }, } @@ -2126,7 +2451,8 @@ function TitanUpdateConfig(action) TitanUpdateAddonAttempts() TitanUpdateExtras() TitanUpdateChars() - TitanPanel_TransOptions(optionsTrans.args) + BuildSkins() + BuildBars() end if action == "nuke" then local nuked = { @@ -2139,7 +2465,8 @@ function TitanUpdateConfig(action) -- Use the same group as below!! -- AceConfig:RegisterOptionsTable("Titan Panel Main", nuked) AceConfig:RegisterOptionsTable("Titan Panel Bars", nuked) - AceConfig:RegisterOptionsTable("Titan Panel Aux Bars", nuked) + AceConfig:RegisterOptionsTable("Titan Panel Globals", nuked) +-- AceConfig:RegisterOptionsTable("Titan Panel Aux Bars", nuked) AceConfig:RegisterOptionsTable("Titan Panel Frames", nuked) AceConfig:RegisterOptionsTable("Titan Panel Transparency Control", nuked) AceConfig:RegisterOptionsTable("Titan Panel Panel Control", nuked) @@ -2150,9 +2477,12 @@ function TitanUpdateConfig(action) AceConfig:RegisterOptionsTable("Titan Panel Addon Extras", nuked) AceConfig:RegisterOptionsTable("Titan Panel Addon Chars", nuked) AceConfig:RegisterOptionsTable("Titan Panel Addon Advanced", nuked) + AceConfig:RegisterOptionsTable("Titan Panel Addon Changes", nuked) + AceConfig:RegisterOptionsTable("Titan Panel Addon Slash", nuked) end end + --[[ Register the options tables with Ace then register the options with Blizz so the user can use them. --]] @@ -2162,9 +2492,8 @@ The second param must be the table Ace will use to create the user options --]] AceConfig:RegisterOptionsTable("Titan Panel Main", optionsControl) AceConfig:RegisterOptionsTable("Titan Panel Bars", optionsBars) -AceConfig:RegisterOptionsTable("Titan Panel Aux Bars", optionsAuxBars) +AceConfig:RegisterOptionsTable("Titan Panel Globals", optionsGlobals) AceConfig:RegisterOptionsTable("Titan Panel Frames", optionsFrames) -AceConfig:RegisterOptionsTable("Titan Panel Transparency Control", optionsTrans) AceConfig:RegisterOptionsTable("Titan Panel Panel Control", optionsUIScale) AceConfig:RegisterOptionsTable("Titan Panel Skin Control", optionsSkins) AceConfig:RegisterOptionsTable("Titan Panel Skin Custom", optionsSkinsCustom) @@ -2175,6 +2504,7 @@ AceConfig:RegisterOptionsTable("Titan Panel Addon Chars", optionsChars) AceConfig:RegisterOptionsTable("Titan Panel Addon Advanced", optionsAdvanced) AceConfig:RegisterOptionsTable("Titan Panel Addon Changes", changeHistory) AceConfig:RegisterOptionsTable("Titan Panel Addon Slash", slashHelp) +AceConfig:RegisterOptionsTable("Titan Panel Help", helpBars) --]] -- Set the main options pages --[[ The first param must be the same as the cooresponding 'Ace register' @@ -2184,12 +2514,11 @@ if not, any 'open' may fail. --AceConfigDialog:AddToBlizOptions("Titan Panel Main", L["TITAN_PANEL"]) AceConfigDialog:AddToBlizOptions("Titan Panel Main", optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Bars", optionsBars.name, optionsControl.name) -AceConfigDialog:AddToBlizOptions("Titan Panel Aux Bars", optionsAuxBars.name, optionsControl.name) +AceConfigDialog:AddToBlizOptions("Titan Panel Globals", optionsGlobals.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Control", optionsAddons.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Chars", optionsChars.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Frames", optionsFrames.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Panel Control", optionsUIScale.name, optionsControl.name) -AceConfigDialog:AddToBlizOptions("Titan Panel Transparency Control", optionsTrans.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Skin Control", optionsSkins.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Skin Custom", optionsSkinsCustom.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Extras", optionsExtras.name, optionsControl.name) @@ -2197,4 +2526,4 @@ AceConfigDialog:AddToBlizOptions("Titan Panel Addon Attempts", optionsAddonAttem AceConfigDialog:AddToBlizOptions("Titan Panel Addon Advanced", optionsAdvanced.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Changes", changeHistory.name, optionsControl.name) AceConfigDialog:AddToBlizOptions("Titan Panel Addon Slash", slashHelp.name, optionsControl.name) - +AceConfigDialog:AddToBlizOptions("Titan Panel Help", helpBars.name, optionsControl.name) diff --git a/Titan/TitanLDB.lua b/Titan/TitanLDB.lua index 37ba2ca..82ac037 100644 --- a/Titan/TitanLDB.lua +++ b/Titan/TitanLDB.lua @@ -883,7 +883,7 @@ print("LDB macrotext" -- This works because the .registry is now set TitanUtils_RegisterPluginList() TitanVariables_SyncSinglePluginSettings(registry.id) --- TitanUtils_RegisterPluginList() + TitanPanel_InitPanelButtons() -- Show it... end if TitanVars.debug.ldb_setup then TitanDebug("LDB create" diff --git a/Titan/TitanVariables.lua b/Titan/TitanVariables.lua index 8fc892d..bc5dfbc 100644 --- a/Titan/TitanVariables.lua +++ b/Titan/TitanVariables.lua @@ -746,9 +746,6 @@ OUT: None --]] function TitanVariables_SyncSinglePluginSettings(id) -- Init this plugin -print("Sync1" -.." "..tostring(id).."" -) local plugin = TitanPlugins[id] if (plugin and plugin.savedVariables) then -- Init savedVariables table @@ -756,17 +753,11 @@ print("Sync1" -- exists else TitanPluginSettings = {}; -print(">>Sync1 void settings" -.." "..tostring(id).."" -) end if TitanPluginSettings[id] then -- exists else TitanPluginSettings[id] = {}; -print(">>Sync1 new settings" -.." "..tostring(id).."" -) end -- Synchronize registered and saved variables