toolbar 8 buttons
This commit is contained in:
parent
55bd1edf6d
commit
3d44412491
@ -442,6 +442,7 @@
|
||||
<img class="tools" id='img-fly'>
|
||||
<img class="tools" id='img-toolbox'>
|
||||
<img class="tools" id='img-keyboard'>
|
||||
<img class="tools" id='img-shop'>
|
||||
<img class="tools" id='img-save'>
|
||||
<img class="tools" id='img-load'>
|
||||
<img class="tools" id='img-settings'>
|
||||
@ -452,6 +453,7 @@
|
||||
<img class="tools" id='img-btn5' 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-btn8' style='display:none'>
|
||||
<p class="statusLabel tools" id="hard"></p>
|
||||
</div>
|
||||
<div id="gameDraw">
|
||||
|
||||
@ -425,6 +425,7 @@
|
||||
<img class="tools" id='img-fly'>
|
||||
<img class="tools" id='img-toolbox'>
|
||||
<img class="tools" id='img-keyboard'>
|
||||
<img class="tools" id='img-shop'>
|
||||
<img class="tools" id='img-save'>
|
||||
<img class="tools" id='img-load'>
|
||||
<img class="tools" id='img-settings'>
|
||||
@ -435,6 +436,7 @@
|
||||
<img class="tools" id='img-btn5' 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-btn8' style='display:none'>
|
||||
<p class="statusLabel tools" id="hard"></p>
|
||||
</div>
|
||||
<div id="gameDraw">
|
||||
|
||||
@ -119,6 +119,7 @@
|
||||
<img class="tools" id='img-fly'>
|
||||
<img class="tools" id='img-toolbox'>
|
||||
<img class="tools" id='img-keyboard'>
|
||||
<img class="tools" id='img-shop'>
|
||||
<img class="tools" id='img-save'>
|
||||
<img class="tools" id='img-load'>
|
||||
<img class="tools" id='img-settings'>
|
||||
@ -129,6 +130,7 @@
|
||||
<img class="tools" id='img-btn5' 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-btn8' style='display:none'>
|
||||
<p class="statusLabel tools" id="hard"></p>
|
||||
</div>
|
||||
<div id="gameDraw">
|
||||
|
||||
@ -2746,6 +2746,7 @@ actions.prototype.exitPaint = function () {
|
||||
core.deleteCanvas('paint');
|
||||
core.ui.closePanel();
|
||||
core.statusBar.image.keyboard.style.opacity = 1;
|
||||
core.statusBar.image.shop.style.opacity = 1;
|
||||
core.updateStatusBar();
|
||||
core.drawTip("退出绘图模式");
|
||||
}
|
||||
|
||||
@ -2056,16 +2056,9 @@ control.prototype.openQuickShop = function (need) {
|
||||
control.prototype.openKeyBoard = function (need) {
|
||||
if (core.isReplaying()) return;
|
||||
|
||||
if (core.platform.extendKeyboard) {
|
||||
if (!core.checkStatus('keyBoard', need))
|
||||
return;
|
||||
core.ui.drawKeyBoard();
|
||||
}
|
||||
else {
|
||||
if (!core.checkStatus('selectShop', need))
|
||||
return;
|
||||
core.ui.drawQuickShop();
|
||||
}
|
||||
if (!core.checkStatus('keyBoard', need))
|
||||
return;
|
||||
core.ui.drawKeyBoard();
|
||||
}
|
||||
|
||||
////// 点击保存按钮时的打开操作 //////
|
||||
@ -2729,6 +2722,7 @@ control.prototype.updateStatusBar = function () {
|
||||
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
|
||||
|
||||
core.statusBar.image.keyboard.src = core.statusBar.icons.book.src;
|
||||
core.statusBar.image.shop.style.opacity = 0;
|
||||
|
||||
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
|
||||
|
||||
@ -2752,8 +2746,8 @@ control.prototype.updateStatusBar = function () {
|
||||
|
||||
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
|
||||
|
||||
core.statusBar.image.keyboard.src =
|
||||
core.platform.extendKeyboard ? core.statusBar.icons.keyboard.src : core.statusBar.icons.shop.src;
|
||||
core.statusBar.image.keyboard.src = core.statusBar.icons.keyboard.src;
|
||||
core.statusBar.image.shop.style.opacity = 1;
|
||||
|
||||
core.statusBar.image.save.src = core.statusBar.icons.save.src;
|
||||
|
||||
@ -2890,21 +2884,23 @@ control.prototype.setToolbarButton = function (useButton) {
|
||||
|
||||
core.domStyle.toolbarBtn = useButton;
|
||||
if (useButton) {
|
||||
["book","fly","toolbox","keyboard","save","load","settings"].forEach(function (t) {
|
||||
["book","fly","toolbox","keyboard","shop","save","load","settings"].forEach(function (t) {
|
||||
core.statusBar.image[t].style.display = 'none';
|
||||
});
|
||||
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
|
||||
["btn1","btn2","btn3","btn4","btn5","btn6","btn7","btn8"].forEach(function (t) {
|
||||
core.statusBar.image[t].style.display = 'block';
|
||||
})
|
||||
}
|
||||
else {
|
||||
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
|
||||
["btn1","btn2","btn3","btn4","btn5","btn6","btn7","btn8"].forEach(function (t) {
|
||||
core.statusBar.image[t].style.display = 'none';
|
||||
});
|
||||
["book","fly","toolbox","keyboard","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.keyboard.style.display = core.domStyle.isVertical ? "block":"none";
|
||||
core.statusBar.image.keyboard.style.display
|
||||
= core.statusBar.image.shop.style.display
|
||||
= core.domStyle.isVertical ? "block":"none";
|
||||
}
|
||||
}
|
||||
|
||||
@ -3033,13 +3029,13 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
||||
|
||||
toolBarTop = statusBarHeight + canvasWidth;
|
||||
toolBarBorder = '3px '+borderColor+' solid';
|
||||
toolsHeight = scale * BASE_LINEHEIGHT;
|
||||
toolsHeight = scale * BASE_LINEHEIGHT * 0.95;
|
||||
toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4;
|
||||
toolsBackground = (core.status.globalAttribute||core.initStatus.globalAttribute).toolsBackground;
|
||||
borderRight = '3px '+borderColor+' solid';
|
||||
|
||||
margin = scale * SPACE * 2;
|
||||
toolsMargin = scale * SPACE * 4;
|
||||
toolsMargin = scale * SPACE * 3;
|
||||
fontSize = DEFAULT_FONT_SIZE * scale;
|
||||
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
|
||||
musicBtnRight = 3;
|
||||
|
||||
@ -2836,6 +2836,7 @@ ui.prototype.drawPaint = function () {
|
||||
core.setStrokeStyle('paint', '#FF0000');
|
||||
|
||||
core.statusBar.image.keyboard.style.opacity = 0;
|
||||
core.statusBar.image.shop.style.opacity = 0;
|
||||
|
||||
core.statusBar.image.book.src = core.statusBar.icons.paint.src;
|
||||
core.statusBar.image.fly.src = core.statusBar.icons.erase.src;
|
||||
|
||||
66
main.js
66
main.js
@ -100,6 +100,7 @@ function main() {
|
||||
'fly': document.getElementById("img-fly"),
|
||||
'toolbox': document.getElementById("img-toolbox"),
|
||||
'keyboard': document.getElementById("img-keyboard"),
|
||||
'shop': document.getElementById('img-shop'),
|
||||
'save': document.getElementById("img-save"),
|
||||
'load': document.getElementById("img-load"),
|
||||
'settings': document.getElementById("img-settings"),
|
||||
@ -109,7 +110,8 @@ function main() {
|
||||
'btn4': document.getElementById("img-btn4"),
|
||||
'btn5': document.getElementById("img-btn5"),
|
||||
'btn6': document.getElementById("img-btn6"),
|
||||
'btn7': document.getElementById("img-btn7")
|
||||
'btn7': document.getElementById("img-btn7"),
|
||||
'btn8': document.getElementById("img-btn8"),
|
||||
},
|
||||
'icons': {
|
||||
'floor': 0,
|
||||
@ -127,30 +129,31 @@ function main() {
|
||||
'fly': 11,
|
||||
'toolbox': 12,
|
||||
'keyboard': 13,
|
||||
'save': 14,
|
||||
'load': 15,
|
||||
'settings': 16,
|
||||
'play': 17,
|
||||
'pause': 18,
|
||||
'stop': 19,
|
||||
'speedDown': 20,
|
||||
'speedUp': 21,
|
||||
'rewind': 22,
|
||||
'equipbox': 23,
|
||||
'mana': 24,
|
||||
'skill': 25,
|
||||
'paint': 26,
|
||||
'erase': 27,
|
||||
'empty': 28,
|
||||
'exit': 29,
|
||||
'btn1': 30,
|
||||
'btn2': 31,
|
||||
'btn3': 32,
|
||||
'btn4': 33,
|
||||
'btn5': 34,
|
||||
'btn6': 35,
|
||||
'btn7': 36,
|
||||
'shop': 37
|
||||
'shop': 14,
|
||||
'save': 15,
|
||||
'load': 16,
|
||||
'settings': 17,
|
||||
'play': 18,
|
||||
'pause': 19,
|
||||
'stop': 20,
|
||||
'speedDown': 21,
|
||||
'speedUp': 22,
|
||||
'rewind': 23,
|
||||
'equipbox': 24,
|
||||
'mana': 25,
|
||||
'skill': 26,
|
||||
'paint': 27,
|
||||
'erase': 28,
|
||||
'empty': 29,
|
||||
'exit': 30,
|
||||
'btn1': 31,
|
||||
'btn2': 32,
|
||||
'btn3': 33,
|
||||
'btn4': 34,
|
||||
'btn5': 35,
|
||||
'btn6': 36,
|
||||
'btn7': 37,
|
||||
'btn8': 38
|
||||
},
|
||||
'floor': document.getElementById('floor'),
|
||||
'name': document.getElementById('name'),
|
||||
@ -509,6 +512,14 @@ main.statusBar.image.keyboard.onclick = function (e) {
|
||||
main.core.openKeyBoard(true);
|
||||
}
|
||||
|
||||
////// 点击状态栏中的快捷商店键盘时 //////
|
||||
main.statusBar.image.shop.onclick = function (e) {
|
||||
e.stopPropagation();
|
||||
|
||||
if (main.core.isPlaying())
|
||||
main.core.openQuickShop(true);
|
||||
}
|
||||
|
||||
////// 点击状态栏中的存档按钮时 //////
|
||||
main.statusBar.image.save.onclick = function (e) {
|
||||
e.stopPropagation();
|
||||
@ -606,6 +617,11 @@ main.statusBar.image.btn7.onclick = function (e) {
|
||||
main.core.onkeyUp({"keyCode": 55});
|
||||
};
|
||||
|
||||
main.statusBar.image.btn8.onclick = function (e) {
|
||||
e.stopPropagation();
|
||||
main.core.onkeyUp({"keyCode": 56});
|
||||
};
|
||||
|
||||
////// 点击“开始游戏”时 //////
|
||||
main.dom.playGame.onclick = function () {
|
||||
main.dom.startButtons.style.display='none';
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
Loading…
Reference in New Issue
Block a user