mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-02 00:14:30 +08:00
全屏游戏
This commit is contained in:
1 parent
2687a0e50b
commit
f3938bf1bb
9 files changed
+175
-91
No files matched your search
+29
-27
@@ -1,50 +1,35 @@
|
||||
import { ref, watch } from 'vue';
|
||||
|
||||
/**
|
||||
* 打开和关闭ui时是否展示动画
|
||||
*/
|
||||
/** 打开和关闭ui时是否展示动画 */
|
||||
export const transition = ref(false);
|
||||
|
||||
/**
|
||||
* 道具详细信息
|
||||
*/
|
||||
/** 道具详细信息 */
|
||||
export const itemDetail = ref(true);
|
||||
|
||||
/**
|
||||
* 自动切换技能
|
||||
*/
|
||||
/** 自动切换技能 */
|
||||
export const autoSkill = ref(true);
|
||||
|
||||
/**
|
||||
* 自动放缩
|
||||
*/
|
||||
/** 自动放缩 */
|
||||
export const autoScale = ref(true);
|
||||
|
||||
/**
|
||||
* 是否在地图上展示范围光环
|
||||
*/
|
||||
/** 是否在地图上展示范围光环 */
|
||||
export const showHalo = ref(true);
|
||||
|
||||
/**
|
||||
* 是否展示已学习的技能
|
||||
*/
|
||||
/** 是否展示已学习的技能 */
|
||||
export const showStudied = ref(true);
|
||||
|
||||
/**
|
||||
* 是否使用定点查看功能
|
||||
*/
|
||||
/** 是否使用定点查看功能 */
|
||||
export const useFixed = ref(true);
|
||||
|
||||
/**
|
||||
* 是否使用勇士自动定位功能
|
||||
*/
|
||||
/** 是否使用勇士自动定位功能 */
|
||||
export const autoLocate = ref(true);
|
||||
|
||||
/**
|
||||
* 是否开启抗锯齿
|
||||
*/
|
||||
/** 是否开启抗锯齿 */
|
||||
export const antiAliasing = ref(true);
|
||||
|
||||
/** 是否开启全屏 */
|
||||
export const fullscreen = ref(false);
|
||||
|
||||
watch(transition, n => {
|
||||
core.plugin.transition.value = n;
|
||||
core.setLocalStorage('transition', n);
|
||||
@@ -106,6 +91,7 @@ function reset() {
|
||||
showStudied.value = core.getLocalStorage('showStudied', true);
|
||||
showHalo.value = core.getLocalStorage('showHalo', true);
|
||||
antiAliasing.value = core.getLocalStorage('antiAliasing', false);
|
||||
fullscreen.value = !!document.fullscreenElement;
|
||||
}
|
||||
|
||||
function resetFlag() {
|
||||
@@ -118,6 +104,22 @@ function resetFlag() {
|
||||
autoLocate.value = flags.autoLocate ? true : false;
|
||||
}
|
||||
|
||||
export async function triggerFullscreen() {
|
||||
if (document.fullscreenElement) {
|
||||
await document.exitFullscreen();
|
||||
requestAnimationFrame(() => {
|
||||
core.maxGameScale(1);
|
||||
});
|
||||
fullscreen.value = false;
|
||||
} else {
|
||||
await document.body.requestFullscreen();
|
||||
requestAnimationFrame(() => {
|
||||
core.maxGameScale();
|
||||
});
|
||||
fullscreen.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
export default function init() {
|
||||
return { resetSettings: reset, resetFlagSettings: resetFlag };
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
import list from '../../data/achievement.json';
|
||||
import { has } from '../utils';
|
||||
|
||||
type AchievementList = typeof list;
|
||||
type AchievementType = keyof AchievementList;
|
||||
|
||||
type AchievementData = Record<AchievementType, boolean[]>;
|
||||
|
||||
export default function init() {
|
||||
return {};
|
||||
}
|
||||
@@ -10,5 +13,15 @@ export default function init() {
|
||||
export function completeAchievement(type: AchievementType, index: number) {}
|
||||
|
||||
export function hasCompletedAchievement(type: AchievementType, index: number) {
|
||||
return true;
|
||||
let data = core.getLocalStorage<AchievementData>('achievement');
|
||||
if (!has(data)) {
|
||||
const d = {
|
||||
normal: [],
|
||||
challenge: [],
|
||||
explore: []
|
||||
};
|
||||
data = d;
|
||||
core.setLocalStorage('achievement', d);
|
||||
}
|
||||
return data[type][index] ?? false;
|
||||
}
|
||||
Reference in new issue
Block a user