横屏底部工具栏

This commit is contained in:
ckcz123 2021-08-14 21:59:49 +08:00
parent 48f5bd1e57
commit 45c918f180
8 changed files with 94 additions and 67 deletions

View File

@ -4023,8 +4023,8 @@ Global_Value_List
Global_Flag_List
: '显示当前楼层'|'显示勇士图标'|'显示当前等级'|'启用生命上限'|'显示生命值'|'显示魔力值'|'显示攻击力'|'显示防御力'|'显示护盾值'|'显示金币值'|'显示经验值'|'允许等级提升'|'升级扣除模式'|'显示钥匙数量'|'显示绿钥匙'|'显示破炸飞'|'显示毒衰咒'|'显示当前技能'|'楼梯边才能楼传'|'楼传平面塔模式'|'铁门不需要钥匙'|'开启加点'|'开启负伤'|'夹击不超伤害值'|'循环计算临界'|'允许轻按'|'允许走到将死领域'|'允许瞬间移动'|'阻激夹域后禁用快捷商店'|'虚化前景层'
/*Global_Flag_List ['s:enableFloor','s:enableName','s:enableLv', 's:enableHPMax', 's:enableHP', 's:enableMana', 's:enableAtk', 's:enableDef', 's:enableMDef', 's:enableMoney', 's:enableExp', 's:enableLevelUp', 's:levelUpLeftMode', 's:enableKeys', 's:enableGreenKey', 's:enablePZF', 's:enableDebuff', 's:enableSkill', 'flyNearStair', 'flyRecordPosition', 'steelDoorWithoutKey', 'enableAddPoint', 'enableNegativeDamage', 'betweenAttackMax', 'useLoop', 'enableGentleClick', 'canGoDeadZone', 'enableMoveDirectly', 'disableShopOnDamage', 'blurFg']*/;
: '显示当前楼层'|'显示勇士图标'|'显示当前等级'|'启用生命上限'|'显示生命值'|'显示魔力值'|'显示攻击力'|'显示防御力'|'显示护盾值'|'显示金币值'|'显示经验值'|'允许等级提升'|'升级扣除模式'|'显示钥匙数量'|'显示绿钥匙'|'显示破炸飞'|'显示毒衰咒'|'显示当前技能'|'横屏底部工具栏'|'楼梯边才能楼传'|'楼传平面塔模式'|'开启加点'|'开启负伤'|'夹击不超伤害值'|'二分计算临界'|'允许轻按'|'允许走到将死领域'|'允许瞬间移动'|'阻激夹域后禁用快捷商店'|'虚化前景层'
/*Global_Flag_List ['s:enableFloor','s:enableName','s:enableLv', 's:enableHPMax', 's:enableHP', 's:enableMana', 's:enableAtk', 's:enableDef', 's:enableMDef', 's:enableMoney', 's:enableExp', 's:enableLevelUp', 's:levelUpLeftMode', 's:enableKeys', 's:enableGreenKey', 's:enablePZF', 's:enableDebuff', 's:enableSkill', 'extendToolbar', 'flyNearStair', 'flyRecordPosition', 'enableAddPoint', 'enableNegativeDamage', 'betweenAttackMax', 'useLoop', 'enableGentleClick', 'canGoDeadZone', 'enableMoveDirectly', 'disableShopOnDamage', 'blurFg']*/;
NextXY_List
: '横坐标'|'纵坐标'

View File

