WIP: Party sheet and Weapon tags
- Reworked the party sheet layout - Tags displayed as images in char sheet ?master
							parent
							
								
									38e4343588
								
							
						
					
					
						commit
						8de509be12
					
				
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 43 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 40 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 4.6 KiB After Width: | Height: | Size: 4.6 KiB | 
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 197 KiB | 
|  | @ -49,6 +49,7 @@ | ||||||
|   "OSE.details.experience.base": "Experience", |   "OSE.details.experience.base": "Experience", | ||||||
|   "OSE.details.experience.bonus": "Bonus Experience", |   "OSE.details.experience.bonus": "Bonus Experience", | ||||||
|   "OSE.details.experience.next": "Next level", |   "OSE.details.experience.next": "Next level", | ||||||
|  |   "OSE.details.experience.share": "Experience Share", | ||||||
|   "OSE.details.experience.award": "XP Award", |   "OSE.details.experience.award": "XP Award", | ||||||
|   "OSE.details.treasure": "Treasure type", |   "OSE.details.treasure": "Treasure type", | ||||||
|   "OSE.details.treasureTable": "Table", |   "OSE.details.treasureTable": "Table", | ||||||
|  |  | ||||||
|  | @ -70,5 +70,17 @@ export const OSE = { | ||||||
|     melee: "OSE.items.Melee", |     melee: "OSE.items.Melee", | ||||||
|     missile: "OSE.items.Missile", |     missile: "OSE.items.Missile", | ||||||
|     slow: "OSE.items.Slow", |     slow: "OSE.items.Slow", | ||||||
|  |     blunt: "OSE.items.Blunt", | ||||||
|  |     reload: "OSE.items.Reload", | ||||||
|  |     splash: "OSE.items.Splash", | ||||||
|  |     brace: "OSE.items.Brace", | ||||||
|  |     twohanded: "OSE.items.TwoHanded", | ||||||
|  |   }, | ||||||
|  |   tag_images: { | ||||||
|  |     melee: "/systems/ose/assets/melee.png", | ||||||
|  |     missile: "/systems/ose/assets/missile.png", | ||||||
|  |     slow: "<i class='fas fa-snail'></i>", | ||||||
|  |     twohanded: "/systems/ose/assets/twohanded.png", | ||||||
|   } |   } | ||||||
| }; | }; | ||||||
|  | // fa-sign-language
 | ||||||
|  | @ -115,10 +115,10 @@ export class OsePartySheet extends FormApplication { | ||||||
|   activateListeners(html) { |   activateListeners(html) { | ||||||
|     super.activateListeners(html); |     super.activateListeners(html); | ||||||
|     html |     html | ||||||
|       .find("button[data-action='select-actors']") |       .find(".item-controls .item-control .select-actors") | ||||||
|       .click(this._selectActors.bind(this)); |       .click(this._selectActors.bind(this)); | ||||||
|      |      | ||||||
|       html.find("button[data-action='deal-xp']").click(this._dealXP.bind(this)); |       html.find(".item-controls .item-control .deal-xp").click(this._dealXP.bind(this)); | ||||||
|      |      | ||||||
|     html.find("a.resync").click(() => this.render(true)); |     html.find("a.resync").click(() => this.render(true)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -34,6 +34,10 @@ export const registerHelpers = async function () { | ||||||
|     return parseFloat(lh) * parseFloat(rh); |     return parseFloat(lh) * parseFloat(rh); | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|  |   Handlebars.registerHelper("roundWeight", function (weight) { | ||||||
|  |     return Math.round(parseFloat(weight) / 100) / 10; | ||||||
|  |   }); | ||||||
|  | 
 | ||||||
|   Handlebars.registerHelper("counter", function (status, value, max) { |   Handlebars.registerHelper("counter", function (status, value, max) { | ||||||
|     return status |     return status | ||||||
|       ? Math.clamped((100.0 * value) / max, 0, 100) |       ? Math.clamped((100.0 * value) / max, 0, 100) | ||||||
|  |  | ||||||
|  | @ -191,6 +191,8 @@ export class OseItem extends Item { | ||||||
|         if (matches) { |         if (matches) { | ||||||
|           title = matches[1]; |           title = matches[1]; | ||||||
|           val = val.substring(0, matches.index); |           val = val.substring(0, matches.index); | ||||||
|  |         } else { | ||||||
|  |           title = val; | ||||||
|         } |         } | ||||||
|         // Auto fill checkboxes
 |         // Auto fill checkboxes
 | ||||||
|         switch (val) { |         switch (val) { | ||||||
|  |  | ||||||
|  | @ -274,6 +274,7 @@ | ||||||
|           height: 30px; |           height: 30px; | ||||||
|           margin: 0; |           margin: 0; | ||||||
|           line-height: 30px; |           line-height: 30px; | ||||||
|  |           flex-basis: 90px; | ||||||
|           .item-image { |           .item-image { | ||||||
|             flex-basis: 30px; |             flex-basis: 30px; | ||||||
|             flex-grow: 0; |             flex-grow: 0; | ||||||
|  | @ -285,12 +286,23 @@ | ||||||
|           } |           } | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|  |       .icon-row { | ||||||
|  |         img { | ||||||
|  |           border: none; | ||||||
|  |           margin: 3px 1px; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |       .field-flex { | ||||||
|  |         flex: 1; | ||||||
|  |         text-align: left; | ||||||
|  |         font-size: 12px; | ||||||
|  |         text-indent: 8px; | ||||||
|  |       } | ||||||
|       .field-longer { |       .field-longer { | ||||||
|         text-indent: 8px; |         text-indent: 8px; | ||||||
|         text-align: left; |         text-align: left; | ||||||
|         flex-basis: 150px; |         flex-basis: 90px; | ||||||
|         font-size: 12px; |         font-size: 12px; | ||||||
|         flex-grow: 0; |  | ||||||
|       } |       } | ||||||
|       .field-long { |       .field-long { | ||||||
|         flex-basis: 65px; |         flex-basis: 65px; | ||||||
|  |  | ||||||
|  | @ -15,7 +15,20 @@ | ||||||
|     color: whitesmoke; |     color: whitesmoke; | ||||||
|     background: $darkBackground; |     background: $darkBackground; | ||||||
|     padding: 4px 0; |     padding: 4px 0; | ||||||
|     text-align: center; |     line-height: 20px; | ||||||
|  |     text-align: left; | ||||||
|  |     padding: 2px 10px; | ||||||
|  |     .item-controls { | ||||||
|  |       .item-control { | ||||||
|  |         padding: 0 2px; | ||||||
|  |         button { | ||||||
|  |           line-height: 15px; | ||||||
|  |           margin: 0 1px; | ||||||
|  |           background: rgba(255, 255, 240, 0.8); | ||||||
|  |           border: 1px solid #b5b3a4; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|   .actor-list { |   .actor-list { | ||||||
|     margin: 0; |     margin: 0; | ||||||
|  | @ -23,15 +36,20 @@ | ||||||
|     list-style: none; |     list-style: none; | ||||||
|     padding: 0; |     padding: 0; | ||||||
|     .actor { |     .actor { | ||||||
|       &:nth-child(even) { |       border-bottom: 1px solid $colorTan; | ||||||
|         background-color: rgba(0, 0, 0, 0.1); |       border-top: 1px solid $colorTan; | ||||||
|       } |  | ||||||
|       .fas { |       .fas { | ||||||
|         padding: 0 2px; |         padding: 0 2px; | ||||||
|  |         font-size: 10px; | ||||||
|       } |       } | ||||||
|       padding: 4px; |       margin-bottom: 2px; | ||||||
|       font-size: 12px; |       font-size: 12px; | ||||||
|       text-align: center; |       text-align: center; | ||||||
|  |       .fields .field-row{ | ||||||
|  |         &:nth-child(odd) { | ||||||
|  |           background-color: rgba(0, 0, 0, 0.1); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|       .field-img { |       .field-img { | ||||||
|         flex: 0 0 50px; |         flex: 0 0 50px; | ||||||
|         position: relative; |         position: relative; | ||||||
|  | @ -42,14 +60,14 @@ | ||||||
|         } |         } | ||||||
|         img { |         img { | ||||||
|           border: none; |           border: none; | ||||||
|           width: 50px; |           width: 45px; | ||||||
|           height: 50px; |           height: 45px; | ||||||
|         } |         } | ||||||
|         .img-btns { |         .img-btns { | ||||||
|           position: absolute; |           position: absolute; | ||||||
|           bottom: 0; |           bottom: 0; | ||||||
|           left: 0; |           left: 0; | ||||||
|           width: 50px; |           width: 45px; | ||||||
|           height: 12px; |           height: 12px; | ||||||
|           button { |           button { | ||||||
|             display: none; |             display: none; | ||||||
|  |  | ||||||
|  | @ -91,6 +91,7 @@ | ||||||
|         "alignment": "", |         "alignment": "", | ||||||
|         "level": 1, |         "level": 1, | ||||||
|         "xp": { |         "xp": { | ||||||
|  |           "share": 100, | ||||||
|           "next": 2000, |           "next": 2000, | ||||||
|           "value": 0, |           "value": 0, | ||||||
|           "bonus": 0 |           "bonus": 0 | ||||||
|  |  | ||||||
|  | @ -33,6 +33,12 @@ | ||||||
|       <input type="text" name="data.details.xp.bonus" id="experience" value="{{data.details.xp.bonus}}" /> |       <input type="text" name="data.details.xp.bonus" id="experience" value="{{data.details.xp.bonus}}" /> | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
|  |   <div class="form-group"> | ||||||
|  |     <label>{{localize "OSE.details.experience.share"}} (%)</label> | ||||||
|  |     <div class="form-fields"> | ||||||
|  |       <input type="text" name="data.details.xp.share" id="experience-share" value="{{data.details.xp.share}}" /> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|   <div class="form-group"> |   <div class="form-group"> | ||||||
|     <label>{{localize "OSE.MeleeBonus"}}</label> |     <label>{{localize "OSE.MeleeBonus"}}</label> | ||||||
|     <div class="form-fields"> |     <div class="form-fields"> | ||||||
|  |  | ||||||
|  | @ -22,9 +22,13 @@ | ||||||
|               </h4> |               </h4> | ||||||
|             </a> |             </a> | ||||||
|           </div> |           </div> | ||||||
|           <div class="field-longer"> |           <div class="icon-row field-longer"> | ||||||
|             {{#each item.data.tags as |tag|}} |             {{#each item.data.tags as |tag|}} | ||||||
|  |               {{#if (lookup @root.config.tag_images tag.value)}} | ||||||
|  |                 <img title="{{tag.title}}" src="{{lookup @root.config.tag_images tag.value}}" width="24" height="24"/> | ||||||
|  |               {{else}} | ||||||
|               <span title="{{tag.title}}">{{tag.value}}</span> |               <span title="{{tag.title}}">{{tag.value}}</span> | ||||||
|  |               {{/if}} | ||||||
|             {{/each}} |             {{/each}} | ||||||
|           </div> |           </div> | ||||||
|           <div class="field-short"> |           <div class="field-short"> | ||||||
|  |  | ||||||
|  | @ -1,18 +1,18 @@ | ||||||
| <form autocomplete="off"> | <form autocomplete="off"> | ||||||
|   <header class="flexrow"> |  | ||||||
|     {{#if user.isGM}} |  | ||||||
|     <button data-action="select-actors" type="button"> |  | ||||||
|       {{localize "OSE.dialog.selectActors"}} |  | ||||||
|     </button> |  | ||||||
|     <button data-action="deal-xp" type="button"> |  | ||||||
|       {{localize "OSE.dialog.dealXP"}} |  | ||||||
|     </button> |  | ||||||
|     {{/if}} |  | ||||||
|   </header> |  | ||||||
|   <div class="actor header flexrow"> |   <div class="actor header flexrow"> | ||||||
|     <div class="field-name"> |     <div> | ||||||
|       <a class="resync"><i class="fas fa-sync"></i></a> |       <a class="item-control resync"><i class="fas fa-sync"></i></a> | ||||||
|     </div> |     </div> | ||||||
|  |     {{#if user.isGM}} | ||||||
|  |     <div class="item-controls flexrow"> | ||||||
|  |       <div class="item-control"> | ||||||
|  |         <button type="button" class="deal-xp" title="{{localize 'OSE.dialog.dealXP'}}"><i class="fas fa-hand-holding"></i></button> | ||||||
|  |       </div> | ||||||
|  |       <div class="item-control"> | ||||||
|  |         <button type="button" class="select-actors" title="{{localize 'OSE.dialog.selectActors'}}"><i class="fas fa-users"></i></button> | ||||||
|  |       </div> | ||||||
|  |     </div> | ||||||
|  |     {{/if}} | ||||||
|   </div> |   </div> | ||||||
|   <ol class="actor-list"> |   <ol class="actor-list"> | ||||||
|     {{#each data.entities as |e|}} {{#if e.data.flags.ose.party}} |     {{#each data.entities as |e|}} {{#if e.data.flags.ose.party}} | ||||||
|  | @ -23,48 +23,61 @@ | ||||||
|           <button type="button" data-action="open-sheet"><i class="fas fa-user"></i></button> |           <button type="button" data-action="open-sheet"><i class="fas fa-user"></i></button> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|       <div> |       <div class="fields"> | ||||||
|         <div class="flexrow"> |         <div class="flexrow field-row"> | ||||||
|           <div class="field-name flex2"> |           <div class="field-name flex2"> | ||||||
|             <strong>{{e.name}}</strong> |             <strong>{{e.name}}</strong> | ||||||
|           </div> |           </div> | ||||||
|           <div class="field-long"> |           <div class="field-long" title="{{localize 'OSE.Health'}}"> | ||||||
|             <i class="fas fa-heart"></i> |             <i class="fas fa-heart"></i> | ||||||
|             {{e.data.data.hp.value}}/{{e.data.data.hp.max}} |             {{e.data.data.hp.value}}/{{e.data.data.hp.max}} | ||||||
|           </div> |           </div> | ||||||
|           <div class="field-short"> |           <div class="field-short" title="{{localize 'OSE.ArmorClass'}}"> | ||||||
|             <i class="fas fa-shield-alt"></i> |             <i class="fas fa-shield-alt"></i> | ||||||
|             {{#if @root.settings.ascending}}<strong>{{e.data.data.aac.value}}</strong> <sub>{{e.data.data.aac.naked}}</sub> |             {{#if @root.settings.ascending}}<strong>{{e.data.data.aac.value}}</strong> | ||||||
|  |             <sub>{{e.data.data.aac.naked}}</sub> | ||||||
|             {{else}}<strong>{{e.data.data.ac.value}}</strong> <sub>{{e.data.data.ac.naked}}</sub> |             {{else}}<strong>{{e.data.data.ac.value}}</strong> <sub>{{e.data.data.ac.naked}}</sub> | ||||||
|             {{/if}} |             {{/if}} | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|         <div class="flexrow"> |         <div class="flexrow field-row"> | ||||||
|           <div class="field-short"> |           <div class="field-short" title="{{localize 'OSE.Thac0'}}"> | ||||||
|             <i class="fas fa-fist-raised"></i> |             <i class="fas fa-crosshairs"></i> | ||||||
|             <sub>{{e.data.data.thac0.mod.melee}}</sub> <strong>{{e.data.data.thac0.value}}</strong> <sub>{{e.data.data.thac0.mod.missile}}</sub> |             {{#unless settings.ascendingAC}} | ||||||
|           </div> |             {{e.data.data.thac0.value}} | ||||||
|           <div class="field-short"> |             {{else}} | ||||||
|             <i class="fas fa-shoe-prints"></i> |             {{e.data.data.thac0.bba}} | ||||||
|             {{e.data.data.movement.encounter}} |             {{/unless}} | ||||||
|           </div> |           </div> | ||||||
|           {{#if (eq e.data.type 'character')}} |           {{#if (eq e.data.type 'character')}} | ||||||
|           <div class="field-short"> |           <div class="field-short" title="{{localize 'OSE.Melee'}}"> | ||||||
|             <i class="fas fa-weight-hanging"></i> |             <i class="fas fa-fist-raised"></i> | ||||||
|             {{e.data.data.encumbrance.value}} |             {{add e.data.data.scores.str.mod e.data.data.thac0.mod.melee}} | ||||||
|           </div> |           </div> | ||||||
|           <div class="field-short"> |           <div class="field-short" title="{{localize 'OSE.Missile'}}"> | ||||||
|             <i class="fas fa-circle"></i> |             <i class="fas fa-bullseye"></i> | ||||||
|             {{e.data.data.treasure}} |             {{add e.data.data.scores.dex.mod e.data.data.thac0.mod.missile}} | ||||||
|  |           </div> | ||||||
|  |           {{/if}} | ||||||
|  |           <div class="field-short flex2"> | ||||||
|  |             <i class="fas fa-shoe-prints" title="{{localize 'OSE.movement.base'}}"></i> | ||||||
|  |             <span title="{{localize 'OSE.movement.encounter.long'}}">{{e.data.data.movement.encounter}}</span> <sub | ||||||
|  |               title="{{localize 'OSE.movement.exploration.long'}}">{{e.data.data.movement.base}}</sub> | ||||||
|  |           </div> | ||||||
|  |           {{#if (eq e.data.type 'character')}} | ||||||
|  |           <div class="field-short flex2"> | ||||||
|  |             <i class="fas fa-weight-hanging" title="{{localize 'OSE.Encumbrance'}}"></i> | ||||||
|  |             {{roundWeight e.data.data.encumbrance.value}}k | ||||||
|           </div> |           </div> | ||||||
|           {{/if}} |           {{/if}} | ||||||
|         </div> |         </div> | ||||||
|         <div class="flexrow"> |         <div class="flexrow field-row"> | ||||||
|           <div class="field-longer flexrow"> |           <div class="field-longer flexrow"> | ||||||
|             {{#each e.data.data.saves as |s i|}} |             {{#each e.data.data.saves as |s i|}} | ||||||
|             <span>{{lookup @root.config.saves_short i}} {{s.value}}</span> |             <span title="{{lookup @root.config.saves_long i}}">{{lookup @root.config.saves_short i}} {{s.value}}</span> | ||||||
|             {{/each}} |             {{/each}} | ||||||
|             <span>{{#if (eq e.data.type 'character')}}<i class="fas fa-magic"></i>{{mod e.data.data.scores.wis.mod}}{{/if}}</span> |             {{#if (eq e.data.type 'character')}}<span><i class="fas fa-magic" | ||||||
|  |                 title="{{localize 'OSE.saves.magic.long'}}"></i>{{mod e.data.data.scores.wis.mod}}</span>{{/if}} | ||||||
|           </div> |           </div> | ||||||
|         </div> |         </div> | ||||||
|       </div> |       </div> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue