Add icons and background

This commit is contained in:
sladecraven 2022-11-09 23:39:55 +01:00
parent 3718749519
commit 4f04a3c97b
18 changed files with 25 additions and 8 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

View File

@ -154,6 +154,8 @@ export class HawkmoonActorSheet extends ActorSheet {
let autoresult = HawkmoonAutomation.processAutomations("on-drop", item, this.actor) let autoresult = HawkmoonAutomation.processAutomations("on-drop", item, this.actor)
if ( autoresult.isValid ) { if ( autoresult.isValid ) {
super._onDropItem(event, dragData) super._onDropItem(event, dragData)
} else {
ui.notifications.warn( autoresult.warningMessage)
} }
} }

View File

@ -228,12 +228,18 @@ export class HawkmoonActor extends Actor {
return {isValid: false} return {isValid: false}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
checkCompetenceLevel(compName, minLevel) { checkAttributOrCompetenceLevel(compName, minLevel) {
let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase() && i.system.niveau >= minLevel) let comp = this.items.find(i => i.type == "competence" && i.name.toLowerCase() == compName.toLowerCase() && i.system.niveau >= minLevel)
if ( comp) { if ( comp) {
return {isValid: true, item: duplicate(comp) } return {isValid: true, item: duplicate(comp) }
} else {
for (let attrKey in this.system.attributs) {
if ( this.system.attributs[attrKey].label.toLowerCase() == compName.toLowerCase() && this.system.attributs[attrKey].value >= minLevel ) {
return {isValid: true, item: duplicate(this.system.attributs[attrKey]) }
} }
return {isValid: false, warningMessage: `Prérequis insuffisant : la compétence ${compName} doit être de niveau ${minLevel} au minimum`} }
}
return {isValid: false, warningMessage: `Prérequis insuffisant : la compétence/attribut ${compName} doit être de niveau ${minLevel} au minimum`}
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
addCompetenceBonus(compName, bonus, baCost) { addCompetenceBonus(compName, bonus, baCost) {

View File

@ -32,12 +32,21 @@ export class HawkmoonAutomation {
return {isValid: true} return {isValid: true}
} }
let validTab = []
for(let auto of relevantAutomations) { for(let auto of relevantAutomations) {
if ( event == "on-drop") { if ( event == "on-drop") {
return actor.checkCompetenceLevel( auto.competence, auto.minLevel) validTab.push( actor.checkAttributOrCompetenceLevel( auto.competence, auto.minLevel) )
} }
} }
return {isValid: false}
// Post process validation array
for (let ret of validTab) {
if ( !ret.isValid) {
return ret
}
}
return {isValid: true}
} }
} }

View File

@ -1269,7 +1269,7 @@ ul, li {
color: #CCC color: #CCC
} }
#pause > img { #pause > img {
content: url(../assets/logos/mournblade_logo_chaos.webp); content: url(../assets/logos/hawkmoon_logo.webp);
height: 256px; height: 256px;
width: 256px; width: 256px;
top: -80px; top: -80px;
@ -1277,7 +1277,7 @@ ul, li {
} }
#logo { #logo {
content : url(../assets/logos/mournblade_logo_texte.webp); content : url(../assets/logos/hawkmoon_logo.webp);
width: 120px; width: 120px;
height: 40px; height: 40px;
} }