RPTools.net

Discussion and Support

Skip to content

It is currently Mon Oct 16, 2017 11:11 pm 




Forum rules


Discussion regarding lmarkus001's framework only. Other posts deleted without notice! :)



Reply to topic  [ 9 posts ] 

Previous topic | Next topic 

  Print view

Author Message
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7882
Location: Bay Area
 Post subject: [MOD] Mod Report (MT1.3b82 r01) [Last update: 12/05/11]
PostPosted: Sun Apr 03, 2011 7:36 pm 
Here's a new mod for Mod Report, which is actually the ConditionReport macro.

  • Output is sorted, shows the token state images in the tooltips.
  • The "conditions" have been reformatted an include a tool tip.
  • Everything is on it's own line and in a table.
  • Items or mods with states, if active, are set in case they get turned off manually or through some other method.
  • All mods appears in a thin border box with header.

Code:
@@ @ConditionReport
[H: output = "" ]
[H: gTok = "Lib:GlobalsSRDPF" ]
[H: jTM = getLibProperty( "TempModToggleSets", gTok ) ]
[H: atms = json.get( PrivateJSON, "ActiveTempModSets" ) ]
[H, IF( json.isEmpty( atms ) ): activeMSList = ""; activeMSList = json.toList( json.unique( atms ) ) ]
[H: jPTM= json.get( PrivateJSON, "CustomModSetValues") ]

[H, FOREACH( m, activeMSList ), CODE: {
   [IF( json.isEmpty( jPTM ) ): jPM = ""; jPM = json.get( jPTM, m ) ]
   [IF( json.isEmpty( jPM ) ): tTip = json.get( json.get( jTM, m ), "tip" );tTip = json.get( jPM, "tip" ) ]
   [ tCat = json.get( json.get( jTM, m ), "cat" )]
   [ tState = json.get( json.get( jTM, m), "state")]
   [H, if(tState != "NA"), code: {
      [H: setState(tState,1)]
      [H: stateImage = strformat("<img src='%s' width=50 height=50>",getStateImage(tState))]
   };{
      [H: stateImage = "&nbsp;"]
   }]     
   [IF(tCat == ""): tCat = "Mod"]
   [H: tTip = strformat('<span title="<html><table><tr valign=top><td>%{stateImage}</td><td>%{tTip}</td></tr></table></html>">%{m}</span>')]
   [H: output = json.append(output,strformat('<tr id="%s"><td style="padding: 0px 2px 0px 5px;text-align:right" NOWRAP><b>%{tCat}:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',replace(lower(tCat+m),"[^a-z0-9._]","")))]
}]
[H: aitems = json.get( PrivateJSON, "ActiveItems" ) ]
[H, IF( json.isEmpty( aitems ) ): activeMSList = ""; activeMSList = json.toList( json.unique( aitems ) ) ]

[H, FOREACH( m, activeMSList ), CODE: {
   [IF( json.isEmpty( jPTM ) ): jPM = ""; jPM = json.get( jPTM, m ) ]
   [IF( json.isEmpty( jPM ) ): tTip = json.get( json.get( BonusTypedItems, m ), "tip" );tTip = json.get( jPM, "tip" ) ]
   [ tCat = json.get( json.get( BonusTypedItems, m ), "cat" )]
   [ tState = json.get( json.get( BonusTypedItems, m), "state")]
   [H, if(tState != "NA"), code: {
      [H: setState(tState,1)]
      [H: stateImage = strformat("<img src='%s' width=50 height=50>",getStateImage(tState))]
   };{
      [H: stateImage = "&nbsp;"]
   }]     
   [IF(tCat == "" || tCat == "Misc"): tCat = "Item"]
   [H: tTip = strformat('<span title="<html><table><tr valign=top><td>%{stateImage}</td><td>%{tTip}</td></tr></table></html>">%{m}</span>')]
   [H: output = json.append(output,strformat('<tr id="%s"><td style="padding: 0px 2px 0px 5px;text-align:right" NOWRAP><b>%{tCat}:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',replace(lower(tCat+m),"[^a-z0-9._]","")))]
}]

