Replace quickShop with keyboard

This commit is contained in:
oc 2019-01-03 23:37:24 +08:00
parent ad25b63bd4
commit 05693a1a81
8 changed files with 27 additions and 22 deletions

View File

@ -29,7 +29,7 @@ main.dom.data.ontouchend // 手指离开触摸屏时
main.statusBar.image.book.onclick // 点击状态栏中的怪物手册时
main.statusBar.image.fly.onclick // 点击状态栏中的楼层传送器时
main.statusBar.image.toolbox.onclick // 点击状态栏中的工具箱时
main.statusBar.image.shop.onclick // 点击状态栏中的快捷商店时
main.statusBar.image.keyboard.onclick // 点击状态栏中的快捷商店时
main.statusBar.image.save.onclick // 点击状态栏中的存档按钮时
main.statusBar.image.load.onclick // 点击状态栏中的读档按钮时
main.statusBar.image.settings.onclick // 点击状态栏中的系统菜单时

View File

@ -118,7 +118,7 @@
<img class="tools" id='img-book'>
<img class="tools" id='img-fly'>
<img class="tools" id='img-toolbox'>
<img class="tools" id='img-shop'>
<img class="tools" id='img-keyboard'>
<img class="tools" id='img-save'>
<img class="tools" id='img-load'>
<img class="tools" id='img-settings'>

View File

