more zone stuff
This commit is contained in:
@@ -124,7 +124,7 @@ class MenuGameList extends Phaser.Scene {
|
||||
|
||||
zones.on('pointerdown', () => {
|
||||
this.scene.add('Missions', Missions, true);
|
||||
return ws.sendZoneCreate();
|
||||
return ws.sendAccountZone();
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -16,16 +16,20 @@ class Missions extends Phaser.Scene {
|
||||
}
|
||||
|
||||
create() {
|
||||
const zone = this.registry.get('zone');
|
||||
if (!zone) return false;
|
||||
|
||||
this.scene.manager.add('MissionControls', MissionControls, true);
|
||||
this.graphics = this.add.graphics();
|
||||
const nodeData = this.registry.get('zone').nodes;
|
||||
this.edgeData = this.registry.get('zone').edges.map(x => x.map(y => nodeData[y]));
|
||||
const nodeData = zone.graph.nodes;
|
||||
this.edgeData = zone.graph.edges.map(x => x.map(y => nodeData[y]));
|
||||
this.cameras.main.setViewport(COMBAT.width() * 0.2, COMBAT.y(),
|
||||
COMBAT.width() * 0.8, COMBAT.height());
|
||||
this.addNodes(nodeData);
|
||||
this.drawEdges(nodeData);
|
||||
this.addCameraControl();
|
||||
this.addEvents();
|
||||
return this;
|
||||
}
|
||||
|
||||
addNodes(nodeData) {
|
||||
|
||||
@@ -48,6 +48,10 @@ function createSocket(events) {
|
||||
send({ method: 'account_items', params: {} });
|
||||
}
|
||||
|
||||
function sendAccountZone() {
|
||||
send({ method: 'account_zone', params: {} });
|
||||
}
|
||||
|
||||
function sendCrypSpawn(name) {
|
||||
send({ method: 'cryp_spawn', params: { name } });
|
||||
}
|
||||
@@ -233,6 +237,7 @@ function createSocket(events) {
|
||||
sendAccountDemo,
|
||||
sendAccountCryps,
|
||||
sendAccountItems,
|
||||
sendAccountZone,
|
||||
sendGameState,
|
||||
sendGamePve,
|
||||
sendGamePvp,
|
||||
|
||||
Reference in New Issue
Block a user