More 'non-fun'...
Posted: Sat Mar 16, 2024 7:06 pm
More 'non-fun' things in the xTalk "Fun and Games" section, but not really sure where else this would live. It's an example stack like the others that we've been posting recently, so...
(it seems I don't really do 'fun' ) - well, other than that Shufflepuck idea, but I can't take the credit for that. It was xAction's creation.
Anyway, back on topic:
What we have here is continuing from my original script editor colours example.
Why? Well, normally you'd dispatch a message to the seutilites stack inside the IDE, and it'd colourise your script for you. Lovely.
However, this doesn't work if you are in a standalone.
It also doesn't work if you'd opened your stack (like me), in an IDE you were creating, that doesn't even have a seutilities stack.... so what to do?
Well, this stack demonstrates both methods. The built in seutilities method, which then passes to an internal command inside the engine.
The second method is me externalising this command in xTalk, and extending it somewhat with customisable colour sets. You can set the textColor of each field using the inspector, and save this scheme. It'll colourise your script even if you made a standalone from it.
Why is this useful? Well, apart from showing coloured xTalk in a standalone - not very at first glance, however it does pave the way for me to work on an alternative script editor for my purposes, and it also allows someone (probably me if I continue my current thinking), to build an xTalk-aware text editor with xTalk syntax coloring.
Each field with colours set, the field names are the names of each function that is normally hidden inside the engine. I just grabbed these names and stored them as fields. This was also the most efficient way I could think of also setting colours on them. I could've done this in an array, but I prefer the visual approach as it's easier to follow. I've done this for consistency, but it may also be possible to weave our script-autocomplete functions easier with all the functions and keywords laid out in this way?
To do:
Sort out the indents - normally indented of course by 3 spaces, inside each function, handler, etc... and indented further in repeat loops and if/else statements.
Edit: make the stack immune to "light mode" setting, after feedback below. [done]
Note: you'll need to have a screen resolution of at least 1200px wide to see this stack properly.
(it seems I don't really do 'fun' ) - well, other than that Shufflepuck idea, but I can't take the credit for that. It was xAction's creation.
Anyway, back on topic:
What we have here is continuing from my original script editor colours example.
Why? Well, normally you'd dispatch a message to the seutilites stack inside the IDE, and it'd colourise your script for you. Lovely.
However, this doesn't work if you are in a standalone.
It also doesn't work if you'd opened your stack (like me), in an IDE you were creating, that doesn't even have a seutilities stack.... so what to do?
Well, this stack demonstrates both methods. The built in seutilities method, which then passes to an internal command inside the engine.
The second method is me externalising this command in xTalk, and extending it somewhat with customisable colour sets. You can set the textColor of each field using the inspector, and save this scheme. It'll colourise your script even if you made a standalone from it.
Why is this useful? Well, apart from showing coloured xTalk in a standalone - not very at first glance, however it does pave the way for me to work on an alternative script editor for my purposes, and it also allows someone (probably me if I continue my current thinking), to build an xTalk-aware text editor with xTalk syntax coloring.
Each field with colours set, the field names are the names of each function that is normally hidden inside the engine. I just grabbed these names and stored them as fields. This was also the most efficient way I could think of also setting colours on them. I could've done this in an array, but I prefer the visual approach as it's easier to follow. I've done this for consistency, but it may also be possible to weave our script-autocomplete functions easier with all the functions and keywords laid out in this way?
To do:
Sort out the indents - normally indented of course by 3 spaces, inside each function, handler, etc... and indented further in repeat loops and if/else statements.
Edit: make the stack immune to "light mode" setting, after feedback below. [done]
Note: you'll need to have a screen resolution of at least 1200px wide to see this stack properly.