mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 20:32:34 +00:00
d7656f1f3b
- volatile mode may not be started from a volatile mode by shortcut key! - added ability to cancel an editing mode change - added mipmap levels setting to images (this fixes blurred fonts in low-quality display)
123 lines
3.1 KiB
C#
123 lines
3.1 KiB
C#
#region ================== Namespaces
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Text;
|
|
using System.IO;
|
|
using CodeImp.DoomBuilder.Editing;
|
|
|
|
#endregion
|
|
|
|
namespace CodeImp.DoomBuilder.Plugins
|
|
{
|
|
/// <summary>
|
|
/// This is the key link between the Doom Builder core and the plugin.
|
|
/// Every plugin must expose a single class that inherits this class.
|
|
/// </summary>
|
|
public class Plug : IDisposable
|
|
{
|
|
#region ================== Constants
|
|
|
|
#endregion
|
|
|
|
#region ================== Variables
|
|
|
|
// Internals
|
|
private Plugin plugin;
|
|
|
|
// Disposing
|
|
private bool isdisposed = false;
|
|
|
|
#endregion
|
|
|
|
#region ================== Properties
|
|
|
|
// Internals
|
|
internal Plugin Plugin { get { return plugin; } set { plugin = value; } }
|
|
|
|
/// <summary>
|
|
/// Indicates if the plugin has been disposed.
|
|
/// </summary>
|
|
public bool IsDisposed { get { return isdisposed; } }
|
|
|
|
#endregion
|
|
|
|
#region ================== Constructor / Disposer
|
|
|
|
/// <summary>
|
|
/// This is the key link between the Doom Builder core and the plugin.
|
|
/// Every plugin must expose a single class that inherits this class.
|
|
/// <para>
|
|
/// NOTE: Some methods cannot be used in this constructor, because the plugin
|
|
/// is not yet fully initialized. Instead, use the Initialize method to do
|
|
/// your initializations.
|
|
/// </para>
|
|
/// </summary>
|
|
public Plug()
|
|
{
|
|
// Initialize
|
|
|
|
// We have no destructor
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is called by the Doom Builder core when the plugin is being disposed.
|
|
/// </summary>
|
|
public virtual void Dispose()
|
|
{
|
|
// Not already disposed?
|
|
if(!isdisposed)
|
|
{
|
|
// Clean up
|
|
plugin = null;
|
|
|
|
// Done
|
|
isdisposed = true;
|
|
}
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region ================== Methods
|
|
|
|
/// <summary>
|
|
/// This is called after the constructor to allow a plugin to initialize.
|
|
/// </summary>
|
|
public virtual void Initialize()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// This finds the embedded resource with the specified name in the plugin and creates
|
|
/// a Stream from it. Returns null when the embedded resource cannot be found.
|
|
/// </summary>
|
|
/// <param name="resourcename">Name of the resource in the plugin.</param>
|
|
/// <returns>Returns a Stream of the embedded resource,
|
|
/// or null when the resource cannot be found.</returns>
|
|
public Stream GetResourceStream(string resourcename)
|
|
{
|
|
return plugin.GetResourceStream(resourcename);
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is called by the Doom Builder core when the user chose to reload the resources.
|
|
/// </summary>
|
|
public virtual void ReloadResources()
|
|
{
|
|
}
|
|
|
|
/// <summary>
|
|
/// This is called by the Doom Builder core when the editing mode changes.
|
|
/// </summary>
|
|
/// <param name="oldmode">The previous editing mode</param>
|
|
/// <param name="newmode">The new editing mode</param>
|
|
public virtual void ModeChanges(EditMode oldmode, EditMode newmode)
|
|
{
|
|
}
|
|
|
|
#endregion
|
|
}
|
|
}
|