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 529122 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Re: JScript Panel script discussion/help

Reply #2150
You can write something like...

Code: [Select]
var str = fb.EnumerateMainMenuCommands();
var arr = JSON.parse(str);

var checked = arr.filter(function (item) {
return item.FullPath == "Playback/Skip tracks & use bookmarks" && item.Checked;
});

if (checked.length == 1) {
console.log("This item is checked");
}

But of course changes cannot be detected while fb2k is running.

Re: JScript Panel script discussion/help

Reply #2151
Thanks Marc :) - That works perfectly, and I got it working in the button script eventually (I had some trouble getting buttons.update() to update after changing the panel property, but then realized probably no longer need to set a property. In any case it works the way I wanted now)

Cheers

Re: JScript Panel script discussion/help

Reply #2152
help to align the text in the text reader according to the center - I understand what's in the file "panel.js" but only the header is aligned, the text itself remains on the left edge

DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER

Re: JScript Panel script discussion/help

Reply #2153
help to align the text in the text reader according to the center - I understand what's in the file "panel.js" but only the header is aligned, the text itself remains on the left edge

DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_PARAGRAPH_ALIGNMENT_CENTER, DWRITE_WORD_WRAPPING_NO_WRAP, DWRITE_TRIMMING_GRANULARITY_CHARACTER
Don't know what function you mean, but for instance:
LEFT:        gr.WriteText(txt, font, colour, x, y, w, h, 0, 2);
RIGHT:     gr.WriteText(txt, font, colour, x, y, w, h, 1, 2);
CENTER:  gr.WriteText(txt, font, colour, x, y, w, h, 2, 2);

 

Re: JScript Panel script discussion/help

Reply #2154
^Tbat's not it.

Scripts that have scrollable text use a different API. You have to open samples\js\text_reader.js and change line 74 from

Code: [Select]
this.text_layout = utils.CreateTextLayout(this.text, this.properties.fixed.enabled ? 'Consolas' : panel.fonts.name, _scale(panel.fonts.size.value));

to become...
Code: [Select]
					this.text_layout = utils.CreateTextLayout(
this.text,
this.properties.fixed.enabled ? 'Consolas' : panel.fonts.name,
_scale(panel.fonts.size.value),
DWRITE_FONT_WEIGHT_NORMAL,
DWRITE_FONT_STYLE_NORMAL,
DWRITE_FONT_STRETCH_NORMAL,
DWRITE_TEXT_ALIGNMENT_CENTER
);


Re: JScript Panel script discussion/help

Reply #2155
Thanks, it worked! I really miss the hand/cursor scroll, I'm learning the language, I'm inserting a translation into the panel under the lyrics, the fact is that you can drag the cursor in the upper panel, but when you switch to the text, you want to use the reader out of habit.

Re: JScript Panel script discussion/help

Reply #2156
+ Last.fm Artist Info + User Info - I think that an invaluable contribution to the development of the player would be the ability to add tags to the body of the GENRE file, and I ask you to remake the script as follows: when selecting information about the artist of the top tags - tags should start with capital letters and be divided according to the general rules - a semicolon, in one line - when clicking on the panel, they should be copied to the clipboard for subsequent editing, and ideally added to the file, as I said above

Progressive Deathcore; Progressive Death Metal; Progressive Metal etc

Re: JScript Panel script discussion/help

Reply #2157
When updating foobar2000 to version 2.24.3 on top of the DarkOne v4 mod based on v1.5.8.0, an error appears at startup:
JScript Panel JScript Execution error
The object cannot be created by the object programming server
File: <main>
Line: 60, Col: 1
How can I fix it?
Unfortunately, the mod is no longer supported by the author.
https://imagizer.imageshack.com/img922/342/z0oOeW.jpg

Re: JScript Panel script discussion/help

Reply #2158
When updating foobar2000 to version 2.24.3 on top of the DarkOne v4 mod based on v1.5.8.0, an error appears at startup:
JScript Panel JScript Execution error
The object cannot be created by the object programming server
File: <main>
Line: 60, Col: 1
How can I fix it?
Unfortunately, the mod is no longer supported by the author.
https://imagizer.imageshack.com/img922/342/z0oOeW.jpg
Since no one responds.
What happens when you upgrade JS2 from 2.3.6.1 to JS2 2.8.8 (on fooBar 2.24.3 32bit of course)?

NB. It would have helped if you had attached the script itself to your post, since there are several variants of the original DarkOne button script.