Merge branch 'zones' of ssh://cryps.gg:40022/~/cryps into zones

This commit is contained in:
Mashy
2018-12-30 14:43:35 +10:00
5 changed files with 22 additions and 20 deletions
+6
View File
@@ -3,6 +3,7 @@ const Phaser = require('phaser');
const Header = require('./header');
const Menu = require('./menu');
const Combat = require('./combat');
const Missions = require('./missions');
function renderCryps() {
const config = {
@@ -35,6 +36,11 @@ function renderCryps() {
if (!data || game.registry.get('inGame')) return false;
return game.scene.add('Combat', Combat, true);
}
if (key === 'zone') {
return game.scene.add('Missions', Missions, true, data);
}
return true;
}
+2 -3
View File
@@ -1,5 +1,4 @@
const Phaser = require('phaser');
const Missions = require('./missions');
const {
TEXT,
@@ -123,8 +122,8 @@ class MenuGameList extends Phaser.Scene {
});
zones.on('pointerdown', () => {
this.scene.add('Missions', Missions, true);
return ws.sendZoneCreate();
if (this.scene.get('Missions')) return false;
return ws.sendAccountZone();
});
+1 -2
View File
@@ -15,8 +15,7 @@ class Missions extends Phaser.Scene {
this.load.image('eye', 'https://labs.phaser.io/assets/particles/green-orb.png');
}
create() {
const zone = this.registry.get('zone');
create(zone) {
if (!zone) return false;
console.log(zone);
+1
View File
@@ -195,6 +195,7 @@ function createSocket(events) {
console.log(res);
// check for error and split into response type and data
if (res.err === 'no active zone') sendZoneCreate();
if (res.err) return errorToast(res.err);
const { method, params } = res;
if (!handlers[method]) return errorToast(`${method} handler missing`);