diff --git a/_codelab/_sidebar.md b/_codelab/_sidebar.md index 590fcf44..4ea36a71 100644 --- a/_codelab/_sidebar.md +++ b/_codelab/_sidebar.md @@ -1,4 +1,4 @@ - [第一章:伤害计算函数](L1) - [第二章:特殊属性定义,表格配置](L2) -- [第二章:怪物真实属性](L3) +- [第三章:怪物真实属性](L3) diff --git a/libs/actions.js b/libs/actions.js index 206daa57..be0eb731 100644 --- a/libs/actions.js +++ b/libs/actions.js @@ -2301,6 +2301,11 @@ actions.prototype._clickSwitchs_display = function (x, y) { core.playSound('确定'); return this._clickSwitchs_display_extraDamageType(); case 7: + core.playSound('确定'); + core.setLocalStorage('autoScale', core.getLocalStorage('autoScale') ? false : true); + core.ui._drawSwitchs_display(); + break; + case 8: core.status.event.selection = 1; core.playSound('取消'); core.ui._drawSwitchs(); diff --git a/libs/ui.js b/libs/ui.js index 50a3e48d..80bec762 100644 --- a/libs/ui.js +++ b/libs/ui.js @@ -1953,6 +1953,7 @@ ui.prototype._drawSwitchs_display = function () { "临界显伤: " + (core.flags.displayCritical ? "[ON]" : "[OFF]"), "领域显伤: " + (core.flags.displayExtraDamage ? "[ON]" : "[OFF]"), "领域模式: " + (core.flags.extraDamageType == 2 ? "[最简]" : core.flags.extraDamageType == 1 ? "[半透明]" : "[完整]"), + "自动放缩: " + (core.getLocalStorage('autoScale') ? "[ON]" : "[OFF]"), "返回上一级", ]; this.drawChoices(null, choices); diff --git a/main.js b/main.js index 7b20dc22..f64060c3 100644 --- a/main.js +++ b/main.js @@ -238,16 +238,19 @@ main.prototype.init = function (mode, callback) { main.core.init(coreData, callback); main.core.resize(); // 自动放缩最大化 - try { - if (main.core) { - var index = main.core.domStyle.availableScale.indexOf(core.domStyle.scale); - main.core.control.setDisplayScale(main.core.domStyle.availableScale.length - 1 - index); - if (!main.core.isPlaying() && main.core.flags.enableHDCanvas) { - main.core.domStyle.ratio = Math.max(window.devicePixelRatio || 1, main.core.domStyle.scale); - main.core.resize(); + if (core.getLocalStorage('autoScale') === void 0) core.setLocalStorage('autoScale', true); + if (core.getLocalStorage('autoScale') && !core.domStyle.isVertical) { + try { + if (main.core) { + var index = main.core.domStyle.availableScale.indexOf(core.domStyle.scale); + main.core.control.setDisplayScale(main.core.domStyle.availableScale.length - 1 - index); + if (!main.core.isPlaying() && main.core.flags.enableHDCanvas) { + main.core.domStyle.ratio = Math.max(window.devicePixelRatio || 1, main.core.domStyle.scale); + main.core.resize(); + } } - } - } catch (e) { console.error(e) }; + } catch (e) { console.error(e) }; + } }); }); }); diff --git a/启动服务.exe b/启动服务.exe index 03dcc7ad..6fc2c67b 100644 Binary files a/启动服务.exe and b/启动服务.exe differ