平面楼传点击及滚轮控制

This commit is contained in:
草莓 2024-11-30 13:57:26 +08:00
parent 018bb28383
commit 4ca285ca42
7 changed files with 138 additions and 137 deletions

1
_saves/Eustia_autoSave Normal file
View File

@ -0,0 +1 @@
N4IgZgNg9lBOCSATEAuEBZAKgZhAGhAAsBTWKVUASwFsBDAc2NSNKgDoAHAO3vxFq41aAFyYowtCAGdiBLrWpiQAHQCuATgBs2bGoCsARgAs6vhABuqAwUIc6AD1Trn6mxysAGLwTryHqAFprEF9aVA8CEQBrTwiQRGIwWJ8EpJQ46iguYgBPcIJie3d0goBHVUo7Yi5hVABtAF0CSlFqKQoQAGMsqWEBYXaUUAAjGBiUYMg8iYBfAmEYaQo5kGJyysHgGZXoTo7HFFcQac0CREpYYk7hSizmCETalcgGTZAW4moAEWI+yghUMJYKpZCBVDIAEK/ADuxGqABlKPRCLUUECQQQAPqYmTERDYqzYdTYPTqIwADj02CxmNgAnxmMJxNJFKpNlosGQExphA5iAAwlBoLACWhYPRhrQABSaIx4ABMej0eEpeAMAEo+NiPtQABKUGqixo0h60czEeFQTqi0BYDwdc6Xa63LjMWBIlF8A4GeUEE7bAjDGFwrgAQWEfU6US+IjCKC4qggEBp5koUg+DI6dsBwNBWFwaNzAfAQugsNgg2NIF6xA4g2p1b6N16lE6bwWfQgmBoYnJWhMRj0RjY8pcAHYh3KuqpYLBu4pUCTnGwp7Z8iBJRGHuvMtlpnFCsU4pvhA8Y3RGOuOFA01lzwwxAf7EDaPfLyUQlBzV8LldT9NlXeeguDgYgAGVRDrVB5V9RsOVRTQPFJNhsGLXlOWYABRWgpDyHxaCgoYVjIVRRGYeEkHoAANUNhlDeB6EwdBQ06ABNTB6OhUMAC0AGkOG40MwKkUMuAAKVDfkjFDHJWIARVDABeRS+HMSQQU2FZzQrF1mDUdRiGwRB9GGPQPDUMdaHUYyNA8eVzNUPRKSMfROg8MB9M0AwkgIegKi5EBNGGIxiGGRAx3JTEDFoIxaExIwwDHdRMXJRBsGGTEqT0eVEiMRBEDAMk+BuBcJjHbBRxJTQlTHCKZiAA===

View File