@ -2735,7 +2735,7 @@ actions.prototype.loadPaint = function () {
actions.prototype.exitPaint = function () {
core.deleteCanvas('paint');
core.ui.closePanel();
core.statusBar.image.shop.style.opacity = 1;
core.statusBar.image.keyboard.style.opacity = 1;
core.updateStatusBar();
core.drawTip("退出绘图模式");
}

View File

@ -2039,6 +2039,13 @@ control.prototype.openQuickShop = function (need) {
core.ui.drawQuickShop();
}
control.prototype.openKeyBoard = function (need) {
if (core.isReplaying()) return;
if (!core.checkStatus('keyBoard', need))
return;
core.ui.drawKeyBoard();
}
////// 点击保存按钮时的打开操作 //////
control.prototype.save = function(need) {
if (core.isReplaying()) return;
@ -2665,7 +2672,7 @@ control.prototype.updateStatusBar = function () {
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
core.statusBar.image.shop.src = core.statusBar.icons.book.src;
core.statusBar.image.keyboard.src = core.statusBar.icons.book.src;
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
@ -2689,7 +2696,7 @@ control.prototype.updateStatusBar = function () {
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
core.statusBar.image.shop.src = core.statusBar.icons.shop.src;
core.statusBar.image.keyboard.src = core.statusBar.icons.keyboard.src;
core.statusBar.image.save.src = core.statusBar.icons.save.src;
@ -2825,7 +2832,7 @@ control.prototype.setToolbarButton = function (useButton) {
core.domStyle.toolbarBtn = useButton;
if (useButton) {
["book","fly","toolbox","shop","save","load","settings"].forEach(function (t) {
["book","fly","toolbox","keyboard","save","load","settings"].forEach(function (t) {
core.statusBar.image[t].style.display = 'none';
});
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
@ -2836,10 +2843,10 @@ control.prototype.setToolbarButton = function (useButton) {
["btn1","btn2","btn3","btn4","btn5","btn6","btn7"].forEach(function (t) {
core.statusBar.image[t].style.display = 'none';
});
["book","fly","toolbox","shop","save","load","settings"].forEach(function (t) {
["book","fly","toolbox","keyboard","save","load","settings"].forEach(function (t) {
core.statusBar.image[t].style.display = 'block';
});
core.statusBar.image.shop.style.display = core.domStyle.isVertical ? "block":"none";
core.statusBar.image.keyboard.style.display = core.domStyle.isVertical ? "block":"none";
}
}
@ -2920,8 +2927,6 @@ control.prototype.resize = function(clientWidth, clientHeight) {
var statusLineFontSize = DEFAULT_FONT_SIZE;
if (count>9) statusLineFontSize = statusLineFontSize * 9 / count;
var shopDisplay;
var borderColor = (core.status.globalAttribute||core.initStatus.globalAttribute).borderColor;
statusBarBorder = '3px '+borderColor+' solid';
@ -2947,8 +2952,6 @@ control.prototype.resize = function(clientWidth, clientHeight) {
if(!isHorizontal){ //竖屏
core.domStyle.screenMode = 'vertical';
core.domStyle.isVertical = true;
//显示快捷商店图标
shopDisplay = 'block';
var tempTopBarH = scale * (BASE_LINEHEIGHT * col + SPACE * 2) + 6;
var tempBotBarH = scale * (BASE_LINEHEIGHT + SPACE * 4) + 6;
@ -2986,7 +2989,6 @@ control.prototype.resize = function(clientWidth, clientHeight) {
}else { //横屏
core.domStyle.screenMode = 'horizontal';
core.domStyle.isVertical = false;
shopDisplay = 'none';
gameGroupWidth = tempWidth + DEFAULT_BAR_WIDTH * scale;
gameGroupHeight = tempWidth;
canvasTop = 0;
@ -3021,7 +3023,6 @@ control.prototype.resize = function(clientWidth, clientHeight) {
core.domStyle.scale = 1;
core.domStyle.screenMode = 'bigScreen';
core.domStyle.isVertical = false;
shopDisplay = 'none';
gameGroupWidth = DEFAULT_CANVAS_WIDTH + DEFAULT_BAR_WIDTH;
gameGroupHeight = DEFAULT_CANVAS_WIDTH;
@ -3180,9 +3181,9 @@ control.prototype.resize = function(clientWidth, clientHeight) {
}
},
{
imgId: 'shop',
imgId: 'keyboard',
rules:{
display: shopDisplay && core.domStyle.showStatusBar
display: core.domStyle.isVertical && core.domStyle.showStatusBar
}
},
{

View File

@ -1265,6 +1265,10 @@ core.prototype.openQuickShop = function (need) {
core.control.openQuickShop(need);
}
core.prototype.openKeyBoard = function (need) {
core.control.openKeyBoard(need);
}
////// 点击保存按钮时的打开操作 //////
core.prototype.save = function(need) {
core.control.save(need);

View File

@ -2800,7 +2800,7 @@ ui.prototype.drawPaint = function () {
core.setLineWidth('paint', 3);
core.setStrokeStyle('paint', '#FF0000');
core.statusBar.image.shop.style.opacity = 0;
core.statusBar.image.keyboard.style.opacity = 0;
core.statusBar.image.book.src = core.statusBar.icons.paint.src;
core.statusBar.image.fly.src = core.statusBar.icons.erase.src;

10
main.js
View File

@ -99,7 +99,7 @@ function main() {
'book': document.getElementById("img-book"),
'fly': document.getElementById("img-fly"),
'toolbox': document.getElementById("img-toolbox"),
'shop': document.getElementById("img-shop"),
'keyboard': document.getElementById("img-keyboard"),
'save': document.getElementById("img-save"),
'load': document.getElementById("img-load"),
'settings': document.getElementById("img-settings"),
@ -126,7 +126,7 @@ function main() {
'book': 10,
'fly': 11,
'toolbox': 12,
'shop': 13,
'keyboard': 13,
'save': 14,
'load': 15,
'settings': 16,
@ -481,8 +481,8 @@ main.statusBar.image.toolbox.ondblclick = function (e) {
}
////// 点击状态栏中的快捷商店时 //////
main.statusBar.image.shop.onclick = function (e) {
////// 点击状态栏中的虚拟键盘时 //////
main.statusBar.image.keyboard.onclick = function (e) {
e.stopPropagation();
if (core.isReplaying()) {
@ -491,7 +491,7 @@ main.statusBar.image.shop.onclick = function (e) {
}
if (main.core.isPlaying())
main.core.openQuickShop(true);
main.core.openKeyBoard(true);
}
////// 点击状态栏中的存档按钮时 //////

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB