Jump to content


Photo

Use userDefineLang.xml in Crimson Editor


  • Please log in to reply
8 replies to this topic

#1 Jeroen

Jeroen
  • Members
  • 236 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 30 March 2011 - 10:58 AM

I want to convert userDefineLang.xml from Notepad++ to Crimson Editor's .psc and .key files. But first a few things:

1) In de userDefineLang.xml (I use the small one for CBEL) under C1_MIS, Words2, the list from .ABIERTO to .ZONE is there twice! After .ZONE (character position 4606) .ABIERTO starts again. Not correct I think, right?

2) Several items appear more than once: .BRIEFING .WATER .XY are in Words1 and in Words2. Is there a reason for this?

In some testing I have:

.MAP [ .SCALE 0.254113 .XY [ 17 23 ] .BITMAP LIBR0Z00.RLE ]

If names (or objects or what are they called?) like .SCALE, .XY and .BITMAP only appear as 'sub items' they get a color different from the 'super item'.
(In the userDefineLang.xml they are all in the same group i.e. they're all blue. Not that I mind, I just think this is more meaningful)

#2 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 30 March 2011 - 05:47 PM

1) The list from .ABIERTO to .ZONE should only appear once, this was a copy&paste mistake. I'll fix that.

2) Yeah, there is a reason why some of the items appear twice. The items .XY and .MAP for example are used as 'super items' as well as 'sub items'. Unfortunately Notepad++ can't handle the hierarchy of the itmes of the user defined language (or at least I don't know how to handle it).
Posted Image

Oh, I just realized that Words2 nearly contains the whole Words1 list - that's not correct.
I'll remove all the items from Words2 which already occur in Words1.

#3 Jeroen

Jeroen
  • Members
  • 236 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 31 March 2011 - 07:18 PM

Did you upload the new version of the xml? Because sites.google.com/site/commandosmod/ now shows SiNP. Great idea, those separate installers with icons showing mission numbers. Nice detail.

So I see in your example that values like NADA will get the lowest 'rank' in the keywords list. Second lowest will be items that do never contain other items, only values. .XY, .SCALE and .Angulo are examples. A level higher are .MAP and .WATER etc.. I'll see how far 'up' it goes.
Not sure if I consider .MAP in FASE0123 different from .MAP in .AUTOEXPCASAS, but I probably don't have any other option then just choose a group for it.

Oh, I just realized that Words2 nearly contains the whole Words1 list - that's not correct.
I'll remove all the items from Words2 which already occur in Words1.


So now stuff in Words2 is exclusively there. On what criterium did you compose Words2?

Well, if anyone is reading this and knows of a text editor that knows what hierarchy means:
.FASE0123 [ ColorLevel1 [ ColorLevel2 [ ColorLevel3 [ ColorLevel4 ]]]]
be sure to let me know :-)

I forgot: I said I used userDefineLang.xml, but the other, bigger xml needs some maintenance as well.

Edit 2: I found the files under Tools - Misc !

Edited by Imp, 01 April 2011 - 03:00 PM.


#4 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 02 April 2011 - 06:47 PM

My first intention was to create a group for all keywords that start with a period (like .LISTAS or .CARISMA).
Then I realized that there were only about 20 super items (.DATOSFICHEROSMISION, .INTERFACE, ..) and I decided to have an own list for these keywords.

In the next step I composed a list which contains all the ac../au.. words.
Finally I added nearly all remainig keywords to a new list (since Notepad++ can only handle 4 groups).

It's a pity that some of the keywords (.MAP, .XY) occur twice and Notepad++ can't distinguish between them :(

#5 Jeroen

Jeroen
  • Members
  • 236 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 04 April 2011 - 09:48 AM

Does your NP++ highlight 0AMA or any other keyword that begins with a numeric character? If it does then maybe my configuration is NOK.

#6 herbert3000

herbert3000

    Guilty Until Proven Innocent

  • Division Admins
  • 610 posts
  • Location:Austria
  • Division:Commandos HQ
  • Job:Division Admin

Posted 05 April 2011 - 03:58 AM

Does your NP++ highlight 0AMA or any other keyword that begins with a numeric character? If it does then maybe my configuration is NOK.

Notepad++ doesn't highlight these keywords on my PC either - I didn't notice this before :(
That's one more negative point for NP++.

I think Crimson Editor neither can handle keywords like 0AMA.

#7 GMC.Phantom

GMC.Phantom
  • Division Leaders
  • 134 posts
  • Location:Italy
  • Division:Commandos HQ
  • Job:Division Leader

Posted 05 April 2011 - 08:44 AM

by the way guys, do you use some tool to autoindent and align all the code somehow? I tried many text editors but all of them have predetermined syntax rules and none of them seems to be good for commandos code. I tried UniversalIndentGUI 1.1.0 but it is not the best solution around. TO tidy up and align all the code (for example in .mis files) what tool would you suggest?

#8 Jeroen

Jeroen
  • Members
  • 236 posts
  • Location:Noord-Brabant
  • Projects:Commandos BEL är bara smörja.

Posted 05 April 2011 - 11:01 AM

> I think Crimson Editor neither can handle keywords like 0AMA.

That's why I asked about np++ , to see if there was anything to gain. Altough Crimson has a language.spc file to play with I cannot get it to understand these keywords.

Phantom, have you used Crimson? Default tab size is 4 and it has column mode so you can add tabs to multiple rows. If your source is really a mess maybe you can run a macro to delete leading spaces and then add tabs (or replace spaces with tabs). I don't think what you call "commandos code" is what many editors get optimized for. ;)

#9 GMC.Phantom

GMC.Phantom
  • Division Leaders
  • 134 posts
  • Location:Italy
  • Division:Commandos HQ
  • Job:Division Leader

Posted 05 April 2011 - 03:04 PM

of course, but there seems to be no editor that you can "train" to recognize the code you want and treat as you wish apart from programming one your own. Yes I tried crimson and all the others but there is no good custom code indentation




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users