@ -282,11 +282,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"equipment": {
"_leaf": true,
"_type": "textarea",
"_hide": true,
"_range": "thiseval instanceof Array",
"_data": "初始装备"
},
"items": {
"_type": "object",
"_hide": true,
"_data": {
"constants": {
"_leaf": true,
@ -330,29 +332,32 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"x": {
"_leaf": true,
"_type": "textarea",
"_data": "初始x坐标"
"_data": "坐标"
},
"y": {
"_leaf": true,
"_type": "textarea",
"_data": "初始y坐标"
"_data": "坐标"
}
}
},
"flags": {
"_leaf": true,
"_type": "textarea",
"_hide": true,
"_range": "thiseval instanceof Object && !(thiseval instanceof Array)",
"_data": "游戏变量"
},
"followers": {
"_leaf": true,
"_type": "disable",
"_hide": true,
"_data": "跟随者"
},
"steps": {
"_leaf": true,
"_type": "disable",
"_hide": true,
"_data": "行走步数"
}
}
@ -475,6 +480,12 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "全局帧动画时间",
"_data": "全局帧动画时间即怪物振动频率一般300比较合适"
},
"moveSpeed": {
"_leaf": true,
"_type": "textarea",
"_docs": "勇士移速",
"_data": "勇士每一格的移速默认是100此项可被用户修改覆盖"
},
"statusCanvasRowsOnMobile": {
"_leaf": true,
"_type": "select",
@ -542,6 +553,12 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
},
"_data": "状态栏显示项"
},
"extendToolbar": {
"_leaf": true,
"_type": "checkbox",
"_docs": "横屏底部工具栏",
"_data": "在横屏状态下是否将工具栏挪动到游戏画布下方,从而完全解放状态栏空间"
},
"flyNearStair": {
"_leaf": true,
"_type": "checkbox",
@ -554,12 +571,6 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_docs": "楼传开平面模式",
"_data": "传送器平面塔模式;此模式下楼层传送器将飞到上次离开该楼层的位置。"
},
"steelDoorWithoutKey": {
"_leaf": true,
"_type": "checkbox",
"_docs": "铁门不消耗钥匙",
"_data": "铁门是否不需要钥匙开启。如果此项为true则无需钥匙也可以开铁门。"
},
"itemFirstText": {
"_leaf": true,
"_type": "checkbox",
@ -575,13 +586,13 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"enableAddPoint": {
"_leaf": true,
"_type": "checkbox",
"_docs": "加点",
"_docs": "开启加点",
"_data": "是否支持加点"
},
"enableNegativeDamage": {
"_leaf": true,
"_type": "checkbox",
"_docs": "负伤",
"_docs": "开启负伤",
"_data": "是否支持负伤害(回血)"
},
"betweenAttackMax": {
@ -611,27 +622,9 @@ var data_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"enableEnemyPoint": {
"_leaf": true,
"_type": "checkbox",
"_docs": "",
"_docs": "定点怪显",
"_data": "是否开启怪物的定点显示功能,即属性不同的怪物会在怪物手册单列;用户可以手动在菜单栏中开关"
},
"displayEnemyDamage": {
"_leaf": true,
"_type": "checkbox",
"_docs": "怪物显伤",
"_data": "是否地图怪物显伤;用户可以手动在菜单栏中开关"
},
"displayCritical": {
"_leaf": true,
"_type": "checkbox",
"_docs": "临界显伤",
"_data": "是否地图显示临界;用户可以手动在菜单栏中开关"
},
"displayExtraDamage": {
"_leaf": true,
"_type": "checkbox",
"_docs": "高级显伤",
"_data": "是否地图高级显伤(领域、夹击等);用户可以手动在菜单栏中开关"
},
"enableGentleClick": {
"_leaf": true,
"_type": "checkbox",

View File

@ -3079,11 +3079,11 @@ control.prototype.hideStatusBar = function (showToolbox) {
// 隐藏
for (var i = 0; i < statusItems.length; ++i)
statusItems[i].style.opacity = 0;
if (!core.domStyle.isVertical || !showToolbox) {
if ((!core.domStyle.isVertical && !core.flags.extendToolbar) || !showToolbox) {
for (var i = 0; i < toolItems.length; ++i)
toolItems[i].style.display = 'none';
}
if (!core.domStyle.isVertical) {
if (!core.domStyle.isVertical && !core.flags.extendToolbar) {
core.dom.toolBar.style.display = 'none';
}
}
@ -3113,7 +3113,7 @@ control.prototype.updateHeroIcon = function (name) {
control.prototype.setToolbarButton = function (useButton) {
if (!core.domStyle.showStatusBar) {
// 隐藏状态栏时检查竖屏
if (!core.domStyle.isVertical) {
if (!core.domStyle.isVertical && !core.flags.extendToolbar) {
for (var i = 0; i < core.dom.tools.length; ++i)
core.dom.tools[i].style.display = 'none';
return;
@ -3123,7 +3123,7 @@ control.prototype.setToolbarButton = function (useButton) {
}
if (useButton == null) useButton = core.domStyle.toolbarBtn;
if (!core.domStyle.isVertical || core.isReplaying()) useButton = false;
if ((!core.domStyle.isVertical && !core.flags.extendToolbar) || core.isReplaying()) useButton = false;
core.domStyle.toolbarBtn = useButton;
if (useButton) {
@ -3144,7 +3144,7 @@ control.prototype.setToolbarButton = function (useButton) {
});
core.statusBar.image.keyboard.style.display
= core.statusBar.image.shop.style.display
= core.domStyle.isVertical ? "block":"none";
= core.domStyle.isVertical || core.flags.extendToolbar ? "block":"none";
}
}
@ -3217,19 +3217,22 @@ control.prototype.resize = function() {
var clientWidth = main.dom.body.clientWidth, clientHeight = main.dom.body.clientHeight;
var CANVAS_WIDTH = core.__PIXELS__, BAR_WIDTH = Math.round(core.__PIXELS__ * 0.31);
var BORDER = 3;
var extendToolbar = core.flags.extendToolbar;
if (clientWidth - 3 * BORDER >= CANVAS_WIDTH + BAR_WIDTH || (clientWidth > clientHeight && clientHeight - 2 * BORDER < CANVAS_WIDTH)) {
var horizontalMaxRatio = (clientHeight - 2 * BORDER - (extendToolbar ? BORDER : 0)) / (CANVAS_WIDTH + (extendToolbar ? 38 : 0));
if (clientWidth - 3 * BORDER >= CANVAS_WIDTH + BAR_WIDTH || (clientWidth > clientHeight && horizontalMaxRatio < 1)) {
// 横屏
core.domStyle.isVertical = false;
core.domStyle.availableScale = [];
[1, 1.25, 1.5, 1.75, 2].forEach(function (v) {
if (clientWidth - 3 * BORDER >= v*(CANVAS_WIDTH + BAR_WIDTH) && clientHeight - 2 * BORDER >= v * CANVAS_WIDTH) {
core.domStyle.availableScale.push(v); // 64x64
if (clientWidth - 3 * BORDER >= v*(CANVAS_WIDTH + BAR_WIDTH) && horizontalMaxRatio >= v) {
core.domStyle.availableScale.push(v);
}
});
if (core.domStyle.availableScale.indexOf(core.domStyle.scale) < 0) {
core.domStyle.scale = Math.min(1, (clientHeight - 2 * BORDER) / CANVAS_WIDTH);
core.domStyle.scale = Math.min(1, horizontalMaxRatio);
}
}
else {
@ -3237,6 +3240,7 @@ control.prototype.resize = function() {
core.domStyle.isVertical = true;
core.domStyle.scale = Math.min(1, (clientWidth - 2 * BORDER) / CANVAS_WIDTH);
core.domStyle.availableScale = [];
extendToolbar = false;
}
var statusDisplayArr = this._shouldDisplayStatus(), count = statusDisplayArr.length;
@ -3254,6 +3258,7 @@ control.prototype.resize = function() {
CANVAS_WIDTH: CANVAS_WIDTH,
BORDER: BORDER,
BAR_WIDTH: BAR_WIDTH,
TOOLBAR_HEIGHT: extendToolbar ? 38 : 44,
outerSize: CANVAS_WIDTH * core.domStyle.scale + 2 * BORDER,
globalAttribute: globalAttribute,
border: '3px ' + core.arrayToRGBA(globalAttribute.borderColor) + ' solid',
@ -3262,6 +3267,7 @@ control.prototype.resize = function() {
col: col,
statusBarHeightInVertical: core.domStyle.isVertical ? (32 * col + 6) * core.domStyle.scale + 2 * BORDER : 0,
toolbarHeightInVertical: core.domStyle.isVertical ? 44 * core.domStyle.scale + 2 * BORDER : 0,
extendToolbar: extendToolbar,
is15x15: core.__SIZE__ == 15
};
@ -3285,7 +3291,7 @@ control.prototype._resize_gameGroup = function (obj) {
}
else {
totalWidth = obj.outerSize + obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER;
totalHeight = obj.outerSize;
totalHeight = obj.outerSize + (obj.extendToolbar ? obj.TOOLBAR_HEIGHT * core.domStyle.scale + obj.BORDER : 0);
}
gameGroup.style.width = totalWidth + "px";
gameGroup.style.height = totalHeight + "px";
@ -3354,10 +3360,14 @@ control.prototype._resize_statusBar = function (obj) {
}
else {
statusBar.style.width = (obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER) + "px";
statusBar.style.height = obj.outerSize + "px";
statusBar.style.height = obj.outerSize + (obj.extendToolbar ? obj.TOOLBAR_HEIGHT * core.domStyle.scale + obj.BORDER : 0) + "px";
statusBar.style.background = obj.globalAttribute.statusLeftBackground;
// --- 计算文字大小
statusBar.style.fontSize = 16 * Math.min(1, (core.__HALF_SIZE__ + 3) / obj.count) * core.domStyle.scale + "px";
if (obj.extendToolbar) {
statusBar.style.fontSize = 16 * core.domStyle.scale + "px";
} else {
statusBar.style.fontSize = 16 * Math.min(1, (core.__HALF_SIZE__ + 3) / obj.count) * core.domStyle.scale + "px";
}
}
statusBar.style.display = 'block';
statusBar.style.borderTop = statusBar.style.borderLeft = obj.border;
@ -3371,14 +3381,19 @@ control.prototype._resize_statusBar = function (obj) {
}
else {
core.dom.statusCanvas.style.width = obj.BAR_WIDTH * core.domStyle.scale + "px";
core.dom.statusCanvas.style.height = obj.outerSize - 2 * obj.BORDER + "px";
core.maps._setHDCanvasSize(core.dom.statusCanvasCtx, obj.BAR_WIDTH, obj.CANVAS_WIDTH);
core.dom.statusCanvas.style.height = obj.outerSize - 2 * obj.BORDER + (obj.extendToolbar ? obj.TOOLBAR_HEIGHT * core.domStyle.scale + obj.BORDER : 0) + "px";
core.maps._setHDCanvasSize(core.dom.statusCanvasCtx, obj.BAR_WIDTH, obj.CANVAS_WIDTH + (obj.extendToolbar ? obj.TOOLBAR_HEIGHT + obj.BORDER : 0));
}
core.dom.statusCanvas.style.display = core.flags.statusCanvas ? "block" : "none";
}
control.prototype._resize_status = function (obj) {
var statusHeight = (core.domStyle.isVertical ? 1 : (core.__HALF_SIZE__ + obj.BORDER) / obj.count) * 32 * core.domStyle.scale * 0.8;
var statusHeight;
if (core.domStyle.isVertical) {
statusHeight = 32 * core.domStyle.scale * 0.8;
} else {
statusHeight = (obj.extendToolbar ? core.__SIZE__ : core.__HALF_SIZE__ + 3) / obj.count * 32 * core.domStyle.scale * 0.8;
}
// status
for (var i = 0; i < core.dom.status.length; ++i) {
var id = core.dom.status[i].id, style = core.dom.status[i].style;
@ -3412,22 +3427,35 @@ control.prototype._resize_toolBar = function (obj) {
// toolBar
var toolBar = core.dom.toolBar;
if (core.domStyle.isVertical) {
toolBar.style.left = 0;
toolBar.style.right = "";
toolBar.style.width = obj.outerSize + "px";
toolBar.style.top = obj.statusBarHeightInVertical + obj.outerSize + "px";
toolBar.style.height = obj.toolbarHeightInVertical + "px";
toolBar.style.background = obj.globalAttribute.toolsBackground;
}
else {
toolBar.style.width = obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER + "px";
toolBar.style.top = 0.718 * obj.outerSize + "px";
toolBar.style.height = 0.281 * obj.outerSize + "px";
toolBar.style.background = 'transparent';
if (obj.extendToolbar) {
toolBar.style.left = "";
toolBar.style.right = 0;
toolBar.style.width = obj.outerSize + "px";
toolBar.style.top = obj.outerSize + "px";
toolBar.style.height = obj.TOOLBAR_HEIGHT * core.domStyle.scale + obj.BORDER + "px";
toolBar.style.background = obj.globalAttribute.toolsBackground;
} else {
toolBar.style.left = 0;
toolBar.style.right = "";
toolBar.style.width = obj.BAR_WIDTH * core.domStyle.scale + obj.BORDER + "px";
toolBar.style.top = 0.718 * obj.outerSize + "px";
toolBar.style.height = 0.281 * obj.outerSize + "px";
toolBar.style.background = 'transparent';
}
}
toolBar.style.borderLeft = obj.border;
toolBar.style.borderRight = toolBar.style.borderBottom = core.domStyle.isVertical ? obj.border : '';
toolBar.style.borderRight = toolBar.style.borderBottom = core.domStyle.isVertical || obj.extendToolbar ? obj.border : '';
toolBar.style.fontSize = 16 * core.domStyle.scale + "px";
if (!core.domStyle.showStatusBar && !core.domStyle.isVertical) {
if (!core.domStyle.showStatusBar && !core.domStyle.isVertical && !obj.extendToolbar) {
toolBar.style.display = 'none';
} else {
toolBar.style.display = 'block';
@ -3435,9 +3463,9 @@ control.prototype._resize_toolBar = function (obj) {
}
control.prototype._resize_tools = function (obj) {
var toolsHeight = 32 * core.domStyle.scale * (core.domStyle.isVertical && !obj.is15x15 ? 0.95 : 1);
var toolsHeight = 32 * core.domStyle.scale * ((core.domStyle.isVertical || obj.extendToolbar) && !obj.is15x15 ? 0.95 : 1);
var toolsMarginLeft;
if (core.domStyle.isVertical)
if (core.domStyle.isVertical || obj.extendToolbar)
toolsMarginLeft = (core.__HALF_SIZE__ - 3) * 3 * core.domStyle.scale;
else
toolsMarginLeft = (obj.BAR_WIDTH * core.domStyle.scale - 9 - toolsHeight * 3) / 4;
@ -3445,10 +3473,10 @@ control.prototype._resize_tools = function (obj) {
var style = core.dom.tools[i].style;
style.height = toolsHeight + "px";
style.marginLeft = toolsMarginLeft + "px";
style.marginTop = 6 * core.domStyle.scale + "px"
style.marginTop = (obj.extendToolbar ? 3 : 6) * core.domStyle.scale + "px"
}
core.dom.hard.style.lineHeight = toolsHeight + "px";
if (core.domStyle.isVertical) {
if (core.domStyle.isVertical || obj.extendToolbar) {
core.dom.hard.style.width = obj.outerSize - 9 * toolsMarginLeft - 8.5 * toolsHeight - 12 + "px";
}
else {

View File

@ -358,14 +358,14 @@ core.prototype._init_flags = function () {
core.prototype._init_sys_flags = function () {
if (core.flags.equipboxButton) core.flags.equipment = true;
core.flags.displayEnemyDamage = core.getLocalStorage('enemyDamage', core.flags.displayEnemyDamage);
core.flags.displayCritical = core.getLocalStorage('critical', core.flags.displayCritical);
core.flags.displayExtraDamage = core.getLocalStorage('extraDamage', core.flags.displayExtraDamage);
core.flags.displayEnemyDamage = core.getLocalStorage('enemyDamage', true);
core.flags.displayCritical = core.getLocalStorage('critical', true);
core.flags.displayExtraDamage = core.getLocalStorage('extraDamage', true);
core.flags.enableEnemyPoint = core.getLocalStorage('enableEnemyPoint', core.flags.enableEnemyPoint);
core.flags.leftHandPrefer = core.getLocalStorage('leftHandPrefer', false);
core.flags.extraDamageType = core.getLocalStorage('extraDamageType', 0);
// 行走速度
core.values.moveSpeed = core.getLocalStorage('moveSpeed', 100);
core.values.moveSpeed = core.getLocalStorage('moveSpeed', core.values.moveSpeed || 100);
core.values.floorChangeTime = core.getLocalStorage('floorChangeTime', core.values.floorChangeTime);
if (core.values.floorChangeTime == null) core.values.floorChangeTime = 500;
core.flags.enableHDCanvas = core.getLocalStorage('enableHDCanvas', !core.platform.isIOS);

View File

@ -634,6 +634,15 @@ main.statusBar.image.money.onclick = function (e) {
main.core.openQuickShop(true);
}
////// 点击楼梯图标也可以浏览地图 //////
main.statusBar.image.floor.onclick = function (e) {
e.stopPropagation();
if (main.core && main.core.isPlaying() && !core.isMoving() && !core.status.lockControl) {
core.ui._drawViewMaps();
}
}
////// 点击状态栏中的存档按钮时 //////
main.statusBar.image.save.onclick = function (e) {
e.stopPropagation();

View File

@ -698,7 +698,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"counterAttack": 0.1,
"purify": 3,
"hatred": 2,
"animateSpeed": 400,
"animateSpeed": 300,
"moveSpeed": 100,
"statusCanvasRowsOnMobile": 3,
"floorChangeTime": 500
},
@ -712,9 +713,9 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"enableMoney",
"enableKeys"
],
"extendToolbar": false,
"flyNearStair": true,
"flyRecordPosition": false,
"steelDoorWithoutKey": false,
"itemFirstText": false,
"equipboxButton": false,
"enableAddPoint": false,
@ -724,9 +725,6 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startUsingCanvas": false,
"statusCanvas": false,
"enableEnemyPoint": true,
"displayEnemyDamage": true,
"displayCritical": true,
"displayExtraDamage": true,
"enableGentleClick": true,
"ignoreChangeFloor": true,
"canGoDeadZone": false,

View File

@ -958,7 +958,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// px和py为点击的像素坐标
// vertical为录像播放过程中的横竖屏信息
//
// 横屏模式下状态栏的画布大小是 129*416
// 横屏模式下状态栏的画布大小是 129*416 (开启拓展装备栏后是 129*457
// 竖屏模式下状态栏的画布大小是 416*(32*rows+9) 其中rows为状态栏行数即全塔属性中statusCanvasRowsOnMobile值
// 可以使用 _isVertical() 来判定当前是否是竖屏模式

View File

@ -247,7 +247,6 @@
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
display: none;
left: 0;
padding: 3px;
}
#toolBar .tools{