Quantcast

- TitanMovable: Fixed delayed removal of TitanPanel frame in WorldMapFrame:IsMaximized() state.

HonorGoG [08-22-18 - 03:05]
- TitanMovable: Fixed delayed removal of TitanPanel frame in WorldMapFrame:IsMaximized() state.
- TitanVariable: Changed base strata of Titan Panel to "LOW" to allow for proper appearance behind WorldMapFrame.
- TitanLocation: Added player and cursor coordinates to fullscreen map.
- Forced TitanPanelStrata level to "LOW".
Filename
Titan/TitanMovable.lua
Titan/TitanPanel.lua
Titan/TitanVariables.lua
TitanLocation/TitanLocation.lua
TitanLocation/TitanLocation.xml
diff --git a/Titan/TitanMovable.lua b/Titan/TitanMovable.lua
index caa80e8..ac9e3be 100755
--- a/Titan/TitanMovable.lua
+++ b/Titan/TitanMovable.lua
@@ -300,9 +300,9 @@ function TitanMovableFrame_MoveFrames(position)
 	-- move them...
 	if not InCombatLockdown() then
 		if (WorldMapFrame:IsShown() and WorldMapFrame:IsMaximized()) then
-			TitanVariables_SetPanelStrata("LOW")
+			--TitanVariables_SetPanelStrata("LOW")
 		else
-			TitanVariables_SetPanelStrata(TitanPanelGetVar("FrameStrata"))
+			--TitanVariables_SetPanelStrata(TitanPanelGetVar("FrameStrata"))
 		end
 		local adj_frame = true
 		for index, value in pairs(TitanMovable) do
@@ -764,8 +764,8 @@ function TitanMovable_SecureFrames()
 --		TitanPanelAce:SecureHook(OverrideActionBar, "Hide", Titan_ManageFramesTest1) -- HelpFrame.xml
 		TitanPanelAce:SecureHook("UpdateContainerFrameAnchors", Titan_ContainerFrames_Relocate) -- ContainerFrame.lua
 		TitanPanelAce:SecureHook(WorldMapFrame.BorderFrame.MaximizeMinimizeFrame.MinimizeButton, "Show", Titan_Hook_Adjust_Both) -- WorldMapFrame.lua
-		TitanPanelAce:SecureHook(WorldMapFrame, "Show", Titan_Hook_Adjust_Both) -- WorldMapFrame.lua
-		TitanPanelAce:SecureHook(WorldMapFrame, "Hide", Titan_Hook_Adjust_Both) -- WorldMapFrame.lua
+--		TitanPanelAce:SecureHook(WorldMapFrame, "Show", Titan_Hook_Adjust_Both) -- WorldMapFrame.lua
+--		TitanPanelAce:SecureHook(WorldMapFrame, "Hide", Titan_Hook_Adjust_Both) -- WorldMapFrame.lua
 		TitanPanelAce:SecureHook("BuffFrame_Update", Titan_Hook_Adjust_Both) -- BuffFrame.lua
 	end

diff --git a/Titan/TitanPanel.lua b/Titan/TitanPanel.lua
index 22267ba..7264493 100644
--- a/Titan/TitanPanel.lua
+++ b/Titan/TitanPanel.lua
@@ -413,6 +413,8 @@ function TitanPanel_PlayerEnteringWorld()
 	end

 	-- Init panel frame strata
+	-- *** Remove the following one line at the end of 2018 ***
+	TitanPanelSetVar("FrameStrata", "LOW")
 	TitanVariables_SetPanelStrata(TitanPanelGetVar("FrameStrata"))

 	-- Titan Panel has initialized its variables and registered plugins.
