made 2 more events for the plugins

This commit is contained in:
codeimp 2008-05-15 09:43:19 +00:00
parent 6b2ba4f2d6
commit 9ba3fa93a3
4 changed files with 31 additions and 4 deletions

View file

@ -1002,6 +1002,9 @@ namespace CodeImp.DoomBuilder
// Create required lumps if they don't exist yet
CreateRequiredLumps(tempwad, TEMP_MAP_HEADER);
// Let the plugins know
General.Plugins.MapReconfigure();
// Reload resources
ReloadResources();

View file

@ -1237,6 +1237,9 @@ namespace CodeImp.DoomBuilder.Interface
{
// Update interface
UpdateInterface();
// Let the plugins know
General.Plugins.ProgramReconfigure();
// Reload resources if a map is open
if(General.Map != null) General.Map.ReloadResources();
@ -1259,6 +1262,9 @@ namespace CodeImp.DoomBuilder.Interface
{
// Update shortcut keys in menus
ApplyShortcutKeys();
// Let the plugins know
General.Plugins.ProgramReconfigure();
// Map opened?
if(General.Map != null)

View file

@ -107,7 +107,7 @@ namespace CodeImp.DoomBuilder.Plugins
}
/// <summary>
/// This is called by the Doom Builder core when the user chose to reload the resources.
/// This is called when the user chose to reload the resources.
/// </summary>
public virtual void OnReloadResources()
{
@ -135,7 +135,7 @@ namespace CodeImp.DoomBuilder.Plugins
public virtual void OnMapReconfigure()
{
}
#endregion
}
}

View file

@ -187,19 +187,37 @@ namespace CodeImp.DoomBuilder.Plugins
return null;
}
// This calls ReloadResources on all plugins
#endregion
#region ================== Events
// This calls OnReloadResources on all plugins
public void ReloadResources()
{
foreach(Plugin p in plugins)
p.Plug.OnReloadResources();
}
// This calls ModeChanges on all plugins
// This calls OnModeChange on all plugins
public void ModeChanges(EditMode oldmode, EditMode newmode)
{
foreach(Plugin p in plugins)
p.Plug.OnModeChange(oldmode, newmode);
}
// This calls OnProgramReconfigure on all plugins
public void ProgramReconfigure()
{
foreach(Plugin p in plugins)
p.Plug.OnProgramReconfigure();
}
// This calls OnMapReconfigure on all plugins
public void MapReconfigure()
{
foreach(Plugin p in plugins)
p.Plug.OnMapReconfigure();
}
#endregion
}