Skip to content

Commit

Permalink
Update: 급한 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
pdom0327 committed Nov 7, 2020
1 parent c20dbd6 commit 689f61a
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 14 deletions.
Binary file modified src/client/assets/backgrounds/multiply.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/assets/backgrounds/multiplyBan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/client/assets/ui/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 48 additions & 13 deletions src/client/components/camera.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ export class Camera extends PIXI.Container {
this._jobNameText.anchor.set(0.5);
this._jobNameText.position.set(1920 / 2, 916);

this.addChild(createBlurOverlay());
this.addChild(new BlurOverlay());

this.addChild(PIXI.Sprite.from('./assets/ui/cameraUI.png'));
}
Expand Down Expand Up @@ -522,22 +522,57 @@ export class Camera extends PIXI.Container {
}
}

function createBlurOverlay() {
const container = new PIXI.Container();
class BlurOverlay extends PIXI.Container {
private _state: 'default' | 'ban';
private _tween?: Tween<any>;
private _multiply: PIXI.Sprite;

const blurFilter = new PIXI.filters.BlurFilter();
blurFilter.blur = 16;
blurFilter.quality = 6;
constructor() {
super();

this._state = 'default';

const blurFilter = new PIXI.filters.BlurFilter();
blurFilter.blur = 16;
blurFilter.quality = 6;

const graphics = PIXI.Sprite.from('../assets/backgrounds/multiply.png');
graphics.filters = [new PIXI.picture.MaskFilter(blurFilter)];
this.addChild(graphics);

this._multiply = PIXI.Sprite.from('../assets/backgrounds/multiply.png');
this._multiply.blendMode = PIXI.BLEND_MODES.MULTIPLY;
this.addChild(this._multiply);

autorun(() => {
if (store.sequenceStore.currentSequence?.payload?.action == 'ban') {
this.state = 'ban';
} else {
this.state = 'default';
}
});
}

const graphics = PIXI.Sprite.from('./assets/backgrounds/multiply.png');
graphics.filters = [new PIXI.picture.MaskFilter(blurFilter)];
container.addChild(graphics);
set state(value: 'default' | 'ban') {
if (this._state == value) {
return;
}

const multiply = PIXI.Sprite.from('./assets/backgrounds/multiply.png');
multiply.blendMode = PIXI.BLEND_MODES.MULTIPLY;
container.addChild(multiply);
this._state = value;

return container;
switch (this._state) {
case 'default':
this._multiply.texture = PIXI.Texture.from(
'../assets/backgrounds/multiply.png'
);
break;
case 'ban':
this._multiply.texture = PIXI.Texture.from(
'../assets/backgrounds/multiplyBan.png'
);
break;
}
}
}

type CameraEvent = {
Expand Down
7 changes: 7 additions & 0 deletions src/client/components/pickPanel.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { IReactionDisposer, autorun } from 'mobx';
import { DropShadowFilter } from 'pixi-filters';
import { JobId } from '../../common/enums';
import { getJob, Job } from '../../common/jobs';
import { store } from '../store';
Expand Down Expand Up @@ -90,6 +91,12 @@ export class PickPanel extends PIXI.Container {
this.title.anchor.set(direction == 'left' ? 1 : 0, 1);
this.title.position.set(direction == 'left' ? 396 - 12 : 0 + 12, 120 - 8);

const dropShadowFilter = new DropShadowFilter({
distance: 4,
rotation: 90,
});
this.filters = [dropShadowFilter];

this.reset();
}

Expand Down
6 changes: 5 additions & 1 deletion src/client/components/titleBar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ export class TitleBar extends PIXI.Container {
fontSize: '56px',
fill: '#de9300',
},
ban: {
fontSize: '56px',
fill: '#ca0000',
},
})
);

Expand All @@ -204,7 +208,7 @@ export class TitleBar extends PIXI.Container {
: `<rightTeam>${store.sequenceStore.rightTeamName}</rightTeam>`
}${
(nextSequence.payload.index ?? 0) + 1
}번째 밴할 직업을 선택 중`;
}번째 <ban>밴</ban>할 직업을 선택 중`;
} else if (nextSequence.payload?.action == 'pick') {
title.text = `${
nextSequence.payload?.team == 'left'
Expand Down
3 changes: 3 additions & 0 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ function onFontLoaded() {
}
loader.add(splashes);

loader.add('../assets/backgrounds/multiply.png');
loader.add('../assets/backgrounds/multiplyBan.png');

loader.load(onAssetsLoaded);

const loading = app.stage.addChild(
Expand Down

0 comments on commit 689f61a

Please sign in to comment.