Add Logger property for resource script
This commit is contained in:
@ -27,5 +27,10 @@ namespace RageCoop.Client.Scripting
|
||||
/// </summary>
|
||||
public ClientResource CurrentResource { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Eqivalent of <see cref="ClientResource.Logger"/> in <see cref="CurrentResource"/>
|
||||
/// </summary>
|
||||
public Core.Logger Logger { get { return CurrentResource.Logger; } }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,11 @@ namespace RageCoop.Client.Scripting
|
||||
/// Get the <see cref="ResourceFile"/> where this script is loaded from.
|
||||
/// </summary>
|
||||
public Dictionary<string, ResourceFile> Files { get; internal set; } = new Dictionary<string, ResourceFile>();
|
||||
|
||||
/// <summary>
|
||||
/// A <see cref="Core.Logger"/> instance that can be used to debug your resource.
|
||||
/// </summary>
|
||||
public Logger Logger { get; internal set; }
|
||||
}
|
||||
internal class Resources
|
||||
{
|
||||
|
@ -31,6 +31,11 @@ namespace RageCoop.Server.Scripting
|
||||
/// Get the <see cref="ResourceFile"/> that the script belongs to.
|
||||
/// </summary>
|
||||
public ResourceFile CurrentFile { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Eqivalent of <see cref="ServerResource.Logger"/> in <see cref="CurrentResource"/>
|
||||
/// </summary>
|
||||
public Core.Logger Logger { get { return CurrentResource.Logger; } }
|
||||
}
|
||||
/// <summary>
|
||||
/// Decorate your method with this attribute and use <see cref="API.RegisterCommands{T}"/> or <see cref="API.RegisterCommands(object)"/> to register commands.
|
||||
|
Reference in New Issue
Block a user