refactor: update dependencies

This commit is contained in:
2023-01-01 13:33:34 +03:00
parent ee846f6219
commit 1cfc98dd57
9 changed files with 4897 additions and 3493 deletions

50
.vscode/launch.json vendored Normal file
View File

@@ -0,0 +1,50 @@
{
"version": "0.2.0",
"configurations": [
{
"args": [
"client:flash:test"
],
"name": "client:flash:test",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"request": "launch",
"type": "node"
},
{
"args": [
"client:linux:test"
],
"name": "client:linux:test",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"request": "launch",
"type": "node"
},
{
"args": [
"client:html5:test"
],
"name": "client:html5:test",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"request": "launch",
"type": "node"
},
{
"args": [
"client:android:test"
],
"name": "client:android:test",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"request": "launch",
"type": "node"
},
{
"args": [
"editor:flash:test"
],
"name": "editor:flash:test",
"program": "${workspaceFolder}/node_modules/gulp/bin/gulp.js",
"request": "launch",
"type": "node"
}
]
}

11
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,11 @@
{
"haxe.executable": {
"path": "/home/shmyga/sdk/haxe/4.2.5/haxe",
"env": {
"HAXE_STD_PATH": "/home/shmyga/sdk/haxe/4.2.5/std",
},
},
"haxe.configurations": [
["build/client/flash/haxe/debug.hxml"]
]
}

View File

@@ -7,6 +7,10 @@ const dateformat = require('dateformat');
const argv = require('yargs').argv; const argv = require('yargs').argv;
const publish = require('./tasks/gulp-publish'); const publish = require('./tasks/gulp-publish');
if (packageInfo.haxe) {
Haxe.VERSION = packageInfo.haxe;
}
if (Config.SdkDir) { if (Config.SdkDir) {
Sdk.dir = Config.SdkDir; Sdk.dir = Config.SdkDir;
} }

6791
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -12,14 +12,15 @@
}, },
"haxeDependencies": { "haxeDependencies": {
"haxework": "git@bitbucket.org:shmyga/haxework.git", "haxework": "git@bitbucket.org:shmyga/haxework.git",
"lime": "7.5.0", "lime": "8.0.0",
"openfl": "8.9.1", "openfl": "9.2.0",
"hxcpp": "4.0.52", "hxcpp": "4.2.1",
"promhx": "1.1.0", "promhx": "1.1.0",
"protohx": "0.4.6", "protohx": "0.4.6",
"yaml": "1.3.0", "yaml": "2.0.1",
"orm": "2.1.0", "orm": "2.1.0",
"haxe-crypto": "0.0.7", "haxe-crypto": "0.0.8",
"svg": "1.1.3" "svg": "1.1.3"
} },
"haxe": "4.2.5"
} }

View File

@@ -1,9 +1,13 @@
package ru.m.tankz; package ru.m.tankz;
import ru.m.animate.AnimateManager;
import flash.Lib; import flash.Lib;
import haxework.animate.Animate; import haxework.animate.Animate;
import haxework.log.TraceLogger; import haxework.log.TraceLogger;
import haxework.net.manage.LoaderManager;
import haxework.view.Root; import haxework.view.Root;
import haxework.view.popup.PopupManager;
import ru.m.tankz.storage.GameStorage;
import ru.m.tankz.storage.SettingsStorage; import ru.m.tankz.storage.SettingsStorage;
import ru.m.tankz.view.ClientView; import ru.m.tankz.view.ClientView;
@@ -20,6 +24,12 @@ class Client {
#if debug #if debug
//L.push(new haxework.log.SocketLogger()); //L.push(new haxework.log.SocketLogger());
#end #end
// ToDo: fix @:provide macro
PopupManager;
LoaderManager;
GameStorage;
AnimateManager;
//
Const.init(); Const.init();
Init.init(); Init.init();
Animate.bind(Lib.current.stage); Animate.bind(Lib.current.stage);

View File

@@ -44,7 +44,7 @@ using ru.m.tankz.view.ViewUtil;
if (update) { if (update) {
updateButton.text = 'Update ${appUpdater.bundle.version}'; updateButton.text = 'Update ${appUpdater.bundle.version}';
} }
}); }).catchError(function(error) {});
var list = levelBundle.list(); var list = levelBundle.list();
list.sort(function(a:PackId, b:PackId) return a.toPackLabel() > b.toPackLabel() ? 1 : -1); list.sort(function(a:PackId, b:PackId) return a.toPackLabel() > b.toPackLabel() ? 1 : -1);
packs.data = list; packs.data = list;

View File

@@ -18,8 +18,7 @@ import ru.m.tankz.game.GameEvent;
import ru.m.tankz.game.GameState; import ru.m.tankz.game.GameState;
import ru.m.tankz.game.Spawner; import ru.m.tankz.game.Spawner;
import ru.m.tankz.Type; import ru.m.tankz.Type;
import ru.m.tankz.game.GameUtil;
using ru.m.tankz.game.GameUtil;
class GameRunner extends Game implements EngineListener { class GameRunner extends Game implements EngineListener {
private var updater:ICaller; private var updater:ICaller;
@@ -116,7 +115,7 @@ class GameRunner extends Game implements EngineListener {
engine.spawn(tank); engine.spawn(tank);
gameEventSignal.emit(EventUtil.buildTankSpawn(tank)); gameEventSignal.emit(EventUtil.buildTankSpawn(tank));
if (player.config.protect > 0) { if (player.config.protect > 0) {
protectTank(tank, player.config.protect); GameUtil.protectTank(this, tank, player.config.protect);
} }
} }
@@ -169,13 +168,13 @@ class GameRunner extends Game implements EngineListener {
switch [entity, with] { switch [entity, with] {
case [TANK(tank), TANK(other_tank)]: case [TANK(tank), TANK(other_tank)]:
tank.rect.lean(other_tank.rect); tank.rect.lean(other_tank.rect);
emitTankMove(tank); GameUtil.emitTankMove(this, tank);
case [TANK(tank), EAGLE(eagle)]: case [TANK(tank), EAGLE(eagle)]:
tank.rect.lean(eagle.rect); tank.rect.lean(eagle.rect);
emitTankMove(tank); GameUtil.emitTankMove(this, tank);
case [TANK(tank), CELL(cell)]: case [TANK(tank), CELL(cell)]:
tank.rect.lean(cell.rect); tank.rect.lean(cell.rect);
emitTankMove(tank); GameUtil.emitTankMove(this, tank);
case [BULLET(bullet), BULLET(other_bullet)]: case [BULLET(bullet), BULLET(other_bullet)]:
if (bullet.playerId != other_bullet.playerId && bullet.layer > 0 && other_bullet.layer > 0) { if (bullet.playerId != other_bullet.playerId && bullet.layer > 0 && other_bullet.layer > 0) {
gameEventSignal.emit(DESTROY(BULLET(bullet.id))); gameEventSignal.emit(DESTROY(BULLET(bullet.id)));
@@ -194,7 +193,7 @@ class GameRunner extends Game implements EngineListener {
if (!tank.protect) { if (!tank.protect) {
if (tank.boat) { if (tank.boat) {
tank.boat = false; tank.boat = false;
emitTankChange(tank); GameUtil.emitTankChange(this, tank);
} else if (tank.hits > 0) { } else if (tank.hits > 0) {
tank.hits--; tank.hits--;
if (tank.bonus) { if (tank.bonus) {
@@ -202,11 +201,11 @@ class GameRunner extends Game implements EngineListener {
spawnBonus(); spawnBonus();
} }
gameEventSignal.emit(HIT(TANK(tank.id, buildShot(bullet)))); gameEventSignal.emit(HIT(TANK(tank.id, buildShot(bullet))));
emitTankChange(tank); GameUtil.emitTankChange(this, tank);
} else if (tank.config.downgrade != null) { } else if (tank.config.downgrade != null) {
tank.config = config.getTank(tank.config.downgrade); tank.config = config.getTank(tank.config.downgrade);
gameEventSignal.emit(HIT(TANK(tank.id, buildShot(bullet)))); gameEventSignal.emit(HIT(TANK(tank.id, buildShot(bullet))));
emitTankChange(tank); GameUtil.emitTankChange(this, tank);
} else { } else {
var score = tank.config.score; var score = tank.config.score;
if (score != null && tank.playerId.team == bullet.playerId.team) { if (score != null && tank.playerId.team == bullet.playerId.team) {
@@ -235,7 +234,7 @@ class GameRunner extends Game implements EngineListener {
public function onMove(entity:EntityType, move:Bool):Void { public function onMove(entity:EntityType, move:Bool):Void {
switch entity { switch entity {
case TANK(tank): case TANK(tank):
emitTankMove(tank, move); GameUtil.emitTankMove(this, tank, move);
case BULLET(bullet): case BULLET(bullet):
gameEventSignal.emit(MOVE(BULLET(bullet.id, {x:bullet.rect.x, y:bullet.rect.y, direction:bullet.rect.direction}))); gameEventSignal.emit(MOVE(BULLET(bullet.id, {x:bullet.rect.x, y:bullet.rect.y, direction:bullet.rect.direction})));
case _: case _:
@@ -328,7 +327,7 @@ class GameRunner extends Game implements EngineListener {
}); });
if (shot.score != null) { if (shot.score != null) {
var tank:Tank = engine.getEntity(shot.tankId); var tank:Tank = engine.getEntity(shot.tankId);
changeScore(tank.playerId, shot.score); GameUtil.changeScore(this, tank.playerId, shot.score);
} }
checkComplete(); checkComplete();
case DESTROY(TANK(id, shot)): case DESTROY(TANK(id, shot)):
@@ -338,9 +337,9 @@ class GameRunner extends Game implements EngineListener {
player.tankId = -1; player.tankId = -1;
team.onDestroy(player.id); team.onDestroy(player.id);
if (player.state.life > 0) { if (player.state.life > 0) {
changeLife(player.id, -1); GameUtil.changeLife(this, player.id, -1);
} else if (team.state.life > 0) { } else if (team.state.life > 0) {
changeTeamLife(team.id, -1); GameUtil.changeTeamLife(this, team.id, -1);
} }
var respawn:Bool = team.tryRespawn(player.id); var respawn:Bool = team.tryRespawn(player.id);
if (respawn) { if (respawn) {
@@ -359,7 +358,7 @@ class GameRunner extends Game implements EngineListener {
score: shot.score, score: shot.score,
}); });
if (shot.score != null) { if (shot.score != null) {
changeScore(shooter.id, shot.score); GameUtil.changeScore(this, shooter.id, shot.score);
} }
engine.destroy(id); engine.destroy(id);
case DESTROY(BONUS(id, shot)): case DESTROY(BONUS(id, shot)):
@@ -373,7 +372,7 @@ class GameRunner extends Game implements EngineListener {
score: shot.score, score: shot.score,
}); });
if (shot.score != null) { if (shot.score != null) {
changeScore(tank.playerId, shot.score); GameUtil.changeScore(this, tank.playerId, shot.score);
} }
engine.destroy(id); engine.destroy(id);
case DESTROY(BULLET(id)): case DESTROY(BULLET(id)):

View File

@@ -1,9 +1,12 @@
package ru.m.tankz.editor; package ru.m.tankz.editor;
import haxework.net.manage.LoaderManager;
import haxework.resources.IResources; import haxework.resources.IResources;
import haxework.view.frame.FrameSwitcher;
import haxework.view.Root; import haxework.view.Root;
import haxework.view.frame.FrameSwitcher;
import haxework.view.popup.PopupManager;
import haxework.view.theme.ITheme; import haxework.view.theme.ITheme;
import ru.m.animate.AnimateManager;
import ru.m.tankz.bundle.CachedLevelBundle; import ru.m.tankz.bundle.CachedLevelBundle;
import ru.m.tankz.bundle.ClientLevelSource; import ru.m.tankz.bundle.ClientLevelSource;
import ru.m.tankz.bundle.ConfigBundle; import ru.m.tankz.bundle.ConfigBundle;
@@ -11,6 +14,7 @@ import ru.m.tankz.bundle.IConfigBundle;
import ru.m.tankz.bundle.ILevelBundle; import ru.m.tankz.bundle.ILevelBundle;
import ru.m.tankz.editor.view.EditorView; import ru.m.tankz.editor.view.EditorView;
import ru.m.tankz.editor.view.PackListFrame; import ru.m.tankz.editor.view.PackListFrame;
import ru.m.tankz.storage.GameStorage;
class Editor { class Editor {
private static inline var TAG = "Editor"; private static inline var TAG = "Editor";
@@ -29,6 +33,12 @@ class Editor {
#if debug #if debug
//L.push(new haxework.log.SocketLogger()); //L.push(new haxework.log.SocketLogger());
#end #end
// ToDo: fix @:provide macro
PopupManager;
LoaderManager;
GameStorage;
AnimateManager;
//
Const.init(); Const.init();
L.d(TAG, 'Debug: ${Const.DEBUG}'); L.d(TAG, 'Debug: ${Const.DEBUG}');
L.i(TAG, 'Version: ${Const.VERSION}'); L.i(TAG, 'Version: ${Const.VERSION}');