enableHDCanvas flag

This commit is contained in:
ckcz123 2020-12-06 11:14:29 +08:00
parent 82577b2fe9
commit 128f7cacdd
3 changed files with 16 additions and 5 deletions

View File

@ -2127,14 +2127,16 @@ actions.prototype._clickSwitchs_display = function (x, y) {
if (x == rightGrid || x == rightGrid + 1) return this._clickSwitchs_display_setSize(1);
return;
case 1:
return this._clickSwitchs_display_enemyDamage();
return this._clickSwitchs_display_enableHDCanvas();
case 2:
return this._clickSwitchs_display_critical();
return this._clickSwitchs_display_enemyDamage();
case 3:
return this._clickSwitchs_display_extraDamage();
return this._clickSwitchs_display_critical();
case 4:
return this._clickSwitchs_display_extraDamageType();
return this._clickSwitchs_display_extraDamage();
case 5:
return this._clickSwitchs_display_extraDamageType();
case 6:
core.status.event.selection = 1;
core.ui._drawSwitchs();
return;
@ -2157,6 +2159,13 @@ actions.prototype._clickSwitchs_display_setSize = function (delta) {
core.ui._drawSwitchs_display();
}
actions.prototype._clickSwitchs_display_enableHDCanvas = function () {
core.flags.enableHDCanvas = !core.flags.enableHDCanvas;
core.setLocalStorage('enableHDCanvas', core.flags.enableHDCanvas);
core.drawTip("开关高清UI需刷新页面方可生效");
core.ui._drawSwitchs_display();
}
actions.prototype._clickSwitchs_display_enemyDamage = function () {
core.flags.displayEnemyDamage = !core.flags.displayEnemyDamage;
core.updateDamage();

View File

@ -327,13 +327,14 @@ core.prototype._init_sys_flags = function () {
core.flags.displayExtraDamage = core.getLocalStorage('extraDamage', core.flags.displayExtraDamage);
core.flags.leftHandPrefer = core.getLocalStorage('leftHandPrefer', false);
core.flags.extraDamageType = core.getLocalStorage('extraDamageType', 0);
core.flags.enableHDCanvas = core.getLocalStorage('enableHDCanvas', true);
// 行走速度
core.values.moveSpeed = core.getLocalStorage('moveSpeed', 100);
core.values.floorChangeTime = core.getLocalStorage('floorChangeTime', core.values.floorChangeTime);
if (core.values.floorChangeTime == null) core.values.floorChangeTime = 500;
if (main.mode != 'editor') {
core.domStyle.scale = core.getLocalStorage('scale', 1);
core.domStyle.ratio = Math.max(window.devicePixelRatio || 1, core.domStyle.scale);
if (core.flags.enableHDCanvas) core.domStyle.ratio = Math.max(window.devicePixelRatio || 1, core.domStyle.scale);
}
}

View File

@ -1799,6 +1799,7 @@ ui.prototype._drawSwitchs_display = function () {
core.status.event.id = 'switchs-display';
var choices = [
" < 放缩:" + Math.max(core.domStyle.scale, 1) + "x > ",
"高清画面: " + (core.flags.enableHDCanvas ? "[ON]" : "[OFF]"),
"怪物显伤: " + (core.flags.displayEnemyDamage ? "[ON]" : "[OFF]"),
"临界显伤: " + (core.flags.displayCritical ? "[ON]" : "[OFF]"),
"领域显伤: " + (core.flags.displayExtraDamage ? "[ON]" : "[OFF]"),