Quantcast

- Further changes for ticket #1381

urnati [01-14-24 - 19:52]
- Further changes for ticket #1381
- Update Config Recent History for 8.0.2
Filename
Titan/TitanConfig.lua
TitanLocation/TitanLocation.lua
diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua
index 7925f45..d4076e7 100644
--- a/Titan/TitanConfig.lua
+++ b/Titan/TitanConfig.lua
@@ -47,6 +47,17 @@ end
 local changes = ""
 do -- recent change history
 changes = changes
+	..TitanUtils_GetGoldText("8.0.2 : 2024/01/14\n")
+	..TitanUtils_GetGreenText("Location : \n")
+	..TitanUtils_GetHighlightText(""
+		.."- Fix for ticket #1381, error on opening map when Location is hidden.\n"
+		.."- Refactor to save cycles when user selected no coords on map.\n"
+		)
+	..TitanUtils_GetGreenText("Config : \n")
+	..TitanUtils_GetHighlightText(""
+		.."- Update many locale / translated strings.\n"
+		)
+	.."\n\n"
 	..TitanUtils_GetGoldText("8.0.1 : 2024/01/01\n")
 	..TitanUtils_GetGreenText("Titan : \n")
 	..TitanUtils_GetHighlightText(""
diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua
index ae8c156..9d72ce9 100755
--- a/TitanLocation/TitanLocation.lua
+++ b/TitanLocation/TitanLocation.lua
@@ -23,10 +23,40 @@ local L = {} -- For AceLocale
 local AceTimer = {}
 local LocationTimer = nil;

--- Difference in the Blizzard frame for the world map
-local MapMinMaxFrame = {}
+local debug_flow = false

 -- ******************************** Functions *******************************
+--[[ local
+-- **************************************************************************
+-- NAME : debug_msg(Message)
+-- DESC : Debug function to print message to chat frame
+-- VARS : Message = message to print to chat frame
+-- **************************************************************************
+--]]
+local function debug_msg(Message)
+	local msg = ""
+	local stamp = date("%H:%M:%S") -- date("%m/%d/%y %H:%M:%S")
+	local milli = GetTime() -- seconds with millisecond precision (float)
+	milli = string.format("%0.2F", milli - math.modf(milli))
+	msg = msg..TitanUtils_GetGoldText(stamp..milli.." "..TITAN_LOCATION_ID..": ")
+	msg = msg..TitanUtils_GetGreenText(Message)
+	DEFAULT_CHAT_FRAME:AddMessage(msg)
+--		DEFAULT_CHAT_FRAME:AddMessage(TITAN_LOCATION_ID..": " .. Message, 1.00, 0.49, 0.04)
+end
+
+--[[ local
+-- **************************************************************************
+-- NAME : RegEvent()
+-- DESC : Check if already registered, register if not
+-- **************************************************************************
+--]]
+local function RegEvent(plugin, event)
+	if plugin:IsEventRegistered(event) then
+		-- already registered
+	else
+		plugin:RegisterEvent(event)
+	end
+end

 --[[
 -- **************************************************************************
@@ -73,34 +103,271 @@ function TitanPanelLocationButton_OnLoad(self)
 		}
 	};

-	self:RegisterEvent("ZONE_CHANGED");
-	self:RegisterEvent("ZONE_CHANGED_INDOORS");
-	self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
-	self:RegisterEvent("PLAYER_ENTERING_WORLD");
+	RegEvent(self, "PLAYER_ENTERING_WORLD")
+
+	if debug_flow then
+		local msg =
+			"_OnLoad"
+--			.." "..tostring(reason)..""
+		debug_msg(msg)
+	else
+		-- not requested
+	end

-	TitanPanelLocation_CreateMapFrames();
 end

+--[[ local
+-- **************************************************************************
+-- NAME : Events()
+-- DESC : Registers / unregisters events the plugin needs
+-- **************************************************************************
+--]]
+local function Events(action, reason)
 --[[
+--]]
+	local plugin = _G[TITAN_BUTTON]
+
+	if action == "register" then
+		RegEvent(plugin, "ZONE_CHANGED")
+		RegEvent(plugin, "ZONE_CHANGED_INDOORS")
+		RegEvent(plugin, "ZONE_CHANGED_NEW_AREA")
+	elseif action == "unregister" then
+		plugin:UnregisterEvent("ZONE_CHANGED")
+		plugin:UnregisterEvent("ZONE_CHANGED_INDOORS")
+		plugin:UnregisterEvent("ZONE_CHANGED_NEW_AREA")
+	else
+		-- action unknown ???
+	end
+
+	if debug_flow then
+		local msg =
+			"Events"
+			.." "..tostring(action)..""
+			.." "..tostring(reason)..""
+		debug_msg(msg)
+	else
+		-- not requested
+	end
+end
+
+local function ZoneUpdate(self)
+
+	local _ = nil
+	self.zoneText = GetZoneText();
+	self.subZoneText = GetSubZoneText();
+	self.pvpType, _, self.factionName = GetZonePVPInfo();
+
+	TitanPanelPluginHandle_OnUpdate(updateTable);
+
+	if TitanPanelLocationButton:IsVisible() and not LocationTimer then
+		LocationTimer = AceTimer.ScheduleRepeatingTimer("TitanPanelLocation", TitanPanelLocationButton_CheckForUpdate, 0.5)
+	end
+end
+
+--[[ local
 -- **************************************************************************
--- NAME : TitanPanelLocationButton_OnShow()
--- DESC : Display button when plugin is visible
+-- NAME : GetPlayerMapPosition()
+-- DESC : Get the player coordinates
+-- VARS : x = location on x axis, y = location on y axis
 -- **************************************************************************
 --]]
-function TitanPanelLocationButton_OnShow()
-	-- Set the version of the map to use
-	if TITAN_ID == "TitanClassic" then
-		MapMinMaxFrame = WorldMapFrame.MaximizeMinimizeFrame
+local function GetPlayerMapPosition()
+    local mapID = C_Map.GetBestMapForUnit("player")
+    if mapID == nil then
+        return nil, nil
+    end

+    local position = C_Map.GetPlayerMapPosition(mapID, "player")
+    if position == nil then
+        return nil, nil
+    else
+    	return position:GetXY()
+	end
+end
+
+local function SetCoordText(player, cursor)
+	local playerLocationText = player or ""
+	local cursorLocationText = cursor or ""
+
+	TitanMapPlayerLocation:SetText(cursorLocationText);
+	TitanMapCursorLocation:SetText(playerLocationText);
+
+--		local mloc = TitanGetVar(TITAN_LOCATION_ID, "MapLocation") or "TOPRIGHT"
+	if TITAN_ID == "TitanClassic" then
+		-- TODO - is setting map id needed??
 		local mapID = C_Map.GetBestMapForUnit("player");
 		if mapID ~= nil and C_Map.MapHasArt(mapID) then
 			WorldMapFrame:SetMapID(mapID);
 		end
+
+		-- Determine where to show the text
+		TitanMapPlayerLocation:ClearAllPoints()
+		TitanMapCursorLocation:ClearAllPoints()
+
+		TitanMapPlayerLocation:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOM", 0, 10)
+		TitanMapCursorLocation:SetPoint("BOTTOMRIGHT", WorldMapFrame, "BOTTOM", -10, 10)
+	else -- current retail
+		-- Position the text
+		local anchor = WorldMapFrame.BorderFrame.MaximizeMinimizeFrame
+		if WorldMapFrame:IsMaximized() then
+			-- map should be 'full' screen
+			TitanMapPlayerLocation:ClearAllPoints();
+			TitanMapCursorLocation:ClearAllPoints();
+			TitanMapPlayerLocation:SetPoint("RIGHT", anchor, "LEFT", 0, 0)
+			TitanMapCursorLocation:SetPoint("TOP", TitanMapPlayerLocation, "BOTTOM", 0, -5)
+			WorldMapFrame.TitanSize = "large"
+		else
+			TitanMapPlayerLocation:ClearAllPoints();
+			TitanMapCursorLocation:ClearAllPoints();
+			TitanMapPlayerLocation:SetPoint("RIGHT", anchor, "LEFT", 0, 0)
+			TitanMapCursorLocation:SetPoint("LEFT", WorldMapFrame.BorderFrame.Tutorial, "RIGHT", 0, 0)
+			WorldMapFrame.TitanSize = "small"
+		end
+	end
+end
+
+--[[
+-- **************************************************************************
+-- NAME : LocOnMiniMap()
+-- DESC : Show / hide the location above the mini map per user settings
+-- **************************************************************************
+--]]
+local function LocOnMiniMap(reason)
+	if TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") then
+		MinimapBorderTop:Show()
+		MinimapZoneTextButton:Show()
+--		MiniMapWorldMapButton:Show()
 	else
-		MapMinMaxFrame = WorldMapFrame.BorderFrame.MaximizeMinimizeFrame
+		MinimapBorderTop:Hide()
+		MinimapZoneTextButton:Hide()
+		MiniMapWorldMapButton:Hide()
 	end
+
+	-- adjust MiniMap frame if needed
+	if reason == "config" then
+		TitanPanel_AdjustFrames(false);
+	else
+		-- 2024 Jan - Do not adjust; allow Titan to handle on PEW
+	end
+end

-	TitanPanelLocation_HandleUpdater();
+--[[
+-- Set the coordinates text for player and cursor
+-- Used on update to refresh and on hide to clear the text
+--]]
+local function CoordFrames(action)
+	local frame = _G["TitanMapFrame"]
+	local show_on_map = (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap") and true or false)
+
+	if show_on_map then
+		if action == "start" then
+			local function updateFunc()
+				TitanMapFrame_OnUpdate(frame, 0.07);	-- simulating an OnUpdate call
+			end
+			frame:SetScript("OnShow", function()
+				frame.updateTicker = frame.updateTicker or C_Timer.NewTicker(0.07, updateFunc);
+				if WorldMapFrame:IsMaximized() then
+					WorldMapFrame.TitanSize = "large"
+					WorldMapFrame.TitanSizePrev = "none"
+				else
+					WorldMapFrame.TitanSize = "small"
+					WorldMapFrame.TitanSizePrev = "none"
+				end
+			end);
+			frame:SetScript("OnHide", function()
+				if (frame.updateTicker) then
+					frame.updateTicker:Cancel();
+					frame.updateTicker = nil;
+				end
+			end);
+		elseif action == "stop" then
+			-- stop timer, hooks are not needed
+			frame:SetScript("OnShow", nil)
+			frame:SetScript("OnHide", nil)
+			SetCoordText("", "") -- cleanup
+		else
+			-- action unknown ???
+		end
+	else
+		-- user did not request so save a few cycles
+	end
+
+	if debug_flow then
+		local msg =
+			"CoordFrames"
+			.." "..tostring(action)..""
+			.." "..tostring(show_on_map)..""
+		debug_msg(msg)
+	else
+		-- not requested
+	end
+end
+
+--[[
+-- **************************************************************************
+-- NAME : CreateMapFrames()
+-- DESC : Adds player and cursor coords to the WorldMapFrame, unless the player has CT_MapMod
+-- VARS : none
+-- **************************************************************************
+--]]
+local function CreateMapFrames()
+	if _G[TitanMapFrame] then
+		return -- if already created
+	end
+
+	-- avoid an addon conflict
+	if (_G["CT_MapMod"]) then
+		return;
+	end
+
+	if debug_flow then
+		local msg =
+			"CreateMapFrames"
+--			.." "..tostring(reason)..""
+		debug_msg(msg)
+	else
+		-- not requested
+	end
+
+	-- create the frame to hold the font strings, and simulate an "OnUpdate" script handler using C_Timer for efficiency
+	local frame = CreateFrame("FRAME", "TitanMapFrame", WorldMapFrame)
+	frame:SetFrameStrata("DIALOG") -- DF need to raise the strata to be seen
+
+	-- create the font strings and update their position based in minimizing/maximizing the main map
+	local playertext = frame:CreateFontString("TitanMapPlayerLocation", "ARTWORK", "GameFontNormal");
+	local cursortext = frame:CreateFontString("TitanMapCursorLocation", "ARTWORK", "GameFontNormal");
+	playertext:ClearAllPoints();
+	cursortext:ClearAllPoints();
+	playertext:SetPoint("TOPRIGHT", WorldMapFrameCloseButton, "BOTTOMRIGHT", 0, 0)
+	cursortext:SetPoint("TOP", playertext, "BOTTOM", 0, 0)
+end
+
+--[[
+-- **************************************************************************
+-- NAME : TitanPanelLocationButton_OnShow()
+-- DESC : Display button when plugin is visible
+-- **************************************************************************
+--]]
+function TitanPanelLocationButton_OnShow(self)
+
+	if debug_flow then
+		local msg =
+			"_OnShow"
+--			.." "..tostring(reason)..""
+		debug_msg(msg)
+	else
+		-- not requested
+	end
+
+	CreateMapFrames() -- as needed
+	CoordFrames("start") -- start coords on map, if requested
+
+	Events("register", "_OnShow")
+
+	-- Zone may not be available yet, PEW event should correct
+	ZoneUpdate(self);
+
+	TitanPanelButton_UpdateButton(TITAN_LOCATION_ID);
 end

 --[[
@@ -112,6 +379,9 @@ end
 function TitanPanelLocationButton_OnHide()
 	AceTimer.CancelTimer("TitanPanelLocation", LocationTimer, true)
 	LocationTimer = nil;
+
+	Events("unregister", "_OnHide")
+	CoordFrames("stop") -- stop coords on map, if requested
 end

 --[[
@@ -127,7 +397,7 @@ function TitanPanelLocationButton_GetButtonText(id)

 	-- Coordinates text, if requested
 	if (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsText")) then
-		button.px, button.py = TitanPanelGetPlayerMapPosition();
+		button.px, button.py = GetPlayerMapPosition();
 		-- cache coordinates for update checking later on
 		cachedX = button.px;
 		cachedY = button.py;
@@ -208,15 +478,22 @@ function TitanPanelLocationButton_GetTooltipText()
 		pvpInfoRichText = ""
 	end

+	-- build the tool tip
+	local zone = TitanUtils_GetHighlightText(TitanPanelLocationButton.zoneText) or ""
+	local sub_zone = TitanUtils_Ternary(
+			(TitanPanelLocationButton.subZoneText == ""),
+			"",
+			L["TITAN_LOCATION_TOOLTIP_SUBZONE"].."\t"..TitanUtils_GetHighlightText(TitanPanelLocationButton.subZoneText).."\n"
+			)
+	local bind_loc = TitanUtils_GetHighlightText(GetBindLocation())
+
 	return ""..
-		L["TITAN_LOCATION_TOOLTIP_ZONE"].."\t"..TitanUtils_GetHighlightText(TitanPanelLocationButton.zoneText).."\n"..
-		TitanUtils_Ternary((TitanPanelLocationButton.subZoneText == ""), "", L["TITAN_LOCATION_TOOLTIP_SUBZONE"].."\t"..TitanUtils_GetHighlightText(TitanPanelLocationButton.subZoneText).."\n")..
-		TitanUtils_Ternary((pvpInfoRichText == ""), "", L["TITAN_LOCATION_TOOLTIP_PVPINFO"].."\t"..pvpInfoRichText.."\n")..
-		"\n"..
-		TitanUtils_GetHighlightText(L["TITAN_LOCATION_TOOLTIP_HOMELOCATION"]).."\n"..
-		L["TITAN_LOCATION_TOOLTIP_INN"].."\t"..TitanUtils_GetHighlightText(GetBindLocation()).."\n"..
-		TitanUtils_GetGreenText(L["TITAN_LOCATION_TOOLTIP_HINTS_1"]).."\n"..
-		TitanUtils_GetGreenText(L["TITAN_LOCATION_TOOLTIP_HINTS_2"]);
+		L["TITAN_LOCATION_TOOLTIP_ZONE"].."\t"..zone.."\n"
+		..sub_zone.."\n"
+		..TitanUtils_GetHighlightText(L["TITAN_LOCATION_TOOLTIP_HOMELOCATION"]).."\n"
+		..L["TITAN_LOCATION_TOOLTIP_INN"].."\t"..bind_loc.."\n"
+		..TitanUtils_GetGreenText(L["TITAN_LOCATION_TOOLTIP_HINTS_1"]).."\n"
+		..TitanUtils_GetGreenText(L["TITAN_LOCATION_TOOLTIP_HINTS_2"])
 end

 --[[
@@ -229,25 +506,31 @@ function TitanPanelLocationButton_OnEvent(self, event, ...)
 -- DF TODO See if we can turn off zone on minimap
 --[=[
 --]=]
+	if debug_flow then
+		local msg =
+			"_OnEvent"
+			.." "..tostring(event)..""
+		debug_msg(msg)
+	else
+		-- not requested
+	end
+
 	if TITAN_ID == "TitanClassic" then
 		if event == "PLAYER_ENTERING_WORLD" then
 			if not TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap")
 				and MinimapBorderTop and MinimapBorderTop:IsShown() then
-				TitanPanelLocationButton_LocOnMiniMap("PEW")
+				LocOnMiniMap("PEW")
 			end
 		end

 		if TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") and MinimapBorderTop:IsShown() then
 			if not MinimapZoneTextButton:IsShown() then MinimapZoneTextButton:Show() end
---			if not MiniMapWorldMapButton:IsShown() then MiniMapWorldMapButton:Show() end
 		end
 	else
 		-- no work needed
 	end

-	TitanPanelLocationButton_UpdateZoneInfo(self);
-	TitanPanelPluginHandle_OnUpdate(updateTable);
-	TitanPanelLocation_HandleUpdater();
+	ZoneUpdate(self);
 --[[
 --]]
 end
@@ -260,7 +543,7 @@ end
 --]]
 function TitanPanelLocationButton_CheckForUpdate()
 	local mapID = C_Map.GetBestMapForUnit("player")
-	local tempx, tempy = TitanPanelGetPlayerMapPosition();
+	local tempx, tempy = GetPlayerMapPosition();
 	if tempx ~= cachedX or tempy ~= cachedY then
 		TitanPanelPluginHandle_OnUpdate(updateTable);
 	end
@@ -268,18 +551,6 @@ end

 --[[
 -- **************************************************************************
--- NAME : TitanPanelLocation_HandleUpdater()
--- DESC : Check to see if you are inside an instance
--- **************************************************************************
---]]
-function TitanPanelLocation_HandleUpdater()
-	if TitanPanelLocationButton:IsVisible() and not LocationTimer then
-		LocationTimer = AceTimer.ScheduleRepeatingTimer("TitanPanelLocation", TitanPanelLocationButton_CheckForUpdate, 0.5)
-	end
-end
-
---[[
--- **************************************************************************
 -- NAME : TitanPanelLocationButton_OnClick(button)
 -- DESC : Copies coordinates to chat line for shift-LeftClick
 -- VARS : button = value of action
@@ -300,29 +571,6 @@ function TitanPanelLocationButton_OnClick(self, button)
 	end
 end

---[[
--- **************************************************************************
--- NAME : TitanPanelLocationButton_UpdateZoneInfo()
--- DESC : Update data on button
--- **************************************************************************
---]]
-function TitanPanelLocationButton_UpdateZoneInfo(self)
-	local _ = nil
-	self.zoneText = GetZoneText();
-	self.subZoneText = GetSubZoneText();
-	self.pvpType, _, self.factionName = GetZonePVPInfo();
-end
-
---[[
--- **************************************************************************
--- NAME : TitanPanelRightClickMenu_PrepareLocationMenu()
--- DESC : Display rightclick menu options
--- **************************************************************************
---]]
-local function CoordLoc(loc)
-	local res = (TitanGetVar(TITAN_LOCATION_ID, "MapLocation") == loc)
-	return res
-end
 function TitanPanelRightClickMenu_PrepareLocationMenu()
 	local info

@@ -332,7 +580,10 @@ function TitanPanelRightClickMenu_PrepareLocationMenu()
 			TitanPanelRightClickMenu_AddTitle(L["TITAN_PANEL_OPTIONS"], TitanPanelRightClickMenu_GetDropdownLevel());
 			info = {};
 			info.text = L["TITAN_LOCATION_MENU_SHOW_ZONE_ON_PANEL_TEXT"];
-			info.func = TitanPanelLocationButton_ToggleDisplay;
+			info.func = function()
+				TitanToggleVar(TITAN_LOCATION_ID, "ShowZoneText");
+				TitanPanelButton_UpdateButton(TITAN_LOCATION_ID);
+			end
 			info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowZoneText");
 			TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());

@@ -357,9 +608,17 @@ function TitanPanelRightClickMenu_PrepareLocationMenu()
 			end
 			info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsText");
 			TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());
+
 			info = {};
 			info.text = L["TITAN_LOCATION_MENU_SHOW_COORDS_ON_MAP_TEXT"];
-			info.func = TitanPanelLocationButton_ToggleLocationOnMap;
+			info.func = function()
+				TitanToggleVar(TITAN_LOCATION_ID, "ShowCoordsOnMap");
+				if (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap")) then
+					CoordFrames("start")
+				else
+					CoordFrames("stop")
+				end
+			end
 			info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap");
 			TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());

@@ -368,7 +627,7 @@ function TitanPanelRightClickMenu_PrepareLocationMenu()
 			info.text = L["TITAN_LOCATION_MENU_SHOW_LOC_ON_MINIMAP_TEXT"];
 			info.func = function()
 				TitanToggleVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap");
-				TitanPanelLocationButton_LocOnMiniMap("config")
+				LocOnMiniMap("config")
 			end
 			info.checked = TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap");
 			info.disabled = InCombatLockdown()
@@ -385,52 +644,8 @@ function TitanPanelRightClickMenu_PrepareLocationMenu()
 			info.disabled = InCombatLockdown()
 			TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());

---[=[
-			if TITAN_ID == "TitanClassic" then
-				info = {};
-				TitanPanelRightClickMenu_AddSpacer(TitanPanelRightClickMenu_GetDropdownLevel());
-				TitanPanelRightClickMenu_AddTitle(L["TITAN_LOCATION_MENU_MAP_COORDS_TITLE"], TitanPanelRightClickMenu_GetDropdownLevel());
-
-				info = {};
-				info.text = L["TITAN_LOCATION_MENU_MAP_COORDS_LOC_1"]
-				info.func = function()
-					TitanSetVar(TITAN_LOCATION_ID, "MapLocation", "TOPLEFT")
-				end
-				info.checked = CoordLoc("TOPLEFT")
-				TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());
-				info = {};
-				info.text = L["TITAN_LOCATION_MENU_MAP_COORDS_LOC_2"]
-				info.func = function()
-					TitanSetVar(TITAN_LOCATION_ID, "MapLocation", "TOPRIGHT")
-				end
-				info.checked = CoordLoc("TOPRIGHT")
-				TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());
-				info = {};
-				info.text = L["TITAN_LOCATION_MENU_MAP_COORDS_LOC_3"]
-				info.func = function()
-					TitanSetVar(TITAN_LOCATION_ID, "MapLocation", "BOTTOMLEFT")
-				end
-				info.checked = CoordLoc("BOTTOMLEFT")
-				TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());
-				info = {};
-				info.text = L["TITAN_LOCATION_MENU_MAP_COORDS_LOC_4"]
-				info.func = function()
-					TitanSetVar(TITAN_LOCATION_ID, "MapLocation", "BOTTOM")
-				end
-				info.checked = CoordLoc("BOTTOM")
-				TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());
-				info = {};
-				info.text = L["TITAN_LOCATION_MENU_MAP_COORDS_LOC_5"]
-				info.func = function()
-					TitanSetVar(TITAN_LOCATION_ID, "MapLocation", "BOTTOMRIGHT")
-				end
-				info.checked = CoordLoc("BOTTOMRIGHT")
-				TitanPanelRightClickMenu_AddButton(info, TitanPanelRightClickMenu_GetDropdownLevel());
-			else
-				-- no work needed
-			end
---]=]
 		end
+
 		if TitanPanelRightClickMenu_GetDropdMenuValue() == "CoordFormat" then
 			TitanPanelRightClickMenu_AddTitle(L["TITAN_LOCATION_FORMAT_COORD_LABEL"], TitanPanelRightClickMenu_GetDropdownLevel());
 			info = {};
@@ -485,72 +700,6 @@ end

 --[[
 -- **************************************************************************
--- NAME : TitanPanelLocationButton_ToggleDisplay()
--- DESC : Set option to show zone text
--- **************************************************************************
---]]
-function TitanPanelLocationButton_ToggleDisplay()
-	TitanToggleVar(TITAN_LOCATION_ID, "ShowZoneText");
-	TitanPanelButton_UpdateButton(TITAN_LOCATION_ID);
-end
-
---[[
--- **************************************************************************
--- NAME : TitanPanelLocationButton_ToggleLocationOnMap()
--- DESC : Set option to show player coordinates on map
--- **************************************************************************
---]]
-function TitanPanelLocationButton_ToggleLocationOnMap()
-	TitanToggleVar(TITAN_LOCATION_ID, "ShowCoordsOnMap");
-	if (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap")) then
-		TitanMapPlayerLocation:Show();
-	else
-		TitanMapPlayerLocation:Hide();
-	end
-end
-
---[[
--- **************************************************************************
--- NAME : TitanPanelLocationButton_ToggleCursorLocationOnMap()
--- DESC : Set option to show cursor coordinates on map
--- **************************************************************************
---]]
-function TitanPanelLocationButton_ToggleCursorLocationOnMap()
-	TitanToggleVar(TITAN_LOCATION_ID, "ShowCursorOnMap");
-	if (TitanGetVar(TITAN_LOCATION_ID, "ShowCursorOnMap")) then
-		TitanMapCursorLocation:Show();
-	else
-		TitanMapCursorLocation:Hide();
-	end
-end
-
---[[
--- **************************************************************************
--- NAME : TitanPanelLocationButton_LocOnMiniMap()
--- DESC : Show / hide the location above the mini map per user settings
--- **************************************************************************
---]]
-function TitanPanelLocationButton_LocOnMiniMap(reason)
-	if TitanGetVar(TITAN_LOCATION_ID, "ShowLocOnMiniMap") then
-		MinimapBorderTop:Show()
-		MinimapZoneTextButton:Show()
---		MiniMapWorldMapButton:Show()
-	else
-		MinimapBorderTop:Hide()
-		MinimapZoneTextButton:Hide()
-		MiniMapWorldMapButton:Hide()
-	end
-
-	-- adjust MiniMap frame if needed
-	if reason == "config" then
-		TitanPanel_AdjustFrames(false);
-	else
-		-- 2024 Jan - Do not adjust; allow Titan to handle on PEW
-	end
-end
-
---[[
--- **************************************************************************
 -- NAME : TitanMapFrame_OnUpdate()
 -- DESC : Update coordinates on map
 -- **************************************************************************
@@ -561,11 +710,18 @@ function TitanMapFrame_OnUpdate(self, elapsed)

 	-- Determine the text to show for player coords

-	local cursorLocationText = "-C-"
-	local playerLocationText = "-P-"
+	local cursorLocationText = ""
+	local playerLocationText = ""
+
+	if debug_flow then
+		cursorLocationText = "-C-"
+		playerLocationText = "-P-"
+	else
+		-- use default
+	end

 	if (TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsOnMap")) then
-		self.px, self.py = TitanPanelGetPlayerMapPosition();
+		self.px, self.py = GetPlayerMapPosition();
 		if self.px == nil then self.px = 0 end
 		if self.py == nil then self.py = 0 end
 		if self.px == 0 and self.py == 0 then
@@ -600,117 +756,10 @@ print("TLoc"
 .." p "..tostring(playerLocationText).." "
 )
 --]==]
-		TitanMapPlayerLocation:SetText(cursorLocationText);
-		TitanMapCursorLocation:SetText(playerLocationText);
-
---		local mloc = TitanGetVar(TITAN_LOCATION_ID, "MapLocation") or "TOPRIGHT"
-		if TITAN_ID == "TitanClassic" then
-			-- Determine where to show the text
-			TitanMapPlayerLocation:ClearAllPoints()
-			TitanMapCursorLocation:ClearAllPoints()
-
-			TitanMapPlayerLocation:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOM", 0, 10)
-			TitanMapCursorLocation:SetPoint("BOTTOMRIGHT", WorldMapFrame, "BOTTOM", -10, 10)
-		else -- current retail
-			-- Position the text
-			if WorldMapFrame:IsMaximized() then
-				-- map should be 'full' screen
-				if WorldMapFrame.TitanSizePrev == "large" then
-					-- no change
-				else
-					TitanMapPlayerLocation:ClearAllPoints();
-					TitanMapCursorLocation:ClearAllPoints();
-					TitanMapPlayerLocation:SetPoint("RIGHT", MapMinMaxFrame, "LEFT", 0, 0)
-					TitanMapCursorLocation:SetPoint("TOP", TitanMapPlayerLocation, "BOTTOM", 0, -5)
-					WorldMapFrame.TitanSize = "large"
-				end
-			else
-				if WorldMapFrame.TitanSizePrev == "small" then
-					-- no change
-				else
-					TitanMapPlayerLocation:ClearAllPoints();
-					TitanMapCursorLocation:ClearAllPoints();
-					TitanMapPlayerLocation:SetPoint("RIGHT", MapMinMaxFrame, "LEFT", 0, 0)
-					TitanMapCursorLocation:SetPoint("LEFT", WorldMapFrame.BorderFrame.Tutorial, "RIGHT", 0, 0)
-					WorldMapFrame.TitanSize = "small"
-				end
-			end
-		end
+	SetCoordText(playerLocationText, cursorLocationText)

 end

---[[
--- **************************************************************************
--- NAME : TitanPanelGetPlayerMapPosition()
--- DESC : Get the player coordinates
--- VARS : x = location on x axis, y = location on y axis
--- **************************************************************************
---]]
-function TitanPanelGetPlayerMapPosition()
-    local mapID = C_Map.GetBestMapForUnit("player")
-    if mapID == nil then
-        return nil, nil
-    end
-
-    local position = C_Map.GetPlayerMapPosition(mapID, "player")
-    if position == nil then
-        return nil, nil
-    else
-    	return position:GetXY()
-	end
-end
-
---[[
--- **************************************************************************
--- NAME : TitanPanelLocation_CreateMapFrames()
--- DESC : Adds player and cursor coords to the WorldMapFrame, unless the player has CT_MapMod
--- VARS : none
--- **************************************************************************
---]]
-function TitanPanelLocation_CreateMapFrames()
-	if _G[TitanMapFrame] then
-		return -- if already created
-	end
-
-	-- avoid an addon conflict
-	if (_G["CT_MapMod"]) then
-		return;
-	end
-
-	-- create the frame to hold the font strings, and simulate an "OnUpdate" script handler using C_Timer for efficiency
---		local frame = CreateFrame("FRAME", "TitanMapFrame", WorldMapFrame.BorderFrame)
-	local frame = CreateFrame("FRAME", "TitanMapFrame", WorldMapFrame)
-	frame:SetFrameStrata("DIALOG") -- DF need to raise the strata to be seen
-	local function updateFunc()
-		TitanMapFrame_OnUpdate(frame, 0.07);	-- simulating an OnUpdate call
-	end
-	frame:HookScript("OnShow", function()
-		frame.updateTicker = frame.updateTicker or C_Timer.NewTicker(0.07, updateFunc);
-		if WorldMapFrame:IsMaximized() then
-			WorldMapFrame.TitanSize = "large"
-			WorldMapFrame.TitanSizePrev = "none"
-		else
-			WorldMapFrame.TitanSize = "small"
-			WorldMapFrame.TitanSizePrev = "none"
-		end
-	end);
-	frame:HookScript("OnHide", function()
-		if (frame.updateTicker) then
-			frame.updateTicker:Cancel();
-			frame.updateTicker = nil;
-		end
-	end);
-
-	-- create the font strings and update their position based in minimizing/maximizing the main map
-	local playertext = frame:CreateFontString("TitanMapPlayerLocation", "ARTWORK", "GameFontNormal");
-	local cursortext = frame:CreateFontString("TitanMapCursorLocation", "ARTWORK", "GameFontNormal");
-	playertext:ClearAllPoints();
-	cursortext:ClearAllPoints();
-	playertext:SetPoint("TOPRIGHT", WorldMapFrameCloseButton, "BOTTOMRIGHT", 0, 0)
-	cursortext:SetPoint("TOP", playertext, "BOTTOM", 0, 0)
-end
-
-
 -- ====== Create needed frames
 local function Create_Frames()
 	if _G[TITAN_BUTTON] then
@@ -745,8 +794,6 @@ local function Create_Frames()
 end


-if TITAN_ID then -- it exists
-	AceTimer = LibStub("AceTimer-3.0")
-	L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true)
-	Create_Frames() -- do the work
-end
+AceTimer = LibStub("AceTimer-3.0")
+L = LibStub("AceLocale-3.0"):GetLocale(TITAN_ID, true)
+Create_Frames()