Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: JScript Panel script discussion/help (Read 291802 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel script discussion/help

Reply #1375
So I've been messing around with a new menu bar script - mainly for CUI since you can't hide the menu in DUI.

This time I've not been so lazy and made a menu for customising the colours....


The buttons will always be black or white based on background colour.

It will be in the next component release but it can be tested now by pasting this in a panel...

https://raw.githubusercontent.com/jscript-panel/component/main/samples/Menu%20%2B%20Playback%20Buttons%20%2B%20Custom%20Colours.txt

Requires component version 3.4.7 or later (the release that ditched FontAwesome and uses Segoe Fluent Icons for all buttons)

Re: JScript Panel script discussion/help

Reply #1376
Hey marc2k3 or anyone,

I've been modifying the 'Status Bar' sample to show both selection and playlist totals, and one thing I miss from the built-in status bars is the "Starting playback..." message, which appears in between the stopped and playing states. This is mostly only noticeable when playing a stream, since playback starts more or less immediately from local files.

I know there is on_playback_starting callback (not in the original sample), and the on_paint is using if (fb.IsPlaying) {...} else {...}, but I seem to be missing how to get it to write text only in between the two states when starting. I tried the inverse if (!fb.IsPlaying) to see if that catches it which did not work either. Basically just trying to get the var left_text_status to display "Starting..." when the track / stream is loading.

Look, I'm not competent at this stuff. :D

(No doubt something simple I'm missing - below is the mess I have so far but you may have to avert your eyes there, perhaps an update to the original sample to fix this small issue would clue me in? ;) )

Edit: Fixed code that saving a draft on the forum screwed up...

Spoiler (click to show/hide)

Re: JScript Panel script discussion/help

Reply #1377
So I've been messing around with a new menu bar script - mainly for CUI since you can't hide the menu in DUI.

This time I've not been so lazy and made a menu for customising the colours....


The buttons will always be black or white based on background colour.

It will be in the next component release but it can be tested now by pasting this in a panel...

https://raw.githubusercontent.com/jscript-panel/component/main/samples/Menu%20%2B%20Playback%20Buttons%20%2B%20Custom%20Colours.txt

Requires component version 3.4.7 or later (the release that ditched FontAwesome and uses Segoe Fluent Icons for all buttons)


Interesting. Would it be possible to have an alternative to Text Display with the menu and Playback buttons placed in this way ?

Re: JScript Panel script discussion/help

Reply #1378
Updated status bar: https://raw.githubusercontent.com/jscript-panel/component/main/samples/Status%20Bar.txt

And nope, I'm not making any more changes to Text Display. Most of my scripts are flexible with regards to positioning/dimensions. This is not so easy and I can't be bothered.

Re: JScript Panel script discussion/help

Reply #1379
How can I check if a certain pattern is in a string?

For instance:
var str = 'Speakers some more text [exclusive]'

How to check that the var str contains 'Speakers ' and/or contains ' [exclusive]'?

Re: JScript Panel script discussion/help

Reply #1380
This Status Bar script has been updated: https://raw.githubusercontent.com/jscript-panel/component/main/samples/Status%20Bar.txt

You can now set title formatting via the right click menu and $rgb is supported.

Re: JScript Panel script discussion/help

Reply #1381
Hi,
Is it possible to move the image (Cover Art) a little lower, by a few pixels?

X

Re: JScript Panel script discussion/help

Reply #1382
Search this line in text_display.js

_drawImage(gr, albumart.img, albumart.x, albumart.y, albumart.w, albumart.h, image.centre);

add the number of pixels to albumart.y (e.g. + 5) and save the file, but remember, that with every update the file will get overwritten, so better save it somewhere else and replace the path in the config window with your new path (or change the file after every update, that's up to you)



Re: JScript Panel script discussion/help

Reply #1384
Yet another Status Bar update: https://raw.githubusercontent.com/jscript-panel/component/main/samples/Status%20Bar.txt

This fixes actual bugz. Ever since the first version, it didn't support the font size being changed so any manual change or DPI increase would have chopped it off. Sorry about that.

Now that it can take up the panel height, multi-line with wrapping is now possible. Use $crlf() in your title formatting.

Re: JScript Panel script discussion/help

Reply #1385
^ I never would've figured that out myself. It'll take me some time to integrate the new changes, so I'll just assume it goes smoothly and say thanks now. Thanks :)

Re: JScript Panel script discussion/help

Reply #1386
Search this line in text_display.js

_drawImage(gr, albumart.img, albumart.x, albumart.y, albumart.w, albumart.h, image.centre);

add the number of pixels to albumart.y (e.g. + 5) and save the file, but remember, that with every update the file will get overwritten, so better save it somewhere else and replace the path in the config window with your new path (or change the file after every update, that's up to you)



Thanks. I'll try It.

Re: JScript Panel script discussion/help

Reply #1387
Nice one Marc2k3... I will try it too....

Re: JScript Panel script discussion/help

Reply #1388
Hi,

I would like to use icons of the font 'Material Icons Round Regular'. How to do it ?

I tried, to use '\uE03D' with char_set[button_set_idx].playlist :

Spoiler (click to show/hide)

But it does not work. :(  :(

X

Re: JScript Panel script discussion/help

Reply #1389

I would like to use icons of the font 'Material Icons Round Regular'. How to do it ?


I think, the font is just called 'Material Icons Round' without 'Regular', at least, that's what it's called here in my system


Re: JScript Panel script discussion/help

Reply #1391
I tried, but It doesn't work.
[/quote]

A little hard to tell you why without the corresponding code - you just defined some variables...

Re: JScript Panel script discussion/help

Reply #1392
I tried, but It doesn't work.

A little hard to tell you why without the corresponding code - you just defined some variables...
[/quote]

Spoiler (click to show/hide)

Then I use rg_plchars to display the button :
Code: [Select]
	bpos = btot - 4;		this.buttons.plmanager	= new _button(x + (bs * bpos), y, bs, bs, { char : rg_plchars, colour:colours.white}, null, function () { fb.RunMainMenuCommand('View/Playlist Manager'); }, 'PL Manager');

C'est ce que je veux afficher :

X

Re: JScript Panel script discussion/help

Reply #1393
Supposing your standard font is Segoe Fluent Icons, why not just put this line into your code and forget about the rest:

this.buttons.plmanager   = new _button(x + (bs * bpos), y, bs, bs, { char : '\ue90b', colour:colours.white}, null, function () { fb.RunMainMenuCommand('View/Playlist Manager'); }, 'PL Manager');


Re: JScript Panel script discussion/help

Reply #1394
I tried, but It doesn't work.

A little hard to tell you why without the corresponding code - you just defined some variables...

Spoiler (click to show/hide)

Then I use rg_plchars to display the button :
Code: [Select]
	bpos = btot - 4;		this.buttons.plmanager	= new _button(x + (bs * bpos), y, bs, bs, { char : rg_plchars, colour:colours.white}, null, function () { fb.RunMainMenuCommand('View/Playlist Manager'); }, 'PL Manager');

C'est ce que je veux afficher :

X
[/quote]

Like this?

RDIT: Try the attached script

Re: JScript Panel script discussion/help

Reply #1395
That's the output of the code you provided - wouldn't look any different with Material Font

You will have to alter the size of the button by adjusting the second bs value:

   this.buttons.plmanager   = new _button(x + (bs * bpos), y, bs, bs + 5...

or whatever value suits your needs



Re: JScript Panel script discussion/help

Reply #1397
Supposing your standard font is Segoe Fluent Icons, why not just put this line into your code and forget about the rest:

this.buttons.plmanager   = new _button(x + (bs * bpos), y, bs, bs, { char : '\ue90b', colour:colours.white}, null, function () { fb.RunMainMenuCommand('View/Playlist Manager'); }, 'PL Manager');


Supposing your standard font is Segoe Fluent Icons, why not just put this line into your code and forget about the rest:

this.buttons.plmanager   = new _button(x + (bs * bpos), y, bs, bs, { char : '\ue90b', colour:colours.white}, null, function () { fb.RunMainMenuCommand('View/Playlist Manager'); }, 'PL Manager');



Thanks for your help.
But if I want to use "Material Icons" for '\ue90b'. What should I write before ?

Re: JScript Panel script discussion/help

Reply #1398
That's the output of the code you provided - wouldn't look any different with Material Font

You will have to alter the size of the button by adjusting the second bs value:

   this.buttons.plmanager   = new _button(x + (bs * bpos), y, bs, bs + 5...

or whatever value suits your needs
👍

 

Re: JScript Panel script discussion/help

Reply #1399
I tried, but It doesn't work.
A little hard to tell you why without the corresponding code - you just defined some variables...
[attach type=image]29696[/attach]

Like this?

RDIT: Try the attached script
[/quote]

It works perfectly. Thanks. 👍👍
The _button_mir function allows, among other things, to assign the "Material Icons Round" font to the plmanager button. 👍