View book while replaying
This commit is contained in:
parent
eafcfa4deb
commit
bf9a9675ed
@ -13,7 +13,7 @@ actions.prototype.init = function () {
|
|||||||
|
|
||||||
////// 按下某个键时 //////
|
////// 按下某个键时 //////
|
||||||
actions.prototype.onkeyDown = function (e) {
|
actions.prototype.onkeyDown = function (e) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
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.holdingKeys))core.status.holdingKeys=[];
|
if (!core.isset(core.status.holdingKeys))core.status.holdingKeys=[];
|
||||||
var isArrow={37:true,38:true,39:true,40:true}[e.keyCode]
|
var isArrow={37:true,38:true,39:true,40:true}[e.keyCode]
|
||||||
if(isArrow && !core.status.lockControl){
|
if(isArrow && !core.status.lockControl){
|
||||||
@ -31,7 +31,7 @@ actions.prototype.onkeyDown = function (e) {
|
|||||||
|
|
||||||
////// 放开某个键时 //////
|
////// 放开某个键时 //////
|
||||||
actions.prototype.onkeyUp = function(e) {
|
actions.prototype.onkeyUp = function(e) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') {
|
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) {
|
||||||
if (e.keyCode==27) // ESCAPE
|
if (e.keyCode==27) // ESCAPE
|
||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
else if (e.keyCode==90) // Z
|
else if (e.keyCode==90) // Z
|
||||||
@ -44,6 +44,8 @@ actions.prototype.onkeyUp = function(e) {
|
|||||||
core.rewindReplay();
|
core.rewindReplay();
|
||||||
else if (e.keyCode==83)
|
else if (e.keyCode==83)
|
||||||
core.saveReplay();
|
core.saveReplay();
|
||||||
|
else if (e.keyCode==67)
|
||||||
|
core.bookReplay();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +66,7 @@ actions.prototype.onkeyUp = function(e) {
|
|||||||
|
|
||||||
////// 按住某个键时 //////
|
////// 按住某个键时 //////
|
||||||
actions.prototype.pressKey = function (keyCode) {
|
actions.prototype.pressKey = function (keyCode) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
|
||||||
if (keyCode === core.status.holdingKeys.slice(-1)[0]) {
|
if (keyCode === core.status.holdingKeys.slice(-1)[0]) {
|
||||||
this.keyDown(keyCode);
|
this.keyDown(keyCode);
|
||||||
window.setTimeout(function(){core.pressKey(keyCode);},30);
|
window.setTimeout(function(){core.pressKey(keyCode);},30);
|
||||||
@ -73,7 +75,7 @@ actions.prototype.pressKey = function (keyCode) {
|
|||||||
|
|
||||||
////// 根据按下键的code来执行一系列操作 //////
|
////// 根据按下键的code来执行一系列操作 //////
|
||||||
actions.prototype.keyDown = function(keyCode) {
|
actions.prototype.keyDown = function(keyCode) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
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.status.lockControl) {
|
if (core.status.lockControl) {
|
||||||
// Ctrl跳过对话
|
// Ctrl跳过对话
|
||||||
if (keyCode==17) {
|
if (keyCode==17) {
|
||||||
@ -193,7 +195,8 @@ actions.prototype.keyDown = function(keyCode) {
|
|||||||
|
|
||||||
////// 根据放开键的code来执行一系列操作 //////
|
////// 根据放开键的code来执行一系列操作 //////
|
||||||
actions.prototype.keyUp = function(keyCode, fromReplay) {
|
actions.prototype.keyUp = function(keyCode, fromReplay) {
|
||||||
if (!fromReplay&&core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
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.status.lockControl) {
|
if (core.status.lockControl) {
|
||||||
core.status.holdingKeys = [];
|
core.status.holdingKeys = [];
|
||||||
@ -399,7 +402,7 @@ actions.prototype.keyUp = function(keyCode, fromReplay) {
|
|||||||
|
|
||||||
////// 点击(触摸)事件按下时 //////
|
////// 点击(触摸)事件按下时 //////
|
||||||
actions.prototype.ondown = function (x ,y) {
|
actions.prototype.ondown = function (x ,y) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
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.status.played || core.status.lockControl) {
|
if (!core.status.played || core.status.lockControl) {
|
||||||
this.onclick(x, y, []);
|
this.onclick(x, y, []);
|
||||||
if (core.timeout.onDownTimeout==null) {
|
if (core.timeout.onDownTimeout==null) {
|
||||||
@ -427,7 +430,7 @@ actions.prototype.ondown = function (x ,y) {
|
|||||||
|
|
||||||
////// 当在触摸屏上滑动时 //////
|
////// 当在触摸屏上滑动时 //////
|
||||||
actions.prototype.onmove = function (x ,y) {
|
actions.prototype.onmove = function (x ,y) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
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.status.holdingPath==0){return;}
|
// if (core.status.holdingPath==0){return;}
|
||||||
//core.status.mouseOutCheck =1;
|
//core.status.mouseOutCheck =1;
|
||||||
var pos={'x':x,'y':y};
|
var pos={'x':x,'y':y};
|
||||||
@ -451,7 +454,7 @@ actions.prototype.onmove = function (x ,y) {
|
|||||||
|
|
||||||
////// 当点击(触摸)事件放开时 //////
|
////// 当点击(触摸)事件放开时 //////
|
||||||
actions.prototype.onup = function () {
|
actions.prototype.onup = function () {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
|
||||||
|
|
||||||
clearTimeout(core.timeout.onDownTimeout);
|
clearTimeout(core.timeout.onDownTimeout);
|
||||||
core.timeout.onDownTimeout = null;
|
core.timeout.onDownTimeout = null;
|
||||||
@ -517,7 +520,7 @@ actions.prototype.getClickLoc = function (x, y) {
|
|||||||
|
|
||||||
////// 具体点击屏幕上(x,y)点时,执行的操作 //////
|
////// 具体点击屏幕上(x,y)点时,执行的操作 //////
|
||||||
actions.prototype.onclick = function (x, y, stepPostfix) {
|
actions.prototype.onclick = function (x, y, stepPostfix) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
|
||||||
// console.log("Click: (" + x + "," + y + ")");
|
// console.log("Click: (" + x + "," + y + ")");
|
||||||
|
|
||||||
stepPostfix=stepPostfix||[];
|
stepPostfix=stepPostfix||[];
|
||||||
@ -671,7 +674,7 @@ actions.prototype.onclick = function (x, y, stepPostfix) {
|
|||||||
|
|
||||||
////// 滑动鼠标滚轮时的操作 //////
|
////// 滑动鼠标滚轮时的操作 //////
|
||||||
actions.prototype.onmousewheel = function (direct) {
|
actions.prototype.onmousewheel = function (direct) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
|
if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
|
||||||
// 向下滚动是 -1 ,向上是 1
|
// 向下滚动是 -1 ,向上是 1
|
||||||
|
|
||||||
// 楼层飞行器
|
// 楼层飞行器
|
||||||
|
|||||||
@ -1433,7 +1433,7 @@ control.prototype.resumeReplay = function () {
|
|||||||
control.prototype.speedUpReplay = function () {
|
control.prototype.speedUpReplay = function () {
|
||||||
if (core.status.event.id=='save') return;
|
if (core.status.event.id=='save') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.status.replay.replaying) return;
|
||||||
var toAdd = core.status.replay.speed>2?2:1;
|
var toAdd = core.status.replay.speed>=3?3:core.status.replay.speed>=2?2:1;
|
||||||
core.status.replay.speed = parseInt(10*core.status.replay.speed + toAdd)/10;
|
core.status.replay.speed = parseInt(10*core.status.replay.speed + toAdd)/10;
|
||||||
if (core.status.replay.speed>6.0) core.status.replay.speed=6.0;
|
if (core.status.replay.speed>6.0) core.status.replay.speed=6.0;
|
||||||
core.drawTip("x"+core.status.replay.speed+"倍");
|
core.drawTip("x"+core.status.replay.speed+"倍");
|
||||||
@ -1443,7 +1443,7 @@ control.prototype.speedUpReplay = function () {
|
|||||||
control.prototype.speedDownReplay = function () {
|
control.prototype.speedDownReplay = function () {
|
||||||
if (core.status.event.id=='save') return;
|
if (core.status.event.id=='save') return;
|
||||||
if (!core.status.replay.replaying) return;
|
if (!core.status.replay.replaying) return;
|
||||||
var toAdd = core.status.replay.speed>2?2:1;
|
var toAdd = core.status.replay.speed>3?3:core.status.replay.speed>2?2:1;
|
||||||
core.status.replay.speed = parseInt(10*core.status.replay.speed - toAdd)/10;
|
core.status.replay.speed = parseInt(10*core.status.replay.speed - toAdd)/10;
|
||||||
if (core.status.replay.speed<0.3) core.status.replay.speed=0.3;
|
if (core.status.replay.speed<0.3) core.status.replay.speed=0.3;
|
||||||
core.drawTip("x"+core.status.replay.speed+"倍");
|
core.drawTip("x"+core.status.replay.speed+"倍");
|
||||||
@ -1519,6 +1519,23 @@ control.prototype.saveReplay = function () {
|
|||||||
core.ui.drawSLPanel(10*page+offset);
|
core.ui.drawSLPanel(10*page+offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 回放时查看怪物手册 //////
|
||||||
|
control.prototype.bookReplay = function () {
|
||||||
|
if (!core.status.replay.replaying) return;
|
||||||
|
if (!core.status.replay.pausing) {
|
||||||
|
core.drawTip("请先暂停录像");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (core.status.replay.animate || core.isset(core.status.event.id)) {
|
||||||
|
core.drawTip("请等待当前事件的处理结束");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
core.lockControl();
|
||||||
|
core.status.event.id='book';
|
||||||
|
core.useItem('book');
|
||||||
|
}
|
||||||
|
|
||||||
////// 回放 //////
|
////// 回放 //////
|
||||||
control.prototype.replay = function () {
|
control.prototype.replay = function () {
|
||||||
|
|
||||||
@ -2264,18 +2281,14 @@ control.prototype.updateStatusBar = function () {
|
|||||||
core.statusBar.image.fly.style.opacity = 1;
|
core.statusBar.image.fly.style.opacity = 1;
|
||||||
|
|
||||||
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
|
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
|
||||||
core.statusBar.image.toolbox.style.opacity = 1;
|
|
||||||
|
|
||||||
core.statusBar.image.shop.style.opacity = 0;
|
core.statusBar.image.shop.src = core.statusBar.icons.book.src;
|
||||||
|
|
||||||
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
|
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
|
||||||
core.statusBar.image.save.style.opacity = 1;
|
|
||||||
|
|
||||||
core.statusBar.image.load.src = core.statusBar.icons.speedUp.src;
|
core.statusBar.image.load.src = core.statusBar.icons.speedUp.src;
|
||||||
core.statusBar.image.load.style.opacity = 1;
|
|
||||||
|
|
||||||
core.statusBar.image.settings.src = core.statusBar.icons.save.src;
|
core.statusBar.image.settings.src = core.statusBar.icons.save.src;
|
||||||
core.statusBar.image.settings.style.opacity = 1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2286,18 +2299,14 @@ control.prototype.updateStatusBar = function () {
|
|||||||
core.statusBar.image.fly.style.opacity = core.hasItem('fly')?1:0.3;
|
core.statusBar.image.fly.style.opacity = core.hasItem('fly')?1:0.3;
|
||||||
|
|
||||||
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
|
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
|
||||||
core.statusBar.image.toolbox.style.opacity = 1;
|
|
||||||
|
|
||||||
core.statusBar.image.shop.style.opacity = 1;
|
core.statusBar.image.shop.src = core.statusBar.icons.shop.src;
|
||||||
|
|
||||||
core.statusBar.image.save.src = core.statusBar.icons.save.src;
|
core.statusBar.image.save.src = core.statusBar.icons.save.src;
|
||||||
core.statusBar.image.save.style.opacity = 1;
|
|
||||||
|
|
||||||
core.statusBar.image.load.src = core.statusBar.icons.load.src;
|
core.statusBar.image.load.src = core.statusBar.icons.load.src;
|
||||||
core.statusBar.image.load.style.opacity = 1;
|
|
||||||
|
|
||||||
core.statusBar.image.settings.src = core.statusBar.icons.settings.src;
|
core.statusBar.image.settings.src = core.statusBar.icons.settings.src;
|
||||||
core.statusBar.image.settings.style.opacity = 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
core.updateFg();
|
core.updateFg();
|
||||||
|
|||||||
@ -932,6 +932,10 @@ core.prototype.saveReplay = function () {
|
|||||||
core.control.saveReplay();
|
core.control.saveReplay();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
core.prototype.bookReplay = function () {
|
||||||
|
core.control.bookReplay();
|
||||||
|
}
|
||||||
|
|
||||||
////// 回放 //////
|
////// 回放 //////
|
||||||
core.prototype.replay = function () {
|
core.prototype.replay = function () {
|
||||||
core.control.replay();
|
core.control.replay();
|
||||||
|
|||||||
6
main.js
6
main.js
@ -403,6 +403,12 @@ main.statusBar.image.toolbox.onclick = function () {
|
|||||||
|
|
||||||
////// 点击状态栏中的快捷商店时 //////
|
////// 点击状态栏中的快捷商店时 //////
|
||||||
main.statusBar.image.shop.onclick = function () {
|
main.statusBar.image.shop.onclick = function () {
|
||||||
|
|
||||||
|
if (core.isset(core.status.replay) && core.status.replay.replaying) {
|
||||||
|
core.bookReplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (main.core.isPlaying())
|
if (main.core.isPlaying())
|
||||||
main.core.openQuickShop(true);
|
main.core.openQuickShop(true);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user