[common] add dota levels
This commit is contained in:
@@ -2,9 +2,9 @@ package ru.m.tankz.editor.frame;
|
||||
|
||||
import haxework.view.ButtonView;
|
||||
import haxework.view.DataView;
|
||||
import haxework.view.InputView;
|
||||
import haxework.view.LabelView;
|
||||
import haxework.view.VGroupView;
|
||||
import haxework.provider.Provider;
|
||||
import ru.m.tankz.bundle.IConfigBundle;
|
||||
import ru.m.tankz.config.Config;
|
||||
import ru.m.tankz.editor.FileUtil;
|
||||
@@ -25,6 +25,7 @@ import ru.m.tankz.util.LevelUtil;
|
||||
@:view var openButton:ButtonView;
|
||||
@:view var saveButton:ButtonView;
|
||||
@:view var fileNameLabel:LabelView;
|
||||
@:view var levelName:InputView;
|
||||
@:view var mapView:MapEditView;
|
||||
@:view var spawnPointList:DataView<SpawnPoint, SpawnPointView>;
|
||||
@:view var brickList:DataView<BrickConfig, BrickView>;
|
||||
@@ -86,13 +87,17 @@ import ru.m.tankz.util.LevelUtil;
|
||||
L.d(TAG, 'OPEN');
|
||||
FileUtil.browse().then(function(content:FileContent) {
|
||||
fileNameLabel.text = content.name;
|
||||
mapView.data = LevelUtil.loads(config, content.content);
|
||||
var data = LevelUtil.loads(config, content.content);
|
||||
mapView.data = data;
|
||||
levelName.text = data.name;
|
||||
});
|
||||
case 'saveButton':
|
||||
L.d(TAG, 'SAVE');
|
||||
var data = mapView.data;
|
||||
data.name = levelName.text;
|
||||
FileUtil.save({
|
||||
name: fileNameLabel.text,
|
||||
content: LevelUtil.dumps(config, mapView.data),
|
||||
content: LevelUtil.dumps(config, data),
|
||||
});
|
||||
case _:
|
||||
}
|
||||
|
||||
@@ -22,6 +22,13 @@ views:
|
||||
+onPress: $code:setGameType('death')
|
||||
- id: fileNameLabel
|
||||
$type: haxework.view.LabelView
|
||||
skinId: text
|
||||
text: level000.txt
|
||||
- id: levelName
|
||||
$type: haxework.view.InputView
|
||||
skinId: text.box
|
||||
geometry.size.width: 300
|
||||
text: ""
|
||||
# map
|
||||
- $type: haxework.view.HGroupView
|
||||
views:
|
||||
|
||||
Reference in New Issue
Block a user