FEATURE: setViewArea()

Developer discussion regarding MapTool 1.4

Moderators: dorpond, trevor, Azhrei

Forum rules
Posting now open to all registered forum users.
User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

I'd rather not complicate these functions and have a separate way of calling functions on player clients.

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: FEATURE: setViewArea()

Post by JamzTheMan »

Well, I was thinking of end users. Doesn't do much good if only 6 high end macro coders use em.

At some point we need to start addressing the #1 complaint users have...
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

I do agree, I just think a generic function to run a macro on another client or all clients is the way to go :) I think what I am saying is that broadcast should be easier to use? Possibly in the UI?

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: FEATURE: setViewArea()

Post by RPTroll »

JamzTheMan wrote:Well, I was thinking of end users. Doesn't do much good if only 6 high end macro coders use em.

At some point we need to start addressing the #1 complaint users have...
Amen, brother.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: FEATURE: setViewArea()

Post by JamzTheMan »

Jagged wrote:I do agree, I just think a generic function to run a macro on another client or all clients is the way to go :) I think what I am saying is that broadcast should be easier to use? Possibly in the UI?
Well, we sort of have that now. It is possible but have to admit not the easiest to work with. I would think the average GM wouldnt know how to do it.

As an example, for the audio functions I've worked on, I made sure you could play to other clients within the function set.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

So something simple, like an optional extra parameter to enforce the view for everyone?

Code: Select all

[r:setView(x1,y1,x2,y2,all)]

User avatar
RPTroll
TheBard
Posts: 3159
Joined: Tue Mar 21, 2006 7:26 pm
Location: Austin, Tx
Contact:

Re: FEATURE: setViewArea()

Post by RPTroll »

I think so, as a trusted function.
ImageImage ImageImageImageImage
Support RPTools by shopping
Image
Image

User avatar
JamzTheMan
Great Wyrm
Posts: 1872
Joined: Mon May 10, 2010 12:59 pm
Location: Chicagoland
Contact:

Re: FEATURE: setViewArea()

Post by JamzTheMan »

Yep. And it shouldn't be to hard, just adding and calling the server command IIRC.

And ya, trusted for that.
-Jamz
____________________
Custom MapTool 1.4.x.x Fork: maptool.nerps.net
Custom TokenTool 2.0 Fork: tokentool.nerps.net
More information here: MapTool Nerps! Fork

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

setViewArea() Function

Sets the currently viewed screen area, set by two cell coordinates, so that the two cells are at the edge of the screen. If the map is "gridless", the coordinates will be pixel coordinates. A final optional parameter causes the view of any connected players to be set the same. Only GMs or trusted macros can trigger the view of all players to change.

Usage

Code: Select all

setViewArea(startX,startY,endX,endY)
setViewArea(startX,startY,endX,endY, allPlayers)
Parameters
  • startX - the x coordinate of the cell that will mark the upper left corner of the displayed area.
  • startY - the y coordinate of the cell that will mark the upper left corner of the displayed area.
  • endX - the x coordinate of the cell that will mark the lower right corner of the displayed area.
  • endY - the x coordinate of the cell that will mark the lower right corner of the displayed area
  • allPlayers - If set to true (1) and called from a trusted macro, all players views will be set
Examples

Code: Select all

[h:setViewArea(0,0,30,20)]

Code: Select all

[h:setViewArea(0,0,30,20,isGM())]

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

Pull request sent to Craig

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: FEATURE: setViewArea()

Post by wolph42 »

wiki created: Wiki: setViewArea()
however I have to ask you to add the 'units' option so it aligns with all the other functions that are related
here an example:
Wiki: getTokenX()

its now that i realise that 'goto' does not have the units option neither, so i'll post this.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

Do you mean this? With units set to 0 for cells?

Code: Select all

setViewArea(startX, startY, endX, endY, pixels, allPlayers)
Can't say I like defaulting to pixels, the code is nice and neat as it stands, but I suppose consistency is the thing :(
I'd suggest that from the point of the Wiki, its surely better to say "pixels" than "units", since when the value is true you get pixels and when false you get cell coordinates?

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

Updated Pull request so that command format is now setViewArea(startX, startY, endX, endY, pixels, allPlayers).

Where pixels and allPlayers are optional. Pixels defaults to true and allPlayers defaults to false.

Done for consistency with other functions and to keep wolph42 happy :D

User avatar
wolph42
Winter Wolph
Posts: 9999
Joined: Fri Mar 20, 2009 5:40 am
Location: Netherlands
Contact:

Re: FEATURE: setViewArea()

Post by wolph42 »

lol thank you!.

We could have the default set up for a vote. I don't mind its default is to cells, as long as its consistent (so 0=cells and 1=pixels), that's the part I asked for, you did, im happy indeed. As for the unit default, If you like you can:
- leave it now
- put it up for a vote
- change the default back to 0

up to you.

User avatar
Jagged
Great Wyrm
Posts: 1306
Joined: Mon Sep 15, 2008 9:27 am
Location: Bristol, UK

Re: FEATURE: setViewArea()

Post by Jagged »

Its not the way I would have done it, but we should be consistent. So I will leave it as it is now :) Plus I don't want to muck Craig around with needless revisions!

Post Reply

Return to “MapTool 1.4”