|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Mon Feb 05, 2007 6:08 am
Events firing in disabled folders |
I have an event located in a folder that is sometimes disabled, sometimes enabled. I would expect that when the folder is disabled that the event would not fire, but it seems the event ignores the status of the folder and fires anyway regardless.
Is this meant to work this way or is this an error? |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 6:22 am |
Works fine for me. I rclicked the class in the package editor and unchecked enable, and tried #t- and both worked. What method are you using?
|
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Mon Feb 05, 2007 7:24 am |
I right-clicked the folder it was contained in and disabled it.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 7:37 am |
The only thing I can think of is that there's another event, not in the class, that's doing the same thing, or that there's something here that you're doing that you haven't described. Try duplicating my test - in the untitled session, I created two events, both called test. One echoes "bam", the other "babam" - one is in a class called test and one isn't. They both raise properly when the class is enabled - rclick and disable and the in-class one stops raising for me.
|
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Mon Feb 05, 2007 3:00 pm |
Is one of the events in another package or module?
|
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Mon Feb 05, 2007 3:38 pm |
I tried it again and it seems to be working just fine now. How odd.
|
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Mon Feb 05, 2007 4:54 pm |
I will mention that I had a lot of program errors before I noticed it malfunctioning and that I restarted the program to test it again. So perhaps the program restart after the errors had something to do with it starting to work again.
|
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 9:24 pm |
By "program errors" I assume you mean crashes that brought up the Report Bug dialog? Oftentimes errors that cause that leave memory corruption unless you restart, which can make things go weird.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Feb 05, 2007 10:03 pm |
Quote: |
I right-clicked the folder it was contained in and disabled it.
|
I think this is a known bug. Basically what happens is that when you disable a setting in the GUI (I know this applies to classes, but I dunno about anything else) it only disables that setting and not the other settings that are contained in it. #T+ and #T- work correctly, and also cut off access to contained settings, but there's no corresponding icon change for those so it looks identical to what happens when you just use the GUI. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 10:57 pm |
But it worked just fine when I tried it.
EDIT: But there is something weird going on. Try reproducing this one:
1)Open the untitled session.
2)Open the package editor.
3)Select New... class and name it test.
4)Select New... event and name it blah, give it a #say script.
5)Select New... event and name it blah again, give it a different #say.
6)Click on the window item to change the current class.
7)Select New... event and name it blah, give it a third #say.
8)Now - and this is the important bit - drag the second event out of the class folder and into the window, so it's in with the third event.
9)On the command line, type #raise blah - all three messages should appear.
10)Now rclick the class test and click Enabled to disable it.
11)Now hit enter on the command line to reraise the event.
I only get the third #say appearing. |
|
Last edited by Fang Xianfu on Mon Feb 05, 2007 11:03 pm; edited 1 time in total |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Feb 05, 2007 11:01 pm |
Quote: |
it only disables that setting and not the other settings that are contained in it |
That's technically true, but whenever CMUD looks for a setting (alias, variable, trigger, etc) it calls a function to see if the setting is "InScope" and this function checks to see if the setting itself is enabled, *AND* checks all of the parent classes to see if they are enabled too.
The GUI only changes the color of the setting if the setting *itself* is disabled, not if the parent class is disabled. This is normal and there isn't any bug about this that I'm aware of.
So, I'm not sure what "known bug" Matt is refering to. |
|
|
|
Fang Xianfu GURU
Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Mon Feb 05, 2007 11:04 pm |
See above edit please Zugg, I added some more info on what could be this problem, or another.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Mon Feb 05, 2007 11:59 pm |
Quote: |
The GUI only changes the color of the setting if the setting *itself* is disabled, not if the parent class is disabled. This is normal and there isn't any bug about this that I'm aware of.
|
Right. I must've been noticing the issue with buttons. Using the GUI to disable the class a button is contained in does not modify the button; using #T+ or #T- does. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Tue Feb 06, 2007 1:07 am |
It seems like it was probably due to the mapper crashes as I had quite a few of those bug reports pop up and when I restarted the program I couldn't reproduce it.
|
|
|
|
kjaerhus Magician
Joined: 18 Dec 2006 Posts: 317 Location: Denmark
|
Posted: Wed Feb 07, 2007 8:21 pm |
I have had a lot of problems with disabled folders. Seems when you copy a setting from a folder (or class or whatever) it is ignored somehow. So often CMUD creates a new variable for instance instead of using the existing one.
I find it very confusing that disabling a folder doesn't disable the children settings. Not very intuitive Zugg...
And it would be nice to be able to disable a lot of settings by just disabling the parent. By the way, am I the only one who hates how easy it is to disable/enable settings? I'd prefer right-clicking or something - I do it accidentally all the time. |
|
|
|
Larkin Wizard
Joined: 25 Mar 2003 Posts: 1113 Location: USA
|
Posted: Thu Feb 08, 2007 12:24 pm |
I'd wager that events firing inside of disabled class folders is a bug that will be fixed. It's intuitive when it works properly.
There are a few different ways to disable settings. You can right-click the class folder or other item and disable it from the context menu, if you like. Why not? |
|
|
|
ReedN Wizard
Joined: 04 Jan 2006 Posts: 1279 Location: Portland, Oregon
|
Posted: Thu Feb 08, 2007 3:40 pm |
I had created mine by copying an existing similar folder over. That could be it.
|
|
|
|
|
|