Quantcast

- Prevent a rare error from showing in Location button text, use blank instead

urnati [08-09-25 - 00:17]
- Prevent a rare error from showing in Location button text, use blank instead
- Titan : Fix #1439, due to an API change in 11.2 (War WIthin)
- Config : Allow BG (plus) widget to be adjusted 'up' on screen
Filename
Titan/Titan.lua
Titan/TitanConfig.lua
TitanLocation/TitanLocation.lua
diff --git a/Titan/Titan.lua b/Titan/Titan.lua
index df47219..73bd355 100644
--- a/Titan/Titan.lua
+++ b/Titan/Titan.lua
@@ -65,6 +65,18 @@ end
 function TitanPanel_SaveCustomProfile()
 	-- Create the dialog box code we'll need...

+	---helper to get the edit box depending on expansion API
+	---@param self table
+	---@return table
+	local function GetBox(self)
+		if self.editBox then
+			-- Older version of API
+			return self.editBox
+		else
+			return self:GetEditBox()
+		end
+	end
+
 	-- helper to actually write the profile to the Titan saved vars
 	local function Write_profile(name)
 		local currentprofilevalue, _, _ = TitanUtils_GetPlayer()
@@ -85,7 +97,7 @@ function TitanPanel_SaveCustomProfile()
 	end
 	-- helper to handle getting the profile name from the user
 	local function Get_profile_name(self)
-		local rawprofileName = self.editBox:GetText();
+		local rawprofileName = GetBox(self):GetText();
 		-- remove any spaces the user may have typed in the name
 		local conc2profileName = string.gsub(rawprofileName, " ", "");
 		if conc2profileName == "" then return; end
@@ -148,10 +160,10 @@ function TitanPanel_SaveCustomProfile()
 			Get_profile_name(self)
 		end,
 		OnShow = function(self)
-			self.editBox:SetFocus();
+			GetBox(self):SetFocus();
 		end,
 		OnHide = function(self)
-			self.editBox:SetText("");
+			GetBox(self):SetText("");
 		end,
 		EditBoxOnEnterPressed = function(self)
 			-- We need to get the parent because self refers to the edit box.
diff --git a/Titan/TitanConfig.lua b/Titan/TitanConfig.lua
index 88c47fd..950471d 100644
--- a/Titan/TitanConfig.lua
+++ b/Titan/TitanConfig.lua
@@ -16,54 +16,6 @@ local TitanSkinToRemove = "None";
 local TitanSkinName, TitanSkinPath = "", "";
 local TitanGlobalProfile = ""

-local function TitanPanel_ScreenAdjustReload()
-	if TitanPanelGetVar("ScreenAdjust") then
-		-- if set then clear it - the screen will adjust
-		TitanPanelBarButton_ToggleScreenAdjust()
-	else
-		-- if NOT set then need a reload - the screen will NOT adjust
-		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("ScreenAdjust");
-				ReloadUI();
-			end,
-			showAlert = 1,
-			timeout = 0,
-			whileDead = 1,
-			hideOnEscape = 1
-		};
-		StaticPopup_Show("TITAN_RELOAD");
-	end
-end
-local function TitanPanel_AuxScreenAdjustReload()
-	if TitanPanelGetVar("AuxScreenAdjust") then
-		-- if set then clear it - the screen will adjust
-		TitanPanelBarButton_ToggleAuxScreenAdjust()
-	else
-		-- if NOT set then need a reload - the screen will NOT adjust
-		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("AuxScreenAdjust");
-				ReloadUI();
-				--				TitanPanelBarButton_ToggleAuxScreenAdjust();
-			end,
-			showAlert = 1,
-			timeout = 0,
-			whileDead = 1,
-			hideOnEscape = 1
-		};
-		StaticPopup_Show("TITAN_RELOAD");
-	end
-end
-
 TITAN_PANEL_CONFIG = {
 	topic = {
 		About          = L["TITAN_PANEL"],
@@ -443,7 +395,7 @@ local function TitanUpdateAdj(t, pos)
 			name = "Vertical Adjustment", --L["TITAN_PANEL_TRANS_MENU_TEXT_SHORT"],
 			order = position,
 			min = -200,
-			max = 0,
+			max = 200,
 			step = 1,
 			get = function(info)
 				local frame_str = info[1]
diff --git a/TitanLocation/TitanLocation.lua b/TitanLocation/TitanLocation.lua
index 6481d4a..9c44ebf 100755
--- a/TitanLocation/TitanLocation.lua
+++ b/TitanLocation/TitanLocation.lua
@@ -136,7 +136,6 @@ local function RealmUpdate()
 end
 ---local Function to throttle down unnecessary updates
 local function CheckForPositionUpdate()
-	local mapID = C_Map.GetBestMapForUnit("player")
 	local tempx, tempy = GetPlayerMapPosition()

 	-- If unknown then use 0,0
@@ -464,6 +463,8 @@ local function GetButtonText(id)
 		if TitanGetVar(TITAN_LOCATION_ID, "ShowCoordsText") then
 			if place.px == 0 and place.py == 0 then
 				xy_text = ""
+			elseif place.px == nil or place.py == nil then
+				xy_text = ""
 			else
 				xy_text = format(TitanGetVar(TITAN_LOCATION_ID, "CoordsFormat"), 100 * place.px, 100 * place.py)
 			end