Thread Tools Display Modes
03-04-24, 10:22 PM   #1
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
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.
  Reply With Quote
03-04-24, 11:21 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
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
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
03-04-24, 11:44 PM   #3
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
Perfect. Thanks again, Fizzle.
  Reply With Quote
03-06-24, 01:26 AM   #4
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
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?
  Reply With Quote
03-06-24, 11:08 AM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,879
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.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 03-06-24 at 11:18 AM.
  Reply With Quote
03-06-24, 12:45 PM   #6
atshn
A Deviate Faerie Dragon
Join Date: Feb 2024
Posts: 19
That took care of it. Much appreciated!
  Reply With Quote
03-07-24, 09:50 AM   #7
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
Originally Posted by Fizzlemizz View Post
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.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » Macro Help » Chat system messages on/off macro


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off