Shadow & Light (ElvUI Plugin)

Shadow & Light (ElvUI Plugin)

14M Downloads

[Feature Request] Ability to hide chat panels in pet battle

leemitchell25 opened this issue ยท 6 comments

commented

Hi there,

Recently changed my ElvUI and the chat panel placement now interferes with the Pet Battle UI. Noticed that Shadow & Light can hide the panels in combat so I figured out a way to have it also hide them in pet battles. I think it would be great if this was implemented in future versions of Shadow & Light for other users.

The modifications I made are as follows.


In defaults\profile.lua add the following code under line 294:

["petbattlehide"] = "NONE",

In modules\chat\chat.lua in function C:Initialize add the following after the --Combat Hide code:

--PetBattle Hide
self:RegisterEvent('PET_BATTLE_OPENING_START', 'PetBattle')
self:RegisterEvent('PET_BATTLE_CLOSE', 'PetBattle')

In modules\chat\chat.lua add the following function after the C:Combat(event) function:

function C:PetBattle(event)
	if event == 'PET_BATTLE_OPENING_START' then
		if E.db.sle.chat.petbattlehide == 'BOTH' or E.db.sle.chat.petbattlehide == 'RIGHT' then
			RightChatPanel:Hide()
			RightChatToggleButton:Hide()
		end
		if E.db.sle.chat.petbattlehide == 'BOTH' or E.db.sle.chat.petbattlehide == 'LEFT' then
			LeftChatPanel:Hide()
			LeftChatToggleButton:Hide()
		end
	elseif event == 'PET_BATTLE_CLOSE' then
		if not RightChatPanel:IsShown() then
			RightChatPanel:Show()
			RightChatToggleButton:Show()
		end
		if not LeftChatPanel:IsShown() then
			LeftChatPanel:Show()
			LeftChatToggleButton:Show()
		end
	end
end

In option\chat\chat_c.lua in function configTable() add the following code after the combathide options:

petbattlehide = {
	order = 10, type = "select",
	name = L["Hide In Pet Battle"],
	get = function(info) return E.db.sle.chat.petbattlehide end,
	set = function(info, value)	E.db.sle.chat.petbattlehide = value end,
	values = {
		["NONE"] = NONE,
		["BOTH"] = L["Both"],
		["LEFT"] = L["Left"],
		["RIGHT"] = L["Right"],
	}
},

And finally, in option\chat\chat_c.lua in function configTable() change the order for the setupDelay options from 10 to 11.


Thank you for all your hard work on Shadow & Light. It's an awesome addition to ElvUI. :)

commented

Also the RMBA interface next to the minimap stays open in a pet battle when it shouldn't

commented

Also the RMBA interface next to the minimap stays open in a pet battle when it shouldn't

The what? I don't pet battle other than to test something specific to it.

commented

Ah, sorry I guess it's not always the same letters. There are 4 letter buttons that I'm not sure what all of them do, but they persist during pet battles, when all UI elements are supposed to hide. Here it is CASR, and the number is the addons list button.

image

commented

ahh ui buttons

commented

Ah, sorry I guess it's not always the same letters. There are 4 letter buttons that I'm not sure what all of them do, but they persist during pet battles, when all UI elements are supposed to hide. Here it is CASR, and the number is the addons list button.

image

u can use the visibility section to hide them during petbattle, put [petbattle] hide; show

commented

cool, done. by the way i never knew what the ui buttons did until i just went into the menu right now, i think it would be cool to put tooltips on each UI button (im going to use the addons one all the time now) but its just a passing thought, thanks for the help!