mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-11-04 07:02:58 +08:00 
			
		
		
		
	refactor: 完成成就
This commit is contained in:
		
							parent
							
								
									2d3146758b
								
							
						
					
					
						commit
						d178908649
					
				@ -159,7 +159,6 @@
 | 
			
		||||
        </div>
 | 
			
		||||
    </div>
 | 
			
		||||
    <div id="root"></div>
 | 
			
		||||
    <div id="root2"></div>
 | 
			
		||||
    <!-- injection -->
 | 
			
		||||
    <script src='libs/thirdparty/lz-string.min.js'></script>
 | 
			
		||||
    <script src='libs/thirdparty/priority-queue.min.js'></script>
 | 
			
		||||
 | 
			
		||||
@ -276,7 +276,6 @@ mainSetting.on('valueChange', (key, n, o) => {
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const root = document.getElementById('root') as HTMLDivElement;
 | 
			
		||||
const root2 = document.getElementById('root2') as HTMLDivElement;
 | 
			
		||||
 | 
			
		||||
function handleScreenSetting<T extends number | boolean>(
 | 
			
		||||
    key: string,
 | 
			
		||||
@ -318,7 +317,7 @@ function handleScreenSetting<T extends number | boolean>(
 | 
			
		||||
    } else if (key === 'fontSize') {
 | 
			
		||||
        // 字体大小
 | 
			
		||||
        core.setLocalStorage('fontSize', n);
 | 
			
		||||
        root.style.fontSize = root2.style.fontSize = `${n}px`;
 | 
			
		||||
        root.style.fontSize = `${n}px`;
 | 
			
		||||
    } else if (key === 'smoothView') {
 | 
			
		||||
        core.setLocalStorage('smoothView', n);
 | 
			
		||||
    } else if (key === 'criticalGem') {
 | 
			
		||||
 | 
			
		||||
@ -21,9 +21,6 @@ export default function init() {
 | 
			
		||||
    return { completeAchievement, hasCompletedAchievement, addMountSign };
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export const showComplete = ref(false);
 | 
			
		||||
export const completeAchi = ref('explore,1');
 | 
			
		||||
 | 
			
		||||
export const totalPoint = Object.values(list)
 | 
			
		||||
    .map((v: Achievement[]) =>
 | 
			
		||||
        v.reduce((prev, curr) => {
 | 
			
		||||
@ -54,8 +51,7 @@ export function completeAchievement(type: AchievementType, index: number) {
 | 
			
		||||
    if (type === 'explore' && !Object.values(achiDict).includes(index)) {
 | 
			
		||||
        checkCompletionAchievement();
 | 
			
		||||
    }
 | 
			
		||||
    completeAchi.value = `${type},${index}`;
 | 
			
		||||
    showComplete.value = true;
 | 
			
		||||
    mota.ui.fixed.open('completeAchi', { complete: `${type},${index}` });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 | 
			
		||||
@ -25,13 +25,15 @@ import list from '../data/achievement.json';
 | 
			
		||||
import {
 | 
			
		||||
    AchievementType,
 | 
			
		||||
    getNowPoint,
 | 
			
		||||
    showComplete,
 | 
			
		||||
    totalPoint
 | 
			
		||||
} from '../plugin/ui/achievement';
 | 
			
		||||
import { GameUi } from '@/core/main/custom/ui';
 | 
			
		||||
 | 
			
		||||
const height = window.innerHeight;
 | 
			
		||||
 | 
			
		||||
const props = defineProps<{
 | 
			
		||||
    num: number;
 | 
			
		||||
    ui: GameUi;
 | 
			
		||||
    complete: string;
 | 
			
		||||
}>();
 | 
			
		||||
 | 
			
		||||
@ -60,7 +62,7 @@ onMounted(async () => {
 | 
			
		||||
        now.value = Math.floor(nowPoint + point * ratio);
 | 
			
		||||
    });
 | 
			
		||||
    await sleep(4600);
 | 
			
		||||
    showComplete.value = false;
 | 
			
		||||
    mota.ui.fixed.close(props.num);
 | 
			
		||||
});
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user