WIP
This commit is contained in:
+35
-3
@@ -1,15 +1,47 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { MD2Icon, MobDlgType, MobInfo } from '../../../massive-darkness2.model';
|
||||
import { MobSkillType } from '../../../massive-darkness2.model.boss';
|
||||
|
||||
@Component({
|
||||
selector: 'ngx-mob-combat-info',
|
||||
selector: 'md2-mob-combat-info',
|
||||
templateUrl: './mob-combat-info.component.html',
|
||||
styleUrls: ['./mob-combat-info.component.scss']
|
||||
})
|
||||
export class MobCombatInfoComponent implements OnInit {
|
||||
|
||||
MD2Icon = MD2Icon;
|
||||
private _mob: MobInfo;
|
||||
public get mob(): MobInfo {
|
||||
return this._mob;
|
||||
}
|
||||
|
||||
@Input() public set mob(v: MobInfo) {
|
||||
if (this._mob != v) {
|
||||
this._mob = v;
|
||||
|
||||
}
|
||||
}
|
||||
@Input() mode: MobDlgType = MobDlgType.PreView;
|
||||
constructor() { }
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
if (this.mob.combatSkill) {
|
||||
switch (this.mode) {
|
||||
case MobDlgType.Activating:
|
||||
this.showSkill = [MobSkillType.Combat, MobSkillType.Attack].includes(this.mob.combatSkill.type);
|
||||
break;
|
||||
case MobDlgType.BeenAttacked:
|
||||
this.showSkill = [MobSkillType.Combat, MobSkillType.Defense].includes(this.mob.combatSkill.type);
|
||||
break;
|
||||
case MobDlgType.PreView:
|
||||
case MobDlgType.Spawn:
|
||||
default:
|
||||
this.showSkill = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
showSkill: boolean = false;;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user