/// <summary> /// Loads and executes a new script. /// </summary> /// <param name="scriptPath"></param> /// <param name="module"></param> public bool Load(string scriptPath, hModule module) { var prevParentModule = module.GetPrevious(); if (prevParentModule is null) { prevParentModule.SetPrevious(/* this.field_0x38 */ null); } bool moduleLoaded = ModuleLoad(scriptPath, module); if (moduleLoaded) { return(moduleLoaded); } // if path is absolute // do something.. var scriptFilePath = scriptPath + ".adc"; LoadCode(scriptFilePath); // check if loaded // if it is, return true, or false return(false); }
public bool Require(string moduleName) { if (Modules.ContainsKey(moduleName)) { return(Modules[moduleName]); } hModule newModule = new hModule(); Load(moduleName, hmodule); }
private bool ModuleLoad(string name, hModule module) { var handle = GetModuleHandle(name); if (handle is null) { return(false); } handle(module); return(true); }
public void SetPrevious(hModule module) { if (Previous != null) { ; // weak_ref module provided } if (Previous is null) { Previous = module; return; } // Previous weak_unref Previous = module; }