@ -1 +1 @@
{"viewportLoc":[0,0],"lastUsed":[{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1732868104690,"frequent":7},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1732867884540,"frequent":6},{"idnum":45,"id":"book","images":"items","y":9,"recent":1732787462314,"frequent":1},{"idnum":46,"id":"fly","images":"items","y":12,"recent":1732768196310,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1732590284009,"frequent":4},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1732590243601,"frequent":4},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1732590229450,"frequent":6},{"idnum":206,"id":"bigBat","images":"enemys","y":5,"recent":1732518600961,"frequent":1},{"idnum":211,"id":"skeletonCaptain","images":"enemys","y":10,"recent":1732518593961,"frequent":3},{"idnum":205,"id":"bat","images":"enemys","y":4,"recent":1732518591433,"frequent":1},{"idnum":88,"id":"downFloor","images":"terrains","y":5,"recent":1732510497803,"frequent":1},{"idnum":87,"id":"upFloor","images":"terrains","y":6,"recent":1732510482564,"frequent":3},{"idnum":257,"id":"dragon","images":"enemys","y":56,"recent":1732431861421,"frequent":4},{"idnum":130,"id":"expShop","images":"npcs","y":9,"recent":1732092503297,"frequent":1},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1732092498097,"frequent":1},{"idnum":246,"id":"blueKing","images":"enemys","y":45,"recent":1731057412587,"frequent":9},{"idnum":43,"id":"sword5","images":"items","y":54,"recent":1730963163489,"frequent":1},{"idnum":36,"id":"shield1","images":"items","y":55,"recent":1730963160769,"frequent":1},{"idnum":1,"id":"yellowWall","images":"animates","y":10,"recent":1673440212744,"frequent":2}],"editor_multi.fontSize":14,"editorLastFloorId":"MT10"}
{"viewportLoc":[0,0],"lastUsed":[{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1732868104690,"frequent":7},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1732867884540,"frequent":6},{"idnum":45,"id":"book","images":"items","y":9,"recent":1732787462314,"frequent":1},{"idnum":46,"id":"fly","images":"items","y":12,"recent":1732768196310,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1732590284009,"frequent":4},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1732590243601,"frequent":4},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1732590229450,"frequent":6},{"idnum":206,"id":"bigBat","images":"enemys","y":5,"recent":1732518600961,"frequent":1},{"idnum":211,"id":"skeletonCaptain","images":"enemys","y":10,"recent":1732518593961,"frequent":3},{"idnum":205,"id":"bat","images":"enemys","y":4,"recent":1732518591433,"frequent":1},{"idnum":88,"id":"downFloor","images":"terrains","y":5,"recent":1732510497803,"frequent":1},{"idnum":87,"id":"upFloor","images":"terrains","y":6,"recent":1732510482564,"frequent":3},{"idnum":257,"id":"dragon","images":"enemys","y":56,"recent":1732431861421,"frequent":4},{"idnum":130,"id":"expShop","images":"npcs","y":9,"recent":1732092503297,"frequent":1},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1732092498097,"frequent":1},{"idnum":246,"id":"blueKing","images":"enemys","y":45,"recent":1731057412587,"frequent":9},{"idnum":43,"id":"sword5","images":"items","y":54,"recent":1730963163489,"frequent":1},{"idnum":36,"id":"shield1","images":"items","y":55,"recent":1730963160769,"frequent":1},{"idnum":1,"id":"yellowWall","images":"animates","y":10,"recent":1673440212744,"frequent":2}],"editor_multi.fontSize":14,"editorLastFloorId":"MT1"}

View File

@ -603,7 +603,17 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"text": "初始剧情"
},
"Hi欢迎来到 HTML5 魔塔样板!\n\n本样板由艾之葵制作可以让你在不会写任何代码\n的情况下也能做出属于自己的H5魔塔",
"这里游戏开始时的剧情。\n\n你可以在这里写上自己的内容。\n赶快来试一试吧"
"这里游戏开始时的剧情。\n\n你可以在这里写上自己的内容。\n赶快来试一试吧",
{
"type": "setValue",
"name": "item:book",
"value": "1"
},
{
"type": "setValue",
"name": "item:fly",
"value": "1"
}
],
"shops": [
{
@ -805,7 +815,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"autoScale": true,
"extendToolbar": false,
"flyNearStair": false,
"flyRecordPosition": false,
"flyRecordPosition": true,
"itemFirstText": false,
"equipboxButton": false,
"enableAddPoint": false,

View File

@ -19,7 +19,7 @@ main.floors.MT0=
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 94],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 45, 46, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],

View File

