[Pathfinder] TR's Toolbar v1

Discussion concerning lmarkus' campaign framework for D&D3.x and Pathfinder.

Moderators: dorpond, trevor, Azhrei, giliath, Gamerdude, jay, Mr.Ice, lmarkus001

Forum rules
Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)
User avatar
toyrobots
Dragon
Posts: 278
Joined: Sat Apr 12, 2008 4:17 pm

Re: TR's Pathfinder Toolbar

Post by toyrobots »

I'll see about adding days some time this week, but for tonight, I have to GM (woe is me!)

User avatar
toyrobots
Dragon
Posts: 278
Joined: Sat Apr 12, 2008 4:17 pm

Re: TR's Pathfinder Toolbar

Post by toyrobots »

Hi everyone!

I have done zero interesting new work with this toolbar, because school has been brutal.

However, there were some bugs in the healing code and other spots that I fixed a few months ago and I just never uploaded the fixed version... I'm not even sure what was broken it was so long ago.

Anyway, here's the version I've been using for a while, it appears to have the bigs fixed.

Let me know if you're using it what you think, although judging by the lack of complaints about the broken last version, I wonder if anyone is using it...

-owen
Attachments
Toolbar.cmpgn
(1.98 MiB) Downloaded 469 times

User avatar
Sir Flak
Dragon
Posts: 344
Joined: Thu Sep 28, 2006 4:20 pm
Location: Oklahoma, US

Re: TR's Pathfinder Toolbar

Post by Sir Flak »

aliasmask wrote:I may go with form submit buttons with images because they're more responsive when clicked, but not necessarily better looking.
I'm curious how that would work. I like the responsiveness of the buttons as well (ie if I don't have the dialog in focus when I click and it still goes off) I've not had much success in controlling <input type="image" since it appears to not let you scale the image. Can you put an image on a regular submit button? If so what does the html look like? Can you scale it with width/height?

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: TR's Pathfinder Toolbar

Post by aliasmask »

Sir Flak wrote:
aliasmask wrote:I may go with form submit buttons with images because they're more responsive when clicked, but not necessarily better looking.
I'm curious how that would work. I like the responsiveness of the buttons as well (ie if I don't have the dialog in focus when I click and it still goes off) I've not had much success in controlling <input type="image" since it appears to not let you scale the image. Can you put an image on a regular submit button? If so what does the html look like? Can you scale it with width/height?
Instead of using an image for the link, it would be a submit button with an image. There are a couple of ways to do that, but putting html in the value of the submit it how I have done it.

Code: Select all

<input type="submit" value="<html><img src="assetId" height=xx width=xx></html>"></html>
Because the built in button format are really skewed 12px margin, I used tinyLaf and default.theme to change that to 4px so button look a little better with text and images.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: TR's Pathfinder Toolbar

Post by Azhrei »

aliasmask wrote:Because the built in button format are really skewed 12px margin, I used tinyLaf and default.theme to change that to 4px so button look a little better with text and images.
Rumble posted a replacement Default.theme that fixes the button margins. Not sure if it's portable to anything other than Windows but if he didn't hard-code fonts it should be...

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: TR's Pathfinder Toolbar

Post by aliasmask »

Yeah, I did the same thing under the Notepad++ link.

User avatar
Azhrei
Site Admin
Posts: 12086
Joined: Mon Jun 12, 2006 1:20 pm
Location: Tampa, FL

Re: TR's Pathfinder Toolbar

Post by Azhrei »

Oh, maybe it was actually yours then. Sorry, I get lost sometimes with all of the "Dragon"-level and above posters. ;)

User avatar
Sir Flak
Dragon
Posts: 344
Joined: Thu Sep 28, 2006 4:20 pm
Location: Oklahoma, US

Re: TR's Pathfinder Toolbar

Post by Sir Flak »

