From 5d79aa9390cc4a6969294b38385a1b61c9a10c3d Mon Sep 17 00:00:00 2001 From: Erdnase <1398341065@qq.com> Date: Sun, 20 Nov 2022 15:50:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=92=A5=E5=8C=99=E7=9A=84?= =?UTF-8?q?=E6=96=87=E6=9C=AC=E6=8F=8F=E8=BF=B0=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E6=A8=AA=E5=B1=8F=E6=97=8B=E8=BD=AC=E3=80=81=E7=AB=96=E5=B1=8F?= =?UTF-8?q?=E6=97=B6=E5=BC=BA=E5=88=B6=E8=BF=9B=E8=A1=8C=E6=8F=90=E7=A4=BA?= =?UTF-8?q?=20=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=BE=97=E9=81=93=E5=85=B7?= =?UTF-8?q?=E6=97=B6=E7=9A=84=E6=96=87=E6=9C=AC=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- project/items.js | 6 ++--- project/plugins.js | 60 ++++++++++++++++++++++++++++++---------------- 2 files changed, 43 insertions(+), 23 deletions(-) diff --git a/project/items.js b/project/items.js index f504254..4a417ea 100644 --- a/project/items.js +++ b/project/items.js @@ -3,19 +3,19 @@ var items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a = "yellowKey": { "cls": "tools", "name": "黄钥匙", - "text": "可以打开一扇黄门", + "text": "用来开黄色的门", "hideInToolbox": true }, "blueKey": { "cls": "tools", "name": "蓝钥匙", - "text": "可以打开一扇蓝门", + "text": "用来开蓝色的门", "hideInToolbox": true }, "redKey": { "cls": "tools", "name": "红钥匙", - "text": "可以打开一扇红门", + "text": "用来开红色的门", "hideInToolbox": true }, "redGem": { diff --git a/project/plugins.js b/project/plugins.js index f750e95..10d7a68 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -4,6 +4,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = this._afterLoadResources = function () { // 本函数将在所有资源加载完毕后,游戏开启前被执行 } + try { + window.screen.orientation.lock("landscape-primary"); + } catch (e) {} + core.control.hideStatusBar(); core.control.resize = function () { if (main.mode == 'editor') return; @@ -15,26 +19,39 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = var horizontalMaxRatio = (clientHeight - 2 * BORDER - (extendToolbar ? BORDER : 0)) / (core._PY_ + (extendToolbar ? 38 : 0)); - if (clientWidth - 3 * BORDER >= core._PX_ + BAR_WIDTH || (clientWidth > clientHeight && horizontalMaxRatio < 1)) { - // 横屏 - core.domStyle.isVertical = false; - core.domStyle.availableScale = []; - [1, 1.25, 1.5, 1.75, 2, 2.25, 2.5].forEach(function (v) { - if (clientWidth - 3 * BORDER >= v * (core._PX_ + BAR_WIDTH) && horizontalMaxRatio >= v) { - core.domStyle.availableScale.push(v); - } - }); - if (core.domStyle.availableScale.indexOf(core.domStyle.scale) < 0) { - core.domStyle.scale = Math.min(1, horizontalMaxRatio); + // 横屏 + + + core.domStyle.availableScale = []; + [1, 1.25, 1.5, 1.75, 2, 2.25, 2.5].forEach(function (v) { + if (clientWidth - 3 * BORDER >= v * (core._PX_ + BAR_WIDTH) && horizontalMaxRatio >= v) { + core.domStyle.availableScale.push(v); } + }); + if (core.domStyle.availableScale.indexOf(core.domStyle.scale) < 0) { + core.domStyle.scale = Math.min(1, horizontalMaxRatio); + } + if (clientWidth - 3 * BORDER >= core._PX_ + BAR_WIDTH || (clientWidth > clientHeight && horizontalMaxRatio < 1)) { + core.domStyle.isVertical = false; + core.clearMap('Vertical'); } else { // 竖屏 core.domStyle.isVertical = true; - core.domStyle.scale = Math.min((clientWidth - 2 * BORDER) / core._PX_); - core.domStyle.availableScale = []; - extendToolbar = false; - BAR_WIDTH = Math.round(core._PX_ * 0.3); + core.createCanvas('Vertical', 0, 0, 480, 480, 200); + core.drawWindowSkin('winskin.png', 'Vertical', 30, 150, 400, 100); + core.drawTextContent('Vertical', '\r[#ff8080]强烈建议建议使用最新版浏览器\n开启手机自动旋转功能进行横屏游戏', { + left: 50, + top: 180, + maxWidth: 400, + fontSize: 20, + lineHeight: 20, + bold: true, + }); + // core.domStyle.scale = Math.min((clientWidth - 2 * BORDER) / core._PX_); + // core.domStyle.availableScale = []; + // extendToolbar = false; + // BAR_WIDTH = Math.round(core._PX_ * 0.3); } var statusDisplayArr = this._shouldDisplayStatus(), @@ -516,11 +533,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = hint = core.replaceText(hint); } catch (e) {} if (!core.status.event.id || core.status.event.id == 'action') { - core.insertAction("\t[" + core.material.items[id].name + "," + id + "]\b[center]" + hint + "\n" + - (id.endsWith('Key') ? "(钥匙类道具,遇到对应的门时自动打开)" : - itemCls == 'tools' ? "(消耗类道具,请按T在道具栏使用)" : - itemCls == 'constants' ? "(永久类道具,请按T在道具栏使用)" : - itemCls == 'equips' ? "(装备类道具,请按Q在装备栏进行装备)" : "")); + //core.insertAction("\t[" + core.material.items[id].name + "," + id + "]\b[center]" + hint + "\n" + //+ + // (id.endsWith('Key') ? "(钥匙类道具,遇到对应的门时自动打开)" : + // itemCls == 'tools' ? "(消耗类道具,请按T在道具栏使用)" : + // itemCls == 'constants' ? "(永久类道具,请按T在道具栏使用)" : + // itemCls == 'equips' ? "(装备类道具,请按Q在装备栏进行装备)" : "")); + core.insertAction("\b[center]\\c[32]\\i[" + id + "]\\c[22]" + core.material.items[id].name + '\n\n' + hint + "\n"); + } itemHint.push(id); }