// // Construct a new compiler instance, backed against a given resource // accessor. // // N.B. The native compiler object is allocated on demand the first // time the user compiles a script. // public NscCompiler(ResourceAccessor ResourceAccessor, SettingsManager SettingsMgr) { m_Disposed = false; m_Compiler = IntPtr.Zero; m_ResourceAccessor = ResourceAccessor; m_SettingsManager = SettingsMgr; }
// // Construct a new instance with the given stock compiler that is to be // attached. // public ScriptCompilerHook(IScriptCompiler StandardCompiler, ResourceAccessor ResourceAccessor, SettingsManager SettingsMgr) { m_Disposed = false; m_StandardCompiler = StandardCompiler; m_ResourceAccessor = ResourceAccessor; m_SettingsManager = SettingsMgr; m_NscCompiler = new NscCompiler(ResourceAccessor, SettingsMgr); }
// // Called when the resource system is indexing resources. // public void OnResourceIndexingStart(ResourceAccessor Accessor) { /* PluginUI.AddVerifyResult( NWN2VerifyOutputType.Information, "Advanced script compiler: Indexing resources..."); */ }
public void OnResourceIndexingFinish(ResourceAccessor Accessor) { PluginUI.AddVerifyResult( NWN2VerifyOutputType.Information, "Advanced script compiler: Completed resource indexing (" + Accessor.GetEncapsulatedFileCount().ToString() + " resources in resource system)."); }
// // Standard INWN2Plugin methods. // // // Called during late stage toolset initialization. // public virtual void Load(INWN2PluginHost Host) { ListView Lv; m_SettingsManager = new SettingsManager(); m_SettingsManager.NeedSettingsLoad = true; // // By the time Load is invoked, the compiler is present. Install // the compiler hook now. // m_CompilerField = GetMainFormCompilerField(); m_ResourceAccessor = new ResourceAccessor(this); HookScriptCompiler(); // // Hook the version control system for resource change notification // distribution if preferences were available at this point. // // Otherwise, wait for a change notification to install the hook. // // if (NWN2ToolsetMainForm.VersionControlManager.Preferences != null) { m_OriginalVCPlugin = NWN2ToolsetMainForm.VersionControlManager.Preferences.ActiveProvider; if (m_OriginalVCPlugin == this) m_OriginalVCPlugin = null; NWN2ToolsetMainForm.VersionControlManager.Preferences.ActiveProvider = this; } else { NWN2Toolset.Plugins.NWN2VersionControlManagerPreferences.PreferencesChanged += this.OnVersionControlManagerPrefsChanged; } Lv = PluginUI.GetVerifyOutputListView(); if (Lv != null) Lv.ItemActivate += this.OnVerifyOutputListViewItemActivated; }