Quantcast

Another attempt on the exit vehicle while in combat

urnati [11-27-18 - 16:31]
Another attempt on the exit vehicle while in combat
Filename
Titan/TitanMovable.lua
Titan/TitanPanel.lua
diff --git a/Titan/TitanMovable.lua b/Titan/TitanMovable.lua
index ca12abf..33d959d 100755
--- a/Titan/TitanMovable.lua
+++ b/Titan/TitanMovable.lua
@@ -74,6 +74,7 @@ NOTE:
 - Needed because 8.0 made changes to the menu bar processing
 - Tell Blizzard that the bar is user placed IF NOT in combat to prevent 'bouncing' of the bar if users use a bottom Titan bar
 - This is called for the various events Titan handles that do / may hide the main menu bar
+- IF TitanMovable_MenuBar_Disable was called, this must be called before having Titan adjust frames. The 'is user placed' is required to work around a Blizzard 'feature' that adjusts the main menu bar while in combat.
 :NOTE
 --]]
 function TitanMovable_MenuBar_Enable()
diff --git a/Titan/TitanPanel.lua b/Titan/TitanPanel.lua
index 0cab352..ab3eff7 100644
--- a/Titan/TitanPanel.lua
+++ b/Titan/TitanPanel.lua
@@ -304,7 +304,7 @@ _G[TITAN_PANEL_CONTROL]:RegisterEvent("CVAR_UPDATE");
 _G[TITAN_PANEL_CONTROL]:RegisterEvent("PLAYER_LOGOUT");
 _G[TITAN_PANEL_CONTROL]:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED");
 _G[TITAN_PANEL_CONTROL]:RegisterEvent("UNIT_ENTERED_VEHICLE");
---_G[TITAN_PANEL_CONTROL]:RegisterEvent("UNIT_EXITED_VEHICLE");
+_G[TITAN_PANEL_CONTROL]:RegisterEvent("UNIT_EXITED_VEHICLE");
 _G[TITAN_PANEL_CONTROL]:SetScript("OnEvent", function(_, event, ...)
 	_G[TITAN_PANEL_CONTROL][event](_G[TITAN_PANEL_CONTROL], ...)
 end)
@@ -521,9 +521,6 @@ function TitanPanelBarButton:PLAYER_REGEN_DISABLED()
 	-- If in combat close all control frames and menus
 	TitanUtils_CloseAllControlFrames();
 	TitanUtils_CloseRightClickMenu();
-
-	-- Needed because 8.0 made changes to the menu bar processing (see TitanMovable)
-	TitanMovable_MenuBar_Disable()
 end

 function TitanPanelBarButton:PLAYER_REGEN_ENABLED()
@@ -539,6 +536,7 @@ function TitanPanelBarButton:ACTIVE_TALENT_GROUP_CHANGED()
 end

 function TitanPanelBarButton:UNIT_ENTERED_VEHICLE(self, ...)
+--TitanPrint("UNIT_ENTERED_VEHICLE - ", "warning")
 	-- If in combat close all control frames and menus
 	TitanUtils_CloseAllControlFrames();
 	TitanUtils_CloseRightClickMenu();
@@ -548,7 +546,12 @@ function TitanPanelBarButton:UNIT_ENTERED_VEHICLE(self, ...)
 end
 function TitanPanelBarButton:UNIT_EXITED_VEHICLE(self, ...)
 	-- Needed because 8.0 made changes to the menu bar processing (see TitanMovable)
-	TitanMovable_MenuBar_Enable()
+	if InCombatLockdown() then
+--TitanPrint("UNIT_EXITED_VEHICLE - nyl", "warning")
+	else
+--TitanPrint("UNIT_EXITED_VEHICLE - enable", "warning")
+		TitanMovable_MenuBar_Enable()
+	end

 	-- A combat check will be done inside the adjust
 	TitanPanel_AdjustFrames()
@@ -559,14 +562,8 @@ function TitanPanelBarButton:PET_BATTLE_OPENING_START()
 --	TitanDebug("Pet_battle start: ")
 	-- Hide all bars and hiders
 	TitanPanelBarButton_HideAllBars()
-
-	-- Needed because 8.0 made changes to the menu bar processing (see TitanMovable)
-	TitanMovable_MenuBar_Disable()
 end
 function TitanPanelBarButton:PET_BATTLE_CLOSE()
-	-- Needed because 8.0 made changes to the menu bar processing (see TitanMovable)
-	TitanMovable_MenuBar_Enable()
-
 	-- A combat check will be done inside the adjust
 	TitanPanelBarButton_DisplayBarsWanted()
 end