Opening is working.
This commit is contained in:
		
					parent
					
						
							
								2023360149
							
						
					
				
			
			
				commit
				
					
						061883ced0
					
				
			
		
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -11,6 +11,14 @@ void Controller::control_menu() const noexcept {
 | 
			
		|||
		if (ifd::FileDialog::Instance().HasResult()) {
 | 
			
		||||
			fs::path str = ifd::FileDialog::Instance().GetResult();
 | 
			
		||||
			SPDLOG_DEBUG("path opening: {}", str.string());
 | 
			
		||||
			const auto filename = str.filename();
 | 
			
		||||
			const auto save_path = str.remove_filename();
 | 
			
		||||
			menu_data.set_filename(*this, filename);
 | 
			
		||||
			menu_data.set_save_path(*this, save_path);
 | 
			
		||||
			std::ifstream file{ save_path / filename };
 | 
			
		||||
			json j = json::parse(file);
 | 
			
		||||
			file.close();
 | 
			
		||||
			sheet = j.at("character_sheet").get<character::CharacterSheet>();
 | 
			
		||||
		}
 | 
			
		||||
		ifd::FileDialog::Instance().Close();
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue