mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-05 19:44:32 +08:00
全屏游戏
This commit is contained in:
1 parent
2687a0e50b
commit
f3938bf1bb
9 files changed
+175
-91
No files matched your search
@@ -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