ENH: Attack markers
							parent
							
								
									f8affb720b
								
							
						
					
					
						commit
						72ec1b973e
					
				|  | @ -196,6 +196,7 @@ | |||
|   "OSE.items.resetAttacks": "Reset all Attacks per Round", | ||||
|   "OSE.items.hasShield": "Has a Shield bonus", | ||||
|   "OSE.items.typeTag": "Type a comma separated list of tag e.g 'Melee,Missile (5’–10’ / 11’–20’ / 21’–30’)'", | ||||
|   "OSE.items.pattern": "Attack pattern marker", | ||||
| 
 | ||||
|   "OSE.armor.type": "Armor Type", | ||||
|   "OSE.armor.unarmored": "Unarmored", | ||||
|  |  | |||
|  | @ -196,6 +196,7 @@ | |||
|   "OSE.items.resetAttacks": "Réinitialiser les Attaques", | ||||
|   "OSE.items.hasShield": "A un bonus de Bouclier", | ||||
|   "OSE.items.typeTag": "Tapez une liste de tags descriptifs ex. 'Mêlée,Missile (5’–10’ / 11’–20’ / 21’–30’)'", | ||||
|   "OSE.items.pattern": "Marqueur de schéma d'attaque", | ||||
| 
 | ||||
|   "OSE.armor.type": "Type d'Armure", | ||||
|   "OSE.armor.unarmored": "Sans Armure", | ||||
|  |  | |||
|  | @ -216,6 +216,22 @@ export class OseActorSheetMonster extends OseActorSheet { | |||
|       actorObject.rollHP({ event: event }); | ||||
|     }); | ||||
| 
 | ||||
|     html.find(".item-pattern").click(ev => { | ||||
|       const li = $(ev.currentTarget).parents(".item"); | ||||
|       const item = this.actor.getOwnedItem(li.data("itemId")); | ||||
|       let currentColor = item.data.data.pattern; | ||||
|       let colors = Object.keys(CONFIG.OSE.colors); | ||||
|       let index = colors.indexOf(currentColor); | ||||
|       if (index + 1 == colors.length) { | ||||
|         index = 0; | ||||
|       } else { | ||||
|         index++; | ||||
|       } | ||||
|       item.update({ | ||||
|         "data.pattern": colors[index] | ||||
|       }) | ||||
|     }); | ||||
| 
 | ||||
|     // Handle default listeners last so system listeners are triggered first
 | ||||
|     super.activateListeners(html); | ||||
|   } | ||||
|  |  | |||
|  | @ -81,4 +81,14 @@ | |||
|       } | ||||
|     } | ||||
|   } | ||||
|   .panel.abilities { | ||||
|     .item-list { | ||||
|       .item-entry { | ||||
|         .item-pattern { | ||||
|           flex: 0 0 15px; | ||||
|           cursor: pointer; | ||||
|         } | ||||
|       }   | ||||
|     } | ||||
|   } | ||||
| } | ||||
|  |  | |||
|  | @ -167,6 +167,7 @@ | |||
|       "weight": 80 | ||||
|     }, | ||||
|     "weapon": { | ||||
|       "pattern": "white", | ||||
|       "description": "", | ||||
|       "damage": "1d6", | ||||
|       "bonus": 0, | ||||
|  | @ -204,6 +205,7 @@ | |||
|       "save": "" | ||||
|     }, | ||||
|     "ability": { | ||||
|       "pattern": "white", | ||||
|       "requirements": "", | ||||
|       "roll": "", | ||||
|       "rollType": "result", | ||||
|  |  | |||
|  | @ -94,6 +94,7 @@ | |||
|                     {{#each abilities as |item|}} | ||||
|                     <li class="item-entry"> | ||||
|                         <div class="item flexrow" data-item-id="{{item._id}}"> | ||||
|                             <div class="item-pattern" title="{{localize 'OSE.items.pattern'}}" style="background:linear-gradient(0.25turn, {{item.data.pattern}}, transparent)"></div> | ||||
|                             <div class="item-name {{#if item.data.roll}}item-rollable{{/if}} flexrow"> | ||||
|                                 <div class="item-image" style="background-image: url({{item.img}})"></div> | ||||
|                                 <h4 title="{{item.name}}"> | ||||
|  | @ -117,6 +118,9 @@ | |||
|                     {{#each section as |item|}} | ||||
|                     <li class="item-entry"> | ||||
|                         <div class="item flexrow" data-item-id="{{item._id}}"> | ||||
|                             {{#if (eq item.type 'weapon')}} | ||||
|                             <div class="item-pattern" title="{{localize 'OSE.items.pattern'}}" style="background:linear-gradient(0.25turn, {{item.data.pattern}}, transparent)"></div> | ||||
|                             {{/if}} | ||||
|                             <div class="item-name {{#if (eq item.type 'weapon')}}item-rollable{{/if}}  flexrow"> | ||||
|                                 <div class="item-image" style="background-image: url({{item.img}})"></div> | ||||
|                                 <h4 title="{{item.name}}"> | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue