From bd86412d83312037cf9f822e8638351142761b01 Mon Sep 17 00:00:00 2001 From: shmyga Date: Tue, 13 Feb 2018 17:12:24 +0300 Subject: [PATCH] [editor] fixes --- src/client/resources/image/map/water.png | Bin 0 -> 598 bytes .../haxe/ru/m/tankz/editor/BrickView.hx | 2 +- src/editor/haxe/ru/m/tankz/editor/Editor.hx | 2 +- .../haxe/ru/m/tankz/editor/MapEditView.hx | 21 +++++++++++++----- 4 files changed, 18 insertions(+), 7 deletions(-) create mode 100644 src/client/resources/image/map/water.png diff --git a/src/client/resources/image/map/water.png b/src/client/resources/image/map/water.png new file mode 100644 index 0000000000000000000000000000000000000000..2151ef8a73c5c384558957ae2a5369a828e096c6 GIT binary patch literal 598 zcmV-c0;&CpP)?E_n1xk}C=> zz6N|b2#{tnnT7{@lBXXWs;=0IxataWMZKohlw=FBiXZMtYEAj40*CAK8%Ew{#M8;* zcSvkV4N_?sZCLS-qkvSJP>R_EglS&Y6+C|JEG#wihLQeMZuG|(FW78 z;+^YnO>CWi(1THbvAR-SP^vF)=&EtC%*U%_X}5f?&-L%gG`#rakShv?eZ|LTKC@U8 z<-%&<@>KEW{tYMlwgipm(eJgG#d1YKZO)==12S(Tud7zh8A&cqmFm zHwn;P9rSFEf^L=}1(;3X>@c9}MsZJN^d=+EKIvMat~!cg>{2>A46G+;>E`7NrC3L9 kDxbHQ(bnrK>+&)94b;8i&`iJaP5=M^07*qoM6N<$g4VPmkN^Mx literal 0 HcmV?d00001 diff --git a/src/editor/haxe/ru/m/tankz/editor/BrickView.hx b/src/editor/haxe/ru/m/tankz/editor/BrickView.hx index 7fe5022..970734a 100644 --- a/src/editor/haxe/ru/m/tankz/editor/BrickView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/BrickView.hx @@ -38,7 +38,7 @@ class BrickView extends SpriteView implements IListItemView { private function set_data(value:BrickConfig):BrickConfig { data = value; - var src = 'resources/images/map/map_${value.type}.png'; + var src = 'resources/image/map/${value.type}.png'; imageView.bitmapData = Assets.getBitmapData(src); imageView.x = (width - imageView.width) / 2; imageView.y = (height - imageView.height) / 2; diff --git a/src/editor/haxe/ru/m/tankz/editor/Editor.hx b/src/editor/haxe/ru/m/tankz/editor/Editor.hx index 94924bc..a94af0f 100644 --- a/src/editor/haxe/ru/m/tankz/editor/Editor.hx +++ b/src/editor/haxe/ru/m/tankz/editor/Editor.hx @@ -112,7 +112,7 @@ class Editor { view.mapView.config = config; view.mapView.data = LevelBundle.empty(config); - view.brickList.data = config.bricks.filter(function(brick) return brick.type > -1); + view.brickList.data = config.bricks.filter(function(brick) return brick.index > -1); view.spawnPointList.data = config.points; view.mapView.brush = Brush.BRICK(view.brickList.data[0]); diff --git a/src/editor/haxe/ru/m/tankz/editor/MapEditView.hx b/src/editor/haxe/ru/m/tankz/editor/MapEditView.hx index 071d303..8db75c5 100644 --- a/src/editor/haxe/ru/m/tankz/editor/MapEditView.hx +++ b/src/editor/haxe/ru/m/tankz/editor/MapEditView.hx @@ -41,12 +41,23 @@ class SpawnPointItem extends BitmapItem { } public static function getSrc(value:SpawnPoint, config:Config):String { - var tankType = config.getTeam(value.team).tanks[0]; - var tankConfig = config.getTank(tankType.type); + var preset:GamePreset = config.presets[config.presets.length - 1]; + var tankConfig:TankConfig = null; + if (value.type == 'tank') { + var team:TeamConfig = Lambda.find(preset.teams, function(t) return t.id == value.team); + var player:PlayerConfig = null; + if (value.index > 0) { + player = Lambda.find(team.players, function(p) return p.index == value.index); + } else { + player = team.players[0]; + } + var tankType = player.tanks[0]; + tankConfig = config.getTank(tankType.type); + } return switch(value.type) { - case 'eagle': 'resources/images/eagle/eagle-0.png'; + case 'eagle': 'resources/image/eagle/eagle.png'; case 'tank': 'resources/image/tank/${tankConfig.skin}-0.png'; - case x: 'resources/images/eagle/eagle-1.png'; + case x: 'resources/image/eagle/eagle-death.png'; } } @@ -181,7 +192,7 @@ class MapEditView extends SpriteView { } private function drawMap() { - for (brick in map.bricks) if (brick.config.type > 0) { + for (brick in map.bricks) if (brick.config.index > 0) { if (!items.exists(brick.key)) { items[brick.key] = new BrickItem(brick); if (brick.config.layer > 2) {