diff --git a/src/client/resources/image/map/water.png b/src/client/resources/image/map/water.png new file mode 100644 index 0000000..2151ef8 Binary files /dev/null and b/src/client/resources/image/map/water.png differ 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) {