diff --git a/Titan/TitanVariables.lua b/Titan/TitanVariables.lua
index 013a616..adb5e56 100644
--- a/Titan/TitanVariables.lua
+++ b/Titan/TitanVariables.lua
@@ -244,7 +244,7 @@ TITAN_PANEL_SAVED_VARIABLES = {
 	TooltipFont = 1,
 	DisableTooltipFont = 1,
 	FontName = TPC.FONT_NAME,
-	FrameStrata = "DIALOG",
+	FrameStrata = "LOW",
 	FontSize = TPC.FONT_SIZE,
 	ScreenAdjust = false,
 	LogAdjust = false,
diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua
old mode 100644
new mode 100755
index 79dd1e2..eb46ae8
--- a/TitanLocation/TitanLocation.lua
+++ b/TitanLocation/TitanLocation.lua
@@ -59,6 +59,8 @@ function TitanPanelLocationButton_OnLoad(self)
 	self:RegisterEvent("ZONE_CHANGED_INDOORS");
 	self:RegisterEvent("ZONE_CHANGED_NEW_AREA");
 	self:RegisterEvent("PLAYER_ENTERING_WORLD");
+
+	TitanPanelLocation_CreateMapFrames();
 end

 -- **************************************************************************
@@ -452,27 +454,6 @@ function TitanMapFrame_OnUpdate(self, elapsed)

 	-- Determine the text to show for player coords

---[[
-	if WorldMapFrame:IsVisible() then
-		TitanMapPlayerLocation:SetText("");
-	else
-		self.px, self.py = TitanPanelGetPlayerMapPosition();
-		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
-			playerLocationText = L["TITAN_LOCATION_NO_COORDS"]
-		else
-			if (TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat1")) then
-				playerLocationText = format(L["TITAN_LOCATION_FORMAT"], 100 * self.px, 100 * self.py);
-			elseif (TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat2")) then
-				playerLocationText = format(L["TITAN_LOCATION_FORMAT2"], 100 * self.px, 100 * self.py);
-			elseif (TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat3")) then
-				playerLocationText = format(L["TITAN_LOCATION_FORMAT3"], 100 * self.px, 100 * self.py);
-			end
-		end
-		TitanMapPlayerLocation:SetText(format(L["TITAN_LOCATION_MAP_PLAYER_COORDS_TEXT"], TitanUtils_GetHighlightText(playerLocationText)));
-	end
-]]
 	if WorldMapFrame:IsMaximized() then
 		self.px, self.py = TitanPanelGetPlayerMapPosition();
 		if self.px == nil then self.px = 0 end
@@ -530,22 +511,16 @@ function TitanMapFrame_OnUpdate(self, elapsed)

 	-- *
 	TitanMapPlayerLocation:ClearAllPoints()
---[[
-	if ( WorldMapFrame:IsVisible() ) then
-		-- **
-		TitanMapPlayerLocation:SetPoint("TOPLEFT", WorldMapFrame, "TOPLEFT", 75, -12)
-	else
-		x_offset = (WorldMapFrame:GetWidth() / 1.6) -- left fifth of map
-			- (TitanMapPlayerLocation:GetWidth() / 1.8) -- center of coords
-		TitanMapPlayerLocation:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOMLEFT", x_offset, 10)
-	end
-]]
+	TitanMapCursorLocation:ClearAllPoints()
+
 	if WorldMapFrame:IsMaximized() then
-		x_offset = (WorldMapFrame:GetWidth() / 1.6) -- left fifth of map
+		x_offset = (WorldMapFrame:GetWidth() / 1.2) -- left fifth of map
 			- (TitanMapPlayerLocation:GetWidth() / 1.8) -- center of coords
-		TitanMapPlayerLocation:SetPoint("BOTTOMLEFT", WorldMapFrame, "BOTTOMLEFT", x_offset, 10)
+		TitanMapPlayerLocation:SetPoint("TOPRIGHT", WorldMapFrame, "TOPRIGHT", -10, -28)
+		TitanMapCursorLocation:SetPoint("TOPRIGHT", WorldMapFrame, "TOPRIGHT", -10, -43)
 	else
-		TitanMapPlayerLocation:SetPoint("TOPLEFT", WorldMapFrame, "TOPLEFT", 75, -12)
+		--TitanMapCursorLocation:SetText("");
+		--TitanMapPlayerLocation:SetPoint("TOPRIGHT", WorldMapFrame, "TOPRIGHT", 65, -20)
 	end
 end

@@ -567,3 +542,25 @@ function TitanPanelGetPlayerMapPosition()
     	return position:GetXY()
 	end
 end
+
+
+-- **************************************************************************
+-- NAME : TitanPanelLocation_CreateMapFrames()
+-- DESC : Delays creating frames until the WorldMapFrame is ready
+-- VARS : none
+-- **************************************************************************
+local TPL_CMF_IsFirstTime = true;
+function TitanPanelLocation_CreateMapFrames()
+	WorldMapFrame:HookScript("OnShow", function(self)
+		if (TPL_CMF_IsFirstTime and not _G["CT_Library"]) then
+			TPL_CMF_IsFirstTime = false;
+			local frame = CreateFrame("FRAME", "TitanMapFrame", WorldMapFrame.BorderFrame)
+			local font1 = frame:CreateFontString("TitanMapPlayerLocation", "ARTWORK", "GameFontNormal");
+			font1:SetPoint("TOPRIGHT",WorldMapFrame,"TOPRIGHT",0,0);
+			local font2 = frame:CreateFontString("TitanMapCursorLocation", "ARTWORK", "GameFontNormal");
+			font2:SetPoint("TOPRIGHT",WorldMapFrame,"TOPRIGHT",0,0);
+			frame:HookScript("OnUpdate",TitanMapFrame_OnUpdate);
+		end
+	end);
+
+end
\ No newline at end of file
diff --git a/TitanLocation/TitanLocation.xml b/TitanLocation/TitanLocation.xml
index 0770882..453e6d2 100644
--- a/TitanLocation/TitanLocation.xml
+++ b/TitanLocation/TitanLocation.xml
@@ -27,33 +27,4 @@
 			</Button>
 		</Frames>
 	</Frame>
-	<Frame name="TitanMapFrame" parent="WorldMapFrame">
-		<Layers>
-			<Layer level="ARTWORK">
-				<FontString name="TitanMapPlayerLocation" inherits="GameFontNormal" justifyH="LEFT">
-					<Anchors>
-						<Anchor point="BOTTOMLEFT" relativeTo="WorldMapFrame" relativePoint="BOTTOMLEFT">
-							<Offset>
-								<AbsDimension x="10" y="0"/>
-							</Offset>
-						</Anchor>
-					</Anchors>
-				</FontString>
-				<FontString name="TitanMapCursorLocation" inherits="GameFontNormal" justifyH="LEFT">
-					<Anchors>
-						<Anchor point="LEFT" relativeTo="TitanMapPlayerLocation" relativePoint="RIGHT">
-							<Offset>
-								<AbsDimension x="20" y="0"/>
-							</Offset>
-						</Anchor>
-					</Anchors>
-				</FontString>
-			</Layer>
-		</Layers>
-		<Scripts>
-			<OnUpdate>
-				TitanMapFrame_OnUpdate(self, elapsed);
-			</OnUpdate>
-		</Scripts>
-	</Frame>
 </Ui>
\ No newline at end of file