Minor changes

This commit is contained in:
LeRatierBretonnien 2023-09-14 23:23:16 +02:00
parent 2394026d0c
commit dc07b27801
4 changed files with 36 additions and 19 deletions

View File

@ -69,8 +69,8 @@ export class PegasusCombat extends Combat {
}
const combatant = game.combat.combatants.get(combatantId)
if (combatant) {
await combatant.setFlag("world", "tic1", { revealed: false, text: rollData.tic1 })
await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2 })
await combatant.setFlag("world", "tic1", { revealed: false, text: rollData.tic1, displayed: false })
await combatant.setFlag("world", "tic2", { revealed: false, text: rollData.tic2, displayed: false })
}
}
@ -83,24 +83,27 @@ export class PegasusCombat extends Combat {
if (combatant) {
let ticData = combatant.getFlag("world", "tic" + num)
if (ticData) {
let ticText = "ACTED"
/* returns if revealed or if GM and NPC or if player and owner */
/* returns if revealed */
if (ticData.revealed && ticData.displayed) {
return "ACTED"
}
if (ticData.revealed && !ticData.displayed) {
ticData.displayed = true
combatant.setFlag("world", "tic" + num, ticData )
let chatData = {
user: game.user.id,
alias: combatant.actor.name,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `<div>${combatant.actor.name} is performing ${ticData.text}</div`
};
ChatMessage.create(chatData);
return ticText
combatant.setFlag("world", "tic" + num, ticData ).then(() => {
let chatData = {
user: game.user.id,
alias: combatant.actor.name,
rollMode: game.settings.get("core", "rollMode"),
whisper: [game.user.id].concat(ChatMessage.getWhisperRecipients('GM')),
content: `<div>${combatant.actor.name} is performing ${ticData.text}</div`
};
ChatMessage.create(chatData);
return "ACTED"
})
}
}
}
return "TIC" + num
return "TIC " + num
}
/* -------------------------------------------- */
async revealTIC(num, combatantId) {
@ -120,6 +123,7 @@ export class PegasusCombat extends Combat {
nextRound() {
for(let c of this.combatants) {
c.setFlag("world", "tic1", { revealed: false, text: "", displayed: false })
c.setFlag("world", "tic2", { revealed: false, text: "", displayed: false })
}
super.nextRound()
}

View File

@ -1142,7 +1142,6 @@ ul, li {
position: relative;
margin:4px;
}
.chat-card-button {
box-shadow: inset 0px 1px 0px 0px #a6827e;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
@ -1352,6 +1351,20 @@ Focus FOC: #ff0084
max-height: 26px;
margin-top: 4px;
}
.combat-tracker-tic-section {
max-width: 5rem;
min-width: 5rem;
align-content: center;
}
.combat-tracker-tic {
text-align: center;
background: linear-gradient(to bottom, #21374afc 5%, #152833ab 100%);
border-radius: 3px;
border: 2px ridge #846109;
color: #ffffff;
font-size: 0.8rem;
margin:2px;
}
.no-grow {
flex-grow: 1;
max-width: 32px;

View File

@ -252,7 +252,7 @@
],
"title": "Pegasus RPG",
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
"version": "11.0.7",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.7.zip",
"version": "11.0.8",
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v11.0.8.zip",
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
}

View File

@ -95,7 +95,7 @@
</div>
{{/if}}
<div class="token-resource" id="{{this.id}}">
<div class="combat-tracker-tic-section flexcol" id="{{this.id}}">
<a class="combat-tracker-tic" data-tic-num="1" data-combatant-id="{{this.id}}">{{getTIC 1 this.id}}</a>
{{#if (isCharacter this.id)}}
<a class="combat-tracker-tic" data-tic-num="2" data-combatant-id="{{this.id}}">{{getTIC 2 this.id}}</a>