aliasmask wrote:
Sir Flak wrote:
aliasmask wrote:I may go with form submit buttons with images because they're more responsive when clicked, but not necessarily better looking.
I'm curious how that would work. I like the responsiveness of the buttons as well (ie if I don't have the dialog in focus when I click and it still goes off) I've not had much success in controlling <input type="image" since it appears to not let you scale the image. Can you put an image on a regular submit button? If so what does the html look like? Can you scale it with width/height?
Instead of using an image for the link, it would be a submit button with an image. There are a couple of ways to do that, but putting html in the value of the submit it how I have done it.

Code: Select all

<input type="submit" value="<html><img src="assetId" height=xx width=xx></html>"></html>
Because the built in button format are really skewed 12px margin, I used tinyLaf and default.theme to change that to 4px so button look a little better with text and images.
Thanks for the tip.

I just tested it and it works (except you need to swap in single quotes around the asset). The only thing weird about it is when you click the button, the passed macro args are a big long asset string. I can work with it though.

Example Functional code for others who are curious:

Code: Select all

[H: Image=getTokenImage()]
<input type="submit" name="save"  value="<html><img src='{Image}' height=32 width=32><html>"></input>
I do have your default theme. I guess mac uses will just have an uglier tool bar if its not portable to them.

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: TR's Pathfinder Toolbar

Post by aliasmask »

If you're worried about what is submitting, don't check the value, but check for the name. You can put values in other input fields (ie type=hidden). Generally speaking, there are at least two ways to handle form submits. First, the whole form is submitted and the value of submit isn't relevant. The other is you have multiple types of submits or multiple forms going to the same processing page. You can either use the value of a same named submit button, hide a value within a tag of the submit value and pull it out with regex (strfind) or check for the existence of a variable name.

User avatar
skester
Giant
Posts: 213
Joined: Mon May 04, 2009 3:44 pm

Re: TR's Pathfinder Toolbar

Post by skester »

I think my Forms are the point that slows down my macros the most. My Form display changes depending on class and feats, but it's the same Form calling the same macro to process the form. Therefore it checks for quite a bit of data before continuing.

Code: Select all

[h: FormData = macro.args ]

[h: useDice = json.contains( FormData, "useDice" ) ] 
[h: FRA = json.contains( FormData, "FRA" ) ] 
[h: Flanking = json.contains( FormData, "Flanking" ) ] 
[h: FE = json.contains( FormData, "FE" ) ] 
[h: FE2 = json.contains( FormData, "FE2" ) ] 
[h: FE3 = json.contains( FormData, "FE3" ) ] 
[h: FE4 = json.contains( FormData, "FE4" ) ] 
[h: FE5 = json.contains( FormData, "FE5" ) ] 
[h: Smite = json.contains( FormData, "Smite" ) ] 
[h: BSmite = json.contains( FormData, "BSmite" ) ] 
[h: PowerAttack = json.contains( FormData, "PowerAttack" ) ] 
[h: Charge = json.contains( FormData, "Charge" ) ] 
[h: wTwoWeaponFighting = json.contains( FormData, "wTwoWeaponFighting" ) ] 
[h: UseSecondary = json.contains( FormData, "UseSecondary" ) ] 
[h: FOB = json.contains( FormData, "FOB" ) ] 
[h: KFOB = json.contains( FormData, "KFOB" ) ] 
[h: ArcaneStrike = json.contains( FormData, "ArcaneStrike" ) ] 
[h: FightingDefensive = json.contains( FormData, "FightingDefensive" ) ] 
[h: wCombatExpertise = json.contains( FormData, "wCombatExpertise" ) ] 
[h: RacialHatred = json.contains( FormData, "RacialHatred" ) ] 
[h: StunningFist = json.contains( FormData, "StunningFist" ) ] 
[h: TA = json.contains( FormData, "TA" ) ] 
[h: MFRA = json.contains( FormData, "MFRA" ) ] 
[h: MFRAW=0]
[h: LayOnHands = json.contains( FormData, "LayOnHands" ) ]
[h: wSneak = json.contains( FormData, "Sneak" ) ] 
[h: wKiDodge = json.contains( FormData, "wKiDodge" ) ] 
[h: zMonsterWeapon = json.contains( FormData, "wMonsterWeapon" ) ] 
[h: Demoralize = json.contains( FormData, "Demoralize" ) ] 
[h: isMonster = json.contains( FormData, "isMonster" ) ] 
[h: CombatMan = json.contains( FormData, "CM" ) ] 
Is there any way to speed this up or make it more efficient?

