Lua call for loading .spr, .dat, .otb
This commit is contained in:
		
							parent
							
								
									aec577a4b4
								
							
						
					
					
						commit
						27ae54d7d6
					
				| 
						 | 
					@ -55,6 +55,7 @@ bool SpriteManager::loadSpr(std::string file)
 | 
				
			||||||
        m_spritesCount = g_game.getFeature(Otc::GameSpritesU32) ? m_spritesFile->getU32() : m_spritesFile->getU16();
 | 
					        m_spritesCount = g_game.getFeature(Otc::GameSpritesU32) ? m_spritesFile->getU32() : m_spritesFile->getU16();
 | 
				
			||||||
        m_spritesOffset = m_spritesFile->tell();
 | 
					        m_spritesOffset = m_spritesFile->tell();
 | 
				
			||||||
        m_loaded = true;
 | 
					        m_loaded = true;
 | 
				
			||||||
 | 
					        g_lua.callGlobalField("g_sprites", "onLoadSpr", file);
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    } catch(stdext::exception& e) {
 | 
					    } catch(stdext::exception& e) {
 | 
				
			||||||
        g_logger.error(stdext::format("Failed to load sprites from '%s': %s", file, e.what()));
 | 
					        g_logger.error(stdext::format("Failed to load sprites from '%s': %s", file, e.what()));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -91,6 +91,7 @@ bool ThingTypeManager::loadDat(std::string file)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        m_datLoaded = true;
 | 
					        m_datLoaded = true;
 | 
				
			||||||
 | 
					        g_lua.callGlobalField("g_things", "onLoadDat", file);
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    } catch(stdext::exception& e) {
 | 
					    } catch(stdext::exception& e) {
 | 
				
			||||||
        g_logger.error(stdext::format("Failed to read dat '%s': %s'", file, e.what()));
 | 
					        g_logger.error(stdext::format("Failed to read dat '%s': %s'", file, e.what()));
 | 
				
			||||||
| 
						 | 
					@ -171,6 +172,7 @@ void ThingTypeManager::loadOtb(const std::string& file)
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        m_otbLoaded = true;
 | 
					        m_otbLoaded = true;
 | 
				
			||||||
 | 
					        g_lua.callGlobalField("g_things", "onLoadOtb", file);
 | 
				
			||||||
    } catch(std::exception& e) {
 | 
					    } catch(std::exception& e) {
 | 
				
			||||||
        g_logger.error(stdext::format("Failed to load '%s' (OTB file): %s", file, e.what()));
 | 
					        g_logger.error(stdext::format("Failed to load '%s' (OTB file): %s", file, e.what()));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue