Merge branch 'master' of ssh://cryps.gg:40022/~/cryps
This commit is contained in:
commit
7e2e44fc57
@ -3,6 +3,7 @@ const { remove } = require('lodash');
|
|||||||
|
|
||||||
const { TEXT, COLOURS, POSITIONS: { CRYP_LIST } } = require('./constants');
|
const { TEXT, COLOURS, POSITIONS: { CRYP_LIST } } = require('./constants');
|
||||||
const genAvatar = require('./avatar');
|
const genAvatar = require('./avatar');
|
||||||
|
const { LineGroup, LineBox } = require('./elements/outline.rotate');
|
||||||
|
|
||||||
const ROW_HEIGHT = CRYP_LIST.height() * 0.2;
|
const ROW_HEIGHT = CRYP_LIST.height() * 0.2;
|
||||||
const ROW_WIDTH = CRYP_LIST.width();
|
const ROW_WIDTH = CRYP_LIST.width();
|
||||||
@ -35,7 +36,7 @@ class HomeCrypList extends Phaser.Scene {
|
|||||||
this.registry.events.on('changedata', this.updateData, this);
|
this.registry.events.on('changedata', this.updateData, this);
|
||||||
this.registry.events.on('setdata', this.updateData, this);
|
this.registry.events.on('setdata', this.updateData, this);
|
||||||
const cryps = this.registry.get('crypList');
|
const cryps = this.registry.get('crypList');
|
||||||
|
const lineGroup = this.add.existing(new LineGroup(this));
|
||||||
|
|
||||||
if (!cryps) return true;
|
if (!cryps) return true;
|
||||||
const ws = this.registry.get('ws');
|
const ws = this.registry.get('ws');
|
||||||
@ -58,12 +59,16 @@ class HomeCrypList extends Phaser.Scene {
|
|||||||
.setOrigin(0);
|
.setOrigin(0);
|
||||||
crypInteract.setAlpha(0.2);
|
crypInteract.setAlpha(0.2);
|
||||||
crypInteract.on('pointerdown', () => {
|
crypInteract.on('pointerdown', () => {
|
||||||
|
lineGroup.clear(true, true);
|
||||||
if (this.activeCryps.includes(crypInteract)) {
|
if (this.activeCryps.includes(crypInteract)) {
|
||||||
remove(this.activeCryps, n => n === crypInteract);
|
remove(this.activeCryps, n => n === crypInteract);
|
||||||
crypInteract.setAlpha(0.2);
|
crypInteract.setAlpha(0.2);
|
||||||
} else {
|
} else {
|
||||||
this.activeCryps.push(crypInteract);
|
this.activeCryps.push(crypInteract);
|
||||||
crypInteract.setAlpha(1);
|
crypInteract.setAlpha(0.75);
|
||||||
|
lineGroup.add(this.add.existing(
|
||||||
|
new LineBox(this, crypInteract.x, crypInteract.y, crypInteract.width, crypInteract.height, crypInteract.fillColor, 3)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
const Phaser = require('phaser');
|
const Phaser = require('phaser');
|
||||||
|
|
||||||
const { LineGroup, LineBox } = require('./elements/outline.rotate');
|
|
||||||
|
|
||||||
const HomeCryps = require('./home.cryps');
|
const HomeCryps = require('./home.cryps');
|
||||||
const HomeNavigation = require('./home.navigation');
|
const HomeNavigation = require('./home.navigation');
|
||||||
@ -35,8 +34,6 @@ class Home extends Phaser.Scene {
|
|||||||
this.scene.manager.add('HomeCryps', HomeCryps, true);
|
this.scene.manager.add('HomeCryps', HomeCryps, true);
|
||||||
this.scene.manager.add('HomeNavigation', HomeNavigation, true);
|
this.scene.manager.add('HomeNavigation', HomeNavigation, true);
|
||||||
|
|
||||||
const lineGroup = this.add.existing(new LineGroup(this));
|
|
||||||
lineGroup.add(this.add.existing(new LineBox(this, 50, 250, 200, 400, 4)));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user