修改钥匙的文本描述

增加横屏旋转、竖屏时强制进行提示
修改获得道具时的文本效果
This commit is contained in:
爱的天使Erdnase 2022-11-20 15:50:50 +08:00
parent 4fa77af458
commit 5d79aa9390
2 changed files with 43 additions and 23 deletions

View File

@ -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": {

View File

@ -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);
}