modloader.c 549 B

1234567891011121314151617181920212223242526
  1. class ModLoader
  2. {
  3. protected static bool m_Loaded;
  4. protected static ref array<ref ModStructure> m_Mods;
  5. static array<ref ModStructure> GetMods()
  6. {
  7. //if( !m_Loaded )
  8. LoadMods();
  9. return m_Mods;
  10. }
  11. static void LoadMods()
  12. {
  13. m_Mods = new array<ref ModStructure>;
  14. int mod_count = GetGame().ConfigGetChildrenCount( "CfgMods" );
  15. for( int i = 2; i < mod_count; i++ )
  16. {
  17. string mod_name;
  18. GetGame().ConfigGetChildName( "CfgMods", i, mod_name );
  19. m_Mods.Insert( new ModStructure( i, "CfgMods " + mod_name ) );
  20. }
  21. }
  22. }