@ -181,48 +181,48 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
}
},
"flyTo": function (toId, callback) {
// 楼层传送器的使用从当前楼层飞往toId
// 如果不能飞行请返回false
// 楼层传送器的使用从当前楼层飞往toId
// 如果不能飞行请返回false
var fromId = core.status.floorId;
var fromId = core.status.floorId;
// 检查能否飞行
if (!core.status.maps[fromId].canFlyFrom || !core.status.maps[toId].canFlyTo || !core.hasVisitedFloor(toId)) {
core.playSound('操作失败');
core.drawTip("无法飞往" + core.status.maps[toId].title + "", 'fly');
return false;
}
// 检查能否飞行
if (!core.status.maps[fromId].canFlyFrom || !core.status.maps[toId].canFlyTo || !core.hasVisitedFloor(toId)) {
core.playSound('操作失败');
core.drawTip("无法飞往" + core.status.maps[toId].title + "", 'fly');
return false;
}
// 平面塔模式
var stair = null,
loc = null;
if (core.flags.flyRecordPosition) {
loc = core.getFlag("__leaveLoc__", {})[toId] || null;
}
if (core.status.maps[toId].flyPoint != null && core.status.maps[toId].flyPoint.length == 2) {
stair = 'flyPoint';
}
if (stair == null && loc == null) {
// 获得两个楼层的索引,以决定是上楼梯还是下楼梯
var fromIndex = core.floorIds.indexOf(fromId),
toIndex = core.floorIds.indexOf(toId);
var stair = fromIndex <= toIndex ? "downFloor" : "upFloor";
// 地下层:同层传送至上楼梯
if (fromIndex == toIndex && core.status.maps[fromId].underGround) stair = "upFloor";
}
// 平面塔模式
var stair = null,
loc = null;
if (core.flags.flyRecordPosition) {
loc = core.getFlag("__leaveLoc__", {})[toId] || null;
}
if (core.status.maps[toId].flyPoint != null && core.status.maps[toId].flyPoint.length == 2) {
stair = 'flyPoint';
}
if (stair == null && loc == null) {
// 获得两个楼层的索引,以决定是上楼梯还是下楼梯
var fromIndex = core.floorIds.indexOf(fromId),
toIndex = core.floorIds.indexOf(toId);
var stair = fromIndex <= toIndex ? "downFloor" : "upFloor";
// 地下层:同层传送至上楼梯
if (fromIndex == toIndex && core.status.maps[fromId].underGround) stair = "upFloor";
}
// 记录录像
core.status.route.push("fly:" + toId);
// 传送
core.ui.closePanel();
core.setFlag('__isFlying__', true);
core.changeFloor(toId, stair, loc, null, function () {
core.removeFlag("__isFlying__");
if (callback) callback();
});
// 记录录像
core.status.route.push("fly:" + toId);
// 传送
core.ui.closePanel();
core.setFlag('__isFlying__', true);
core.changeFloor(toId, stair, loc, null, function () {
core.removeFlag("__isFlying__");
if (callback) callback();
});
return true;
},
return true;
},
"beforeBattle": function (enemyId, x, y) {
// 战斗前触发的事件,可以加上一些战前特效(详见下面支援的例子)
// 此函数在“检测能否战斗和自动存档”【之后】执行。如果需要更早的战前事件,请在插件中覆重写 core.events.doSystemEvent 函数。

View File

@ -316,7 +316,7 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
"hideInReplay": true,
"hideInToolbox": true,
"useItemEffect": "//core.ui.drawFly(core.floorIds.indexOf(core.status.floorId));\ncore.ui._drawViewMaps(core.floorIds.indexOf(core.status.floorId));",
"canUseItemEffect": "(function () {\n\tif (!core.canMoveFloor())\n\t\treturn false;\n\treturn core.status.maps[core.status.floorId].canFlyFrom;\n})();"
"canUseItemEffect": "(function () {\n\tif (core.flags.flyNearStair && !core.nearStair() && !core.canMoveFloor())\n\t\treturn false;\n\treturn core.status.maps[core.status.floorId].canFlyFrom;\n})();"
},
"coin": {
"cls": "constants",

View File

@ -2085,7 +2085,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
//this._update_equips(); //更新装备
//this._update_keys(); //更新钥匙
//this._update_infoWindow(); //更新道具说明
//this._update_toolBox(); //更新工具栏
this._update_toolBox(); //更新工具栏
this._redrawMap()
}
_redrawMap() {
@ -2430,6 +2430,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
id: itemId
});
break;
case "fly":
core.useItem(itemId, true)
break;
default:
core.useItem(itemId);
}
@ -7833,7 +7836,7 @@ core.plugin.animate = {
all = all.filter(v => !result.order.includes(v));
}
res('success');
});
}).then(() => { core.setFlag("areas", areas) });
}
})();
}
@ -8106,6 +8109,7 @@ core.plugin.animate = {
////// 绘制浏览地图界面 //////
ui.prototype._drawViewMaps = function (index, x, y) {
core.lockControl();
core.clearMap('data')
core.status.event.id = 'viewMaps';
this.clearUI();
//console.log(index)
@ -8121,7 +8125,9 @@ core.plugin.animate = {
const mapdir = bfs.mapdir[floorId];
core.setTextAlign('ui', 'center');
let size = core.__PIXELS__ * 3 / 4; //312
const areas = core.getFlag('areas')
const i = areas.findIndex(v => v.name === core.status.maps[floorId].areas)
core.fillRoundRect('ui', 15 - 2, 15 - 2, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 15 - 4, 35 + 8, 35 + 8, 4, "#444444", 1)
core.fillText('ui', '当前', 13 + 20, 17 + 20, '#FFFFFF', this._buildFont(18, true))
@ -8145,8 +8151,8 @@ core.plugin.animate = {
core.fillText('ui', '北▲', 30 + 145 + 10, 17 + 20, '#909090', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2, 60 - 2, 35 + 4, size + 4 - 58, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 60 - 4, 35 + 8, size + 8 - 58, 4, "#444444", 1)
core.fillRoundRect('ui', 15 - 2, 59 - 2, 35 + 4, size + 4 - 58, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 59 - 4, 35 + 8, size + 8 - 58, 4, "#444444", 1)
if (mapdir.includes("left")) {
core.fillText('ui', '西', 15 + 17, 25 + 150, '#FFFFFF', this._buildFont(18, true))
core.fillText('ui', '◀', 15 + 17, 45 + 150, '#FFFFFF', this._buildFont(18, true))
@ -8162,8 +8168,8 @@ core.plugin.animate = {
core.fillText('ui', '南▼', 30 + 145 + 10, 17 + 20 + size - 4, '#909090', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 60 - 2, 35 + 4, size + 4 - 58, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 60 - 4, 35 + 8, size + 8 - 58, 4, "#444444", 1)
core.fillRoundRect('ui', 15 - 2 + size - 4, 59 - 2, 35 + 4, size + 4 - 58, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 59 - 4, 35 + 8, size + 8 - 58, 4, "#444444", 1)
if (mapdir.includes("right")) {
core.fillText('ui', '东', 15 + 17 + size - 4, 25 + 150, '#FFFFFF', this._buildFont(18, true))
core.fillText('ui', '▶', 15 + 17 + size - 4, 45 + 150, '#FFFFFF', this._buildFont(18, true))
@ -8182,10 +8188,18 @@ core.plugin.animate = {
core.fillText('ui', core.status.maps[floorId].areas, 30 + 145 + 10, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
core.fillRoundRect('ui', 15 - 2, 60 - 2 + size - 4, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4, 60 - 4 + size - 4, 35 + 8, 35 + 8, 4, "#444444", 1)
core.fillText('ui', '◀', 35, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
if (i === 0) {
core.fillText('ui', '◀', 35, 17 + 65 + size - 4, '#909090', this._buildFont(18, true))
} else {
core.fillText('ui', '◀', 35, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 60 - 2 + size - 4, 35 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 60 - 4 + size - 4, 35 + 8, 35 + 8, 4, "#444444", 1)
core.fillText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
if (i === areas.length - 1) {
core.fillText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#909090', this._buildFont(18, true))
} else {
core.fillText('ui', '▶', 30 + 300 + 10, 17 + 65 + size - 4, '#FFFFFF', this._buildFont(18, true))
}
core.fillRoundRect('ui', 15 - 2 + size - 4, 15 - 2, 80 + 4, 35 + 4, 4, '#444444');
core.strokeRoundRect('ui', 15 - 4 + size - 4, 15 - 4, 80 + 8, 35 + 8, 4, "#444444", 1)
@ -8429,6 +8443,9 @@ core.plugin.animate = {
if (!formto[fromfloorId][dir]) formto[fromfloorId][dir] = tofloorId
}
const areas = core.getFlag('areas')
let i = areas.findIndex(v => v.name === core.status.maps[floorId].areas)
if (px >= 11 && px <= 54 && py >= 11 && py <= 54) {
core.ui._drawViewMaps(core.floorIds.indexOf(core.status.floorId))
} else if (px >= 362 && px <= 407 && py >= 191 && py <= 318) {
@ -8440,92 +8457,54 @@ core.plugin.animate = {
core.ui.closePanel();
core.getItemDetail();
core.redrawMap();
core.ui.statusBar._update_map()
return;
} else if (px >= 55 && px <= 317 && py >= 11 && py <= 54) {
if (formto[floorId].up) {
if (mapdir.includes("up")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].up))
if (mapdir.includes("up")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].up))
} else if (px >= 55 && px <= 317 && py >= 319 && py <= 362) {
if (mapdir.includes("down")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].down))
} else if (px >= 11 && px <= 54 && py >= 55 && py <= 317) {
if (mapdir.includes("left")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].left))
} else if (px >= 319 && px <= 362 && py >= 55 && py <= 317) {
if (mapdir.includes("right")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].right))
} else if (px >= 319 && px <= 407 && py >= 11 && py <= 54) {
if (mapdir.includes("upFloor")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].upFloor))
} else if (px >= 319 && px <= 407 && py >= 319 && py <= 362) {
if (mapdir.includes("downFloor")) core.ui._drawViewMaps(core.floorIds.indexOf(formto[floorId].downFloor))
} else if (px >= 55 && px <= 317 && py >= 55 && py <= 317 && !core.isReplaying()) {
core.useFly(false);
return;
} else if (px >= 11 && px <= 54 && py >= 364 && py <= 407) {
if (i > 0) {
i -= 1
core.ui._drawViewMaps(core.floorIds.indexOf(areas[i].maps[0]))
}
} else if (px >= 319 && px <= 362 && py >= 364 && py <= 407) {
if (i < areas.length - 1) {
i += 1
core.ui._drawViewMaps(core.floorIds.indexOf(areas[i].maps[0]))
}
}
/*if (px >= 338 && px <= 338 + 58) {
if (py >= 11 && py <= 11 + 58) {
core.playSound('光标移动');
if (!core.hasVisitedFloor(core.floorIds[core.status.event.data.index + 1])) {
for (var f = 0; f < 10; f++) {
index++;
while (index < core.floorIds.length && index != now && core.status.maps[core.floorIds[index]].cannotViewMap)
index++;
}
} else {
for (var f = 0; f < 10; f++) {
if (core.hasVisitedFloor(core.floorIds[core.status.event.data.index + f + 1])) {
index++;
while (index < core.floorIds.length && index != now && core.status.maps[core.floorIds[index]].cannotViewMap)
index++;
}
}
}
{
if (index < core.floorIds.length)
core.ui._drawViewMaps(index);
else
core.ui._drawViewMaps(core.floorIds.length - 1);
}
return;
} else if (py >= 11 + 58 + 10 && py <= 11 + 58 + 58 + 10) {
core.playSound('光标移动');
index++;
while (index < core.floorIds.length && index != now && core.status.maps[core.floorIds[index]].cannotViewMap)
index++;
if (index < core.floorIds.length)
core.ui._drawViewMaps(index);
return;
} else if (py >= 230 - 58 - 4 + 10 + 25 && py <= 230 - 4 + 10 + 25) {
core.playSound('光标移动');
index--;
while (index >= 0 && index != now && core.status.maps[core.floorIds[index]].cannotViewMap)
index--;
if (index >= 0)
core.ui._drawViewMaps(index);
return;
} else if (py >= 230 - 4 + 20 + 25 && py <= 230 - 4 + 58 + 20 + 25) {
core.playSound('光标移动');
if (!core.hasVisitedFloor(core.floorIds[core.status.event.data.index - 1])) {
for (var f = 0; f < 10; f++) {
index--;
while (index >= 0 && index != now && core.status.maps[core.floorIds[index]].cannotViewMap)
index--;
}
} else {
for (var f = 0; f < 10; f++) {
if (core.hasVisitedFloor(core.floorIds[core.status.event.data.index - f - 1])) {
index--;
while (index >= 0 && index != now && core.status.maps[core.floorIds[index]].cannotViewMap)
index--;
}
}
}
if (index >= 0)
core.ui._drawViewMaps(index);
else
core.ui._drawViewMaps(0);
return;
} else if (py >= 342 - 4 && py <= 342 - 4 + 58) {
core.clearMap('data');
core.playSound('取消');
core.ui.closePanel();
core.getItemDetail();
core.redrawMap();
return;
}
} else if (px >= 11 && px <= 330 && py >= 11 && py <= 330 && !core.isReplaying()) {
core.useFly(false);
return;
}*/
}
const replayAction_fly = function (action) {
if (action.indexOf("fly:") != 0) return false;
var floorId = action.substring(4);
var toIndex = core.floorIds.indexOf(floorId);
if (!core.canUseItem('fly') || core.flags.flyNearStair && !core.nearStair()) return false;
core.ui._drawViewMaps(toIndex)
if (core.status.replay.speed == 24) {
if (!core.flyTo(floorId, core.replay))
core.control._replay_error(action);
return true;
}
setTimeout(function () {
if (!core.flyTo(floorId, core.replay))
core.control._replay_error(action);
}, core.control.__replay_getTimeout());
return true;
}
core.registerReplayAction("fly", replayAction_fly);
////// 查看地图界面时,放开某个键的操作 //////
actions.prototype._keyUpViewMaps = function (keycode) {
if (core.status.event.data == null) {
@ -8534,12 +8513,17 @@ core.plugin.animate = {
}
var floorId = core.floorIds[core.status.event.data.index];
if (keycode == 27 || keycode == 88 || keycode == 71) {
if (keycode == 27 || keycode == 71) {
core.clearMap('data');
core.playSound('取消');
core.ui.closePanel();
core.getItemDetail();
core.redrawMap();
core.ui.statusBar._update_map()
return;
}
if (keycode == 88) {
core.openBook(true)
return;
}
if (keycode == 86) {
@ -8564,10 +8548,12 @@ core.plugin.animate = {
var floorId = core.floorIds[core.status.event.data.index],
mh = core.floors[floorId].height;
if (keycode == 39) this._clickViewMaps(9, 1, 370, 40);
if (keycode == 37) this._clickViewMaps(9, 8, 370, 275);
if (keycode == 40 || keycode == 34) this._clickViewMaps(9, 6, 370, 235);
if (keycode == 38 || keycode == 33) this._clickViewMaps(9, 3, 370, 100);
if (keycode == 39) this._clickViewMaps(9, 1, 330, 250);
if (keycode == 37) this._clickViewMaps(9, 8, 25, 200);
if (keycode == 40) this._clickViewMaps(9, 6, 250, 330);
if (keycode == 38) this._clickViewMaps(9, 3, 200, 25);
if (keycode == 34) this._clickViewMaps(9, 3, 350, 330);
if (keycode == 33) this._clickViewMaps(9, 3, 350, 25);
return;
}
@ -8606,8 +8592,12 @@ core.plugin.animate = {
// 浏览地图
if (core.status.lockControl && core.status.event.id == 'viewMaps') {
if (direct == 1) this._clickViewMaps(9, 3, 370, 100);
if (direct == -1) this._clickViewMaps(9, 6, 370, 210);
let floorId = core.floorIds[core.status.event.data.index]
if (!flags.__visited__[floorId]) floorId = core.status.floorId;
const visit = Object.keys(flags.__visited__);
let index = visit.indexOf(floorId)
if (direct == 1) { if (index > 0) core.ui._drawViewMaps(core.floorIds.indexOf(visit[index - 1])) }
if (direct == -1) { if (index < visit.length - 1) core.ui._drawViewMaps(core.floorIds.indexOf(visit[index + 1])) }
return;
}