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