Thanks,
Skester

User avatar
aliasmask
RPTools Team
Posts: 9023
Joined: Tue Nov 10, 2009 6:11 pm
Location: Bay Area

Re: TR's Pathfinder Toolbar

Post by aliasmask »

One trick is to dump the json as a string property list. Just be careful about ; in your data. If you don't have that, then it's safe to do. Otherwise, depending on what it represents, you can do a replace first.

Code: Select all

[H: varsFromStrProp(json.toStrProp(FormData))]

User avatar
skester
Giant
Posts: 213
Joined: Mon May 04, 2009 3:44 pm

Re: TR's Pathfinder Toolbar

Post by skester »

Just checked the form data.

Code: Select all

{"Flanking":"on","wCombatExpertise":"on","FOB":"on","wKiDodge":"on","CM":"0","MyAction":"Action"}    
So, I guess I set all my variables to 0, make sure the forms data sent over is the same as the variable names, then run that which would change all the 0s to "On" (for the Checkboxes).

And add in Value='1' on my forms so I don't have to change the rest of the macro to deal with on. :D

I'll give it a try. Thanks!

Skester

withlyn
Kobold
Posts: 12
Joined: Fri Aug 08, 2008 11:07 am

Re: TR's Pathfinder Toolbar

Post by withlyn »

I'd like to use this toolbar, but I'm having a few problems:
  • Whenever initiative passes to a new token on a map other than the initial map (GM Screen), Maptool freezes. (If there is only one token in the initiative, this is not a problem.)
  • If I add a new map to the campaign, add a token to the map, and save the campaign, it will freeze on reload.
Both these errors occur in both B63 and B86. I'm using Ubuntu 10.04 with Sun Java 6 update 26. The (non-working) saved campaign file is attached.

Edit: I tracked this down to a bug in MapTool. Nothing wrong with the toolbar!
Attachments
toolbar2 test.cmpgn
(2.21 MiB) Downloaded 294 times
Last edited by withlyn on Thu Jul 28, 2011 5:16 pm, edited 1 time in total.

Ozman51
Kobold
Posts: 3
Joined: Thu Jul 28, 2011 11:50 am

Re: TR's Pathfinder Toolbar

Post by Ozman51 »

toyrobots wrote:
To put it into another campaign file, save a copy of the Lib:PathfinderRPG token, the button image tokens (there are several of these in stacked) and the campaign properties. Then drop the lib and image tokens in your new campaign, and load the new properties. As long as you have the Libs, Images, and props, you're good to go.

All the properties are hidden and accessed through getProperty() and setProperty(), which is why you only see the one prop in the campaign props. They get initialized when you run the "setup token" button, so nothing will work until you have set up the token.
I am very interested in trying this but also very new to using MapTools as anything than just mapping software. I have all of the Tokens exported but am unclear on how to save a copy of the properties and then in turn import them into my campaign.

withlyn
Kobold
Posts: 12
Joined: Fri Aug 08, 2008 11:07 am

Re: TR's Pathfinder Toolbar

Post by withlyn »

Ozman51 wrote:I am very interested in trying this but also very new to using MapTools as anything than just mapping software. I have all of the Tokens exported but am unclear on how to save a copy of the properties and then in turn import them into my campaign.
In the MapTools menu, go to Edit->Campaign Properties, and click "Export" near the lower left of the dialog box. "Import" is right next to it.

Post Reply

Return to “D&D 3.5/Pathfinder 1e Campaign Macros”