ALL THE THINGS

ALL THE THINGS

31M Downloads

MiniList, and probably mainlist hide in pet battle

Nirek-K opened this issue ยท 4 comments

commented

Could an option be added to hide the lists when a pet battle starts?

commented

Any traction on this? I have a rudementary solution that works, but having to readd it every update gets kind of old :)

commented

If you post your code snippet that you copy+paste and I'll add it as an interface option.

commented

Relatively lazy way to do it I'm sure, but this is what I use, to hide the main list if it's open when going into a pet battle. I've used it for quite some time, but I don't go crazy with having lots of windows open or anything, just the mainlist.

these at ~line 11330 with the other event registers, and then the code block at the very bottom of the file past the last end

app:RegisterEvent("PET_BATTLE_OPENING_START")
app:RegisterEvent("PET_BATTLE_CLOSE")


local popoutVis = false;
local mainVis = false;
app.events.PET_BATTLE_OPENING_START = function(...)
	local popout = app:GetWindow("CurrentInstance");
	local main = app:GetWindow("Prime");
		if popout:IsVisible() then
			popout:Toggle();
			popoutVis = true;
		end
		if main:IsVisible() then
			main:Toggle();
			mainVis = true;
		end
end
app.events.PET_BATTLE_CLOSE = function(...)
	if popoutVis then 
		app:ToggleMiniListForCurrentZone() 
		popoutVis = false;
	end
	if mainVis then 
		ToggleMainList() 
		mainVis = false;
	end
end

commented

Just pushed it in 1fe9b20 . Adjusted a couple things and tested it and it was properly working. If you get any bugs with it just let us know and we'll look at it again, but with what I just pushed all seemed to be working as I tested it with about 10 different pet battles. If Crieve sees anything he might think need tweaking he can do that as well, but I didn't see anything else offhand.