Quantcast

- Titan - Add localized bar name to the plugin name in right click menu

urnati [04-27-23 - 15:34]
- Titan - Add localized bar name to the plugin name in right click menu
- Utils - Add localized Bar name as 2nd param to _GetWhichBar
- Config - Add an section showing Bar order on screen to help users
Filename
Titan/Titan.lua
Titan/TitanConfig.lua
Titan/TitanUtils.lua
diff --git a/Titan/Titan.lua b/Titan/Titan.lua
index 9683eb8..f1cc822 100644
--- a/Titan/Titan.lua
+++ b/Titan/Titan.lua
@@ -1983,7 +1983,7 @@ local function BuildMainMenu(frame)
 		end
 	TitanPanelRightClickMenu_AddButton(info);

-	TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel());
+--	TitanPanelRightClickMenu_AddSeparator(TitanPanelRightClickMenu_GetDropdownLevel());
 	local glob, toon, player, server = TitanUtils_GetGlobalProfile()
 	info = {};
 	info.text = "Use Global Profile\n   "..toon
@@ -2314,6 +2314,14 @@ local function BuildPluginCategoryMenu(frame)
 				else
 					info.text = plugin.menuText;
 				end
+				-- Add Bar
+				local _, which_bar = TitanUtils_GetWhichBar(id)
+				if which_bar == nil then
+					-- Plugin not shown
+				else
+					info.text = info.text..TitanUtils_GetGoldText(" ("..which_bar..")")
+				end
+
 				if plugin.controlVariables then
 					info.hasArrow = 1;
 				end
@@ -2360,6 +2368,23 @@ print("_prep R click"
 --]]

 	-- Level 1
+	--[===[
+		Title - <Bar name>
+		----
+		Plugins
+		<list of Categories>
+		----
+		Configuration => Opens Titan Options
+		-----
+		Profiles
+		Manage > <Level 2>
+		Save => Save current profile (used for Global)
+		-----
+		Use Globale Profile
+			<Profile name used or <>>
+		----
+		Hide => Hide this Bar
+	--]===]
 	if lev == 1 then
 		BuildMainMenu(frame)
 	end
@@ -2382,7 +2407,7 @@ print("_prep R click"
 	-- Level 3
 	-- Plugin Categories => Plugins in that category => Plugin defined options
 	-- OR
-	-- Profiles => Server / Realm list => Character on realm list
+	-- Profiles > Server / Realm list > Character on realm list
 	if ( lev == 3 ) then
 		if string.find(TitanPanelRightClickMenu_GetDropdMenuValue(), R_PLUGIN) then
 			BuildPluginMenu()
@@ -2394,7 +2419,7 @@ print("_prep R click"
 	end

 	-- Level 4
-	-- Profiles => Server / Realm list => Character on realm list => load / delete
+	-- Profiles > Server / Realm list > Character on realm list > Load / Delete
 	if ( lev == 4 ) then
 		BuildAProfileMenu()
 		return;
diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua
index d9edd66..579ac38 100644
--- a/Titan/TitanConfig.lua
+++ b/Titan/TitanConfig.lua
@@ -1094,6 +1094,12 @@ help_text = ""
 		.."- 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")
diff --git a/Titan/TitanUtils.lua b/Titan/TitanUtils.lua
index 2f80c7d..2154bff 100644
--- a/Titan/TitanUtils.lua
+++ b/Titan/TitanUtils.lua
@@ -229,14 +229,24 @@ end
 NAME: TitanUtils_GetWhichBar
 DESC: Return the bar the plugin is shown on.
 VAR: id - is the id of the plugin
-OUT: string - bar name or nil
+OUT: string - internal bar name or nil
+OUT: string - locale bar name or nil
 --]]
 function TitanUtils_GetWhichBar(id)
 	local i = TitanPanel_GetButtonNumber(id);
 	if TitanPanelSettings.Location[i] == nil then
-		return
+		return nil, nil
 	else
-		return TitanPanelSettings.Location[i];
+		local internal = TitanPanelSettings.Location[i]
+		local locale = ""
+		for _,v in pairs (TitanBarData) do
+			if v.name == internal then
+				locale = v.locale_name
+			else
+				-- not the Bar wanted
+			end
+		end
+		return internal, locale
 	end
 end