I was just looking something over based on something Az mentioned. I have a super small tweak to condition report. It's funny, I thought I had already made this change. First of all, the id="..." shouldn't have a space in there and the bottom conditions, which I named states, because that's all they really are (active states) doesn't have that in the id. All the ids should be unique and I didn't really see a need to change the attribute to class since id is unsupported anyway (no javascript or domain). I use this for the sort.
Code: Select all
@@ @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 = " "]
}]
[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"><b>%{tCat}:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',replace(lower(tCat+m),"[^a-zA-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 = " "]
}]
[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"><b>%{tCat}:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',replace(lower(tCat+m),"[^a-zA-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"><b>Condition:</b></td><td style="padding-right: 5px">%{tTip}</td></tr>',lower(curState)))]
};{}]
}]
[H: output = json.sort(output,"a")]
[R,S, if(! json.isEmpty(output)): '<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>"; "<b>Mod Report: No mods to report.</b>"]
!!
edit: added replace for cat names.