Formatting of an input() form

Discuss macro implementations, ask for macro help (to share your creations, see User Creations, probably either Campaign Frameworks or Drop-in Resources).

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

Post Reply
smartsoldier
Cave Troll
Posts: 45
Joined: Sat Aug 10, 2013 10:03 pm

Formatting of an input() form

Post by smartsoldier »

Code: Select all

[h:status=input(
"tab0 | Stats || TAB",
".|<html><font size=3><b>Basic Stats</b>||LABEL|SPAN=TRUE",
"HitDice|"+HitDice+"|Character Level|TEXT|WIDTH=2",
"BAB|"+BAB+"|Base Attack Bonus|TEXT|WIDTH=2",
".|<html><b>Saves||LABEL|SPAN=TRUE",
"FortBase|"+FortBase+"|Fortitude|TEXT|WIDTH=2",
"RefBase|"+RefBase+"|Reflex|TEXT|WIDTH=2",
"WillBase|"+WillBase+"|Will|TEXT|WIDTH=2",
"tab1 | Skills || TAB",
"wAcrobatics|"+json.get(Skills, "Acrobatics")+"|Acrobatics|TEXT|Width=2",
"wAppraise|"+json.get(Skills, "Appraise")+"|Appraise|TEXT|Width=2",
)]
[h: abort(status)]
[h: Skills = "{}"]
[h: Skills = json.set(Skills, "Acrobatics", wAcrobatics)]
[h: Skills = json.set(Skills, "Appraise", wAppraise)]
[h: setProperty("Skills", Skills)]
My macro code above is a simple input form popup for character creation. You can input all of your information (BAB, Fortitude, Acrobatics etc.) and it automagically saves it to the token. However, I am looking for a way to make it look prettier. You can see I can use certain html commands (font size etc.) but things like align and background colors and such don't seem to work. Is there something I am missing?
Attachments
Capture.PNG
Capture.PNG (10 KiB) Viewed 798 times

User avatar
aliasmask
RPTools Team
Posts: 9031
Joined: Tue Nov 10, 2009 6:11 pm
Location: California

Re: Formatting of an input() form

Post by aliasmask »

If you use <html><table>...</table></html> or <div> then you can set the width and apply more formatting options, but it still doesn't look very good. Using a <form> input is the best way to get some customization. Personally, I would just add some labels for data separation or use more tabs rather than messing with some fancy formatting. wolph42's signature has a link to making your own <form> inputs.

smartsoldier
Cave Troll
Posts: 45
Joined: Sat Aug 10, 2013 10:03 pm

Re: Formatting of an input() form

Post by smartsoldier »

Thanks for the tips it is working well! I just used the <html><table> stuff. Is there a way to get the colors to propagate all the way through the TEXT boxes? Its kinda weird having them not go all the way across, plus I want them to connect on top and bottom as well.

Edit: width=*** will only push the text box farther away, they wont overlap.
Edit2: I also use an input() dialog and PROPS from my framework to autopopulate the table for easy filling and editing of weapons. However, it seems this only works if all of the properties are text-based. For example, if I wanted to add a RADIO set of buttons for one-handed vs two-handed could I add it into my framework properties somehow?

Code: Select all

  
From Framework:
Weapon0:WpnName=--none-- ; WpnAttackBonus=0 ; WpnDamage=1d4 ; WpnWield=--none-- ; WpnCritRange=20 ; WpnCritDamage=1d6 ; WpnMissRange=1 ;

Snippet of Weapon Edit Macro:
[h: status = input("blah | " + WpnNum + " | Weapon number | LABEL",
      WpnPropName + " | " + WpnProps + " | Weapon properties | PROPS")]
[h: abort(status)]
Attachments
Capture.PNG
Capture.PNG (13.32 KiB) Viewed 787 times
Capture.PNG
Capture.PNG (23.67 KiB) Viewed 790 times

Post Reply

Return to “Macros”