Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Mon May 05, 2008 8:32 pm   

[2.23] Syntax highlighting quirks
 
I've noticed two things, both illustrated with a single screenshot here:



The first is more obvious in that the blackened areas kinda stand out. I haven't changed my color scheme at all, and this seems to happen on certain types of repainting, like changing focus. The preferences page seems to indicate that these items should have the black background, but if I hit certain toolbar buttons (like opening the Prefs dialog with the PE open somewhere that it won't be occluded/repainted), then the black parts go away. They mysteriously disappear and reappear, so I'm confused as to just what's going on there.

The second thing is that the variable in this code, critical_types, is shown as though it doesn't exist or have a value, which it does and it has. It's in the Vars folder there (which I didn't expand, sorry). Mucking around with focus, closing, opening, etc, will cause it to finally change to a legitimate variable reference, but not right away and not for all variables that are defined and within the scope of the code.

Both relatively minor things in the grand scheme, but it doesn't hurt to put them on the list!
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 9:07 pm   
 
Try deleting your STYLES.INI file and let CMUD recreate it. You might have some messed up style information from a past beta version left over. I cannot reproduce the color problems here. But in the past I have seen that when my STYLES.INI file had gotten messed up.

On the variable not showing as being defined, I'll see if I can reproduce this in the example of this file that you have already sent me. The syntax highlighting isn't as rigorous about setting the correct context for searching for variables since it is designed to be as fast as possible. So it might not be setting the context to the proper module. But I'll check it.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Mon May 05, 2008 9:15 pm   
 
I had something very similar happen aaaaages ago back in the 1.xx versions, and deleting styles.ini fixed it.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 9:36 pm   
 
Hmm, I was testing Larkin's package and ended up having the same thing happen with the colors. In the Styles sheet, the colors are shown as $000000 instead of the proper clWindow and clWindowText colors. But they are correct in my STYLES.INI file. So this looks like something new, even though I didn't think I changed anything in the Style system recently.

So I reproduced the problem with all of the black background colors. But I wasn't able to reproduce the problem with the @critical_types variable turning red. It was always blue for me. Had you done anything else such as recreating this package while the settings editor was open? It's possible that somehow it had cached the ID pointer of a previous version of this variable.

If you can give me a procedure for reproducing the variable color going red on your packages that I already have, let me know. In the meantime, I'll investigate this problem with the background colors getting set to black.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 9:40 pm   
 
OK, now I can't get the background color to mess up, but I reproduced the red variable color. This is just really weird!

Edited: OK, I found that if the @critical_types variable is disabled, then when you open the settings editor, the reference will be red. And it will stay that way even if you enable the variable. If you close and reopen the settings editor, then it is blue again. So maybe your variable got disabled somehow (or the class it was in was disabled?)

I think the bug is related to the fact that it doesn't change color as the variable is enabled or disabled. That means that it is caching something somewhere and not looking for the current variable reference.

I also found that loading your Treant Criticals package caused a variable to be created in the main window called "//Treant Persistent/Vars/critical_hits" which is obviously very bad. There was also a "critical_hits" variable created in the main window for some reason. So I have several weird problems to figure out here.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 9:51 pm   
 
OK, I see the reason the "//Treant Persistent/Vars/critical_hits" was created. The #VAR command doesn't know how to create a new module, and the "Treant Persistent" module wasn't loaded in my testing. Annoying, but not unexpected. If I can figure out how to make #VAR create a module easily, then I might fix that.

And when @critical_types is disabled, that causes the script to create the @critical_hits variable in the main window. So I understand that now too.

I deleted my old STYLES.INI file and now I can't get the background color to fail again. So I might have had something messed up in my styles file too.
Reply with quote
oldguy2
Wizard


Joined: 17 Jun 2006
Posts: 1201

PostPosted: Mon May 05, 2008 10:01 pm   
 
Quote:
Edited: OK, I found that if the @critical_types variable is disabled, then when you open the settings editor, the reference will be red. And it will stay that way even if you enable the variable. If you close and reopen the settings editor, then it is blue again. So maybe your variable got disabled somehow (or the class it was in was disabled?)


This happens when you reference a global variable in a script before actually creating it too. Even after creating the variable it will still appear red in the script until you reopen the settings editor.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Mon May 05, 2008 10:29 pm   
 
Yep, I found the cause for this problem and have it fixed for 2.24. The editor was caching the style value and not refreshing itself.
Reply with quote
Larkin
Wizard


Joined: 25 Mar 2003
Posts: 1113
Location: USA

PostPosted: Tue May 06, 2008 11:22 am   
 
Thanks again! Glad my packages could help. Smile
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net