Update boss fight
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
<img class="g-width-95x img-thumbnail mobBg" src="{{imgUrl('/Mobs/BG.png')}}" />
|
||||
<img class="mobImg roamingMonster" src="{{getMobImageUrl(mob)}}" (click)="showMobImage(mob)" *ngIf="!isMob" />
|
||||
<div *ngIf="isMob">
|
||||
<img class="mobImg mobLeader" src="{{mob.leaderImgUrl}}" (click)="showMobImage(mob)" />
|
||||
<img class="mobImg mobMinion" src="{{mob.minionImgUrl}}" (click)="showMobImage(mob)" />
|
||||
|
||||
</div>
|
||||
@@ -0,0 +1,23 @@
|
||||
.mobImg {
|
||||
position: absolute;
|
||||
z-index: 2;
|
||||
&.roamingMonster {
|
||||
width: 95%;
|
||||
max-height: 80%;
|
||||
}
|
||||
&.mobLeader {
|
||||
z-index: 3;
|
||||
width: 70%;
|
||||
max-height: 80%;
|
||||
top: 40px;
|
||||
}
|
||||
&.mobMinion {
|
||||
width: 60%;
|
||||
max-height: 80%;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
.mobBg {
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { MobStandInfoComponent } from './mob-stand-info.component';
|
||||
|
||||
describe('MobStandInfoComponent', () => {
|
||||
let component: MobStandInfoComponent;
|
||||
let fixture: ComponentFixture<MobStandInfoComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ MobStandInfoComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(MobStandInfoComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,69 @@
|
||||
import { ChangeDetectorRef, Component, Input, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { first } from 'rxjs/operators';
|
||||
import { MD2Service } from '../../../../services/MD2/md2.service';
|
||||
import { StateService } from '../../../../services/state.service';
|
||||
import { StringUtils } from '../../../../utilities/string-utils';
|
||||
import { MD2Icon, MobInfo, MobDlgType, MobType } from '../../massive-darkness2.model';
|
||||
import { MD2ComponentBase } from '../../MD2Base';
|
||||
import { SpawnMobDlgComponent } from '../spawn-mob-dlg/spawn-mob-dlg.component';
|
||||
|
||||
@Component({
|
||||
selector: 'md2-mob-stand-info',
|
||||
templateUrl: './mob-stand-info.component.html',
|
||||
styleUrls: ['./mob-stand-info.component.scss']
|
||||
})
|
||||
export class MobStandInfoComponent extends MD2ComponentBase 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;
|
||||
public get hideWeaponInfo(): boolean {
|
||||
return this.mode == MobDlgType.Spawn;
|
||||
}
|
||||
|
||||
|
||||
constructor(
|
||||
public md2Service: MD2Service,
|
||||
protected stateService: StateService,
|
||||
protected route: ActivatedRoute,
|
||||
protected cdRef: ChangeDetectorRef,
|
||||
) {
|
||||
super(md2Service, stateService, route, cdRef);
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
}
|
||||
|
||||
public getMobImageUrl(mob: MobInfo): string {
|
||||
if (StringUtils.isNullOrWhitespace(mob.leaderImgUrl)) {
|
||||
return mob.imageUrl;
|
||||
} else {
|
||||
return mob.leaderImgUrl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
showMobImage(mob: MobInfo) {
|
||||
this.md2Service.dlgService.open(SpawnMobDlgComponent, { context: { title: `${mob.description}`, mode: MobDlgType.PreView, mob: mob } })
|
||||
.onClose.pipe(first()).subscribe(result => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public get isMob(): boolean {
|
||||
return this.mob.type == MobType.Mob;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user