Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
Implemented Warn and Message functions
Browse files Browse the repository at this point in the history
  • Loading branch information
erri120 committed Nov 28, 2019
1 parent 6fb570a commit db1ab36
Show file tree
Hide file tree
Showing 3 changed files with 748 additions and 0 deletions.
2 changes: 2 additions & 0 deletions OMODFramework/Framework.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ public class Framework

public static string TempDir { get; set; } = Path.Combine(Path.GetTempPath(), "OMODFramework");

public static bool EnableWarnings { get; set; } = false;

public static void CleanTempDir(bool deleteRoot = false)
{
if(!Directory.Exists(TempDir))
Expand Down
24 changes: 24 additions & 0 deletions OMODFramework/Scripting/IScriptFunctions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
namespace OMODFramework.Scripting
{
public interface IScriptFunctions
{
/// <summary>
/// Warn the user about something. This will only be called if Framework.EnableWarnings = true
/// </summary>
/// <param name="msg">The message, will always contain the line number</param>
void Warn(string msg);

/// <summary>
/// Inform the user about something
/// </summary>
/// <param name="msg">The message to be displayed</param>
void Message(string msg);

/// <summary>
/// Inform the user about something
/// </summary>
/// <param name="msg">The message to be displayed</param>
/// <param name="title">The title of the popup</param>
void Message(string msg, string title);
}
}
Loading

0 comments on commit db1ab36

Please sign in to comment.