Author Topic: [Solved] Signature for 'clientCmdOpenPrintSelectorDlg' function  (Read 1194 times)

I'm trying to figure out the parameters for the 'clientCmdOpenPrintSelectorDlg(%aspectRatio, %a, %b)' function, because I need to call it.

I know it takes three variables, but I only know the first one.

Here's the traces I've used:
Code: [Select]
clientCmdOpenPrintSelectorDlg(1x1, 24, 0) // On a 1x1 Brick
clientCmdOpenPrintSelectorDlg(2x2f, 7, 7) // On a 2x2f Brick
clientCmdOpenPrintSelectorDlg(1x2f, 14, 10) // On a 1x2f Brick
clientCmdOpenPrintSelectorDlg(1x1f, 24, 0) // On a 1x1f Brick
clientCmdOpenPrintSelectorDlg(2x2r, 0, 7) // On a 2x2r Brick (Both Normal and Upside-Down)
clientCmdOpenPrintSelectorDlg(ModTer, 24, 22) // On a ModTer Brick

The first one is clearly the printAspectRatio. As for the others, I have no idea. I've only deduced that they're constant. No matter the color, print, position, etc, these remain constant for the type of brick.

I know that neither one of the last two parameters can be datablocks.

Right now, I only know to call it like this:
Code: [Select]
commandToClient(%client, 'OpenPrintSelectorDlg', %brick.getDatablock().printAspectRatio, %a, %b);

And just to a switch/case on the aspect ratio.



This is one of these moments where having certain functions being open source and/or documented would be awesome.
« Last Edit: July 04, 2015, 01:38:36 AM by Boomshicleafaunda »

function clientCmdOpenPrintSelectorDlg(%aspectRatio, %startPrint, %numPrints)

This is one of these moments where having certain functions being open source and/or documented would be awesome.
Working on it!

Thanks!

How can I derive these values?

I think I figured it out:
Code: [Select]
commandToClient(%client, 'OpenPrintSelectorDlg', %aspectRatio, $PrintARStart[%aspectRatio], $PrintARNumPrints[%aspectRatio]);

I'm hoping those are Server-Side Variables.

This works when I'm on my own server. I don't know about a dedicated server though.

That's what the default code does, good work!

Thanks for the help.

I'll mark this as solved.

~ Locked