Skip to content

Commit

Permalink
hotfix abilities, update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Lurkars committed Oct 30, 2024
1 parent 9f08862 commit 61ffc41
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 37 deletions.
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gloomhavensecretariat",
"version": "0.102.5",
"version": "0.102.6",
"license": "AGPL3",
"description": "Gloomhaven Secretariat is a Gloomhaven/Frosthaven Companion app.",
"homepage": "https://gloomhaven-secretariat.de",
Expand Down Expand Up @@ -85,29 +85,29 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^18.2.9",
"@angular/animations": "^18.2.10",
"@angular/cdk": "^18.2.10",
"@angular/common": "^18.2.9",
"@angular/compiler": "^18.2.9",
"@angular/core": "^18.2.9",
"@angular/forms": "^18.2.9",
"@angular/platform-browser": "^18.2.9",
"@angular/platform-browser-dynamic": "^18.2.9",
"@angular/router": "^18.2.9",
"@angular/service-worker": "^18.2.9",
"@angular/common": "^18.2.10",
"@angular/compiler": "^18.2.10",
"@angular/core": "^18.2.10",
"@angular/forms": "^18.2.10",
"@angular/platform-browser": "^18.2.10",
"@angular/platform-browser-dynamic": "^18.2.10",
"@angular/router": "^18.2.10",
"@angular/service-worker": "^18.2.10",
"autocompleter": "^9.3.2",
"leaflet": "^1.9.4",
"mermaid": "^10.9.1",
"ng-in-viewport": "^16.1.0",
"rxjs": "~7.8.1",
"tslib": "^2.8.0",
"uuid": "^11.0.1",
"uuid": "^11.0.2",
"zone.js": "~0.14.10"
},
"devDependencies": {
"@angular-devkit/build-angular": "^18.2.10",
"@angular/cli": "^18.2.10",
"@angular/compiler-cli": "^18.2.9",
"@angular-devkit/build-angular": "^18.2.11",
"@angular/cli": "^18.2.11",
"@angular/compiler-cli": "^18.2.10",
"@types/d3": "^7.4.3",
"@types/dom-screen-wake-lock": "1.0.3",
"@types/dompurify": "^3.0.5",
Expand Down
28 changes: 14 additions & 14 deletions src/app/ui/figures/actions/action.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
[disabled]="!isInteractiveApplicableAction"
[ngClass]="{'action-interactive' : isInteractiveApplicableAction, 'action-interactive-highlight': highlightAction()}">
<span class="condition-value">
<span [ghs-label]="('game.condition.' + getConditionName(values[0]))"
[ghs-label-args]="(values.length > 1 ? [values[1]] : [])" [style]="style"></span>
<span [ghs-label]="('game.condition.' + getConditionName(getValues(action)[0]))"
[ghs-label-args]="(values.length > 1 ? [getValues(action)[1]] : [])" [style]="style"></span>
</span>
<span class="condition-image">
<img class="icon" *ngIf="getConditionName(values[0]) != 'invalid'"
[src]="'./assets/images' + (fhStyle ? '/fh' : '') + '/condition/' + getConditionName(values[0]) + '.svg'" />
<img class="icon warning" *ngIf="getConditionName(values[0]) == 'invalid'" src="./assets/images/warning.svg" />
[src]="'./assets/images' + (fhStyle ? '/fh' : '') + '/condition/' + getConditionName(getValues(action)[0]) + '.svg'" />
<img class="icon warning" *ngIf="getConditionName(getValues(action)[0]) == 'invalid'" src="./assets/images/warning.svg" />
<span *ngIf="values.length > 1" class="value">{{values[1]}}</span>
</span>
</span>
Expand Down Expand Up @@ -56,10 +56,10 @@
ghs-pointer-input (singleClick)="toggleHighlight($event)" [clickBehind]="!isInteractiveApplicableAction"
[ghs-tooltip]="'monster.toggleAction'" [delay]="1" [disabled]="!isInteractiveApplicableAction">
<span class="element-half">
<img [src]="'./assets/images' + (fhStyle ? '/fh' : '') + '/element/' + values[0] + '.svg'" />
<img [src]="'./assets/images' + (fhStyle ? '/fh' : '') + '/element/' + getValues(action)[0] + '.svg'" />
</span>
<span class="element-half">
<img [src]="'./assets/images' + (fhStyle ? '/fh' : '') + '/element/' + values[1] + '.svg'" />
<img [src]="'./assets/images' + (fhStyle ? '/fh' : '') + '/element/' + getValues(action)[1] + '.svg'" />
</span>
</span>
<span class="minus" *ngIf="action.valueType == ActionValueType.minus">:</span>
Expand Down Expand Up @@ -100,8 +100,8 @@
</ng-container>

<span class="action-specialTarget" *ngSwitchCase="ActionType.specialTarget">
<span class="special-target-value" [ghs-label]="('game.specialTarget.' + values[0])"
[ghs-label-args]="values.splice(1)" [relative]="relative || forceRelative" [style]="style"
<span class="special-target-value" [ghs-label]="('game.specialTarget.' + getValues(action)[0])"
[ghs-label-args]="getValues(action).splice(1)" [relative]="relative || forceRelative" [style]="style"
[ngClass]="{'text-white' : !right, 'small' : action.small}"></span>
<span
*ngIf="[ 'alliesRange:', 'alliesRangeAffect:','allyAffectRange:', 'enemiesRange:', 'enemiesRangeAffect:', 'enemyRange:'].indexOf(action.value + '') != -1"
Expand Down Expand Up @@ -272,7 +272,7 @@
*ngIf="!inline && (values.length > 1 && +(values[1]) > 0 && index < +(values[1]) - 1 || values.length < 2 && index < subActions.length -1)"
class="action-concatenation-item">
<span *ngIf="values.length > 0">
<span *ngIf="!fhStyle" [ghs-label]="values[0]" [relative]="relative || forceRelative"
<span *ngIf="!fhStyle" [ghs-label]="getValues(action)[0]" [relative]="relative || forceRelative"
[style]="style"></span>
<span *ngIf="fhStyle">,</span>
</span>
Expand Down Expand Up @@ -366,13 +366,13 @@

<ng-container *ngSwitchCase="ActionType.card">
<span class="action-card" [ngClass]="{'small' : action.small}">
<div class="card-value" [ngClass]="values[0]">
<img class="ghs-svg" src="./assets/images/action/card/{{values[0]}}.svg" />
<div class="card-value" [ngClass]="getValues(action)[0]">
<img class="ghs-svg" [src]="'./assets/images/action/card/'+ getValues(action)[0] + '.svg'" />
<img *ngIf="values[0] != 'slot' && values[0] != 'slotStart' && values[0] != 'slotXp'" class="overlay"
src="./assets/images/action/card/overlay/{{values[0]}}.svg" />
[src]="'./assets/images/action/card/overlay/' + getValues(action)[0] + '.svg'" />
<span *ngIf="values[0] == 'slot' || values[0] == 'slotStart' || values[0] == 'slotXp'" class="overlay"
[style.mask-image]="'url(\'/assets/images/action/card/overlay/' + values[0] +'.svg\')'"
[style.-webkit-mask-image]="'url(\'/assets/images/action/card/overlay/' + values[0] +'.svg\')'">
[style.mask-image]="'url(\'/assets/images/action/card/overlay/' + getValues(action)[0] +'.svg\')'"
[style.-webkit-mask-image]="'url(\'/assets/images/action/card/overlay/' + getValues(action)[0] +'.svg\')'">
</span>
<span class="value" *ngIf="values.length > 1">{{values[1]}}</span>
</div>
Expand Down
20 changes: 11 additions & 9 deletions src/app/ui/figures/actions/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,6 @@ export class ActionComponent implements OnInit, OnDestroy {
this.monsterType = this.action.value as MonsterType;
}

if (this.action) {
this.normalValue = this.getNormalValue();
this.eliteValue = this.getEliteValue();
this.values = this.getValues(this.action);
this.specialActions = this.getSpecial(this.action);
}

this.updateSubActions();
this.applyChallenges();

Expand All @@ -132,6 +125,13 @@ export class ActionComponent implements OnInit, OnDestroy {
this.flying = this.monster.flying && (!this.monster.statEffect || this.monster.statEffect.flying != 'disabled') || this.monster.statEffect != undefined && this.monster.statEffect.flying == true;
}

if (this.action) {
this.normalValue = this.getNormalValue();
this.eliteValue = this.getEliteValue();
this.values = this.getValues(this.action, true);
this.specialActions = this.getSpecial(this.action);
}

this.isInteractiveApplicableAction = this.interactiveAbilities && this.monster && this.monster.entities.some((entity) => this.origAction && gameManager.actionsManager.isInteractiveApplicableAction(entity, this.origAction, this.actionIndex)) || this.objective && this.objective.entities.some((entity) => this.origAction && gameManager.actionsManager.isInteractiveApplicableAction(entity, this.origAction, this.actionIndex)) || false;
}

Expand Down Expand Up @@ -188,7 +188,10 @@ export class ActionComponent implements OnInit, OnDestroy {
return this.getRange(MonsterType.elite);
}

getValues(action: Action): string[] {
getValues(action: Action, force: boolean = false): string[] {
if (!force) {
return [...this.values];
}
return gameManager.actionsManager.getValues(action);
}

Expand Down Expand Up @@ -602,7 +605,6 @@ export class ActionComponent implements OnInit, OnDestroy {
}
}
this.interactiveActionsChange.emit(this.interactiveActions);
this.update();
event.preventDefault();
event.stopPropagation();
}
Expand Down

0 comments on commit 61ffc41

Please sign in to comment.