[H: numConditions = tbl("Conditions",0)]
[H, for(i,0,numConditions), code: {
   [H: conditionStr = tbl("Conditions",i + 1)]
   [H: curState = listGet(conditionStr,0,";")]
   [H, if(getState(curState)), code: {
      [H: conditionText = replace(listGet(conditionStr,1,";"),"%","%%")]
      [H: stateImage = "'"+getStateImage(curState)+"'"]
      [H: tTip = strformat('<span title="<html><table><tr valign=top><td><img src=%{stateImage} width=50 height=50></td><td>%{conditionText}</td></tr></table></html>">%{curState}</span>')]
      [H: output = json.append(output,strformat('<tr id="state%s"><td style="padding: 0px 2px 0px 5px;text-align:right" NOWRAP><b>State:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',lower(curState)))]
   };{}]
}]

[H: output = json.sort(output,"a")]
[R,S: '<table style="background-color:black"><tr><td style="padding:1pt"><table style="background-color:white"><tr><th colspan=2 style="color:blue;text-align:center">Mod Report</th></tr>' + json.toList(output,"") + "</table></td></tr></table>"]

!!
- Updated (12/05/11)

_________________
Downloads:


Last edited by aliasmask on Sat Jul 16, 2011 6:32 pm, edited 3 times in total.

Top
 Profile  
 
 Offline
Great Wyrm
 
Joined: Tue May 26, 2009 7:51 pm
Posts: 2060
Location: Philadelphia, PA
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Sun Apr 03, 2011 7:55 pm 
I so wish the states showed up in the header of the character sheet as images as well. Would really love them to show up on the mouse over sheet.


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7882
Location: Bay Area
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Sun Apr 03, 2011 8:35 pm 
Character sheet wouldn't be a problem, but I don't think images work on mouseover sheet.

_________________
Downloads:


Top
 Profile  
 
 Offline
Dragon
 
Joined: Sat Dec 22, 2007 5:37 pm
Posts: 358
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Thu Apr 28, 2011 1:35 pm 
Nice and neat, I like it!


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Fri Mar 28, 2008 11:30 pm
Posts: 1866
Location: Layfayette Hill, PA
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Thu Jun 30, 2011 9:08 am 
Incorporated, thanks!

_________________
D&D3.5 / Pathfinder Framework


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7882
Location: Bay Area
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Thu Jun 30, 2011 1:38 pm 
Cool.

I was looking at my code again and for a sec I couldn't understand why I put id= in the <tr> of the output... until I realized I did that for the sort feature so the beginning of the strings are always the same except the condition name. Also, the name had to be in quotes and as part of a option variable.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Great Wyrm
 
Joined: Fri Mar 28, 2008 11:30 pm
Posts: 1866
Location: Layfayette Hill, PA
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Thu Jun 30, 2011 1:55 pm 
I was toying with the idea of a full mod table for the report, but then that might be better for an additional page on the character sheet.

Code:
                STRmod DEXmod etc...
Modname (Shaken)  -2    -2    etc...
Modname2           1
etc...

TOTAL             -1    -2


Could show the type in a tool tip and only show columns for items that are actually modded.

_________________
D&D3.5 / Pathfinder Framework


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7882
Location: Bay Area
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01)
PostPosted: Thu Jun 30, 2011 2:02 pm 
lmarkus001 wrote:
I was toying with the idea of a full mod table for the report, but then that might be better for an additional page on the character sheet.

Code:
                STRmod DEXmod etc...
Modname (Shaken)  -2    -2    etc...
Modname2           1
etc...

TOTAL             -1    -2

What would the "Total" represent? Combat mods? Or will you list totals for things like stats, saves, AC...? I would say a new page on character sheet if doing it that way. But really, you could have it in both places. Just make one macro that builds the output, then you can output it as a tool tip or to its own page.

_________________
Downloads:


Top
 Profile  
 
User avatar  Offline
Deity
 
Joined: Tue Nov 10, 2009 6:11 pm
Posts: 7882
Location: Bay Area
 Post subject: Re: [MOD] Mod Report (MT1.3b82 r01) [Last update: 12/05/11]
PostPosted: Mon Dec 05, 2011 5:15 pm 
I made a minor update adding NOWRAP to the first column for the category names.

_________________
Downloads:


Top
 Profile  
 
Display posts from previous:  Sort by  
Reply to topic  [ 9 posts ] 

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Who is online

In total there are 3 users online :: 0 registered, 0 hidden and 3 guests (based on users active over the past 5 minutes)
Most users ever online was 243 on Sun Nov 04, 2012 6:14 am

Users browsing this forum: No registered users and 3 guests





Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Style based on Andreas08 by Andreas Viklund

Style by Elizabeth Shulman