replay funcs
This commit is contained in:
parent
900d186922
commit
c7e6d85f35
15
_docs/api.md
15
_docs/api.md
@ -264,9 +264,6 @@ value: 属性的增量
|
|||||||
autosave: fn(removeLast?: bool)
|
autosave: fn(removeLast?: bool)
|
||||||
自动存档
|
自动存档
|
||||||
|
|
||||||
bookReplay: fn()
|
|
||||||
回放时查看怪物手册
|
|
||||||
|
|
||||||
checkAutosave: fn()
|
checkAutosave: fn()
|
||||||
实际将自动存档写入存储
|
实际将自动存档写入存储
|
||||||
|
|
||||||
@ -317,9 +314,6 @@ status: 只能为 stop, leftFoot 和 rightFoot,不填用stop。
|
|||||||
offset: 相对主角逻辑位置的偏移量,不填视为无偏移。
|
offset: 相对主角逻辑位置的偏移量,不填视为无偏移。
|
||||||
frame: 绘制的第几帧
|
frame: 绘制的第几帧
|
||||||
|
|
||||||
equipboxReplay: fn()
|
|
||||||
回放录像时打开装备栏
|
|
||||||
|
|
||||||
fillPosWithPoint: fn(pos?: ?)
|
fillPosWithPoint: fn(pos?: ?)
|
||||||
显示离散的寻路点
|
显示离散的寻路点
|
||||||
|
|
||||||
@ -518,9 +512,6 @@ saveAndStopAutomaticRoute: fn()
|
|||||||
saveData: fn()
|
saveData: fn()
|
||||||
存档到本地
|
存档到本地
|
||||||
|
|
||||||
saveReplay: fn()
|
|
||||||
回放时存档
|
|
||||||
|
|
||||||
screenFlash: fn(color: [number], time: number, times?: number, callback?: fn())
|
screenFlash: fn(color: [number], time: number, times?: number, callback?: fn())
|
||||||
画面闪烁
|
画面闪烁
|
||||||
例如:core.screenFlash([255, 0, 0, 1], 3); // 红屏一闪而过
|
例如:core.screenFlash([255, 0, 0, 1], 3); // 红屏一闪而过
|
||||||
@ -637,9 +628,6 @@ syncLoad: fn()
|
|||||||
syncSave: fn(type?: string)
|
syncSave: fn(type?: string)
|
||||||
同步存档到服务器
|
同步存档到服务器
|
||||||
|
|
||||||
toolboxReplay: fn()
|
|
||||||
回放录像时打开道具栏
|
|
||||||
|
|
||||||
triggerBgm: fn()
|
triggerBgm: fn()
|
||||||
开启或关闭背景音乐的播放
|
开启或关闭背景音乐的播放
|
||||||
|
|
||||||
@ -699,9 +687,6 @@ doNotCheckAutoEvents: 是否不检查自动事件
|
|||||||
updateViewport: fn()
|
updateViewport: fn()
|
||||||
更新大地图的可见区域
|
更新大地图的可见区域
|
||||||
|
|
||||||
viewMapReplay: fn()
|
|
||||||
回放录像时浏览地图
|
|
||||||
|
|
||||||
waitHeroToStop: fn(callback?: fn())
|
waitHeroToStop: fn(callback?: fn())
|
||||||
等待主角停下
|
等待主角停下
|
||||||
例如:core.waitHeroToStop(core.vibrate); // 等待主角停下,然后视野左右抖动1秒
|
例如:core.waitHeroToStop(core.vibrate); // 等待主角停下,然后视野左右抖动1秒
|
||||||
|
|||||||
@ -2175,11 +2175,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
|
|||||||
"setFlag": {
|
"setFlag": {
|
||||||
"!doc": "设置一个flag变量<br/>例如:core.setFlag('poison', true); // 令主角中毒<br/>name: 变量名,支持中文<br/>value: 变量的新值,不填或填null视为删除",
|
"!doc": "设置一个flag变量<br/>例如:core.setFlag('poison', true); // 令主角中毒<br/>name: 变量名,支持中文<br/>value: 变量的新值,不填或填null视为删除",
|
||||||
"!type": "fn(name: string, value: ?)"
|
"!type": "fn(name: string, value: ?)"
|
||||||
},
|
},
|
||||||
"viewMapReplay": {
|
|
||||||
"!doc": "回放录像时浏览地图",
|
|
||||||
"!type": "fn()"
|
|
||||||
},
|
|
||||||
"playSound": {
|
"playSound": {
|
||||||
"!doc": "播放一个音效",
|
"!doc": "播放一个音效",
|
||||||
"!type": "fn(sound: string)"
|
"!type": "fn(sound: string)"
|
||||||
@ -2315,11 +2311,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
|
|||||||
"continueAutomaticRoute": {
|
"continueAutomaticRoute": {
|
||||||
"!doc": "继续剩下的自动寻路操作",
|
"!doc": "继续剩下的自动寻路操作",
|
||||||
"!type": "fn()"
|
"!type": "fn()"
|
||||||
},
|
},
|
||||||
"saveReplay": {
|
|
||||||
"!doc": "回放时存档",
|
|
||||||
"!type": "fn()"
|
|
||||||
},
|
|
||||||
"setAutoHeroMove": {
|
"setAutoHeroMove": {
|
||||||
"!doc": "连续行走<br/>例如:core.setAutoHeroMove([{direction: \"up\", step: 1}, {direction: \"left\", step: 3}]); // 上左左左<br/>steps: 压缩的步伐数组,每项表示朝某方向走多少步",
|
"!doc": "连续行走<br/>例如:core.setAutoHeroMove([{direction: \"up\", step: 1}, {direction: \"left\", step: 3}]); // 上左左左<br/>steps: 压缩的步伐数组,每项表示朝某方向走多少步",
|
||||||
"!type": "fn(steps: [?])"
|
"!type": "fn(steps: [?])"
|
||||||
@ -2415,11 +2407,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
|
|||||||
"rewindReplay": {
|
"rewindReplay": {
|
||||||
"!doc": "回退到上一个录像节点",
|
"!doc": "回退到上一个录像节点",
|
||||||
"!type": "fn()"
|
"!type": "fn()"
|
||||||
},
|
},
|
||||||
"toolboxReplay": {
|
|
||||||
"!doc": "回放录像时打开道具栏",
|
|
||||||
"!type": "fn()"
|
|
||||||
},
|
|
||||||
"playBgm": {
|
"playBgm": {
|
||||||
"!doc": "播放背景音乐,中途开播但不计入存档且只会持续到下次场景切换。如需长期生效请将背景音乐的文件名赋值给flags.__bgm__<br/>例如:core.playBgm('bgm.mp3', 30); // 播放bgm.mp3,并跳过前半分钟<br/>bgm: 背景音乐的文件名,支持全塔属性中映射前的中文名<br/>startTime: 跳过前多少秒,不填则不跳过",
|
"!doc": "播放背景音乐,中途开播但不计入存档且只会持续到下次场景切换。如需长期生效请将背景音乐的文件名赋值给flags.__bgm__<br/>例如:core.playBgm('bgm.mp3', 30); // 播放bgm.mp3,并跳过前半分钟<br/>bgm: 背景音乐的文件名,支持全塔属性中映射前的中文名<br/>startTime: 跳过前多少秒,不填则不跳过",
|
||||||
"!type": "fn(bgm: string, startTime?: number)"
|
"!type": "fn(bgm: string, startTime?: number)"
|
||||||
@ -2455,11 +2443,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
|
|||||||
"stopReplay": {
|
"stopReplay": {
|
||||||
"!doc": "停止播放",
|
"!doc": "停止播放",
|
||||||
"!type": "fn(force?: bool)"
|
"!type": "fn(force?: bool)"
|
||||||
},
|
},
|
||||||
"bookReplay": {
|
|
||||||
"!doc": "回放时查看怪物手册",
|
|
||||||
"!type": "fn()"
|
|
||||||
},
|
|
||||||
"turnHero": {
|
"turnHero": {
|
||||||
"!doc": "主角转向并计入录像,不会导致跟随者聚集,会导致视野重置到以主角为中心<br/>例如:core.turnHero(); // 主角顺时针旋转90°,即单击主角或按下Z键的效果<br/>direction: 主角的新朝向,可为 up, down, left, right, :left, :right, :back 七种之一",
|
"!doc": "主角转向并计入录像,不会导致跟随者聚集,会导致视野重置到以主角为中心<br/>例如:core.turnHero(); // 主角顺时针旋转90°,即单击主角或按下Z键的效果<br/>direction: 主角的新朝向,可为 up, down, left, right, :left, :right, :back 七种之一",
|
||||||
"!type": "fn(direction?: string)"
|
"!type": "fn(direction?: string)"
|
||||||
@ -2471,11 +2455,7 @@ var terndefs_f6783a0a_522d_417e_8407_94c67b692e50 = [
|
|||||||
"resize": {
|
"resize": {
|
||||||
"!doc": "屏幕分辨率改变后重新自适应",
|
"!doc": "屏幕分辨率改变后重新自适应",
|
||||||
"!type": "fn()"
|
"!type": "fn()"
|
||||||
},
|
},
|
||||||
"equipboxReplay": {
|
|
||||||
"!doc": "回放录像时打开装备栏",
|
|
||||||
"!type": "fn()"
|
|
||||||
},
|
|
||||||
"getSave": {
|
"getSave": {
|
||||||
"!doc": "获得某个存档内容",
|
"!doc": "获得某个存档内容",
|
||||||
"!type": "fn(index?: number, callback?: fn(data: ?))"
|
"!type": "fn(index?: number, callback?: fn(data: ?))"
|
||||||
|
|||||||
@ -159,24 +159,24 @@ actions.prototype._sys_onkeyUp_replay = function (e) {
|
|||||||
core.stopReplay();
|
core.stopReplay();
|
||||||
else if (e.keyCode == 90) // Z
|
else if (e.keyCode == 90) // Z
|
||||||
core.speedDownReplay();
|
core.speedDownReplay();
|
||||||
else if (e.keyCode == 88) // X
|
else if (e.keyCode == 67) // C
|
||||||
core.speedUpReplay();
|
core.speedUpReplay();
|
||||||
else if (e.keyCode == 32) // SPACE
|
else if (e.keyCode == 32) // SPACE
|
||||||
core.triggerReplay();
|
core.triggerReplay();
|
||||||
else if (e.keyCode == 65) // A
|
else if (e.keyCode == 65) // A
|
||||||
core.rewindReplay();
|
core.rewindReplay();
|
||||||
else if (e.keyCode == 83) // S
|
else if (e.keyCode == 83) // S
|
||||||
core.saveReplay();
|
core.control._replay_SL();
|
||||||
else if (e.keyCode == 67) // C
|
else if (e.keyCode == 88) // X
|
||||||
core.bookReplay();
|
core.control._replay_book();
|
||||||
else if (e.keyCode == 33 || e.keyCode == 34) // PgUp/PgDn
|
else if (e.keyCode == 33 || e.keyCode == 34) // PgUp/PgDn
|
||||||
core.viewMapReplay();
|
core.control._replay_viewMap();
|
||||||
else if (e.keyCode == 78) // N
|
else if (e.keyCode == 78) // N
|
||||||
core.stepReplay();
|
core.stepReplay();
|
||||||
else if (e.keyCode == 84) // T
|
else if (e.keyCode == 84) // T
|
||||||
core.toolboxReplay();
|
core.control._replay_toolbox();
|
||||||
else if (e.keyCode == 81) // Q
|
else if (e.keyCode == 81) // Q
|
||||||
core.equipboxReplay();
|
core.control._replay_equipbox();
|
||||||
else if (e.keyCode == 66) // B
|
else if (e.keyCode == 66) // B
|
||||||
core.ui._drawStatistics();
|
core.ui._drawStatistics();
|
||||||
else if (e.keyCode >= 49 && e.keyCode <= 51) // 1-3
|
else if (e.keyCode >= 49 && e.keyCode <= 51) // 1-3
|
||||||
@ -1297,7 +1297,7 @@ actions.prototype._keyUpViewMaps = function (keycode) {
|
|||||||
}
|
}
|
||||||
if (keycode == 88 || (core.isReplaying() && keycode == 67)) {
|
if (keycode == 88 || (core.isReplaying() && keycode == 67)) {
|
||||||
if (core.isReplaying()) {
|
if (core.isReplaying()) {
|
||||||
core.bookReplay();
|
core.control._replay_book();
|
||||||
} else {
|
} else {
|
||||||
core.openBook(false);
|
core.openBook(false);
|
||||||
}
|
}
|
||||||
@ -1353,7 +1353,7 @@ actions.prototype._clickToolbox = function (x, y) {
|
|||||||
if (x >= this.LAST - 2 && y == 0) {
|
if (x >= this.LAST - 2 && y == 0) {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
if (core.isReplaying())
|
if (core.isReplaying())
|
||||||
core.equipboxReplay();
|
core.control._replay_equipbox();
|
||||||
else
|
else
|
||||||
core.openEquipbox();
|
core.openEquipbox();
|
||||||
return;
|
return;
|
||||||
@ -1521,7 +1521,7 @@ actions.prototype._keyUpToolbox = function (keycode) {
|
|||||||
if (keycode == 81) {
|
if (keycode == 81) {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
if (core.isReplaying())
|
if (core.isReplaying())
|
||||||
core.equipboxReplay();
|
core.control._replay_equipbox();
|
||||||
else
|
else
|
||||||
core.openEquipbox();
|
core.openEquipbox();
|
||||||
return;
|
return;
|
||||||
@ -1544,7 +1544,7 @@ actions.prototype._clickEquipbox = function (x, y) {
|
|||||||
if (x >= this.LAST - 2 && y == 0) {
|
if (x >= this.LAST - 2 && y == 0) {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
if (core.isReplaying())
|
if (core.isReplaying())
|
||||||
core.toolboxReplay();
|
core.control._replay_toolbox();
|
||||||
else
|
else
|
||||||
core.openToolbox();
|
core.openToolbox();
|
||||||
return;
|
return;
|
||||||
@ -1696,7 +1696,7 @@ actions.prototype._keyUpEquipbox = function (keycode, altKey) {
|
|||||||
if (keycode == 84) {
|
if (keycode == 84) {
|
||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
if (core.isReplaying())
|
if (core.isReplaying())
|
||||||
core.toolboxReplay();
|
core.control._replay_toolbox();
|
||||||
else
|
else
|
||||||
core.openToolbox();
|
core.openToolbox();
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -1390,7 +1390,7 @@ control.prototype.rewindReplay = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// 回放时存档 //////
|
////// 回放时存档 //////
|
||||||
control.prototype.saveReplay = function () {
|
control.prototype._replay_SL = function () {
|
||||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||||
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
||||||
@ -1405,7 +1405,7 @@ control.prototype.saveReplay = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// 回放时查看怪物手册 //////
|
////// 回放时查看怪物手册 //////
|
||||||
control.prototype.bookReplay = function () {
|
control.prototype._replay_book = function () {
|
||||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||||
if (core.isMoving() || core.status.replay.animate
|
if (core.isMoving() || core.status.replay.animate
|
||||||
@ -1423,7 +1423,7 @@ control.prototype.bookReplay = function () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////// 回放录像时浏览地图 //////
|
////// 回放录像时浏览地图 //////
|
||||||
control.prototype.viewMapReplay = function () {
|
control.prototype._replay_viewMap = function () {
|
||||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||||
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
||||||
@ -1434,7 +1434,7 @@ control.prototype.viewMapReplay = function () {
|
|||||||
core.ui._drawViewMaps();
|
core.ui._drawViewMaps();
|
||||||
}
|
}
|
||||||
|
|
||||||
control.prototype.toolboxReplay = function () {
|
control.prototype._replay_toolbox = function () {
|
||||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||||
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
||||||
@ -1445,7 +1445,7 @@ control.prototype.toolboxReplay = function () {
|
|||||||
core.ui._drawToolbox();
|
core.ui._drawToolbox();
|
||||||
}
|
}
|
||||||
|
|
||||||
control.prototype.equipboxReplay = function () {
|
control.prototype._replay_equipbox = function () {
|
||||||
if (!core.isPlaying() || !core.isReplaying()) return;
|
if (!core.isPlaying() || !core.isReplaying()) return;
|
||||||
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
if (!core.status.replay.pausing) return core.drawTip("请先暂停录像");
|
||||||
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
if (core.isMoving() || core.status.replay.animate || core.status.event.id)
|
||||||
|
|||||||
6
main.js
6
main.js
@ -610,7 +610,7 @@ main.statusBar.image.keyboard.onclick = function (e) {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isReplaying()) {
|
if (core.isReplaying()) {
|
||||||
core.bookReplay();
|
core.control._replay_book();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -623,7 +623,7 @@ main.statusBar.image.shop.onclick = function (e) {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isReplaying()) {
|
if (core.isReplaying()) {
|
||||||
core.viewMapReplay();
|
core.control._replay_viewMap();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -670,7 +670,7 @@ main.statusBar.image.settings.onclick = function (e) {
|
|||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
|
|
||||||
if (core.isReplaying()) {
|
if (core.isReplaying()) {
|
||||||
core.saveReplay();
|
core.control._replay_SL();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
15
runtime.d.ts
vendored
15
runtime.d.ts
vendored
@ -666,21 +666,6 @@ declare class control {
|
|||||||
/** 回退 */
|
/** 回退 */
|
||||||
rewindReplay(): void
|
rewindReplay(): void
|
||||||
|
|
||||||
/** 回放时存档 */
|
|
||||||
saveReplay(): void
|
|
||||||
|
|
||||||
/** 回放时查看怪物手册 */
|
|
||||||
bookReplay(): void
|
|
||||||
|
|
||||||
/** 回放录像时浏览地图 */
|
|
||||||
viewMapReplay(): void
|
|
||||||
|
|
||||||
/** 回放录像时打开道具栏 */
|
|
||||||
toolboxReplay(): void
|
|
||||||
|
|
||||||
/** 回放录像时打开装备栏 */
|
|
||||||
equipboxReplay(): void
|
|
||||||
|
|
||||||
/** 是否正在播放录像 */
|
/** 是否正在播放录像 */
|
||||||
isReplaying(): boolean
|
isReplaying(): boolean
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user