More 'non-fun'...

A forum to share your demonstrations stacks, fun stacks, games, etc.
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

More 'non-fun'...

Post by tperry2x »

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' :lol: ) - 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.
screenshot.png
screenshot.png (118.06 KiB) Viewed 5619 times
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.
script-colour-test-3.zip
(17.21 KiB) Downloaded 132 times
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.
int-to-ext.png
int-to-ext.png (26.92 KiB) Viewed 5677 times
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. Image [done]


Note: you'll need to have a screen resolution of at least 1200px wide to see this stack properly.
User avatar
richmond62
Posts: 4242
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: More 'non-fun'...

Post by richmond62 »

This looks very odd indeed (MacOS 12.7.4): especially the field in the top-left hand corner:
-
Screenshot 2024-03-16 at 21.15.52.png
Screenshot 2024-03-16 at 21.15.52.png (464.69 KiB) Viewed 5672 times
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

Righto, yeah - forgot 'light mode'. :roll:
It all makes sense if you were to set the background colour of that stack to a dark colour!

if you are in light mode, set the background colour of that "odd" looking field on the left to white. Adjust your colours as needed to create your own preset.
(Save the current scheme to a file, modify it in a text editor, load your modified scheme).

If in dark mode, use dark colours for the stack. (I'll make it do that in future).

Now I know why people don't publish their work as 'works in progress' (sigh)
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: More 'non-fun'...

Post by xAction »

tperry2x wrote: Sat Mar 16, 2024 7:19 pm Now I know why people don't publish their work as 'works in progress' (sigh)
Posting works in progress are good for finding the things you overlooked. Just update your top post when you update.

I spent...oh hours...setting up syntax coloring for xTalk and it was AWFUL, ugliest thing ever.

But then I tried to read Animation Engine documentation with zero syntax hilighting and my eyes gave up and my brain completely checked out for the tenth time of trying that. So I started writing my own instruction stack using syntax hilighting from the script editor and that was like 3 hours for the first AE lesson, yikes. Anyway here's how that worked:
1. Hold mouse over script window
2. Hit return in message box with the command "ScriptToField" in place
on ScriptToField
put the long name of the mouseControl into tScriptWindow
set the htmlText of field "TheScript" to the htmlText of tScriptWindow
end ScriptToField
Sure would be great if that could be automated, like "Rip all the scripts of all the stacks in a folder to syntax hilighted text" Especially if it was a format that could be dumped on github or a blog or something.

So good to see you on this path.
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

xAction wrote: Sat Mar 16, 2024 8:33 pm (I assume if course that GitHub can read standard CSS formatted html)?
Most definately not.

Feature Support Level Explanation
Direct CSS Styling No GitHub Markdown prioritizes security and sanitizes most CSS to prevent malicious code.
Inline Styles (within HTML tags) Limited Some basic inline styles might work (e.g., <p style="color: red;">), but complexity is often stripped.
External CSS Files No GitHub Markdown won’t reference external stylesheets.

How people have the patience to produce beautiful documentation and examples in there is beyond me.

Apparently you can jam your css and html into an svg file? Jeezlouise.
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

Um... I didn't write the above!?
Plus my original post is gone.

Anyway, I was going to say, it would be easy to automate inline span tags, but it'd slow down the creation of the html pages. Even automated, be prepared for a long progress bar.

Either that, or don't use GitHub ;)
xAction
Posts: 285
Joined: Thu Sep 16, 2021 1:40 pm
Contact:

Re: More 'non-fun'...

Post by xAction »

Wow that's so weird, it used your account and quoted me when I was quoting you.
User avatar
OpenXTalkPaul
Posts: 2393
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: More 'non-fun'...

Post by OpenXTalkPaul »

tperry2x wrote: Sat Mar 16, 2024 9:41 pm Um... I didn't write the above!?
Plus my original post is gone.

Anyway, I was going to say, it would be easy to automate inline span tags, but it'd slow down the creation of the html pages. Even automated, be prepared for a long progress bar.

Either that, or don't use GitHub ;)
I think I gave some of you guys full moderation privileges a while back. When you have that, It's an easy mistake to click the edit button instead of the quote button. I've made that mistake and wrecked people's post before (but not this one).
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

It was probably my fault in all honesty. I was trying to post via a slow phone, and probably hit a link that jumped around as the page loaded.
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

Now with added colour-selector goodness (first detailed here)

Script Colour Test #4
https://mega.nz/folder/NPt2lJib#-L_Le0Z3TFcllPPhVB5AeQ
Screenshot_2024-04-05_19-57-11.png
Screenshot_2024-04-05_19-57-11.png (132.61 KiB) Viewed 5515 times
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

Version 5:
(link is in here, by the way)
Now it does indents, comments and bold / italic styles too:
(On the way to making my own script editor, which does not rely on the "revSEUtilities" stack) - that's the point of this (one day, anyway).
screenshot.png
screenshot.png (137.6 KiB) Viewed 5495 times
By the way, if anyone is running MacOS Sonoma - please download this and click the 'Run Script' at the bottom left.
I'd be interested to know how it returns the date formats (I suspect they are wrong).
User avatar
richmond62
Posts: 4242
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: More 'non-fun'...

Post by richmond62 »

I won't be running MacOS Snowman until Monday lunchtime . . .
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

richmond62 wrote: Sat Apr 06, 2024 4:01 pm I won't be running MacOS Snowman until Monday lunchtime . . .
No problem. I'd appreciate it, but there's no huge rush of course.
It will just confirm to me if the date-getting syntax needs fixing on Sonoma. (I think that's at the point it broke, but could be earlier - Like MacOS 11 possibly).

Just because I have to tweak (it would seem).
Here's version 6 (link).
Now with the ability to max / min the window size, so that it resizes to show more of the script editor:
screenshot.gif
screenshot.gif (75.14 KiB) Viewed 5487 times
Yeah, I know - I'm just putting off the next step (the auto-script suggestion). It's not going to be easy, but I guess that's coming up in v7... :shock: (somehow) - probably not using any AI (or at least not any online algorithm).
User avatar
richmond62
Posts: 4242
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: More 'non-fun'...

Post by richmond62 »

So: let me at least give this a whirl on MacOS 12:
-
Screenshot 2024-04-06 at 21.19.36.png
Screenshot 2024-04-06 at 21.19.36.png (55.35 KiB) Viewed 5477 times
-
1. What is that file on the far left?

2. Nice to see you use GIMP. 8-)
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

You want to download the whole folder ideally.
The file on the left is the default colour scheme the stack tries to load. You can create and save your own script colourisation themes. This is the format it saves them as. (Glorified text file).

Yes, I do use Gimp on Linux (well, PhotoGimp to be precise).
User avatar
richmond62
Posts: 4242
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: More 'non-fun'...

Post by richmond62 »

So: I am starting with a very "sexy" picture from my Devawriter Pro stack:
-
Screenshot 2024-04-06 at 21.27.52.png
Screenshot 2024-04-06 at 21.27.52.png (744.82 KiB) Viewed 5473 times
-
Now I'll click on this and see what happens:
-
Screenshot 2024-04-06 at 21.30.46.png
Screenshot 2024-04-06 at 21.30.46.png (333.04 KiB) Viewed 5471 times
-
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

richmond62 wrote: Sat Apr 06, 2024 6:30 pm So: I am starting with a very "sexy" picture from my Devawriter Pro stack...
Um... Why?
........ I don't follow.

It only changes the field in that stack. It doesn't do any others.
User avatar
richmond62
Posts: 4242
Joined: Sun Sep 12, 2021 11:03 am
Location: Bulgaria
Contact:

Re: More 'non-fun'...

Post by richmond62 »

Well, isn't the point of your stack to recolourise scripts?

Aha: a bit slow off the mark there: ONLY in its own stack????

Obviously as it did NOT recolourise my script in Devawriter Pro.

YES: it does recolourise the script in your field in that stack . . . with OXT Lite 1.03 on MacOS 12.

Presumably . . . though . . . it should be extended to affect everything open in the IDE.
https://richmondmathewson.owlstown.net/
User avatar
tperry2x
Posts: 2785
Joined: Tue Dec 21, 2021 9:10 pm
Location: Somewhere in deepest darkest Norfolk, England
Contact:

Re: More 'non-fun'...

Post by tperry2x »

richmond62 wrote: Sat Apr 06, 2024 6:35 pm Presumably . . . though . . . it should be extended to affect everything open in the IDE.
Yes, that is indeed the end goal - eventually.
You'll notice I don't use any features of the "revSEutilites" stack. That's not by accident - it's so it will work in versions of an xTalk engine that doesn't have a "rev[anything]" stack.
User avatar
OpenXTalkPaul
Posts: 2393
Joined: Sat Sep 11, 2021 4:19 pm
Contact:

Re: More 'non-fun'...

Post by OpenXTalkPaul »

I changed the name of this sub-forum to reflect that there may be non-fun demo things posted in here.

if the stack or script is intended to possibly become a community IDE change(s) or addition(s) then I'd prefer for those to go in the "Workshop" forum.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests