Merge pull request #140 from ckcz123/v2.0

V2.0
This commit is contained in:
Zhang Chen 2018-06-06 00:23:38 +08:00 committed by GitHub
commit c42dc193ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 6 deletions

View File

@ -514,6 +514,35 @@ editor.prototype.listen = function () {
}
}
document.getElementById('mid').onmousewheel = function (e) {
e.preventDefault();
var wheel = function (direct) {
var index=editor.core.floorIds.indexOf(editor.currentFloorId);
var toId = editor.currentFloorId;
if (direct>0 && index<editor.core.floorIds.length-1)
toId = editor.core.floorIds[index+1];
else if (direct<0 && index>0)
toId = editor.core.floorIds[index-1];
else return;
editor_mode.onmode('nextChange');
editor_mode.onmode('floor');
document.getElementById('selectFloor').value = toId;
editor.changeFloor(toId);
}
try {
if (e.wheelDelta)
wheel(Math.sign(e.wheelDelta))
else if (e.detail)
wheel(Math.sign(e.detail));
}
catch (ee) {
console.log(ee);
}
}
var preMapData = {};
var currDrawData = {
pos: [],
@ -546,8 +575,8 @@ editor.prototype.listen = function () {
if (e.keyCode==33) {
e.preventDefault();
var index=editor.core.floorIds.indexOf(editor.currentFloorId);
if (index>0) {
var toId = editor.core.floorIds[index-1];
if (index<editor.core.floorIds.length-1) {
var toId = editor.core.floorIds[index+1];
editor_mode.onmode('nextChange');
editor_mode.onmode('floor');
document.getElementById('selectFloor').value = toId;
@ -557,8 +586,8 @@ editor.prototype.listen = function () {
if (e.keyCode==34) {
e.preventDefault();
var index=editor.core.floorIds.indexOf(editor.currentFloorId);
if (index<editor.core.floorIds.length-1) {
var toId = editor.core.floorIds[index+1];
if (index>0) {
var toId = editor.core.floorIds[index-1];
editor_mode.onmode('nextChange');
editor_mode.onmode('floor');
document.getElementById('selectFloor').value = toId;

View File

@ -204,6 +204,7 @@ HTML5的塔都是可以进行控制台调试的。
- `core.changeFloor('MT2', 'downFloor')` 立刻执行楼层切换到MT2层的下楼点位置。
- `core.changeFloor('MT5', null, {'x': 4, 'y': 7})` 立刻切换楼层到MT5层的(4,7)点。
- `core.getBlock(3, 5, 'MT1')` 获得当前地图上某一个块的信息。第三个参数为floorId可省略表示当前楼层。
- `core.getBlockId(3, 5, 'MT1')` 获得当前地图上某一个点的图块ID。第三个参数为floorId可省略表示当前楼层。
- `core.resetMap()` 重置当前层地图。**当修改地图后再读档修改的地图不会立刻生效此时可以使用resetMap来重置当前楼层的地图。**
- `localStorage` 获得所有的存档数据。可以用 `core.getLocalStorage('save1')` 来具体获得某个存档。
- ……

View File

@ -13,8 +13,8 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.material.items.pickaxe.text = "可以破坏勇士四周的墙";
if (core.flags.bombFourDirections)
core.material.items.bomb.text = "可以炸掉勇士四周的怪物";
if (core.flags.snowFourDirections)
core.material.items.bomb.text = "可以将四周的熔岩变成平地";
if (core.flags.snowFourDirections)
core.material.items.bomb.text = "可以将四周的熔岩变成平地";
if (core.flags.equipment) {
core.material.items.sword1.cls = 'constants';
core.material.items.sword2.cls = 'constants';