-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
90 lines (80 loc) · 3.23 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
using SpellFramework.Properties;
using System;
using System.Drawing;
using System.Linq;
using System.Windows.Forms;
namespace SpellFramework
{
static class Program
{
public static Spell currentSpell;
public static Loader currentLoader;
public static StartupLoading loading;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.VisualStyleState = System.Windows.Forms.VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled;
Application.SetCompatibleTextRenderingDefault(false);
if (!String.IsNullOrEmpty(Settings.Default.BASPath))
{
//var appDomainSetup = new AppDomainSetup();
//appDomainSetup.ApplicationBase = Settings.Default.BASPath;
//appDomainSetup.PrivateBinPath = @"\BladeAndSorcery_Data\Managed";
//var domain = AppDomain.CreateDomain("test", null, appDomainSetup);
//var str = domain.SetupInformation.ApplicationBase + domain.SetupInformation.PrivateBinPath;
loading = new StartupLoading();
Application.Run(loading);
currentSpell = new Spell();
Application.Run(currentSpell);
//Debug.Log("testtest" + str + " test");
}
else
{
currentLoader = new Loader();
Application.Run(currentLoader);
}
}
}
class Debug
{
public static void Log(string text)
{
Console.WriteLine(text);
if (Program.currentSpell != null)
{
var str = "> " + text + "\n";
Spell.localDebugConsole.Text = Spell.localDebugConsole.Text.Insert(0, str);
if (!Spell.startupComplete) return;
Spell.localDebugConsole.SelectionStart = 0;
Spell.localDebugConsole.SelectionLength = str.Count();
Spell.localDebugConsole.SelectionFont = new Font(Spell.localDebugConsole.Font, FontStyle.Bold);
Spell.localDebugConsole.Select(0, 0);
}
}
public static void LogWarning(string text)
{
Console.WriteLine("WARNING: " + text);
if (Program.currentSpell != null)
{
var str = "WARNING: " + text + "\n";
Spell.localDebugConsole.Text = Spell.localDebugConsole.Text.Insert(0, str);
if (!Spell.startupComplete) return;
Spell.localDebugConsole.SelectionStart = 0;
Spell.localDebugConsole.SelectionLength = str.Count();
Spell.localDebugConsole.SelectionFont = new Font(Spell.localDebugConsole.Font, FontStyle.Bold);
Spell.localDebugConsole.Select(0, 0);
}
}
public void LogException(Exception exception, UnityEngine.Object context)
{
Spell.localDebugConsole.AppendText("\n> " + context);
}
public void LogFormat(UnityEngine.LogType logType, UnityEngine.Object context, string format, params object[] args)
{
}
}
}