mirror of
				https://github.com/unanmed/HumanBreak.git
				synced 2025-10-31 12:12:58 +08:00 
			
		
		
		
	fix: 读档报错
This commit is contained in:
		
							parent
							
								
									1bfad1d5e7
								
							
						
					
					
						commit
						32184d23a2
					
				| @ -407,6 +407,10 @@ export class HeroRenderer | |||||||
|             this.animateTick(time); |             this.animateTick(time); | ||||||
|             this.moveTick(time); |             this.moveTick(time); | ||||||
|         }); |         }); | ||||||
|  |         if (core.status.hero) { | ||||||
|  |             const image = core.status.hero.image; | ||||||
|  |             this.setImage(core.material.images.images[image]); | ||||||
|  |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     onDestroy(layer: Layer): void { |     onDestroy(layer: Layer): void { | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ import { | |||||||
|     SetupComponentOptions, |     SetupComponentOptions, | ||||||
|     UIComponentProps |     UIComponentProps | ||||||
| } from '@motajs/system-ui'; | } from '@motajs/system-ui'; | ||||||
| import { defineComponent, ref, computed, watch } from 'vue'; | import { defineComponent, ref, computed, watch, nextTick } from 'vue'; | ||||||
| import { Page, PageExpose } from '../components'; | import { Page, PageExpose } from '../components'; | ||||||
| import { useKey } from '../use'; | import { useKey } from '../use'; | ||||||
| import { MAP_WIDTH, MAP_HEIGHT } from '../shared'; | import { MAP_WIDTH, MAP_HEIGHT } from '../shared'; | ||||||
| @ -423,8 +423,9 @@ export async function saveSave( | |||||||
|         } |         } | ||||||
|     }; |     }; | ||||||
|     const index = await selectSave(controller, loc, validate, props); |     const index = await selectSave(controller, loc, validate, props); | ||||||
|     if (index === -2) return; |     if (index === -2) return false; | ||||||
|     core.doSL(index + 1, 'save'); |     core.doSL(index + 1, 'save'); | ||||||
|  |     return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| export async function saveLoad( | export async function saveLoad( | ||||||
| @ -436,10 +437,11 @@ export async function saveLoad( | |||||||
|         return { message: '无效的存档!', valid: exist }; |         return { message: '无效的存档!', valid: exist }; | ||||||
|     }; |     }; | ||||||
|     const index = await selectSave(controller, loc, validate, props); |     const index = await selectSave(controller, loc, validate, props); | ||||||
|     if (index === -2) return; |     if (index === -2) return false; | ||||||
|     if (index === -1) { |     if (index === -1) { | ||||||
|         core.doSL('autosave', 'load'); |         core.doSL('autosave', 'load'); | ||||||
|     } else { |     } else { | ||||||
|         core.doSL(index + 1, 'load'); |         core.doSL(index + 1, 'load'); | ||||||
|     } |     } | ||||||
|  |     return true; | ||||||
| } | } | ||||||
|  | |||||||
| @ -7,6 +7,7 @@ import { | |||||||
| import { defineComponent, nextTick, onMounted, ref } from 'vue'; | import { defineComponent, nextTick, onMounted, ref } from 'vue'; | ||||||
| import { MAIN_HEIGHT, MAIN_WIDTH } from '../shared'; | import { MAIN_HEIGHT, MAIN_WIDTH } from '../shared'; | ||||||
| import { | import { | ||||||
|  |     ElementLocator, | ||||||
|     IActionEvent, |     IActionEvent, | ||||||
|     MotaOffscreenCanvas2D, |     MotaOffscreenCanvas2D, | ||||||
|     Shader, |     Shader, | ||||||
| @ -169,8 +170,13 @@ export const GameTitle = defineComponent<GameTitleProps>(props => { | |||||||
|         buttonsAlpha.set(1); |         buttonsAlpha.set(1); | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     const loadGame = () => { |     const loadGame = async () => { | ||||||
|         saveLoad(props.controller, [0, 0, MAIN_WIDTH, MAIN_HEIGHT]); |         const loc: ElementLocator = [0, 0, MAIN_WIDTH, MAIN_HEIGHT]; | ||||||
|  |         const success = await saveLoad(props.controller, loc); | ||||||
|  |         if (success) { | ||||||
|  |             props.controller.close(props.instance); | ||||||
|  |             props.controller.open(MainSceneUI, {}); | ||||||
|  |         } | ||||||
|     }; |     }; | ||||||
| 
 | 
 | ||||||
|     const replay = () => { |     const replay = () => { | ||||||
|  | |||||||
| @ -2147,7 +2147,7 @@ control.prototype._doSL_load_afterGet = function (id, data) { | |||||||
|     Mota.r(() => { |     Mota.r(() => { | ||||||
|         Mota.require('@user/legacy-plugin-client').end(false); |         Mota.require('@user/legacy-plugin-client').end(false); | ||||||
|     }); |     }); | ||||||
|     core.ui.closePanel(); |     // core.ui.closePanel();
 | ||||||
|     core.loadData(data, function () { |     core.loadData(data, function () { | ||||||
|         core.removeFlag('__fromLoad__'); |         core.removeFlag('__fromLoad__'); | ||||||
|         core.drawTip('读档成功'); |         core.drawTip('读档成功'); | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user