feat:(temp)工具栏新增一些内容,有待进一步完善
This commit is contained in:
parent
2709efeceb
commit
4490fa3b63
@ -564,6 +564,12 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
|
|||||||
"_docs": "横屏底部工具栏",
|
"_docs": "横屏底部工具栏",
|
||||||
"_data": "在横屏状态下是否将工具栏挪动到游戏画布下方,从而完全解放状态栏空间"
|
"_data": "在横屏状态下是否将工具栏挪动到游戏画布下方,从而完全解放状态栏空间"
|
||||||
},
|
},
|
||||||
|
"showHard": {
|
||||||
|
"_leaf": true,
|
||||||
|
"_type": "checkbox",
|
||||||
|
"_docs": "工具栏显示难度",
|
||||||
|
"_data": "工具栏是否显示难度字符。由于空间不足,显示时将隐藏回退等新增按钮。"
|
||||||
|
},
|
||||||
"flyNearStair": {
|
"flyNearStair": {
|
||||||
"_leaf": true,
|
"_leaf": true,
|
||||||
"_type": "checkbox",
|
"_type": "checkbox",
|
||||||
|
|||||||
@ -153,6 +153,8 @@
|
|||||||
<img class="tools" id='img-save'>
|
<img class="tools" id='img-save'>
|
||||||
<img class="tools" id='img-load'>
|
<img class="tools" id='img-load'>
|
||||||
<img class="tools" id='img-settings'>
|
<img class="tools" id='img-settings'>
|
||||||
|
<img class="tools" id='img-rollback'>
|
||||||
|
<img class="tools" id='img-undoRollback'>
|
||||||
<img class="tools" id='img-btn1' style='display:none'>
|
<img class="tools" id='img-btn1' style='display:none'>
|
||||||
<img class="tools" id='img-btn2' style='display:none'>
|
<img class="tools" id='img-btn2' style='display:none'>
|
||||||
<img class="tools" id='img-btn3' style='display:none'>
|
<img class="tools" id='img-btn3' style='display:none'>
|
||||||
@ -161,6 +163,8 @@
|
|||||||
<img class="tools" id='img-btn6' style='display:none'>
|
<img class="tools" id='img-btn6' style='display:none'>
|
||||||
<img class="tools" id='img-btn7' style='display:none'>
|
<img class="tools" id='img-btn7' style='display:none'>
|
||||||
<img class="tools" id='img-btn8' style='display:none'>
|
<img class="tools" id='img-btn8' style='display:none'>
|
||||||
|
<img class="tools" id='img-single' style='display:none'>
|
||||||
|
<img class="tools" id='img-valve' style='display:none'>
|
||||||
<p class="statusLabel tools" id="hard"></p>
|
<p class="statusLabel tools" id="hard"></p>
|
||||||
</div>
|
</div>
|
||||||
<div id="gameDraw">
|
<div id="gameDraw">
|
||||||
|
|||||||
@ -3218,6 +3218,8 @@ control.prototype._updateStatusBar_setToolboxIcon = function () {
|
|||||||
core.statusBar.image.save.style.opacity = 1;
|
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.settings.src = core.statusBar.icons.save.src;
|
core.statusBar.image.settings.src = core.statusBar.icons.save.src;
|
||||||
|
core.statusBar.image.rollback.src = core.statusBar.icons.single.src;
|
||||||
|
core.statusBar.image.undoRollback.src = core.statusBar.icons.valve.src;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.statusBar.image.book.src = core.statusBar.icons.book.src;
|
core.statusBar.image.book.src = core.statusBar.icons.book.src;
|
||||||
@ -3237,6 +3239,8 @@ control.prototype._updateStatusBar_setToolboxIcon = function () {
|
|||||||
core.statusBar.image.save.style.opacity = core.hasFlag('__forbidSave__') ? 0.3 : 1;
|
core.statusBar.image.save.style.opacity = core.hasFlag('__forbidSave__') ? 0.3 : 1;
|
||||||
core.statusBar.image.load.src = core.statusBar.icons.load.src;
|
core.statusBar.image.load.src = core.statusBar.icons.load.src;
|
||||||
core.statusBar.image.settings.src = core.statusBar.icons.settings.src;
|
core.statusBar.image.settings.src = core.statusBar.icons.settings.src;
|
||||||
|
core.statusBar.image.rollback.src = core.statusBar.icons.rollback.src;
|
||||||
|
core.statusBar.image.undoRollback.src = core.statusBar.icons.undoRollback.src;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3320,6 +3324,9 @@ control.prototype.setToolbarButton = function (useButton) {
|
|||||||
["book", "fly", "toolbox", "keyboard", "shop", "save", "load", "settings"].forEach(function (t) {
|
["book", "fly", "toolbox", "keyboard", "shop", "save", "load", "settings"].forEach(function (t) {
|
||||||
core.statusBar.image[t].style.display = 'none';
|
core.statusBar.image[t].style.display = 'none';
|
||||||
});
|
});
|
||||||
|
["rollback", "undoRollback"].forEach(function (t) {
|
||||||
|
core.statusBar.image[t].style.display = 'none';
|
||||||
|
});
|
||||||
["btn1", "btn2", "btn3", "btn4", "btn5", "btn6", "btn7", "btn8"].forEach(function (t) {
|
["btn1", "btn2", "btn3", "btn4", "btn5", "btn6", "btn7", "btn8"].forEach(function (t) {
|
||||||
core.statusBar.image[t].style.display = 'block';
|
core.statusBar.image[t].style.display = 'block';
|
||||||
})
|
})
|
||||||
@ -3332,8 +3339,17 @@ control.prototype.setToolbarButton = function (useButton) {
|
|||||||
["book", "fly", "toolbox", "save", "load", "settings"].forEach(function (t) {
|
["book", "fly", "toolbox", "save", "load", "settings"].forEach(function (t) {
|
||||||
core.statusBar.image[t].style.display = 'block';
|
core.statusBar.image[t].style.display = 'block';
|
||||||
});
|
});
|
||||||
|
if (core.domStyle.isVertical || core.flags.extendToolbar || !core.flags.showHard) {
|
||||||
|
core.statusBar.image.shop.style.display = "block";
|
||||||
|
}
|
||||||
|
else core.statusBar.image.shop.style.display = "none";
|
||||||
|
|
||||||
|
if (!core.flags.showHard) {
|
||||||
|
["rollback", "undoRollback"].forEach(function (t) {
|
||||||
|
core.statusBar.image[t].style.display = 'block';
|
||||||
|
});
|
||||||
|
}
|
||||||
core.statusBar.image.keyboard.style.display
|
core.statusBar.image.keyboard.style.display
|
||||||
= core.statusBar.image.shop.style.display
|
|
||||||
= core.domStyle.isVertical || core.flags.extendToolbar ? "block" : "none";
|
= core.domStyle.isVertical || core.flags.extendToolbar ? "block" : "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3671,7 +3687,7 @@ control.prototype._resize_tools = function (obj) {
|
|||||||
var toolsHeight = 32 * core.domStyle.scale * ((core.domStyle.isVertical || obj.extendToolbar) && !obj.is15x15 ? 0.95 : 1);
|
var toolsHeight = 32 * core.domStyle.scale * ((core.domStyle.isVertical || obj.extendToolbar) && !obj.is15x15 ? 0.95 : 1);
|
||||||
var toolsMarginLeft;
|
var toolsMarginLeft;
|
||||||
if (core.domStyle.isVertical || obj.extendToolbar)
|
if (core.domStyle.isVertical || obj.extendToolbar)
|
||||||
toolsMarginLeft = (core.__HALF_SIZE__ - 3) * 3 * core.domStyle.scale;
|
toolsMarginLeft = (core.__HALF_SIZE__ - 3) * 3 * core.domStyle.scale - 1;
|
||||||
else
|
else
|
||||||
toolsMarginLeft = (obj.BAR_WIDTH * core.domStyle.scale - 9 - toolsHeight * 3) / 4;
|
toolsMarginLeft = (obj.BAR_WIDTH * core.domStyle.scale - 9 - toolsHeight * 3) / 4;
|
||||||
for (var i = 0; i < core.dom.tools.length; ++i) {
|
for (var i = 0; i < core.dom.tools.length; ++i) {
|
||||||
@ -3682,7 +3698,8 @@ control.prototype._resize_tools = function (obj) {
|
|||||||
}
|
}
|
||||||
core.dom.hard.style.lineHeight = toolsHeight + "px";
|
core.dom.hard.style.lineHeight = toolsHeight + "px";
|
||||||
if (core.domStyle.isVertical || obj.extendToolbar) {
|
if (core.domStyle.isVertical || obj.extendToolbar) {
|
||||||
core.dom.hard.style.width = obj.outerSize - 9 * toolsMarginLeft - 8.5 * toolsHeight - 12 + "px";
|
if (core.flags.showHard) core.dom.hard.style.width = obj.outerSize - 9 * toolsMarginLeft - 8.5 * toolsHeight - 22 + "px";
|
||||||
|
else core.dom.hard.style.width = "10px";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
core.dom.hard.style.width = obj.BAR_WIDTH * core.domStyle.scale - 9 - 2 * toolsMarginLeft + "px";
|
core.dom.hard.style.width = obj.BAR_WIDTH * core.domStyle.scale - 9 - 2 * toolsMarginLeft + "px";
|
||||||
|
|||||||
37
main.js
37
main.js
@ -122,6 +122,10 @@ function main () {
|
|||||||
'btn6': document.getElementById("img-btn6"),
|
'btn6': document.getElementById("img-btn6"),
|
||||||
'btn7': document.getElementById("img-btn7"),
|
'btn7': document.getElementById("img-btn7"),
|
||||||
'btn8': document.getElementById("img-btn8"),
|
'btn8': document.getElementById("img-btn8"),
|
||||||
|
'rollback': document.getElementById("img-rollback"),
|
||||||
|
'undoRollback': document.getElementById("img-undoRollback"),
|
||||||
|
'single': document.getElementById("img-single"),
|
||||||
|
'valve': document.getElementById("img-valve"),
|
||||||
},
|
},
|
||||||
'icons': {
|
'icons': {
|
||||||
'floor': 0,
|
'floor': 0,
|
||||||
@ -159,7 +163,11 @@ function main () {
|
|||||||
'btn5': 31,
|
'btn5': 31,
|
||||||
'btn6': 32,
|
'btn6': 32,
|
||||||
'btn7': 33,
|
'btn7': 33,
|
||||||
'btn8': 34
|
'btn8': 34,
|
||||||
|
'rollback': 35,
|
||||||
|
'undoRollback': 36,
|
||||||
|
'single': 37,
|
||||||
|
'valve': 38,
|
||||||
},
|
},
|
||||||
'floor': document.getElementById('floor'),
|
'floor': document.getElementById('floor'),
|
||||||
'name': document.getElementById('name'),
|
'name': document.getElementById('name'),
|
||||||
@ -764,6 +772,33 @@ main.prototype.listen = function () {
|
|||||||
main.core.openSettings(true);
|
main.core.openSettings(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////// 点击状态栏中的回退菜单时 //////
|
||||||
|
main.statusBar.image.rollback.onclick = function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
// 单步播放录像
|
||||||
|
if (core.isReplaying()) {
|
||||||
|
core.control.stepReplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (main.core.isPlaying())
|
||||||
|
core.doSL("autoSave", "load");
|
||||||
|
}
|
||||||
|
|
||||||
|
////// 点击状态栏中的取消回退菜单时 //////
|
||||||
|
main.statusBar.image.undoRollback.onclick = function (e) {
|
||||||
|
e.stopPropagation();
|
||||||
|
|
||||||
|
if (core.isReplaying()) {
|
||||||
|
core.control.interceptReplay();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (main.core.isPlaying())
|
||||||
|
core.doSL("autoSave", "reload");
|
||||||
|
}
|
||||||
|
|
||||||
////// 点击工具栏时 //////
|
////// 点击工具栏时 //////
|
||||||
main.dom.hard.onclick = function () {
|
main.dom.hard.onclick = function () {
|
||||||
if (core.isReplaying())
|
if (core.isReplaying())
|
||||||
|
|||||||
@ -729,6 +729,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
|||||||
"enableRouteFolding": true,
|
"enableRouteFolding": true,
|
||||||
"disableShopOnDamage": false,
|
"disableShopOnDamage": false,
|
||||||
"blurFg": false,
|
"blurFg": false,
|
||||||
"chaseThroughEnemy": false
|
"chaseThroughEnemy": false,
|
||||||
|
"showHard": false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1296,7 +1296,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
core.setStatusBarInnerHTML('fly', "飞" + core.itemCount('centerFly'));
|
core.setStatusBarInnerHTML('fly', "飞" + core.itemCount('centerFly'));
|
||||||
|
|
||||||
// 难度
|
// 难度
|
||||||
if (core.statusBar.hard.innerText != core.status.hard) {
|
if (!core.flags.showHard) core.statusBar.hard.innerText = '';
|
||||||
|
else if (core.statusBar.hard.innerText != core.status.hard) {
|
||||||
core.statusBar.hard.innerText = core.status.hard;
|
core.statusBar.hard.innerText = core.status.hard;
|
||||||
}
|
}
|
||||||
var hardColor = core.getFlag('__hardColor__', 'red');
|
var hardColor = core.getFlag('__hardColor__', 'red');
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 8.7 KiB After Width: | Height: | Size: 7.9 KiB |
Loading…
Reference in New Issue
Block a user