WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Macro Help (https://www.wowinterface.com/forums/forumdisplay.php?f=140)
-   -   Chat system messages on/off macro (https://www.wowinterface.com/forums/showthread.php?t=59812)

atshn 03-04-24 10:22 PM

Chat system messages on/off macro
 
I'm using this in two of my macros:

Code:

/run ChatConfigOtherSettingsSystemCheckBox1Check:Click()
It does the job, but I'd rather have one of my macros be able turn it on, and the other macro be able to turn it off, rather than the toggle above.

Fizzlemizz 03-04-24 11:21 PM

Presumably:

Lua Code:
  1. /run if ChatConfigOtherSettingsSystemCheckBox1Check:GetChecked() then ChatConfigOtherSettingsSystemCheckBox1Check:Click() else print("Already OFF!") end

and:

Lua Code:
  1. /run if not ChatConfigOtherSettingsSystemCheckBox1Check:GetChecked() then ChatConfigOtherSettingsSystemCheckBox1Check:Click() else print("Already ON!") end

atshn 03-04-24 11:44 PM

Perfect. Thanks again, Fizzle.

atshn 03-06-24 01:26 AM

There is one problem that I've encountered. I have to open the frame where the system messages check box is located after I login before the macros will work. After I open it once, the macros will work fine until I log out. I'm guessing the frame doesn't "exist" for the macros to work until it is opened? Any solution to this problem that you know of?

Fizzlemizz 03-06-24 11:08 AM

For both macros, after /run and before if insert

Lua Code:
  1. CURRENT_CHAT_FRAME_ID = 1 ChatConfigOtherSettings_OnShow()

This will change the setting for the "General" chat frame. Each chat frame has it's own list of channels and messages it listens for.

A better method would probably be to add/remove the message event(s) from the chatframe rather than doing the Click() thing especially if you wanted to do this for all chat frames.

atshn 03-06-24 12:45 PM

That took care of it. Much appreciated!

SDPhantom 03-07-24 09:50 AM

Quote:

Originally Posted by Fizzlemizz (Post 343499)
A better method would probably be to add/remove the message event(s) from the chatframe rather than doing the Click() thing especially if you wanted to do this for all chat frames.

This is what the checkbox ends up calling
Code:

/run if not ChatFrame_ContainsMessageGroup(ChatFrame1,"SYSTEM") then ChatFrame_AddMessageGroup(ChatFrame1,"SYSTEM");end
Code:

/run if ChatFrame_ContainsMessageGroup(ChatFrame1,"SYSTEM") then ChatFrame_RemoveMessageGroup(ChatFrame1,"SYSTEM");end
ChatFrame1 is the default general chatframe, ChatFrame2 is the CombatLog. This goes up to ChatFrame10, which is the maximum number of them (there are some exceptions) you can have.


All times are GMT -6. The time now is 12:28 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI