完善各种ui

This commit is contained in:
AncTe committed 2023-01-11 09:45:18 +08:00
1 parent 7465dd92c8
commit eaa8644df6
22 files changed
+359 -312

No files matched your search

+13 -1
View File
@@ -47,7 +47,19 @@
"text": "自动勇士定位",
"desc": [
"此项会在进入第二章后会起作用。开启后,当勇士处于不同位置打同一个怪物伤害不同时,在地图上使用绿色箭头标出伤害最低的位置,",
"使用红色箭头标出伤害较高的位置,在自动寻路中选择伤害最低的位置。"
"其余方向,伤害越高,箭头颜色越红,同时在自动寻路中选择可以到达的伤害最低的位置。",
"<br>",
"<br>",
"注:如果出现明显卡顿现象可以考虑关闭本设置或自动切换技能设置。"
]
},
"antiAliasing": {
"text": "抗锯齿",
"desc": [
"是否开启抗锯齿。开启后,画面会变得不那么锐利,观感更加舒适;关闭后,可以更好地展现出像素感。",
"<br>",
"<br>",
"此项只对游戏画面起作用,对浏览地图和楼传均不起作用。"
]
},
"showStudied": {
+17
View File
@@ -40,6 +40,11 @@ export const useFixed = ref(true);
*/
export const autoLocate = ref(true);
/**
* 是否开启抗锯齿
*/
export const antiAliasing = ref(true);
watch(transition, n => {
core.plugin.transition.value = n;
core.setLocalStorage('transition', n);
@@ -78,6 +83,17 @@ watch(autoSkill, n => {
core.status.route.push(`set:autoLocate:${n}`);
});
watch(antiAliasing, n => {
core.setLocalStorage('antiAliasing', n);
for (const canvas of core.dom.gameCanvas) {
if (n) {
canvas.classList.remove('no-anti-aliasing');
} else {
canvas.classList.add('no-anti-aliasing');
}
}
});
/**
* 重置设置信息,从localStorage读取即可
*/
@@ -88,6 +104,7 @@ function reset() {
autoScale.value = core.getLocalStorage('autoScale', true);
showStudied.value = core.getLocalStorage('showStudied', true);
showHalo.value = core.getLocalStorage('showHalo', true);
antiAliasing.value = core.getLocalStorage('antiAliasing', false);
}
function resetFlag() {
+2 -2
View File
@@ -75,8 +75,8 @@ export function getDetailedEnemy<I extends EnemyIds>(
}
const damageColor = getDamageColor(enemyInfo.damage);
const detail: DetailedEnemy<I> = Object.assign(enemyInfo, {
critical: critical[0][0],
criticalDamage: critical[0][1],
critical: critical[0]?.[0] ?? '???',
criticalDamage: critical[0]?.[1] ?? '???',
defDamage,
specialColor,
specialText,
+14
View File
@@ -530,6 +530,7 @@ interface IdToCls {
E601: 'enemys';
E602: 'enemys';
E603: 'enemys';
T604: 'terrains';
X20037: 'tileset';
X20038: 'tileset';
X20039: 'tileset';
@@ -561,11 +562,24 @@ interface IdToCls {
X30121: 'tileset';
X30196: 'tileset';
X30204: 'tileset';
X70048: 'tileset';
X70049: 'tileset';
X70050: 'tileset';
X70056: 'tileset';
X70058: 'tileset';
X70064: 'tileset';
X70065: 'tileset';
X70066: 'tileset';
X70112: 'tileset';
X70114: 'tileset';
X70120: 'tileset';
X70122: 'tileset';
X70128: 'tileset';
X70130: 'tileset';
X70184: 'tileset';
X70185: 'tileset';
X70186: 'tileset';
X70200: 'tileset';
X70201: 'tileset';
X70202: 'tileset';
}
+28
View File
@@ -530,6 +530,7 @@ interface IdToNumber {
E601: 601;
E602: 602;
E603: 603;
T604: 604;
X20037: 20037;
X20038: 20038;
X20039: 20039;
@@ -561,13 +562,26 @@ interface IdToNumber {
X30121: 30121;
X30196: 30196;
X30204: 30204;
X70048: 70048;
X70049: 70049;
X70050: 70050;
X70056: 70056;
X70058: 70058;
X70064: 70064;
X70065: 70065;
X70066: 70066;
X70112: 70112;
X70114: 70114;
X70120: 70120;
X70122: 70122;
X70128: 70128;
X70130: 70130;
X70184: 70184;
X70185: 70185;
X70186: 70186;
X70200: 70200;
X70201: 70201;
X70202: 70202;
}
interface NumberToId {
1: 'yellowWall';
@@ -1101,6 +1115,7 @@ interface NumberToId {
601: 'E601';
602: 'E602';
603: 'E603';
604: 'T604';
20037: 'X20037';
20038: 'X20038';
20039: 'X20039';
@@ -1132,11 +1147,24 @@ interface NumberToId {
30121: 'X30121';
30196: 'X30196';
30204: 'X30204';
70048: 'X70048';
70049: 'X70049';
70050: 'X70050';
70056: 'X70056';
70058: 'X70058';
70064: 'X70064';
70065: 'X70065';
70066: 'X70066';
70112: 'X70112';
70114: 'X70114';
70120: 'X70120';
70122: 'X70122';
70128: 'X70128';
70130: 'X70130';
70184: 'X70184';
70185: 'X70185';
70186: 'X70186';
70200: 'X70200';
70201: 'X70201';
70202: 'X70202';
}
+1 -1
View File
@@ -98,7 +98,7 @@ async function calHeight() {
function getLabel(attr: keyof DetailedEnemy) {
if (attr === 'critical') return '临界';
if (attr === 'criticalDamage') return '临界减伤';
if (attr === 'defDamage') return `${core.status.thisMap.ratio}防`;
if (attr === 'defDamage') return `${core.status?.thisMap?.ratio ?? 1}防`;
return core.getStatusLabel(attr);
}
+9
View File
@@ -546,6 +546,8 @@ onMounted(async () => {
thumb = document.getElementById('fly-thumbnail') as HTMLCanvasElement;
thumbCtx = thumb.getContext('2d')!;
const antiAliasing = core.getLocalStorage('antiAliasing', true);
const mapStyle = getComputedStyle(map);
const thumbStyle = getComputedStyle(thumb);
map.width = parseFloat(mapStyle.width) * devicePixelRatio;
@@ -553,6 +555,13 @@ onMounted(async () => {
thumb.width = parseFloat(thumbStyle.width) * devicePixelRatio;
thumb.height = parseFloat(thumbStyle.width) * devicePixelRatio;
if (!antiAliasing) {
requestAnimationFrame(() => {
thumb.classList.add('no-anti-aliasing');
thumbCtx.imageSmoothingEnabled = false;
});
}
Array.from(document.getElementsByClassName('fly-settings')).forEach(v => {
v.addEventListener('click', e => (v as HTMLElement).blur());
});
+12 -1
View File
@@ -58,6 +58,14 @@
autoLocate ? 'ON' : 'OFF'
}}</span
>
<span
class="selectable"
:selected="selected === 'antiAliasing'"
@click="click('antiAliasing')"
>抗锯齿:&nbsp;&nbsp;&nbsp;{{
antiAliasing ? 'ON' : 'OFF'
}}</span
>
<span
class="selectable"
:selected="selected === 'showStudied'"
@@ -83,7 +91,8 @@ import {
showStudied,
showHalo,
useFixed,
autoLocate
autoLocate,
antiAliasing
} from '../plugin/settings';
import settingInfo from '../data/settings.json';
import { has, splitText } from '../plugin/utils';
@@ -124,6 +133,8 @@ function click(id: keyof Settings) {
useFixed.value = !useFixed.value;
} else if (id === 'autoLocate') {
autoLocate.value = !autoLocate.value;
} else if (id === 'antiAliasing') {
antiAliasing.value = !antiAliasing.value;
}
}
</script>