From 6471f61e359c1faaac44c6964cd72f203e7b6aa8 Mon Sep 17 00:00:00 2001 From: ckcz123 Date: Mon, 27 Aug 2018 17:21:05 +0800 Subject: [PATCH] Show PZF on status bar --- _server/data.comment.js | 6 +++++ editor-mobile.html | 7 +++++- editor.html | 7 +++++- index.html | 5 +++++ libs/actions.js | 50 +++++++++++++++++++++++++++++++---------- libs/control.js | 11 +++++++++ libs/ui.js | 6 +++-- main.js | 4 ++++ project/data.js | 1 + styles.css | 2 +- 更新说明.txt | 4 ++++ 11 files changed, 86 insertions(+), 17 deletions(-) diff --git a/_server/data.comment.js b/_server/data.comment.js index 760450e8..acfae9fc 100644 --- a/_server/data.comment.js +++ b/_server/data.comment.js @@ -426,6 +426,12 @@ data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = "_bool": "bool", "_data": "是否在状态栏显示三色钥匙数量" }, + "enablePZF": { + "_leaf": true, + "_type": "checkbox", + "_bool": "bool", + "_data": "是否在状态栏显示破炸飞数量" + }, "enableDebuff": { "_leaf": true, "_type": "checkbox", diff --git a/editor-mobile.html b/editor-mobile.html index 73bc757a..fc364e5e 100644 --- a/editor-mobile.html +++ b/editor-mobile.html @@ -372,11 +372,16 @@

-
+
+
+ + + +
diff --git a/editor.html b/editor.html index 32610082..fddc72c2 100644 --- a/editor.html +++ b/editor.html @@ -357,11 +357,16 @@

-
+
+
+ + + +
diff --git a/index.html b/index.html index 52b69439..32b05a58 100644 --- a/index.html +++ b/index.html @@ -87,6 +87,11 @@
+
+ + + +
diff --git a/libs/actions.js b/libs/actions.js index a667031c..2d9d4660 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -13,7 +13,8 @@ actions.prototype.init = function () { ////// 按下某个键时 ////// actions.prototype.onkeyDown = function (e) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; if (!core.isset(core.status.holdingKeys))core.status.holdingKeys=[]; var isArrow={37:true,38:true,39:true,40:true}[e.keyCode] if(isArrow && !core.status.lockControl){ @@ -32,7 +33,8 @@ actions.prototype.onkeyDown = function (e) { ////// 放开某个键时 ////// actions.prototype.onkeyUp = function(e) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) { + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') { if (e.keyCode==27) // ESCAPE core.stopReplay(); else if (e.keyCode==90) // Z @@ -47,6 +49,8 @@ actions.prototype.onkeyUp = function(e) { core.saveReplay(); else if (e.keyCode==67) core.bookReplay(); + else if (e.keyCode==33||e.keyCode==34) + core.viewMapReplay(); return; } @@ -77,7 +81,8 @@ actions.prototype.pressKey = function (keyCode) { ////// 根据按下键的code来执行一系列操作 ////// actions.prototype.keyDown = function(keyCode) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; if (core.status.lockControl) { // Ctrl跳过对话 if (keyCode==17) { @@ -171,8 +176,8 @@ actions.prototype.keyDown = function(keyCode) { ////// 根据放开键的code来执行一系列操作 ////// actions.prototype.keyUp = function(keyCode, fromReplay) { - if (!fromReplay&&core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) - return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; if (core.status.lockControl) { core.status.holdingKeys = []; @@ -393,7 +398,8 @@ actions.prototype.keyUp = function(keyCode, fromReplay) { ////// 点击(触摸)事件按下时 ////// actions.prototype.ondown = function (x ,y) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; if (!core.status.played || core.status.lockControl) { this.onclick(x, y, []); if (core.timeout.onDownTimeout==null) { @@ -421,7 +427,8 @@ actions.prototype.ondown = function (x ,y) { ////// 当在触摸屏上滑动时 ////// actions.prototype.onmove = function (x ,y) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; // if (core.status.holdingPath==0){return;} //core.status.mouseOutCheck =1; var pos={'x':x,'y':y}; @@ -445,7 +452,8 @@ actions.prototype.onmove = function (x ,y) { ////// 当点击(触摸)事件放开时 ////// actions.prototype.onup = function () { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; clearTimeout(core.timeout.onDownTimeout); core.timeout.onDownTimeout = null; @@ -508,7 +516,8 @@ actions.prototype.getClickLoc = function (x, y) { ////// 具体点击屏幕上(x,y)点时,执行的操作 ////// actions.prototype.onclick = function (x, y, stepPostfix) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; // console.log("Click: (" + x + "," + y + ")"); stepPostfix=stepPostfix||[]; @@ -650,7 +659,8 @@ actions.prototype.onclick = function (x, y, stepPostfix) { ////// 滑动鼠标滚轮时的操作 ////// actions.prototype.onmousewheel = function (direct) { - if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return; + if (core.isset(core.status.replay)&&core.status.replay.replaying + &&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0&&core.status.event.id!='viewMaps') return; // 向下滚动是 -1 ,向上是 1 // 楼层飞行器 @@ -1379,8 +1389,17 @@ actions.prototype.clickSL = function(x,y) { } // 删除 if (x>=0 && x<=2 && y==12) { - core.status.event.selection=!core.status.event.selection; - core.ui.drawSLPanel(index); + + if (core.status.event.id=='save') { + core.status.event.selection=!core.status.event.selection; + core.ui.drawSLPanel(index); + } + else { + var index = parseInt(prompt("请输入读档编号"))||0; + if (index>0) { + core.doSL(index, core.status.event.id); + } + } return; } @@ -1485,6 +1504,13 @@ actions.prototype.keyUpSL = function (keycode) { } return; } + if (keycode==69 && core.status.event.id == 'load') { // E + var index = parseInt(prompt("请输入读档编号"))||0; + if (index>0) { + core.doSL(index, core.status.event.id); + } + return; + } if (keycode==46) { if (offset==0) { core.drawTip("无法删除自动存档!"); diff --git a/libs/control.js b/libs/control.js index b98fd7a1..0fdffd9e 100644 --- a/libs/control.js +++ b/libs/control.js @@ -2600,6 +2600,11 @@ control.prototype.updateStatusBar = function () { core.statusBar.weak.innerHTML = core.hasFlag('weak')?"衰":""; core.statusBar.curse.innerHTML = core.hasFlag('curse')?"咒":""; } + if (core.flags.enablePZF) { + core.statusBar.pickaxe.innerHTML = "破"+core.itemCount('pickaxe'); + core.statusBar.bomb.innerHTML = "炸"+core.itemCount('bomb'); + core.statusBar.fly.innerHTML = "飞"+core.itemCount('centerFly'); + } core.statusBar.hard.innerHTML = core.status.hard; @@ -2983,6 +2988,12 @@ control.prototype.resize = function(clientWidth, clientHeight) { display: !core.isset(core.flags.enableKeys)||core.flags.enableKeys?'block':'none' } }, + { + id: 'pzfCol', + rules: { + display: core.flags.enablePZF?'block':'none' + } + }, { 'id': 'debuffCol', rules: { diff --git a/libs/ui.js b/libs/ui.js index 73af00ee..1d80b92c 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1755,8 +1755,10 @@ ui.prototype.drawSLPanel = function(index) { if (core.status.event.selection) core.setFillStyle('ui', '#FF6A6A'); - core.fillText('ui', '删除模式', 48, 403); - + if (core.status.event.id=='save') + core.fillText('ui', '删除模式', 48, 403); + else + core.fillText('ui', '输入编号', 48, 403); } ////// 绘制一个缩略图 ////// diff --git a/main.js b/main.js index 1a2a649f..dcb07fb5 100644 --- a/main.js +++ b/main.js @@ -59,6 +59,7 @@ function main() { 'expCol': document.getElementById('expCol'), 'upCol': document.getElementById('upCol'), 'keyCol': document.getElementById('keyCol'), + 'pzfCol': document.getElementById('pzfCol'), 'debuffCol': document.getElementById('debuffCol'), 'hard': document.getElementById('hard'), }; @@ -134,6 +135,9 @@ function main() { 'poison': document.getElementById('poison'), 'weak':document.getElementById('weak'), 'curse': document.getElementById('curse'), + 'pickaxe': document.getElementById('pickaxe'), + 'bomb': document.getElementById('bomb'), + 'fly': document.getElementById('fly'), 'hard': document.getElementById("hard") } this.floors = {} diff --git a/project/data.js b/project/data.js index c6ba374e..188651f5 100644 --- a/project/data.js +++ b/project/data.js @@ -142,6 +142,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d = "enableExperience": false, "enableLevelUp": false, "enableKeys": true, + "enablePZF": true, "enableDebuff": false, "flyNearStair": true, "pickaxeFourDirections": false, diff --git a/styles.css b/styles.css index 0983974a..05637e6c 100644 --- a/styles.css +++ b/styles.css @@ -222,7 +222,7 @@ p#hard { margin: 0 6px 6px 0; } -span#poison, span#weak, span#curse { +span#poison, span#weak, span#curse, span#pickaxe, span#bomb, span#fly { font-style: normal; font-size: 1em; } diff --git a/更新说明.txt b/更新说明.txt index 5e78abec..5fa96440 100644 --- a/更新说明.txt +++ b/更新说明.txt @@ -2,6 +2,10 @@ 大地图的支持 修复超大数值领域导致自动寻路卡死的问题 +同点多事件的颜色块绘制 +录像播放时可以按PgUp/PgDn浏览地图 +可以在读档时E键直接指定编号 +破炸飞可以在状态栏显示个数 部分细节优化 -----------------------------------------------------------------------