delay on choices
This commit is contained in:
parent
45009ddd7c
commit
bcfd1899b7
@ -767,6 +767,12 @@ actions.prototype.clickAction = function (x,y) {
|
||||
|
||||
////// 自定义事件时,按下某个键的操作 //////
|
||||
actions.prototype.keyDownAction = function (keycode) {
|
||||
// 视为无效
|
||||
var startTime = core.status.event.data.startTime||0;
|
||||
if (startTime>0 && new Date().getTime()-startTime<250)
|
||||
return;
|
||||
core.status.event.data.startTime = 0;
|
||||
|
||||
if (core.status.event.data.type=='choices') {
|
||||
var data = core.status.event.data.current;
|
||||
var choices = data.choices;
|
||||
@ -809,6 +815,15 @@ actions.prototype.keyUpAction = function (keycode) {
|
||||
core.insertAction(choices[core.status.event.selection].action);
|
||||
core.doAction();
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
core.status.route.push("choices:"+index);
|
||||
core.insertAction(choices[index].action);
|
||||
core.doAction();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1137,6 +1152,14 @@ actions.prototype.keyUpShop = function (keycode) {
|
||||
var topIndex = 6 - parseInt(choices.length / 2);
|
||||
this.clickShop(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<=choices.length) {
|
||||
var topIndex = 6 - parseInt(choices.length / 2);
|
||||
this.clickShop(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1184,6 +1207,13 @@ actions.prototype.keyUpQuickShop = function (keycode) {
|
||||
var topIndex = 6 - parseInt(keys.length / 2);
|
||||
this.clickQuickShop(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<=keys.length) {
|
||||
var topIndex = 6 - parseInt(keys.length / 2);
|
||||
this.clickQuickShop(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1826,6 +1856,14 @@ actions.prototype.keyUpSwitchs = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSwitchs(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSwitchs(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1906,6 +1944,14 @@ actions.prototype.keyUpSettings = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSettings(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSettings(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////// 同步存档界面时的点击操作 //////
|
||||
@ -2026,6 +2072,14 @@ actions.prototype.keyUpSyncSave = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSyncSave(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSyncSave(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////// 同步存档选择界面时的点击操作 //////
|
||||
@ -2075,6 +2129,14 @@ actions.prototype.keyUpSyncSelect = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSyncSelect(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickSyncSelect(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////// 存档下载界面时的点击操作 //////
|
||||
@ -2148,6 +2210,14 @@ actions.prototype.keyUpLocalSaveSelect = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickLocalSaveSelect(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickLocalSaveSelect(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////// 存档删除界面时的点击操作 //////
|
||||
@ -2234,6 +2304,14 @@ actions.prototype.keyUpStorageRemove = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickStorageRemove(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickStorageRemove(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////// 回放选择界面时的点击操作 //////
|
||||
@ -2308,6 +2386,14 @@ actions.prototype.keyUpReplay = function (keycode) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickReplay(6, topIndex+core.status.event.selection);
|
||||
}
|
||||
// 数字键快速选择
|
||||
if (keycode>=49 && keycode<=57) {
|
||||
var index = keycode-49;
|
||||
if (index<choices.length) {
|
||||
var topIndex = 6 - parseInt((choices.length - 1) / 2);
|
||||
this.clickReplay(6, topIndex+index);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////// “虚拟键盘”界面时的点击操作 //////
|
||||
|
||||
@ -316,7 +316,7 @@ events.prototype.doEvents = function (list, x, y, callback) {
|
||||
core.status.event = {'id': 'action', 'data': {
|
||||
'list': [
|
||||
{"todo": core.clone(list), "total": core.clone(list), "condition": "false"}
|
||||
], 'x': x, 'y': y, 'callback': callback
|
||||
], 'x': x, 'y': y, 'callback': callback, 'startTime': new Date().getTime()
|
||||
}}
|
||||
|
||||
// 停止勇士
|
||||
|
||||
Loading…
Reference in New Issue
Block a user