commit da459a94c9baf179a2ede0cd9766c31ee0faee24 Author: Melissa Geels Date: Tue Apr 28 16:33:45 2020 +0200 Initial commit (2011) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..46f9239 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +bin/ +obj/ + +*.suo +*.docstates +*.user diff --git a/MrAG.sln b/MrAG.sln new file mode 100644 index 0000000..aefd2d1 --- /dev/null +++ b/MrAG.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C# Express 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MrAG", "MrAG\MrAG.csproj", "{48B30584-0795-4FDA-9561-61B2381F8656}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {48B30584-0795-4FDA-9561-61B2381F8656}.Debug|x86.ActiveCfg = Debug|x86 + {48B30584-0795-4FDA-9561-61B2381F8656}.Debug|x86.Build.0 = Debug|x86 + {48B30584-0795-4FDA-9561-61B2381F8656}.Release|x86.ActiveCfg = Release|x86 + {48B30584-0795-4FDA-9561-61B2381F8656}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/MrAG/Achievements.cs b/MrAG/Achievements.cs new file mode 100644 index 0000000..ac23c0b --- /dev/null +++ b/MrAG/Achievements.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Threading; + +namespace MrAG +{ + public class Achievements + { + public class GamerServicesAchievementsException : Exception{ + public GamerServicesAchievementsException(string msg): base(msg){ + } + } + + public class Achievement{ + public short ID; + public string Name; + public string Desc; + public string Hash; + public int CurrentValue; + public int TargetValue; + public bool Completed; + public byte Points; + } + + + public static Dictionary AchievementList = new Dictionary(); + + public static void Load(){ + AchievementList = new Dictionary(); + + Gamerservices.GetAPIConnection().Send(2, 0, (byte)0); + + /* + string[] lines = Networking.PostData("achievement", "sub=list"); + for (short i = 0; i < lines.Length; i++){ + AchievementList[lines[i]] = new Achievement(); + AchievementList[lines[i]].Name = lines[i]; + AchievementList[lines[i]].Desc = lines[i + 1]; + AchievementList[lines[i]].CurrentValue = int.Parse(lines[i + 2]); + AchievementList[lines[i]].TargetValue = int.Parse(lines[i + 3]); + AchievementList[lines[i]].Completed = AchievementList[lines[i]].CurrentValue >= AchievementList[lines[i]].TargetValue; + AchievementList[lines[i]].ID = i; + + i += 3; + }*/ + } + + public static Achievement Get(string ach){ + if (!Gamerservices.IsLoggedIn()) return null; + + if (!AchievementList.ContainsKey(ach)){ + throw new GamerServicesAchievementsException("No such achievement!"); + } + + return AchievementList[ach]; + } + + public static Dictionary GetAll(){ + return AchievementList; + } + + public static void Add(string ach, int value){ + if (!Gamerservices.IsLoggedIn()) return; + + if (!AchievementList.ContainsKey(ach)){ + throw new GamerServicesAchievementsException("No such achievement!"); + } + + if (AchievementList[ach].Completed){ + return; + }else{ + if (AchievementList[ach].CurrentValue + value > AchievementList[ach].TargetValue) { + value = AchievementList[ach].TargetValue - AchievementList[ach].CurrentValue; + } + + + AchievementList[ach].CurrentValue += value; + AchievementList[ach].Completed = AchievementList[ach].CurrentValue >= AchievementList[ach].TargetValue; + + if (AchievementList[ach].Completed){ + Overlay.AddNotice(0, "Achievement update", "Unlocked " + ach); + } + + } + + Gamerservices.GetAPIConnection().Send(2, 9 + AchievementList[ach].Hash.Length, (byte)1, AchievementList[ach].Hash, value); + /* + new Thread(new ThreadStart(delegate{ + string[] res = Networking.PostData("achievement", "sub=add&achievement[0]=" + ach + "&val[0]=" + value); + + if (res.Length == 1){ + Overlay.AddNotice(0, "Achievement update", "Unlocked " + ach); + } + })).Start(); + * */ + } + + public static void Set(string ach, int value){ + if (!Gamerservices.IsLoggedIn()) return; + + if (!AchievementList.ContainsKey(ach)){ + throw new GamerServicesAchievementsException("No such achievement!"); + } + + if (AchievementList[ach].Completed){ + return; + }else{ + AchievementList[ach].CurrentValue = value; + AchievementList[ach].Completed = AchievementList[ach].CurrentValue >= AchievementList[ach].TargetValue; + + if (AchievementList[ach].Completed){ + Overlay.AddNotice(0, "Achievement update", "Unlocked " + ach); + } + } + + Gamerservices.GetAPIConnection().Send(2, 9 + AchievementList[ach].Hash.Length, (byte)2, AchievementList[ach].Hash, value); + + /* + string[] res = Networking.PostData("achievement", "sub=set&achievement[0]=" + ach + "&val[0]=" + value); + + if (res.Length == 1){ + Overlay.AddNotice(0, res[0]); + } + * */ + } + } +} diff --git a/MrAG/Checksum.cs b/MrAG/Checksum.cs new file mode 100644 index 0000000..c8bc00b --- /dev/null +++ b/MrAG/Checksum.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using System.Security.Cryptography; + +namespace MrAG +{ + public class Checksum + { + // + // "This is like FABFUKAU(*W(&!@*JKHDHD" + // + // - Bromvlieg + // + + // + // "Cool story, bro." + // + // - Angelo + // + + public class FileInfo{ + public string Path; + public string Hash; + public string LastWritten; + public string LastAccessed; + public string DateCreated; + + public long Size; + + public FileInfo(){} + public FileInfo(string path){ + FileInfo f = MrAG.Checksum.GetInfo(path); + + this.Hash = f.Hash; + this.Path = f.Path; + this.LastWritten = f.LastWritten; + this.LastAccessed = f.LastWritten; + this.DateCreated = f.DateCreated; + this.Size = f.Size; + } + } + + public static FileInfo GetInfo(string Filename){ + FileInfo f = new FileInfo(); + + System.IO.FileInfo Fileinfo = new System.IO.FileInfo(Filename); + + f.Hash = MrAG.Checksum.FileHash(Filename); + + f.DateCreated = Fileinfo.CreationTimeUtc.ToString(); + f.LastAccessed = Fileinfo.LastAccessTimeUtc.ToString(); + f.LastWritten = Fileinfo.LastWriteTimeUtc.ToString(); + f.Size = Fileinfo.Length; + + + return f; + } + + public static String FileHash(String Filename) + { + FileStream File = new FileStream(Filename, FileMode.Open); + MD5 md5 = new MD5CryptoServiceProvider(); + byte[] RetVal = md5.ComputeHash(File); + File.Close(); + + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < RetVal.Length; i++) + sb.Append(RetVal[i].ToString("x2")); + + return sb.ToString().ToLower(); + } + } +} diff --git a/MrAG/Config.cs b/MrAG/Config.cs new file mode 100644 index 0000000..de6b419 --- /dev/null +++ b/MrAG/Config.cs @@ -0,0 +1,239 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; + +namespace MrAG +{ + public class Config + { + private static Hashtable Data = new Hashtable(); + private static bool Busy; + + public static void Clear(){ + while (Busy) { }; + Busy = true; + + Data.Clear(); + + Busy = false; + } + + public static void Write(string path){ + while (Busy) { }; + Busy = true; + + StreamWriter writer = new StreamWriter(File.OpenWrite(path)); + foreach( DictionaryEntry cat in Data) + { + writer.WriteLine("[\"" + cat.Key + "\"] = {"); + + Hashtable values = (Hashtable)Data[cat.Key]; + foreach( DictionaryEntry entry in values) + { + writer.WriteLine(" [\"" + entry.Key + "\"] = \"" + entry.Value + "\";"); + } + + writer.WriteLine("}"); + writer.WriteLine(""); + } + + Busy = false; + writer.Close(); + } + + public static bool Read(string file){ + while (Busy) { }; + Busy = true; + Data.Clear(); + + if (File.Exists(file)){ + StreamReader reader = new StreamReader(File.OpenRead(file)); + string[] content = reader.ReadToEnd().Replace("\r", "").Split('\n'); + reader.Close(); + + int entrys = 0; + string CurrentSection = ""; + string CurrentName = ""; + foreach(string line in content){ + if (line.Length > 0){ + if (line.Replace(" ","").Replace(" ", "").StartsWith("#")){ // comment + }else if (line.StartsWith("[\"")){ // section + CurrentSection = line.Substring(2, line.Length - 8); + Data[CurrentSection] = new Hashtable(); + }else if (line == "}"){ // end-section + CurrentSection = ""; + }else if (line.StartsWith(" [\"") || line.StartsWith(" [\"")){ // name/value + int splitpos = line.IndexOf("\"] = \""); + if (line.EndsWith("\";")){ + entrys++; + (Data[CurrentSection] as Hashtable)[line.Substring(3, splitpos - 3)] = line.Substring(splitpos + 6, line.Length - splitpos - 8); + }else{ + CurrentName = line.Substring(3, splitpos - 3); + (Data[CurrentSection] as Hashtable)[CurrentName] = line.Substring(splitpos + 6, line.Length - splitpos - 6); + } + }else{ // resume value on next line (multilined crap :3) + if (line.EndsWith("\";")){ + (Data[CurrentSection] as Hashtable)[CurrentName] += "\n" + line.Substring(1, line.Length - 3); + CurrentName = ""; + }else{ + (Data[CurrentSection] as Hashtable)[CurrentName] += "\n" + line; + } + } + } + } + Console.WriteLine("Finished reading '" + file + "', " + entrys + " entrys"); + Busy = false; + return true; + } + + Busy = false; + return false; + } + + public static bool IsBusy(){ + return Busy; + } + + public static bool Value_Exist(string section, string name){ + while (Busy) { }; + Busy = true; + if (Data[section] == null){ + + Busy = false; + return false; + } + + if ((Data[section] as Hashtable)[name] == null){ + + Busy = false; + return false; + } + + Busy = false; + return true; + } + + public static Hashtable Section_Get(string name){ + while (Busy) { }; + Busy = true; + if (Data[name] == null) { + Busy = false; + return new Hashtable(); + } + + Busy = false; + return (Hashtable)Data[name]; + } + + public static bool Section_Exists(string name){ + while (Busy) { }; + return Data[name] != null; + } + + public static void Section_Set(string name, Hashtable data){ + while (Busy) { }; + Busy = true; + + Data[name] = data; + + Busy = false; + } + + public static string Value_Get(string section, string name){ + while (Busy) { }; + Busy = true; + + if (Data[section] == null) { + Busy = false; + return ""; + } + + Busy = false; + return (string)(Data[section] as Hashtable)[name]; + } + + public static string Value_Get(string section, string name, string def){ + while (Busy) { }; + Busy = true; + + if (Data[section] == null) { + Busy = false; + return def; + } + + + string value = (string)(Data[section] as Hashtable)[name]; + Busy = false; + return value == null ? def : value; + } + + public static int Value_GetInt(string section, string name, int def){ + int.TryParse(Value_Get(section, name), out def); + + return def; + } + + public static short Value_GetShort(string section, string name, short def){ + short.TryParse(Value_Get(section, name), out def); + + return def; + } + + public static float Value_GetFloat(string section, string name, float def){ + float.TryParse(Value_Get(section, name), out def); + + return def; + } + + public static double Value_GetDouble(string section, string name, double def){ + double.TryParse(Value_Get(section, name), out def); + + return def; + } + + public static bool Value_GetBool(string section, string name, bool def){ + return Value_Get(section, name, def.ToString()).ToLower() == "true"; + } + + public static void Value_Set(string section, string name, string value){ + while (Busy) { }; + Busy = true; + + if (Data[section] == null) + Data[section] = new Hashtable(); + + (Data[section] as Hashtable)[name] = value; + + Busy = false; + } + public static void Value_SetBool(string section, string name, bool value){ Value_Set(section, name, value.ToString()); } + public static void Value_SetInt(string section, string name, int value){ Value_Set(section, name, value.ToString()); } + public static void Value_SetShort(string section, string name, short value){ Value_Set(section, name, value.ToString()); } + public static void Value_SetFloat(string section, string name, float value){ Value_Set(section, name, value.ToString()); } + public static void Value_SetDouble(string section, string name, double value){ Value_Set(section, name, value.ToString()); } + + public static void PrintContent(){ + while (Busy) { }; + Busy = true; + + foreach( DictionaryEntry cat in Data ) + { + Console.WriteLine("[\"" + cat.Key + "\"] = {"); + + Hashtable values = (Hashtable)Data[cat.Key]; + foreach( DictionaryEntry entry in values) + { + Console.WriteLine(" [\"" + entry.Key + "\"] = \"" + entry.Value + "\";"); + } + + Console.WriteLine("}"); + Console.WriteLine(""); + } + + Busy = false; + } + } +} \ No newline at end of file diff --git a/MrAG/DLLChecker.cs b/MrAG/DLLChecker.cs new file mode 100644 index 0000000..5ba8c4e --- /dev/null +++ b/MrAG/DLLChecker.cs @@ -0,0 +1,19 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MrAG { + public class DLLChecker { + class XNA{ public XNA() { new Microsoft.Xna.Framework.Color(); } } + + public static bool HasXNA() { + try { + new XNA(); + return true; + } catch { + return false; + } + } + } +} diff --git a/MrAG/Draw.cs b/MrAG/Draw.cs new file mode 100644 index 0000000..6234e61 --- /dev/null +++ b/MrAG/Draw.cs @@ -0,0 +1,242 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.IO; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Content; +using Microsoft.Xna.Framework.Graphics; + +namespace MrAG { + public class Draw { + public static SpriteBatch SpriteBatch; + + private static Texture2D Pixel; + public static SpriteFont Font; + public static SpriteFont _defFont; + + public enum TextAlignmentX{Left, Center, Right}; + public enum TextAlignmentY{Top, Center, Bottom}; + + public static void Initialize(GraphicsDevice gd, SpriteBatch sb, ContentManager cm) { + SpriteBatch = sb; + + System.Drawing.Bitmap pix = new System.Drawing.Bitmap(1, 1); + pix.SetPixel(0, 0, System.Drawing.Color.White); + + MemoryStream mem = new MemoryStream(); + + pix.Save(mem, System.Drawing.Imaging.ImageFormat.Png); + + Pixel = Texture2D.FromStream(gd, mem); + + mem.Close(); + pix.Dispose(); + + #region massive uber sized super to the max master king byte array, realy dont open. it freezes ya VS xD + File.WriteAllBytes("content/tmpfont.xnb", new byte[]{88, 78, 66, 119, 5, 0, 174, 52, 0, 0, 8, 149, 1, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 83, 112, 114, 105, 116, 101, 70, 111, 110, 116, 82, 101, 97, 100, 101, 114, 44, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 71, 114, 97, 112, 104, 105, 99, 115, 44, 32, 86, 101, 114, 115, 105, 111, 110, 61, 52, 46, 48, 46, 48, 46, 48, 44, 32, 67, 117, 108, 116, 117, 114, 101, 61, 110, 101, 117, 116, 114, 97, 108, 44, 32, 80, 117, 98, 108, 105, 99, 75, 101, 121, 84, 111, 107, 101, 110, 61, 56, 52, 50, 99, 102, 56, 98, 101, 49, 100, 101, 53, 48, 53, 53, 51, 0, 0, 0, 0, 148, 1, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 84, 101, 120, 116, 117, 114, 101, 50, 68, 82, 101, 97, 100, 101, 114, 44, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 71, 114, 97, 112, 104, 105, 99, 115, 44, 32, 86, 101, 114, 115, 105, 111, 110, 61, 52, 46, 48, 46, 48, 46, 48, 44, 32, 67, 117, 108, 116, 117, 114, 101, 61, 110, 101, 117, 116, 114, 97, 108, 44, 32, 80, 117, 98, 108, 105, 99, 75, 101, 121, 84, 111, 107, 101, 110, 61, 56, 52, 50, 99, 102, 56, 98, 101, 49, 100, 101, 53, 48, 53, 53, 51, 0, 0, 0, 0, 173, 1, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 76, 105, 115, 116, 82, 101, 97, 100, 101, 114, 96, 49, 91, 91, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 82, 101, 99, 116, 97, 110, 103, 108, 101, 44, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 44, 32, 86, 101, 114, 115, 105, 111, 110, 61, 52, 46, 48, 46, 48, 46, 48, 44, 32, 67, 117, 108, 116, 117, 114, 101, 61, 110, 101, 117, 116, 114, 97, 108, 44, 32, 80, 117, 98, 108, 105, 99, 75, 101, 121, 84, 111, 107, 101, 110, 61, 56, 52, 50, 99, 102, 56, 98, 101, 49, 100, 101, 53, 48, 53, 53, 51, 93, 93, 0, 0, 0, 0, 47, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 82, 101, 99, 116, 97, 110, 103, 108, 101, 82, 101, 97, 100, 101, 114, 0, 0, 0, 0, 136, 1, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 76, 105, 115, 116, 82, 101, 97, 100, 101, 114, 96, 49, 91, 91, 83, 121, 115, 116, 101, 109, 46, 67, 104, 97, 114, 44, 32, 109, 115, 99, 111, 114, 108, 105, 98, 44, 32, 86, 101, 114, 115, 105, 111, 110, 61, 52, 46, 48, 46, 48, 46, 48, 44, 32, 67, 117, 108, 116, 117, 114, 101, 61, 110, 101, 117, 116, 114, 97, 108, 44, 32, 80, 117, 98, 108, 105, 99, 75, 101, 121, 84, 111, 107, 101, 110, 61, 98, 55, 55, 97, 53, 99, 53, 54, 49, 57, 51, 52, 101, 48, 56, 57, 93, 93, 0, 0, 0, 0, 42, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 67, 104, 97, 114, 82, 101, 97, 100, 101, 114, 0, 0, 0, 0, 171, 1, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 76, 105, 115, 116, 82, 101, 97, 100, 101, 114, 96, 49, 91, 91, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 86, 101, 99, 116, 111, 114, 51, 44, 32, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 44, 32, 86, 101, 114, 115, 105, 111, 110, 61, 52, 46, 48, 46, 48, 46, 48, 44, 32, 67, 117, 108, 116, 117, 114, 101, 61, 110, 101, 117, 116, 114, 97, 108, 44, 32, 80, 117, 98, 108, 105, 99, 75, 101, 121, 84, 111, 107, 101, 110, 61, 56, 52, 50, 99, 102, 56, 98, 101, 49, 100, 101, 53, 48, 53, 53, 51, 93, 93, 0, 0, 0, 0, 45, 77, 105, 99, 114, 111, 115, 111, 102, 116, 46, 88, 110, 97, 46, 70, 114, 97, 109, 101, 119, 111, 114, 107, 46, 67, 111, 110, 116, 101, 110, 116, 46, 86, 101, 99, 116, 111, 114, 51, 82, 101, 97, 100, 101, 114, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 64, 0, 0, 0, 128, 0, 0, 0, 1, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 80, 0, 170, 80, 10, 255, 255, 0, 0, 85, 213, 165, 109, 0, 0, 250, 255, 5, 0, 250, 170, 255, 255, 0, 0, 85, 2, 87, 162, 0, 0, 10, 0, 250, 0, 90, 10, 255, 255, 0, 0, 85, 86, 82, 110, 0, 0, 0, 240, 80, 250, 160, 245, 255, 255, 0, 0, 85, 21, 45, 57, 0, 0, 0, 0, 90, 0, 165, 0, 255, 255, 0, 0, 85, 85, 94, 91, 0, 0, 80, 255, 240, 15, 240, 15, 255, 255, 0, 0, 85, 13, 65, 65, 0, 0, 0, 255, 0, 240, 0, 240, 255, 255, 0, 0, 85, 5, 21, 21, 0, 0, 5, 0, 15, 0, 15, 0, 255, 255, 0, 0, 85, 87, 84, 84, 0, 0, 80, 10, 240, 5, 245, 5, 255, 255, 0, 0, 85, 109, 113, 115, 0, 0, 160, 5, 80, 15, 80, 95, 255, 255, 0, 0, 85, 121, 77, 205, 0, 0, 0, 255, 0, 255, 0, 255, 255, 255, 0, 0, 85, 5, 5, 5, 0, 0, 15, 240, 0, 0, 0, 0, 255, 255, 0, 0, 85, 20, 85, 85, 0, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 85, 80, 80, 80, 0, 0, 240, 15, 0, 0, 240, 15, 255, 255, 0, 0, 85, 65, 85, 65, 0, 0, 240, 0, 240, 0, 240, 0, 255, 255, 0, 0, 85, 81, 81, 81, 0, 0, 0, 10, 80, 10, 160, 5, 255, 255, 0, 0, 85, 101, 109, 121, 160, 85, 240, 160, 240, 240, 240, 165, 255, 255, 0, 0, 249, 145, 17, 177, 10, 245, 0, 240, 0, 245, 5, 250, 255, 255, 0, 0, 54, 21, 53, 39, 10, 15, 5, 15, 85, 10, 160, 5, 255, 255, 0, 0, 70, 71, 111, 121, 240, 245, 160, 255, 0, 250, 0, 240, 255, 255, 0, 0, 49, 9, 37, 21, 0, 0, 10, 0, 175, 0, 245, 0, 255, 255, 0, 0, 85, 86, 88, 83, 240, 15, 245, 10, 175, 0, 245, 10, 255, 255, 0, 0, 65, 99, 88, 99, 0, 240, 0, 160, 0, 0, 0, 160, 255, 255, 0, 0, 21, 149, 85, 149, 15, 0, 95, 0, 255, 0, 95, 0, 255, 255, 0, 0, 84, 92, 80, 92, 250, 0, 255, 0, 255, 0, 250, 0, 255, 255, 0, 0, 82, 80, 80, 82, 0, 175, 0, 255, 0, 255, 0, 175, 255, 255, 0, 0, 133, 5, 5, 133, 0, 255, 0, 255, 0, 255, 0, 255, 255, 255, 0, 0, 5, 5, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 255, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 80, 80, 80, 80, 240, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 65, 65, 65, 240, 0, 240, 0, 240, 0, 240, 0, 255, 255, 0, 0, 81, 81, 81, 81, 160, 0, 160, 0, 165, 0, 90, 0, 255, 255, 0, 0, 89, 89, 91, 94, 80, 90, 0, 170, 0, 80, 0, 0, 255, 255, 0, 0, 237, 165, 213, 85, 255, 250, 5, 0, 250, 255, 0, 0, 255, 255, 0, 0, 32, 87, 2, 85, 90, 0, 165, 10, 90, 0, 0, 0, 255, 255, 0, 0, 94, 107, 94, 85, 160, 245, 80, 255, 0, 240, 0, 0, 255, 255, 0, 0, 57, 13, 21, 85, 165, 0, 90, 0, 0, 0, 0, 0, 255, 255, 0, 0, 91, 94, 85, 85, 240, 15, 240, 15, 80, 255, 0, 0, 255, 255, 0, 0, 65, 65, 13, 85, 0, 240, 0, 240, 0, 255, 0, 0, 255, 255, 0, 0, 21, 21, 5, 85, 15, 0, 15, 0, 5, 0, 0, 0, 255, 255, 0, 0, 84, 84, 87, 85, 245, 5, 240, 10, 80, 10, 0, 0, 255, 255, 0, 0, 115, 97, 109, 85, 80, 95, 160, 15, 160, 5, 0, 0, 255, 255, 0, 0, 205, 73, 121, 85, 0, 255, 0, 255, 0, 255, 0, 0, 255, 255, 0, 0, 5, 5, 5, 85, 0, 0, 0, 0, 15, 240, 0, 0, 255, 255, 0, 0, 85, 85, 20, 85, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 0, 0, 80, 80, 80, 85, 240, 15, 240, 15, 250, 5, 0, 0, 255, 255, 0, 0, 65, 65, 114, 85, 240, 0, 240, 0, 240, 0, 0, 0, 255, 255, 0, 0, 81, 81, 81, 85, 10, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 86, 85, 85, 85, 0, 0, 0, 245, 80, 175, 160, 15, 255, 255, 0, 0, 85, 53, 141, 73, 0, 0, 255, 5, 160, 95, 0, 175, 255, 255, 0, 0, 85, 112, 201, 133, 0, 0, 0, 250, 0, 250, 0, 245, 255, 255, 0, 0, 85, 37, 37, 53, 0, 0, 0, 245, 5, 250, 10, 250, 255, 255, 0, 0, 85, 53, 39, 38, 0, 0, 5, 240, 10, 245, 15, 250, 255, 255, 0, 0, 85, 23, 54, 36, 0, 0, 10, 0, 10, 0, 5, 0, 255, 255, 0, 0, 85, 86, 86, 87, 0, 0, 0, 250, 0, 255, 160, 175, 255, 255, 0, 0, 85, 37, 5, 137, 0, 0, 15, 0, 95, 0, 175, 0, 255, 255, 0, 0, 85, 84, 92, 88, 0, 0, 0, 255, 0, 255, 0, 255, 255, 255, 0, 0, 85, 5, 5, 5, 0, 0, 15, 0, 95, 80, 175, 160, 255, 255, 0, 0, 85, 84, 220, 152, 0, 0, 255, 15, 255, 15, 255, 15, 255, 255, 0, 0, 85, 64, 64, 64, 0, 0, 160, 175, 240, 240, 240, 240, 255, 255, 0, 0, 85, 137, 17, 17, 0, 0, 0, 90, 80, 10, 160, 5, 255, 255, 0, 0, 85, 229, 109, 121, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 175, 0, 250, 85, 160, 255, 255, 255, 0, 0, 85, 88, 242, 9, 0, 0, 250, 0, 175, 0, 10, 0, 255, 255, 0, 0, 85, 82, 88, 86, 240, 15, 240, 15, 160, 15, 80, 175, 255, 255, 0, 0, 65, 65, 73, 141, 0, 255, 0, 255, 90, 255, 245, 95, 255, 255, 0, 0, 5, 5, 14, 195, 0, 240, 0, 160, 0, 80, 0, 80, 255, 255, 0, 0, 21, 149, 213, 213, 15, 175, 175, 15, 255, 10, 255, 5, 255, 255, 0, 0, 132, 72, 96, 112, 15, 255, 175, 175, 250, 175, 245, 95, 255, 255, 0, 0, 4, 136, 130, 195, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 240, 15, 245, 10, 250, 255, 175, 0, 255, 255, 0, 0, 65, 99, 2, 88, 255, 0, 250, 5, 255, 10, 245, 10, 255, 255, 0, 0, 80, 114, 96, 99, 0, 255, 0, 255, 0, 255, 0, 255, 255, 255, 0, 0, 5, 5, 5, 5, 250, 240, 245, 245, 240, 255, 160, 175, 255, 255, 0, 0, 18, 51, 1, 137, 250, 15, 245, 15, 240, 15, 240, 15, 255, 255, 0, 0, 66, 67, 65, 65, 160, 175, 0, 0, 0, 80, 0, 160, 255, 255, 0, 0, 137, 85, 213, 149, 165, 0, 90, 250, 10, 15, 5, 15, 255, 255, 0, 0, 91, 46, 70, 71, 0, 0, 10, 0, 15, 0, 15, 0, 255, 255, 0, 0, 85, 86, 84, 84, 80, 255, 80, 255, 160, 255, 250, 85, 255, 255, 0, 0, 13, 13, 9, 242, 5, 0, 5, 0, 10, 0, 175, 0, 255, 255, 0, 0, 87, 87, 86, 88, 0, 245, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 53, 85, 85, 85, 175, 95, 0, 165, 0, 0, 0, 0, 255, 255, 0, 0, 200, 181, 85, 85, 0, 0, 0, 0, 0, 0, 0, 245, 255, 255, 0, 0, 85, 85, 85, 53, 255, 0, 0, 0, 0, 0, 10, 160, 255, 255, 0, 0, 80, 85, 85, 150, 240, 15, 0, 0, 0, 0, 95, 0, 255, 255, 0, 0, 65, 85, 85, 92, 0, 80, 0, 0, 0, 0, 80, 255, 255, 255, 0, 0, 213, 85, 85, 13, 95, 0, 0, 0, 0, 0, 95, 0, 255, 255, 0, 0, 92, 85, 85, 92, 240, 15, 0, 0, 0, 0, 0, 245, 255, 255, 0, 0, 65, 85, 85, 53, 0, 255, 0, 0, 0, 0, 255, 10, 255, 255, 0, 0, 5, 85, 85, 96, 80, 95, 0, 0, 0, 0, 0, 80, 255, 255, 0, 0, 205, 85, 85, 213, 240, 15, 0, 0, 0, 0, 250, 175, 255, 255, 0, 0, 65, 85, 85, 130, 0, 165, 0, 0, 0, 0, 0, 240, 255, 255, 0, 0, 181, 85, 85, 21, 0, 250, 0, 0, 0, 0, 15, 160, 255, 255, 0, 0, 37, 85, 85, 148, 10, 0, 0, 0, 0, 0, 15, 0, 255, 255, 0, 0, 86, 85, 85, 84, 175, 0, 0, 0, 0, 0, 80, 255, 255, 255, 0, 0, 88, 85, 85, 13, 250, 0, 0, 0, 0, 0, 95, 0, 255, 255, 0, 0, 82, 85, 85, 92, 240, 255, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 1, 65, 65, 65, 175, 5, 240, 10, 240, 15, 245, 10, 255, 255, 0, 0, 120, 97, 65, 99, 0, 160, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 149, 85, 85, 85, 15, 240, 95, 245, 250, 175, 240, 15, 255, 255, 0, 0, 20, 60, 130, 65, 10, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 86, 85, 85, 85, 240, 15, 160, 175, 80, 255, 245, 250, 255, 255, 0, 0, 65, 137, 13, 35, 255, 0, 175, 0, 5, 0, 90, 10, 255, 255, 0, 0, 80, 88, 87, 110, 80, 175, 160, 95, 240, 15, 240, 15, 255, 255, 0, 0, 141, 201, 65, 65, 80, 175, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 141, 85, 85, 85, 0, 245, 0, 250, 0, 255, 0, 255, 255, 255, 0, 0, 53, 37, 5, 5, 10, 245, 5, 0, 0, 0, 0, 255, 255, 255, 0, 0, 54, 87, 85, 5, 10, 240, 0, 240, 0, 240, 15, 240, 255, 255, 0, 0, 22, 21, 21, 20, 15, 250, 175, 175, 255, 95, 175, 175, 255, 255, 0, 0, 36, 136, 192, 136, 5, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 87, 85, 85, 85, 245, 10, 250, 0, 255, 0, 255, 0, 255, 255, 0, 0, 99, 82, 80, 80, 250, 5, 240, 10, 240, 15, 240, 15, 255, 255, 0, 0, 114, 97, 65, 65, 240, 255, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 1, 65, 65, 65, 255, 5, 250, 5, 160, 15, 80, 175, 255, 255, 0, 0, 112, 114, 73, 141, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 240, 15, 240, 15, 240, 15, 0, 0, 255, 255, 0, 0, 65, 65, 65, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 255, 80, 250, 85, 160, 255, 0, 0, 255, 255, 0, 0, 208, 242, 9, 85, 255, 5, 255, 10, 170, 10, 0, 0, 255, 255, 0, 0, 112, 96, 106, 85, 160, 95, 80, 175, 0, 165, 0, 0, 255, 255, 0, 0, 201, 141, 181, 85, 0, 0, 80, 175, 255, 90, 0, 0, 255, 255, 0, 0, 85, 141, 224, 85, 0, 250, 0, 245, 0, 80, 0, 0, 255, 255, 0, 0, 37, 53, 213, 85, 5, 240, 10, 245, 250, 175, 0, 0, 255, 255, 0, 0, 23, 54, 130, 85, 15, 240, 15, 240, 5, 240, 0, 0, 255, 255, 0, 0, 20, 20, 23, 85, 15, 250, 15, 240, 15, 160, 0, 0, 255, 255, 0, 0, 36, 20, 148, 85, 5, 0, 10, 0, 95, 0, 0, 0, 255, 255, 0, 0, 87, 86, 92, 85, 250, 0, 245, 10, 80, 255, 0, 0, 255, 255, 0, 0, 82, 99, 13, 85, 240, 10, 250, 5, 95, 0, 0, 0, 255, 255, 0, 0, 97, 114, 92, 85, 0, 0, 0, 0, 240, 15, 240, 15, 255, 255, 0, 0, 85, 85, 65, 65, 0, 0, 0, 0, 240, 15, 240, 15, 255, 255, 0, 0, 85, 85, 65, 65, 0, 0, 0, 250, 0, 250, 0, 245, 255, 255, 0, 0, 85, 37, 37, 53, 0, 0, 0, 240, 5, 245, 10, 250, 255, 255, 0, 0, 85, 21, 55, 38, 0, 0, 10, 160, 10, 80, 5, 0, 255, 255, 0, 0, 85, 150, 214, 87, 0, 0, 15, 0, 175, 160, 255, 240, 255, 255, 0, 0, 85, 84, 152, 16, 0, 0, 175, 0, 95, 0, 15, 0, 255, 255, 0, 0, 85, 88, 92, 84, 0, 0, 0, 10, 80, 10, 255, 255, 255, 255, 0, 0, 85, 101, 109, 0, 0, 0, 160, 0, 165, 0, 255, 0, 255, 255, 0, 0, 85, 89, 91, 80, 0, 0, 0, 245, 0, 255, 160, 250, 255, 255, 0, 0, 85, 53, 5, 41, 0, 0, 15, 0, 15, 0, 15, 0, 255, 255, 0, 0, 85, 84, 84, 84, 0, 0, 255, 255, 255, 0, 255, 0, 255, 255, 0, 0, 85, 0, 80, 80, 0, 0, 95, 0, 255, 0, 175, 0, 255, 255, 0, 0, 85, 92, 80, 88, 0, 0, 255, 255, 255, 80, 255, 0, 255, 255, 0, 0, 85, 0, 208, 80, 0, 0, 10, 0, 175, 0, 255, 0, 255, 255, 0, 0, 85, 86, 88, 80, 0, 0, 10, 0, 90, 0, 165, 0, 255, 255, 0, 0, 85, 86, 94, 91, 240, 15, 240, 255, 240, 15, 240, 15, 255, 255, 0, 0, 65, 1, 65, 65, 240, 15, 255, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 64, 65, 65, 0, 240, 0, 240, 0, 160, 0, 80, 255, 255, 0, 0, 21, 21, 149, 213, 15, 255, 95, 255, 175, 175, 255, 95, 255, 255, 0, 0, 4, 12, 136, 192, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 245, 245, 240, 255, 160, 175, 160, 95, 255, 255, 0, 0, 51, 1, 137, 201, 10, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 86, 85, 85, 85, 160, 0, 160, 0, 255, 255, 90, 160, 255, 255, 0, 0, 89, 89, 0, 158, 10, 0, 10, 0, 255, 0, 5, 0, 255, 255, 0, 0, 86, 86, 80, 87, 160, 240, 90, 240, 255, 255, 0, 240, 255, 255, 0, 0, 25, 30, 0, 21, 15, 0, 15, 0, 255, 0, 15, 0, 255, 255, 0, 0, 84, 84, 80, 84, 255, 255, 255, 80, 255, 0, 255, 0, 255, 255, 0, 0, 0, 208, 80, 80, 10, 0, 175, 0, 255, 0, 175, 0, 255, 255, 0, 0, 86, 88, 80, 88, 255, 0, 255, 0, 255, 0, 255, 80, 255, 255, 0, 0, 80, 80, 80, 208, 255, 0, 255, 0, 255, 0, 95, 0, 255, 255, 0, 0, 80, 80, 80, 92, 160, 0, 160, 0, 160, 5, 80, 10, 255, 255, 0, 0, 89, 89, 121, 109, 240, 15, 240, 15, 0, 0, 0, 0, 255, 255, 0, 0, 65, 65, 85, 85, 240, 15, 240, 15, 0, 0, 0, 0, 255, 255, 0, 0, 65, 65, 85, 85, 0, 0, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 85, 85, 85, 65, 255, 15, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 64, 85, 85, 85, 0, 240, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 21, 85, 85, 65, 255, 5, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 112, 85, 85, 65, 0, 0, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 85, 85, 85, 1, 10, 160, 0, 0, 0, 0, 175, 5, 255, 255, 0, 0, 150, 85, 85, 120, 0, 0, 0, 0, 0, 0, 80, 250, 255, 255, 0, 0, 85, 85, 85, 45, 0, 240, 0, 0, 0, 0, 175, 5, 255, 255, 0, 0, 21, 85, 85, 120, 15, 0, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 84, 85, 85, 1, 255, 255, 0, 0, 0, 0, 255, 15, 255, 255, 0, 0, 0, 85, 85, 64, 90, 0, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 94, 85, 85, 65, 255, 255, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 0, 85, 85, 65, 10, 0, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 86, 85, 85, 1, 0, 10, 0, 0, 0, 0, 255, 15, 255, 255, 0, 0, 101, 85, 85, 64, 240, 15, 240, 15, 240, 175, 240, 95, 255, 255, 0, 0, 65, 65, 129, 193, 0, 0, 0, 0, 175, 0, 245, 10, 255, 255, 0, 0, 85, 85, 88, 99, 240, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 65, 65, 65, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 240, 95, 240, 175, 240, 175, 240, 95, 255, 255, 0, 0, 193, 129, 129, 193, 240, 15, 240, 15, 245, 15, 250, 15, 255, 255, 0, 0, 65, 65, 67, 66, 240, 15, 240, 15, 240, 15, 240, 255, 255, 255, 0, 0, 65, 65, 65, 1, 245, 10, 240, 15, 245, 10, 175, 5, 255, 255, 0, 0, 99, 65, 99, 120, 160, 95, 240, 95, 160, 255, 0, 165, 255, 255, 0, 0, 201, 193, 9, 181, 245, 10, 0, 0, 10, 0, 255, 10, 255, 255, 0, 0, 99, 85, 86, 96, 0, 240, 0, 240, 0, 240, 0, 240, 255, 255, 0, 0, 21, 21, 21, 21, 15, 0, 15, 0, 15, 0, 15, 0, 255, 255, 0, 0, 84, 84, 84, 84, 240, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 65, 65, 65, 240, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 65, 65, 65, 0, 0, 0, 0, 0, 160, 0, 245, 255, 255, 0, 0, 85, 85, 149, 53, 245, 10, 255, 0, 95, 0, 10, 0, 255, 255, 0, 0, 99, 80, 92, 86, 240, 15, 240, 15, 240, 95, 240, 175, 255, 255, 0, 0, 65, 65, 193, 129, 240, 15, 240, 15, 245, 10, 175, 0, 255, 255, 0, 0, 65, 65, 99, 88, 240, 15, 240, 15, 240, 255, 0, 0, 255, 255, 0, 0, 65, 65, 1, 85, 0, 0, 0, 0, 255, 15, 0, 0, 255, 255, 0, 0, 85, 85, 64, 85, 240, 15, 240, 15, 240, 15, 0, 0, 255, 255, 0, 0, 65, 65, 65, 85, 250, 15, 245, 15, 240, 15, 0, 0, 255, 255, 0, 0, 66, 67, 65, 85, 240, 15, 240, 15, 240, 15, 0, 0, 255, 255, 0, 0, 65, 65, 65, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 160, 95, 80, 250, 0, 0, 255, 255, 0, 0, 85, 201, 45, 85, 240, 15, 245, 10, 175, 5, 0, 0, 255, 255, 0, 0, 65, 99, 120, 85, 0, 240, 0, 240, 0, 240, 0, 0, 255, 255, 0, 0, 21, 21, 21, 85, 15, 0, 15, 0, 15, 0, 0, 0, 255, 255, 0, 0, 84, 84, 84, 85, 240, 15, 160, 95, 0, 250, 0, 0, 255, 255, 0, 0, 65, 201, 37, 85, 240, 15, 245, 10, 175, 0, 0, 0, 255, 255, 0, 0, 65, 99, 88, 85, 0, 255, 160, 95, 240, 255, 0, 0, 255, 255, 0, 0, 5, 201, 1, 85, 0, 0, 0, 0, 255, 15, 0, 0, 255, 255, 0, 0, 85, 85, 64, 85, 0, 0, 0, 0, 80, 250, 240, 15, 255, 255, 0, 0, 85, 85, 45, 65, 0, 0, 0, 0, 90, 0, 175, 0, 255, 255, 0, 0, 85, 85, 94, 88, 0, 0, 0, 0, 0, 0, 0, 250, 255, 255, 0, 0, 85, 85, 85, 37, 0, 0, 240, 15, 240, 15, 250, 15, 255, 255, 0, 0, 85, 65, 65, 66, 0, 0, 0, 250, 160, 95, 240, 15, 255, 255, 0, 0, 85, 37, 201, 65, 0, 0, 250, 15, 245, 15, 240, 15, 255, 255, 0, 0, 85, 66, 67, 65, 0, 0, 240, 15, 240, 15, 240, 175, 255, 255, 0, 0, 85, 65, 65, 129, 0, 0, 0, 0, 0, 0, 255, 5, 255, 255, 0, 0, 85, 85, 85, 112, 0, 0, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 85, 65, 65, 65, 0, 0, 0, 0, 0, 0, 245, 10, 255, 255, 0, 0, 85, 85, 85, 99, 0, 0, 240, 175, 240, 95, 240, 15, 255, 255, 0, 0, 85, 129, 193, 65, 0, 0, 175, 0, 245, 10, 240, 15, 255, 255, 0, 0, 85, 88, 99, 65, 0, 0, 0, 250, 160, 95, 240, 15, 255, 255, 0, 0, 85, 37, 201, 65, 0, 0, 250, 15, 245, 15, 240, 15, 255, 255, 0, 0, 85, 66, 67, 65, 0, 0, 0, 250, 160, 95, 240, 15, 255, 255, 0, 0, 85, 37, 201, 65, 0, 0, 10, 0, 175, 0, 255, 0, 255, 255, 0, 0, 85, 86, 88, 80, 0, 0, 0, 80, 0, 245, 0, 175, 255, 255, 0, 0, 85, 213, 53, 133, 255, 0, 175, 0, 15, 0, 0, 0, 255, 255, 0, 0, 80, 88, 84, 85, 160, 95, 240, 15, 240, 15, 160, 95, 255, 255, 0, 0, 201, 65, 65, 201, 245, 15, 240, 15, 240, 15, 245, 15, 255, 255, 0, 0, 67, 65, 65, 67, 240, 15, 160, 95, 80, 250, 240, 5, 255, 255, 0, 0, 65, 201, 45, 113, 240, 15, 245, 15, 250, 15, 240, 10, 255, 255, 0, 0, 65, 67, 66, 97, 240, 95, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 193, 65, 65, 65, 245, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 67, 65, 65, 65, 240, 95, 240, 255, 240, 175, 240, 15, 255, 255, 0, 0, 193, 1, 129, 65, 175, 0, 95, 0, 175, 0, 250, 5, 255, 255, 0, 0, 88, 92, 88, 114, 240, 15, 240, 95, 240, 175, 240, 15, 255, 255, 0, 0, 65, 193, 129, 65, 240, 15, 245, 10, 175, 0, 0, 0, 255, 255, 0, 0, 65, 99, 88, 85, 240, 15, 160, 95, 0, 250, 0, 0, 255, 255, 0, 0, 65, 201, 37, 85, 240, 15, 245, 15, 250, 15, 240, 15, 255, 255, 0, 0, 65, 67, 66, 65, 240, 15, 240, 15, 240, 15, 160, 95, 255, 255, 0, 0, 65, 65, 65, 201, 255, 0, 255, 0, 255, 0, 175, 0, 255, 255, 0, 0, 80, 80, 80, 88, 160, 10, 240, 255, 0, 0, 0, 0, 255, 255, 0, 0, 105, 1, 85, 85, 0, 0, 175, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 88, 85, 85, 0, 250, 0, 0, 0, 0, 165, 175, 255, 255, 0, 0, 37, 85, 85, 139, 250, 15, 0, 0, 0, 0, 5, 0, 255, 255, 0, 0, 66, 85, 85, 87, 80, 250, 0, 0, 0, 0, 255, 255, 255, 255, 0, 0, 45, 85, 85, 0, 175, 5, 0, 0, 0, 0, 0, 160, 255, 255, 0, 0, 120, 85, 85, 149, 240, 15, 0, 0, 0, 0, 255, 5, 255, 255, 0, 0, 65, 85, 85, 112, 240, 15, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 65, 85, 85, 1, 240, 15, 0, 0, 0, 0, 255, 0, 255, 255, 0, 0, 65, 85, 85, 80, 245, 10, 0, 0, 0, 0, 165, 175, 255, 255, 0, 0, 99, 85, 85, 139, 240, 15, 0, 0, 0, 0, 5, 80, 255, 255, 0, 0, 65, 85, 85, 215, 0, 0, 0, 0, 0, 0, 250, 10, 255, 255, 0, 0, 85, 85, 85, 98, 0, 0, 0, 0, 0, 0, 0, 165, 255, 255, 0, 0, 85, 85, 85, 181, 240, 15, 0, 0, 0, 0, 175, 5, 255, 255, 0, 0, 65, 85, 85, 120, 0, 250, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 37, 85, 85, 1, 10, 0, 0, 0, 0, 0, 255, 0, 255, 255, 0, 0, 86, 85, 85, 80, 240, 255, 240, 15, 240, 15, 240, 255, 255, 255, 0, 0, 1, 65, 65, 1, 255, 0, 0, 0, 0, 0, 255, 0, 255, 255, 0, 0, 80, 85, 85, 80, 250, 240, 0, 245, 0, 255, 0, 240, 255, 255, 0, 0, 18, 53, 5, 21, 15, 80, 10, 80, 0, 160, 10, 160, 255, 255, 0, 0, 212, 214, 149, 150, 175, 0, 95, 0, 255, 95, 5, 175, 255, 255, 0, 0, 88, 92, 192, 135, 0, 245, 0, 255, 0, 255, 0, 255, 255, 255, 0, 0, 53, 5, 5, 5, 245, 10, 0, 0, 250, 5, 245, 10, 255, 255, 0, 0, 99, 85, 114, 99, 0, 160, 0, 240, 0, 240, 0, 245, 255, 255, 0, 0, 149, 21, 21, 53, 175, 0, 15, 0, 10, 0, 5, 0, 255, 255, 0, 0, 88, 84, 86, 87, 255, 240, 250, 240, 160, 255, 250, 245, 255, 255, 0, 0, 16, 18, 9, 50, 15, 160, 10, 240, 0, 160, 10, 80, 255, 255, 0, 0, 148, 22, 149, 214, 95, 175, 15, 255, 95, 255, 175, 255, 255, 255, 0, 0, 140, 4, 12, 8, 0, 250, 0, 0, 0, 80, 0, 240, 255, 255, 0, 0, 37, 85, 213, 21, 245, 10, 245, 15, 175, 5, 15, 0, 255, 255, 0, 0, 99, 67, 120, 84, 240, 15, 240, 15, 240, 255, 240, 15, 255, 255, 0, 0, 65, 65, 1, 65, 0, 0, 0, 0, 255, 0, 0, 0, 255, 255, 0, 0, 85, 85, 80, 85, 240, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 65, 65, 65, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 240, 250, 245, 165, 175, 0, 0, 255, 255, 0, 0, 21, 50, 139, 85, 15, 0, 10, 160, 0, 80, 0, 0, 255, 255, 0, 0, 84, 150, 213, 85, 0, 255, 95, 175, 250, 10, 0, 0, 255, 255, 0, 0, 5, 140, 98, 85, 0, 255, 0, 250, 0, 160, 0, 0, 255, 255, 0, 0, 5, 37, 149, 85, 240, 15, 245, 10, 175, 5, 0, 0, 255, 255, 0, 0, 65, 99, 120, 85, 0, 250, 0, 255, 0, 255, 0, 0, 255, 255, 0, 0, 37, 5, 5, 85, 5, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 87, 85, 85, 85, 255, 240, 250, 245, 165, 175, 0, 0, 255, 255, 0, 0, 16, 50, 139, 85, 15, 0, 10, 160, 5, 80, 0, 0, 255, 255, 0, 0, 84, 150, 215, 85, 0, 255, 95, 95, 255, 10, 0, 0, 255, 255, 0, 0, 5, 204, 96, 85, 0, 0, 0, 240, 0, 240, 0, 0, 255, 255, 0, 0, 85, 21, 21, 85, 0, 0, 15, 0, 15, 0, 0, 0, 255, 255, 0, 0, 85, 84, 84, 85, 240, 15, 240, 15, 240, 255, 0, 0, 255, 255, 0, 0, 65, 65, 1, 85, 0, 0, 0, 0, 255, 0, 0, 0, 255, 255, 0, 0, 85, 85, 80, 85, 0, 0, 0, 0, 0, 0, 0, 165, 255, 255, 0, 0, 85, 85, 85, 181, 0, 0, 0, 0, 165, 0, 90, 0, 255, 255, 0, 0, 85, 85, 91, 94, 0, 0, 0, 240, 0, 240, 0, 240, 255, 255, 0, 0, 85, 21, 21, 21, 0, 0, 15, 0, 15, 0, 15, 240, 255, 255, 0, 0, 85, 84, 84, 20, 0, 0, 245, 175, 255, 0, 255, 15, 255, 255, 0, 0, 85, 131, 80, 64, 0, 0, 0, 80, 0, 240, 0, 255, 255, 255, 0, 0, 85, 213, 21, 5, 0, 0, 10, 0, 15, 0, 255, 0, 255, 255, 0, 0, 85, 86, 84, 80, 0, 0, 0, 160, 0, 250, 240, 250, 255, 255, 0, 0, 85, 149, 37, 33, 0, 0, 15, 240, 15, 240, 15, 240, 255, 255, 0, 0, 85, 20, 20, 20, 0, 0, 15, 240, 15, 240, 15, 0, 255, 255, 0, 0, 85, 20, 20, 84, 0, 0, 15, 240, 15, 240, 0, 240, 255, 255, 0, 0, 85, 20, 20, 21, 0, 0, 15, 240, 15, 0, 15, 240, 255, 255, 0, 0, 85, 20, 84, 20, 0, 0, 15, 240, 0, 240, 15, 240, 255, 255, 0, 0, 85, 20, 21, 20, 0, 0, 15, 80, 15, 0, 15, 0, 255, 255, 0, 0, 85, 212, 84, 84, 0, 0, 175, 160, 255, 240, 255, 245, 255, 255, 0, 0, 85, 152, 16, 48, 0, 0, 95, 0, 15, 0, 15, 0, 255, 255, 0, 0, 85, 92, 84, 84, 160, 95, 160, 95, 0, 165, 0, 0, 255, 255, 0, 0, 201, 201, 181, 85, 0, 0, 0, 0, 90, 0, 165, 0, 255, 255, 0, 0, 85, 85, 94, 91, 0, 240, 0, 240, 0, 240, 255, 240, 255, 255, 0, 0, 21, 21, 21, 16, 15, 0, 15, 0, 15, 0, 10, 0, 255, 255, 0, 0, 84, 84, 84, 86, 255, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 80, 80, 80, 80, 0, 240, 0, 240, 0, 240, 0, 240, 255, 255, 0, 0, 21, 21, 21, 21, 15, 0, 15, 0, 15, 0, 15, 0, 255, 255, 0, 0, 84, 84, 84, 84, 160, 240, 0, 240, 0, 240, 0, 240, 255, 255, 0, 0, 25, 21, 21, 21, 15, 160, 15, 160, 15, 0, 15, 240, 255, 255, 0, 0, 148, 148, 84, 20, 10, 0, 10, 240, 0, 240, 15, 80, 255, 255, 0, 0, 86, 22, 21, 212, 0, 240, 15, 240, 15, 240, 10, 240, 255, 255, 0, 0, 21, 20, 20, 22, 15, 240, 15, 240, 15, 240, 15, 240, 255, 255, 0, 0, 20, 20, 20, 20, 15, 240, 15, 240, 15, 240, 15, 240, 255, 255, 0, 0, 20, 20, 20, 20, 15, 0, 15, 0, 15, 0, 15, 0, 255, 255, 0, 0, 84, 84, 84, 84, 250, 250, 245, 255, 240, 255, 0, 0, 255, 255, 0, 0, 34, 3, 1, 85, 10, 0, 5, 0, 0, 0, 0, 0, 255, 255, 0, 0, 86, 87, 85, 85, 0, 0, 0, 0, 0, 0, 240, 175, 255, 255, 0, 0, 85, 85, 85, 129, 0, 0, 0, 0, 0, 0, 255, 165, 255, 255, 0, 0, 85, 85, 85, 176, 245, 175, 0, 0, 0, 0, 255, 5, 255, 255, 0, 0, 131, 85, 85, 112, 5, 0, 0, 0, 0, 0, 240, 10, 255, 255, 0, 0, 87, 85, 85, 97, 255, 0, 0, 0, 0, 0, 245, 5, 255, 255, 0, 0, 80, 85, 85, 115, 0, 80, 0, 0, 0, 0, 250, 0, 255, 255, 0, 0, 213, 85, 85, 82, 255, 5, 0, 0, 0, 0, 160, 255, 255, 255, 0, 0, 112, 85, 85, 9, 0, 240, 0, 0, 0, 0, 10, 0, 255, 255, 0, 0, 21, 85, 85, 86, 15, 240, 0, 0, 0, 0, 255, 250, 255, 255, 0, 0, 20, 85, 85, 32, 15, 160, 0, 0, 0, 0, 95, 0, 255, 255, 0, 0, 148, 85, 85, 92, 5, 240, 0, 0, 0, 0, 160, 255, 255, 255, 0, 0, 23, 85, 85, 9, 15, 240, 0, 0, 0, 0, 10, 0, 255, 255, 0, 0, 20, 85, 85, 86, 15, 240, 0, 0, 0, 0, 80, 95, 255, 255, 0, 0, 20, 85, 85, 205, 15, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 84, 85, 85, 85, 0, 0, 175, 160, 250, 250, 240, 255, 255, 255, 0, 0, 85, 152, 34, 1, 0, 0, 95, 0, 10, 0, 0, 0, 255, 255, 0, 0, 85, 92, 86, 85, 240, 95, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 193, 65, 65, 65, 240, 95, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 193, 65, 65, 65, 240, 15, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 65, 65, 65, 65, 160, 15, 80, 95, 80, 255, 0, 255, 255, 255, 0, 0, 73, 205, 13, 5, 250, 10, 255, 95, 95, 255, 10, 250, 255, 255, 0, 0, 98, 192, 12, 38, 175, 0, 175, 0, 95, 0, 95, 0, 255, 255, 0, 0, 88, 88, 92, 92, 250, 85, 255, 255, 255, 0, 250, 85, 255, 255, 0, 0, 242, 0, 80, 242, 175, 0, 255, 0, 0, 0, 175, 0, 255, 255, 0, 0, 88, 80, 85, 88, 255, 85, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 240, 80, 80, 80, 255, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 80, 80, 80, 80, 250, 85, 255, 0, 255, 0, 250, 85, 255, 255, 0, 0, 242, 80, 80, 242, 175, 0, 255, 0, 255, 0, 175, 0, 255, 255, 0, 0, 88, 80, 80, 88, 160, 175, 245, 250, 250, 245, 0, 0, 255, 255, 0, 0, 137, 35, 50, 85, 0, 0, 5, 0, 10, 80, 0, 0, 255, 255, 0, 0, 85, 87, 214, 85, 240, 255, 250, 250, 175, 160, 0, 0, 255, 255, 0, 0, 1, 34, 152, 85, 5, 0, 10, 0, 95, 0, 0, 0, 255, 255, 0, 0, 87, 86, 92, 85, 240, 15, 0, 0, 0, 0, 160, 5, 255, 255, 0, 0, 65, 85, 85, 121, 240, 15, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 65, 85, 85, 85, 240, 15, 0, 0, 0, 0, 165, 255, 255, 255, 0, 0, 65, 85, 85, 11, 0, 255, 0, 0, 0, 0, 5, 0, 255, 255, 0, 0, 5, 85, 85, 87, 5, 245, 0, 0, 0, 0, 250, 90, 255, 255, 0, 0, 55, 85, 85, 226, 15, 0, 0, 0, 0, 0, 0, 255, 255, 255, 0, 0, 84, 85, 85, 5, 160, 255, 0, 0, 0, 0, 255, 15, 255, 255, 0, 0, 9, 85, 85, 64, 10, 0, 0, 0, 0, 0, 240, 175, 255, 255, 0, 0, 86, 85, 85, 129, 255, 0, 0, 0, 0, 0, 10, 240, 255, 255, 0, 0, 80, 85, 85, 22, 255, 0, 0, 0, 0, 0, 15, 0, 255, 255, 0, 0, 80, 85, 85, 84, 160, 255, 0, 0, 0, 0, 240, 0, 255, 255, 0, 0, 9, 85, 85, 81, 10, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 86, 85, 85, 85, 0, 0, 165, 255, 255, 80, 250, 175, 255, 255, 0, 0, 85, 11, 208, 130, 0, 0, 10, 0, 175, 0, 5, 0, 255, 255, 0, 0, 85, 86, 88, 87, 0, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 85, 80, 80, 80, 0, 0, 255, 0, 255, 0, 255, 0, 255, 255, 0, 0, 85, 80, 80, 80, 80, 170, 0, 80, 0, 80, 80, 170, 255, 255, 0, 0, 173, 213, 213, 173, 5, 0, 175, 0, 175, 0, 5, 0, 255, 255, 0, 0, 87, 88, 88, 87, 90, 240, 160, 250, 250, 245, 255, 245, 255, 255, 0, 0, 30, 41, 50, 48, 15, 160, 15, 240, 15, 240, 15, 160, 255, 255, 0, 0, 148, 20, 20, 148, 95, 175, 15, 0, 15, 0, 95, 175, 255, 255, 0, 0, 140, 84, 84, 140, 0, 0, 0, 0, 0, 160, 0, 250, 255, 255, 0, 0, 85, 85, 149, 37, 245, 10, 175, 0, 15, 0, 5, 0, 255, 255, 0, 0, 99, 88, 84, 87, 240, 95, 240, 15, 240, 15, 240, 15, 255, 255, 0, 0, 193, 65, 65, 65, 0, 240, 0, 0, 0, 0, 0, 240, 255, 255, 0, 0, 21, 85, 85, 21, 15, 0, 0, 240, 0, 0, 15, 0, 255, 255, 0, 0, 84, 21, 85, 84, 240, 0, 255, 255, 240, 0, 240, 0, 255, 255, 0, 0, 81, 0, 81, 81, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 80, 250, 250, 5, 160, 255, 0, 0, 255, 255, 0, 0, 45, 114, 9, 85, 175, 0, 255, 0, 90, 0, 0, 0, 255, 255, 0, 0, 88, 80, 94, 85, 255, 0, 255, 85, 245, 175, 0, 0, 255, 255, 0, 0, 80, 240, 131, 85, 255, 0, 255, 0, 255, 0, 0, 0, 255, 255, 0, 0, 80, 80, 80, 85, 160, 5, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 121, 85, 85, 65, 0, 0, 0, 0, 0, 0, 80, 175, 255, 255, 0, 0, 85, 85, 85, 141, 245, 250, 0, 0, 0, 0, 160, 0, 255, 255, 0, 0, 35, 85, 85, 89, 15, 0, 0, 0, 0, 0, 250, 5, 255, 255, 0, 0, 84, 85, 85, 114, 250, 90, 0, 0, 0, 0, 240, 15, 255, 255, 0, 0, 226, 85, 85, 65, 0, 255, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 5, 85, 85, 1, 255, 15, 0, 0, 0, 0, 255, 15, 255, 255, 0, 0, 64, 85, 85, 64, 240, 15, 0, 0, 0, 0, 240, 255, 255, 255, 0, 0, 65, 85, 85, 1, 0, 240, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 21, 85, 85, 85, 15, 0, 0, 0, 0, 240, 0, 0, 255, 255, 0, 0, 84, 85, 21, 85, 0, 0, 0, 0, 255, 255, 0, 0, 255, 255, 0, 0, 85, 85, 0, 85, 0, 0, 0, 240, 0, 250, 0, 245, 255, 255, 0, 0, 85, 21, 37, 53, 0, 0, 0, 240, 10, 240, 5, 80, 255, 255, 0, 0, 85, 21, 22, 215, 0, 0, 15, 240, 15, 240, 10, 160, 255, 255, 0, 0, 85, 20, 20, 150, 0, 0, 15, 255, 15, 255, 10, 170, 255, 255, 0, 0, 85, 4, 4, 166, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 240, 15, 160, 10, 0, 0, 0, 0, 255, 255, 0, 0, 65, 105, 85, 85, 160, 80, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 217, 85, 85, 85, 95, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 92, 85, 85, 85, 160, 10, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 105, 85, 85, 85, 240, 15, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 65, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 240, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 21, 85, 85, 85, 255, 255, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 0, 85, 85, 85, 0, 10, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 101, 85, 85, 85, 10, 160, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 150, 85, 85, 85, 5, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 87, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85, 85, 0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 0, 0, 85, 85, 85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, 0, 0, 0, 5, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 14, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 5, 0, 0, 0, 14, 0, 0, 0, 5, 95, 0, 0, 0, 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, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 13, 0, 0, 0, 0, 0, 0, 0, 7, 95, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 65, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, 64, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 0, 65, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 224, 64, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 48, 65, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 160, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 64, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 32, 65, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, 64, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 160, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 192, 64, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 224, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 65, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 224, 64, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 224, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 128, 64, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 128, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 64, 0, 0, 128, 63, 0}); + Font = cm.Load("tmpfont"); + _defFont = Font; + File.Delete("content/tmpfont.xnb"); + #endregion + } + + public static void SetFont(SpriteFont font) { + if (font == null) + return; + + Font = font; + } + + public static void ResetFont() { + Font = _defFont; + } + + public static Texture2D GetPixelTexture() { + return Pixel; + } + + public static void Texture(Texture2D texture, int x, int y, int w, int h) { + SpriteBatch.Draw(texture, new Rectangle(x, y, w, h), Color.White); + } + + public static void Texture(Texture2D texture, int x, int y, int w, int h, Color col) { + SpriteBatch.Draw(texture, new Rectangle(x, y, w, h), col); + } + + public static void Texture(Texture2D texture, int x, int y, int w, int h, Color col, float rotation) { + SpriteBatch.Draw(texture, new Rectangle(x, y, w, h), null, col, rotation, new Vector2(w / 2, h / 2), SpriteEffects.None, 0); + } + + public static void Box(int x, int y, int w, int h, Color col) { + SpriteBatch.Draw(Pixel, new Rectangle(x, y, w, h), col); + } + + public static void OutlinedBox(int x, int y, int w, int h, int bordersize, Color col) { + if (bordersize == 0) + return; + + SpriteBatch.Draw(Pixel, new Rectangle(x + bordersize, y, w - bordersize * 2, bordersize), col); // u + SpriteBatch.Draw(Pixel, new Rectangle(x, y, bordersize, h), col); // l + SpriteBatch.Draw(Pixel, new Rectangle(x + w - bordersize, y, bordersize, h), col); // r + SpriteBatch.Draw(Pixel, new Rectangle(x + bordersize, y + h - bordersize, w - bordersize * 2, bordersize), col); // d + } + + public static void Text(string text, int x, int y) { + SpriteBatch.DrawString(Font, text, new Vector2(x, y), Color.White); + } + + public static void Text(string text, int x, int y, Color col) { + SpriteBatch.DrawString(Font, text, new Vector2(x, y), col); + } + + public static void Line(int x0, int y0, int x1, int y1, Color color){ + float ang = (float)-Math.Atan2(x0 - x1, y0 - y1) - (float)(Math.PI / 2); + float dist = (float)Math.Sqrt(((x0 - x1) * (x0 - x1)) + ((y0 - y1) * (y0 - y1))); + + SpriteBatch.Draw(Pixel, new Vector2(x0, y0), null, color, ang, new Vector2(0, 0), new Vector2((int)dist, 1), SpriteEffects.None, 0); + } + + public static void Line(int x0, int y0, int x1, int y1, float width, Color color) + { + float ang = (float)-Math.Atan2(x0 - x1, y0 - y1) - (float)(Math.PI / 2); + float dist = (float)Math.Sqrt(((x0 - x1) * (x0 - x1)) + ((y0 - y1) * (y0 - y1))); + + SpriteBatch.Draw(Pixel, new Vector2(x0, y0), null, color, ang, new Vector2(0, 0.5f), new Vector2((int)dist, width), SpriteEffects.None, 0); + } + + public static void DrawTexturePart(Texture2D texture, int x, int y, int px1, int py1, int width, int height){ + SpriteBatch.Draw( + texture, new Vector2(x, y), new Rectangle(px1, py1, width, height), + Color.White, 0, new Vector2(0, 0), + 1, SpriteEffects.None, 1); + } + + public static void DrawTexturePart(Texture2D texture, int x, int y, int px1, int py1, int width, int height, Color col){ + SpriteBatch.Draw( + texture, new Vector2(x, y), new Rectangle(px1, py1, width, height), + col, 0, new Vector2(0, 0), + 1, SpriteEffects.None, 1); + } + + public static Vector2 GetFontSize(SpriteFont font){ + return font.MeasureString("W"); + } + + public static Vector2 GetTextSize(SpriteFont font, string text) + { + return font.MeasureString(text); + } + + public static Vector2 GetTextSize(string text) + { + return Font.MeasureString(text); + } + + public static void TextShadow(string text, int x, int y, Color col, Color shadowColor, TextAlignmentX AlignX, TextAlignmentY AlignY, int OffsetX, int OffsetY) { + Text(text, x + OffsetX, y + OffsetY, shadowColor, AlignX, AlignY); + Text(text, x, y, col, AlignX, AlignY); + } + + public static void Text(SpriteFont font, string text, int x, int y, Color col, TextAlignmentX AlignX, TextAlignmentY AlignY) { + if (font == null) + font = Font; + + Vector2 ts = font.MeasureString(text); + + switch(AlignX){ + case TextAlignmentX.Left: + break; + + case TextAlignmentX.Right: + x -= (int)ts.X; + break; + + case TextAlignmentX.Center: + x -= (int)(ts.X / 2); + break; + } + + switch(AlignY){ + case TextAlignmentY.Top: + break; + + case TextAlignmentY.Bottom: + y -= (int)ts.Y; + break; + + case TextAlignmentY.Center: + y -= (int)(ts.Y / 2); + break; + } + + SpriteBatch.DrawString(font, text, new Vector2(x, y), col); + } + + public static void Text(string text, int x, int y, Color col, TextAlignmentX AlignX, TextAlignmentY AlignY) { + Vector2 ts = Font.MeasureString(text); + + switch(AlignX){ + case TextAlignmentX.Left: + break; + + case TextAlignmentX.Right: + x -= (int)ts.X; + break; + + case TextAlignmentX.Center: + x -= (int)(ts.X / 2); + break; + } + + switch(AlignY){ + case TextAlignmentY.Top: + break; + + case TextAlignmentY.Bottom: + y -= (int)ts.Y; + break; + + case TextAlignmentY.Center: + y -= (int)(ts.Y / 2); + break; + } + + SpriteBatch.DrawString(Font, text, new Vector2(x, y), col); + } + + public static void Text(string text, int x, int y, Color col, TextAlignmentX AlignX, TextAlignmentY AlignY, float rotation) { + Vector2 ts = Font.MeasureString(text); + x += (int)(ts.X / 2); + y += (int)(ts.Y / 2); + + switch(AlignX){ + case TextAlignmentX.Left: + break; + + case TextAlignmentX.Right: + x -= (int)ts.X; + break; + + case TextAlignmentX.Center: + x -= (int)(ts.X / 2); + break; + } + + switch(AlignY){ + case TextAlignmentY.Top: + break; + + case TextAlignmentY.Bottom: + y -= (int)ts.Y; + break; + + case TextAlignmentY.Center: + y -= (int)(ts.Y / 2); + break; + } + + SpriteBatch.DrawString(Font, text, new Vector2(x, y), col, rotation, new Vector2(ts.X / 2, ts.Y / 2), 1, SpriteEffects.None, 0); + } + } +} diff --git a/MrAG/Gamerservices.cs b/MrAG/Gamerservices.cs new file mode 100644 index 0000000..ab519c1 --- /dev/null +++ b/MrAG/Gamerservices.cs @@ -0,0 +1,266 @@ +using System; +using System.Diagnostics; +using System.Collections.Generic; + +namespace MrAG +{ + public class Gamerservices + { + public class GamerServicesException : Exception{ + public GamerServicesException(string msg): base(msg){ + } + } + + private struct AvatarRequest{ + public string user; + public Action cb; + } + + public static Action> ServerListCallback; + public static Action IncommingTCPPacket; + public static Dictionary Avatars = new Dictionary(); + + private static string User = ""; + private static string SessID = ""; + private static bool LoggedIn = false; + + private static string GameName = ""; + private static string APIKey = ""; + private static bool DebugMode = false; + + private static Microsoft.Xna.Framework.Graphics.GraphicsDevice GraphicsDevice; + + private static System.Collections.Generic.List AvatarRequests = new System.Collections.Generic.List(); + private static MrAG.Networking.TCPClient APIConnection; + + public static MrAG.Networking.TCPClient GetAPIConnection() { + return APIConnection; + } + + public static bool GetDebug(){ + return DebugMode; + } + + public static void SetDebug(bool debug){ + DebugMode = debug; + } + + public static string GetSessID(){ + return SessID; + } + + public static string GetAPIKey(){ + return APIKey; + } + + public static string GetUser(){ + return User; + } + + public static void SetAPIKey(string key){ + APIKey = key; + } + + public static string GetIdentifier(){ + return GameName; + } + + public static void SetIdentifier(string id){ + GameName = id; + } + + public static void SetUsername(string user) { + User = user; + } + + public static bool IsLoggedIn(){ + return LoggedIn; + } + + public static void SetGraphicsDevice(Microsoft.Xna.Framework.Graphics.GraphicsDevice gs){ + GraphicsDevice = gs; + } + + public static Microsoft.Xna.Framework.Graphics.Texture2D GetAvatar(string user) { + if (Avatars.ContainsKey(user)) + return Avatars[user]; + else + return null; + } + + public static void RequestAvatar(string user, Action Callback) { + AvatarRequests.Add(new AvatarRequest(){user = user, cb = Callback}); + + MrAG.Gamerservices.APIConnection.Send(6, 0, user); + } + + public static void Print(string head, string[] keys, string[] values){ + string remotetext = head + "\r\n"; + + System.Diagnostics.Debug.Print(head); + for (int i = 0; i < keys.Length; i++){ + System.Diagnostics.Debug.Print("\t" + keys[i] + ": " + values[i]); + remotetext += "\t" + keys[i] + ": " + values[i] + "\r\n"; + } + + System.Diagnostics.Debug.Print(""); + GetAPIConnection().Send(5, remotetext.Length + 4, remotetext.Substring(0, remotetext.Length - 1)); + } + + public static void Print(string text){ + System.Diagnostics.Debug.Print(text); + GetAPIConnection().Send(5, text.Length + 5, text); + } + + public static bool Login(bool EnableDrawNoticeSystem){ + if (LoggedIn) return false; + + string[] args = Environment.GetCommandLineArgs(); + if (args.Length > 1) { + string sessID = args[args.Length - 2]; + int APIPort = int.Parse(args[args.Length - 1]); + + try { + APIConnection = new MrAG.Networking.TCPClient("127.0.0.1", APIPort); + } catch { + throw new GamerServicesException("Failed to connect to the API service!"); + } + + APIConnection.Send(0, sessID.Length + APIKey.Length + GameName.Length + 13, sessID, APIKey, GameName); + + APIConnection.Packets[0] = new Action(Packet_00); + APIConnection.Packets[1] = new Action(Packet_01); + APIConnection.Packets[2] = new Action(Packet_02); + APIConnection.Packets[3] = new Action(Packet_03); + APIConnection.Packets[5] = new Action(Packet_05); + APIConnection.Packets[6] = new Action(Packet_06); + APIConnection.Packets[7] = new Action(Packet_07); + + while (User.Length == 0) { + APIConnection.Update(); + } + + LoggedIn = true; + + Achievements.Load(); + Overlay.InitilizeSystem(EnableDrawNoticeSystem); + } else { + return false; + } + + + return true; + } + + public static void Update() { + if (APIConnection != null) { + APIConnection.OnRecieve = IncommingTCPPacket; + APIConnection.Update(); + } + } + + public static void LogOut(){ + if (User != null && User.Length > 0) + GetAPIConnection().Send(4, 1); + + User = ""; + SessID = ""; + LoggedIn = false; + + Overlay.Close(); + } + + private static void Packet_00(MrAG.Networking.Packet p){ + User = p.ReadString(); + } + + private static void Packet_01(MrAG.Networking.Packet p){ + p.Send(1, 1); + } + + private static void Packet_02(MrAG.Networking.Packet p){ + byte type = p.ReadByte(); + + switch (type) { + case 0: + short loops = p.ReadShort(); + for (short i = 0; i < loops; i++) { + string name = p.ReadString(); + Achievements.AchievementList[name] = new Achievements.Achievement(); + Achievements.AchievementList[name].Name = name; + Achievements.AchievementList[name].Hash = p.ReadString(); + Achievements.AchievementList[name].Desc = p.ReadString(); + Achievements.AchievementList[name].CurrentValue = p.ReadInt(); + Achievements.AchievementList[name].TargetValue = p.ReadInt(); + Achievements.AchievementList[name].Points = p.ReadByte(); + Achievements.AchievementList[name].Completed = Achievements.AchievementList[name].CurrentValue >= Achievements.AchievementList[name].TargetValue; + Achievements.AchievementList[name].ID = i; + } + break; + } + } + + private static void Packet_03(MrAG.Networking.Packet p){ + MrAG.Leaderboard.SubmittedEntry.Rank = p.ReadInt(); + + MrAG.Gamerservices.GetAPIConnection().Send(5, 0, "Recieved leaderboard pos " + MrAG.Leaderboard.SubmittedEntry.Rank); + } + + private static void Packet_05(MrAG.Networking.Packet p){ + string title = p.ReadString(); + string msg = p.ReadString(); + byte icon = p.ReadByte(); + + Overlay.AddNotice(icon, title, msg); + } + + private static void Packet_06(MrAG.Networking.Packet p){ + string user = p.ReadString(); + string url = p.ReadString(); + + if (GraphicsDevice == null) + return; + + System.Net.WebClient wc = new System.Net.WebClient(); + wc.Proxy = null; + + System.IO.MemoryStream ms = new System.IO.MemoryStream(wc.DownloadData(url)); + System.Drawing.Image img = System.Drawing.Image.FromStream(ms); + + + System.IO.MemoryStream ms2 = new System.IO.MemoryStream(); + + img.Save(ms2, System.Drawing.Imaging.ImageFormat.Png); + + Microsoft.Xna.Framework.Graphics.Texture2D tex = Microsoft.Xna.Framework.Graphics.Texture2D.FromStream(GraphicsDevice, ms2); + ms.Close(); + + Avatars[user] = tex; + + for (int i = 0; i < AvatarRequests.Count; i++) { + if (AvatarRequests[i].user == user) { + AvatarRequests[i].cb.DynamicInvoke(user, tex); + AvatarRequests.RemoveAt(i); + + break; + } + } + } + + private static void Packet_07(MrAG.Networking.Packet p){ + int count = p.ReadInt(); + List servers = new List(); + + for (int i = 0; i < count; i++) + servers.Add(new MrAG.Serverlist.ServerInfo(){IP = p.ReadString(), + Port = p.ReadInt(), + Servername = p.ReadString(), + Meta = p.ReadString(), + Users = p.ReadInt(), + MaxUsers = p.ReadInt()}); + + + ServerListCallback.DynamicInvoke(servers); + } + } +} \ No newline at end of file diff --git a/MrAG/Gui.cs b/MrAG/Gui.cs new file mode 100644 index 0000000..7aa6121 --- /dev/null +++ b/MrAG/Gui.cs @@ -0,0 +1,474 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Input; +using Microsoft.Xna.Framework.Graphics; + +namespace MrAG { + public partial class Gui { + public class Key { + public bool Shift, Alt, Ctrl; + public string Letter; + public int Char; + } + + public enum MouseKey : byte {Left = 1, Right = 2, Middle = 3} + public static MouseState CurMouseState = Mouse.GetState(); + public static System.Windows.Forms.Form MainForm; + + public static Action OnScreenMouseClick; + public static Action OnScreenMouseUp; + public static Action OnScreenMouseDown; + public static Action OnScreenKeyPress; + + public static bool AcceptInput = true; + + + private static List Objects = new List(); + private static int curscrollval = 0; + private static Base _currentfocus; + internal static bool BroughtToFront; + + public static Base CurrentFocus{ + get { + return _currentfocus; + } + set { + if (_currentfocus != null) { + _currentfocus.FocusLost(); + + if (_currentfocus.OnUnFocus != null) + _currentfocus.OnUnFocus.Invoke(); + } + + _currentfocus = value; + + if (_currentfocus != null){ + _currentfocus.FocusGained(); + + if (_currentfocus.OnFocus != null) + _currentfocus.OnFocus.Invoke(); + } + } + } + + public static void Initialize(GameWindow w) { + MainForm = (System.Windows.Forms.Form)System.Windows.Forms.Form.FromHandle(w.Handle); + + MainForm.KeyPreview = true; + MainForm.PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(KeyPress); + MainForm.MouseClick += new System.Windows.Forms.MouseEventHandler(MouseClick); + MainForm.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(MouseDoubleClick); + MainForm.MouseUp += new System.Windows.Forms.MouseEventHandler(MouseUp); + MainForm.MouseDown += new System.Windows.Forms.MouseEventHandler(MouseDown); + } + + public static void AddObject(Gui.Base obj) { + obj.Removed = false; + + Objects.Add(obj); + } + + public static void RemoveObject(Gui.Base obj) { + obj.Removed = true; + + if (obj.Parent != null) { + obj.Parent.Children.Remove(obj); + } else { + Objects.Remove(obj); + } + } + + public static void Draw() { + for (int i = 0; i < Objects.Count; i++){ + if (Objects[i].Render){ + Objects[i].Draw(); + + if (BroughtToFront){ + BroughtToFront = false; + i--; + } + } + } + } + + public static string ParseOemKey(string Input, bool Shift) + { + switch (Input) + { + case "Space": return " "; + case "Tab": return " "; + case "OemMinus": return Shift ? "_" : "-"; + case "Oemplus": return Shift ? "+" : "="; + case "OemPeriod": return Shift ? ">" : "."; + case "Oemcomma": return Shift ? "<" : ","; + case "OemQuestion": return Shift ? "?" : "/"; + case "OemOpenBrackets": return Shift ? "{" : "["; + case "Oem1": return Shift ? ":" : ";"; + case "Oem5": return Shift ? "|" : "\\"; + case "Oem6": return Shift ? "}" : "]"; + case "Oem7": return Shift ? "\"" : "'"; + case "Return": return "\n"; + case "ShiftKey": return ""; + case "Back": return "Backspace"; + } + + return ""; + } + + public static string ParseNumberKey(string Input, bool Shift) + { + int Num = int.Parse(Input[Input.Length - 1].ToString()); + + if (Shift) + { + switch (int.Parse(Input[1].ToString())) + { + case 1: return "!"; + case 2: return "@"; + case 3: return "#"; + case 4: return "$"; + case 5: return "%"; + case 6: return "^"; + case 7: return "&"; + case 8: return "*"; + case 9: return "("; + case 0: return ")"; + } + } + else + return Num.ToString(); + + return ""; + } + + private static void KeyPress(object sender, System.Windows.Forms.PreviewKeyDownEventArgs args) { + string letter = ""; + string[] Parts = args.KeyData.ToString().Split(new string[] { ", " }, StringSplitOptions.None); + + if (Parts[0].Length == 1) + { + if (args.Shift) + letter += Parts[0].ToUpper(); + else + letter += Parts[0].ToLower(); + } + else if ((Parts[0].Length == 2 && Parts[0][0] == 'D') || Parts[0].StartsWith("NumPad")) + letter += ParseNumberKey(Parts[0], args.Shift); + else + { + letter += ParseOemKey(Parts[0], args.Shift); + } + + + Key keypressed = new Key { + Alt = args.Alt, + Ctrl = args.Control, + Shift = args.Shift, + Letter = letter, + Char = (int)args.KeyCode + }; + + if (CurrentFocus != null && CurrentFocus.Render && AcceptInput) { + if (CurrentFocus.Enabled){ + CurrentFocus.KeyPress(keypressed); + + if (CurrentFocus.OnKeyPress != null) + CurrentFocus.OnKeyPress.Invoke(); + } + } else { + if (OnScreenKeyPress != null) + OnScreenKeyPress.Invoke(keypressed); + } + } + + private static void MouseClick(object sender, System.Windows.Forms.MouseEventArgs args) { + if (AcceptInput){ + byte btn = 0; + switch (args.Button) { + case System.Windows.Forms.MouseButtons.Left: + btn = 1; + break; + + case System.Windows.Forms.MouseButtons.Right: + btn = 2; + break; + + case System.Windows.Forms.MouseButtons.Middle: + btn = 3; + break; + } + + if (CurrentFocus != null) { + if (CurrentFocus.Hovering()) { + if (!DoMouseAction(CurrentFocus, btn, 2)) { + if (OnScreenMouseClick != null) + OnScreenMouseClick.Invoke(args.X, args.Y, (MouseKey)btn); + } + } else { + CurrentFocus = null; + } + } else { + if (OnScreenMouseClick != null) + OnScreenMouseClick.Invoke(args.X, args.Y, (MouseKey)btn); + } + } + } + + private static void MouseDoubleClick(object sender, System.Windows.Forms.MouseEventArgs args) { + if (AcceptInput){ + byte btn = 0; + switch (args.Button) { + case System.Windows.Forms.MouseButtons.Left: + btn = 1; + break; + + case System.Windows.Forms.MouseButtons.Right: + btn = 2; + break; + + case System.Windows.Forms.MouseButtons.Middle: + btn = 3; + break; + } + + if (CurrentFocus != null) { + if (CurrentFocus.Hovering()) { + if (!DoMouseAction(CurrentFocus, btn, 3)) { + if (OnScreenMouseClick != null) + OnScreenMouseClick.Invoke(args.X, args.Y, (MouseKey)btn); + } + } else { + CurrentFocus = null; + } + } else { + if (OnScreenMouseClick != null) + OnScreenMouseClick.Invoke(args.X, args.Y, (MouseKey)btn); + } + } + } + + private static void MouseUp(object sender, System.Windows.Forms.MouseEventArgs args) { + if (AcceptInput){ + byte btn = 0; + switch (args.Button) { + case System.Windows.Forms.MouseButtons.Left: + btn = 1; + break; + + case System.Windows.Forms.MouseButtons.Right: + btn = 2; + break; + + case System.Windows.Forms.MouseButtons.Middle: + btn = 3; + break; + } + + if (CurrentFocus != null){ + if (CurrentFocus.Hovering()) { + if (!DoMouseAction(CurrentFocus, btn, 1)) { + if (OnScreenMouseUp != null) + OnScreenMouseUp.Invoke(args.X, args.Y, (MouseKey)btn); + } + } else { + CurrentFocus = null; + } + }else{ + if (OnScreenMouseUp != null) + OnScreenMouseUp.Invoke(args.X, args.Y, (MouseKey)btn); + } + } + } + + private static void MouseDown(object sender, System.Windows.Forms.MouseEventArgs args) { + byte btn = 0; + switch (args.Button) { + case System.Windows.Forms.MouseButtons.Left: + btn = 1; + break; + + case System.Windows.Forms.MouseButtons.Right: + btn = 2; + break; + + case System.Windows.Forms.MouseButtons.Middle: + btn = 3; + break; + } + + if (AcceptInput){ + CurrentFocus = null; + + for(int i = Objects.Count - 1; i > -1; i--) + if (DoMouseAction(Objects[i], btn, 0)) + return; + } + + if (OnScreenMouseDown != null) + OnScreenMouseDown.Invoke(args.X, args.Y, (MouseKey)btn); + } + + private static bool DoMouseAction(Base obj, byte btn, byte press){ + if (!obj.Render || !obj.Enabled) return false; + + int x = MrAG.Gui.CurMouseState.X; + int y = MrAG.Gui.CurMouseState.Y; + + bool yes = false; + for(int i = obj.Children.Count - 1; i > -1; i--){ + if (DoMouseAction(obj.Children[i], btn, press)){ + yes = true; + break; + } + } + + if (!yes) + if (obj.Hovering()){ + yes = true; + CurrentFocus = obj; + obj.SetFocus(); + if (press != 1)obj.BringToFront(); + + if (obj.Enabled) { + switch (press){ + case 0: + switch (btn) { + case 1: + obj.LeftMousePress(x - obj.X, y - obj.Y); + if (obj.OnLeftMousePress != null) obj.OnLeftMousePress.Invoke(); + if (obj.OnArgumentedLeftMousePress != null) obj.OnArgumentedLeftMousePress.Invoke(obj); + break; + + case 2: + obj.RightMousePress(x - obj.X, y - obj.Y); + if (obj.OnRightMousePress != null) obj.OnRightMousePress.Invoke(); + if (obj.OnArgumentedRightMousePress != null) obj.OnArgumentedRightMousePress.Invoke(obj); + break; + + case 3: + obj.MiddleMousePress(x - obj.X, y - obj.Y); + if (obj.OnLeftMousePress != null) obj.OnLeftMousePress.Invoke(); + if (obj.OnArgumentedLeftMousePress != null) obj.OnArgumentedLeftMousePress.Invoke(obj); + break; + } + break; + + case 1: + switch (btn) { + case 1: + obj.LeftMouseRelease(x - obj.X, y - obj.Y); + if (obj.OnLeftMouseRelease != null) obj.OnLeftMouseRelease.Invoke(); + if (obj.OnArgumentedLeftMouseRelease != null) obj.OnArgumentedLeftMouseRelease.Invoke(obj); + break; + + case 2: + obj.RightMouseRelease(x - obj.X, y - obj.Y); + if (obj.OnRightMouseRelease != null) obj.OnRightMouseRelease.Invoke(); + if (obj.OnArgumentedRightMouseRelease != null) obj.OnArgumentedRightMouseRelease.Invoke(obj); + break; + + case 3: + obj.MiddleMouseRelease(x - obj.X, y - obj.Y); + if (obj.OnLeftMouseRelease != null) obj.OnLeftMouseRelease.Invoke(); + if (obj.OnArgumentedLeftMouseRelease != null) obj.OnArgumentedLeftMouseRelease.Invoke(obj); + break; + } + break; + + case 2: + obj.DoClick(x - obj.X, y - obj.Y, (MouseKey)btn); + switch (btn) { + case 1: + obj.LeftMouseClick(x - obj.X, y - obj.Y); + if (obj.OnLeftMouseClick != null) obj.OnLeftMouseClick.Invoke(); + if (obj.OnArgumentedLeftMouseClick != null) obj.OnArgumentedLeftMouseClick.Invoke(obj); + break; + + case 2: + obj.RightMouseClick(x - obj.X, y - obj.Y); + if (obj.OnRightMouseClick != null) obj.OnRightMouseClick.Invoke(); + if (obj.OnArgumentedRightMouseClick != null) obj.OnArgumentedRightMouseClick.Invoke(obj); + break; + + case 3: + obj.MiddleMouseClick(x - obj.X, y - obj.Y); + if (obj.OnLeftMouseClick != null) obj.OnLeftMouseClick.Invoke(); + if (obj.OnArgumentedLeftMouseClick != null) obj.OnArgumentedLeftMouseClick.Invoke(obj); + break; + } + break; + + case 3: + obj.DoDoubleClick(x - obj.X, y - obj.Y, (MouseKey)btn); + switch (btn) { + case 1: + obj.LeftMouseClick(x - obj.X, y - obj.Y); + if (obj.OnLeftDoubleMouseClick != null) obj.OnLeftDoubleMouseClick.Invoke(); + if (obj.OnArgumentedLeftDoubleMouseClick != null) obj.OnArgumentedLeftDoubleMouseClick.Invoke(obj); + break; + + case 2: + obj.RightMouseClick(x - obj.X, y - obj.Y); + if (obj.OnRightDoubleMouseClick != null) obj.OnRightDoubleMouseClick.Invoke(); + if (obj.OnArgumentedRightDoubleMouseClick != null) obj.OnArgumentedRightDoubleMouseClick.Invoke(obj); + break; + + case 3: + obj.MiddleMouseClick(x - obj.X, y - obj.Y); + if (obj.OnLeftDoubleMouseClick != null) obj.OnLeftDoubleMouseClick.Invoke(); + if (obj.OnArgumentedLeftDoubleMouseClick != null) obj.OnArgumentedLeftDoubleMouseClick.Invoke(obj); + break; + } + break; + } + } + } + + return yes; + } + + public static void Update() { + CurMouseState = Mouse.GetState(); + + int scrollrem = curscrollval - CurMouseState.ScrollWheelValue; + if (scrollrem != 0) { + if (CurrentFocus != null) { + bool up = scrollrem < 0; + if (scrollrem < 0) + scrollrem = -scrollrem; + + while (scrollrem > 0) { + if (up) { + CurrentFocus.DoScrollUp(); + + if (CurrentFocus.OnScrollUp != null) + CurrentFocus.OnScrollUp.Invoke(); + + } else { + CurrentFocus.DoScrollDown(); + + if (CurrentFocus.OnScrollDown != null) + CurrentFocus.OnScrollDown.Invoke(); + } + + scrollrem -= 120; + } + } + + curscrollval = CurMouseState.ScrollWheelValue; + } + + for (int i = 0; i < Objects.Count; i++){ + Objects[i].Update(); + + if (BroughtToFront){ + BroughtToFront = false; + i--; + } + } + } + } +} diff --git a/MrAG/Gui/Base.cs b/MrAG/Gui/Base.cs new file mode 100644 index 0000000..d894fde --- /dev/null +++ b/MrAG/Gui/Base.cs @@ -0,0 +1,356 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MrAG { + public partial class Gui { + public class Base { + #region actions + public Action OnLeftMousePress; + public Action OnLeftMouseRelease; + public Action OnLeftMouseClick; + public Action OnLeftDoubleMouseClick; + public Action OnRightMousePress; + public Action OnRightMouseRelease; + public Action OnRightMouseClick; + public Action OnRightDoubleMouseClick; + public Action OnMiddleMousePress; + public Action OnMiddleMouseRelease; + public Action OnMiddleMouseClick; + public Action OnMiddleDoubleMouseClick; + public Action OnScrollUp; + public Action OnScrollDown; + public Action OnKeyPress; + public Action OnFocus; + public Action OnUnFocus; + public Action OnMove; + public Action OnResize; + public Action OnParent; + public Action OnRemove; + public Action OnUpdate; + public Action OnDraw; + + public Action OnArgumentedLeftMousePress; + public Action OnArgumentedLeftMouseRelease; + public Action OnArgumentedLeftMouseClick; + public Action OnArgumentedLeftDoubleMouseClick; + public Action OnArgumentedRightMousePress; + public Action OnArgumentedRightMouseRelease; + public Action OnArgumentedRightMouseClick; + public Action OnArgumentedRightDoubleMouseClick; + public Action OnArgumentedMiddleMousePress; + public Action OnArgumentedMiddleMouseRelease; + public Action OnArgumentedMiddleMouseClick; + public Action OnArgumentedMiddleDoubleMouseClick; + public Action OnArgumentedScrollUp; + public Action OnArgumentedScrollDown; + public Action OnArgumentedKeyPress; + public Action OnArgumentedFocus; + public Action OnArgumentedUnFocus; + public Action OnArgumentedMove; + public Action OnArgumentedResize; + public Action OnArgumentedParent; + public Action OnArgumentedRemove; + public Action OnArgumentedUpdate; + public Action OnArgumentedDraw; + #endregion + + public List Children = new List(); + public object Tag; + public bool Removed; + public bool Enabled = true; + public bool HasFocus{ + get{ return MrAG.Gui.CurrentFocus == this; } + + set{ + if (value){ + this.SetFocus(); + }else{ + if (this.HasFocus){ + MrAG.Gui.CurrentFocus = null; + } + } + } + } + + private int ParrentOffsetX; + private int ParrentOffsetY; + + + #region Interal Get/Set + private int _X; + private int _Y; + private int _Width; + private int _Height; + private Gui.Base _parent; + private bool _render = true; + + public bool Render{ + get { return this._render; } + set{ + this._render = value; + + foreach (MrAG.Gui.Base pnl in this.Children) + pnl.Render = this._render; + } + } + + public int X{ + get{return this._X;} + set{this.SetX(value);} + } + + public int Y{ + get{return this._Y;} + set{this.SetY(value);} + } + + public int Width{ + get{return this._Width;} + set{this.SetWidth(value);} + } + + public int Height{ + get{return this._Height;} + set{this.SetHeight(value);} + } + + + public Gui.Base Parent{ + set{ + this.SetParent(value); + } + + get{ + return this._parent; + } + } + #endregion + + public Base() { + MrAG.Gui.AddObject(this); + } + + public virtual void SetPos(int x, int y) { + if (this.Removed) return; + + if (this.Parent != null) { + this.ParrentOffsetX = x; + this.ParrentOffsetY = y; + + x += this.Parent.X; + y += this.Parent.Y; + } + + this._X = x; + this._Y = y; + + if (this.OnMove != null) + this.OnMove.Invoke(); + + for (int i = 0; i < this.Children.Count; i++) { + this.Children[i].SetPos(this.Children[i].ParrentOffsetX, this.Children[i].ParrentOffsetY); + } + } + + + public virtual void SetSize(int w, int h) { + if (this.Removed) return; + + this._Width = w; + this._Height = h; + + if (this.OnResize != null) + this.OnResize.Invoke(); + } + + + public virtual void Center() { + if (this.Removed) return; + + if (this.Parent != null){ + this.X = (this.Parent.Width / 2) - (this.Width / 2); + this.Y = (this.Parent.Height / 2) - (this.Height / 2); + }else{ + this.X = (MrAG.Gui.MainForm.Width / 2) - (this.Width / 2); + this.Y = (MrAG.Gui.MainForm.Height / 2) - (this.Height / 2); + } + } + + + public virtual void CenterX() { + if (this.Removed) return; + + if (this.Parent != null){ + this.X = (this.Parent.Width / 2) - (this.Width / 2); + }else{ + this.X = (MrAG.Gui.MainForm.Width / 2) - (this.Width / 2); + } + } + + + public virtual void CenterY() { + if (this.Removed) return; + + if (this.Parent != null){ + this.Y = (this.Parent.Height / 2) - (this.Height / 2); + }else{ + this.Y = (MrAG.Gui.MainForm.Height / 2) - (this.Height / 2); + } + } + + public virtual void SetParent(Gui.Base obj) { + if (this.Removed) return; + + if (this._parent == obj) + return; + + if (this._parent != null) { + this._parent.Children.Remove(this); + this._parent = null; + } else { + MrAG.Gui.RemoveObject(this); + } + + this.Removed = false; + this._parent = obj; + this._parent.Children.Add(this); + + if (this.OnParent != null) + this.OnParent.Invoke(); + } + + public virtual void Remove() { + this.Removed = true; + + MrAG.Gui.RemoveObject(this); + + if (this.OnRemove != null) + this.OnRemove.Invoke(); + } + + public virtual void BringToFront() { + if (this.Removed) return; + + if (this.Parent != null) { + this.Parent.BringToFront(); + + this.Parent.Children.Remove(this); + this.Parent.Children.Add(this); + } else { + MrAG.Gui.RemoveObject(this); + MrAG.Gui.AddObject(this); + } + + MrAG.Gui.BroughtToFront = true; + } + + public virtual bool Hovering() { + if (this.Removed) return false; + + int x = MrAG.Gui.CurMouseState.X; + int y = MrAG.Gui.CurMouseState.Y; + return x >= this.X && x <= this.X + this.Width && y >= this.Y && y <= this.Y + this.Height; + } + + //TODO: Recode this... + public virtual bool IsActive() + { + if (this.Removed) return false; + + return Hovering() && Microsoft.Xna.Framework.Input.Mouse.GetState().LeftButton == Microsoft.Xna.Framework.Input.ButtonState.Pressed; + } + + public virtual void Update(){ + if (this.Removed) return; + + if (this.Render) + { + bool preftofront = MrAG.Gui.BroughtToFront; + MrAG.Gui.BroughtToFront = false; + + for (int i = 0; i < this.Children.Count; i++){ + this.Children[i].Update(); + + if (BroughtToFront){ + MrAG.Gui.BroughtToFront = false; + i--; + } + } + MrAG.Gui.BroughtToFront = preftofront; + + if (this.OnUpdate != null) + this.OnUpdate.Invoke(); + } + } + + public virtual void Draw(){ + if (this.Removed) return; + + if (this.Render) + { + bool preftofront = MrAG.Gui.BroughtToFront; + MrAG.Gui.BroughtToFront = false; + + for (int i = 0; i < this.Children.Count; i++){ + if (this.Children[i].Render) + this.Children[i].Draw(); + + if (BroughtToFront){ + MrAG.Gui.BroughtToFront = false; + i--; + } + } + MrAG.Gui.BroughtToFront = preftofront; + + if (this.OnDraw != null) + this.OnDraw.Invoke(); + } + } + + public virtual void ClearChildren(){ + if (this.Removed) return; + + for (int i = 0;i < this.Children.Count; i++){ + this.Children[i].Remove(); + + i--; + } + } + + public virtual void LeftMousePress(int x, int y) {} + public virtual void RightMousePress(int x, int y) {} + public virtual void MiddleMousePress(int x, int y) {} + + public virtual void LeftMouseRelease(int x, int y) {} + public virtual void RightMouseRelease(int x, int y) {} + public virtual void MiddleMouseRelease(int x, int y) {} + + public virtual void LeftMouseClick(int x, int y) {} + public virtual void RightMouseClick(int x, int y) {} + public virtual void MiddleMouseClick(int x, int y) {} + + public virtual void LeftDoubleMouseClick(int x, int y) { this.LeftMouseClick(x, y); } + public virtual void RightDoubleMouseClick(int x, int y) { this.RightMouseClick(x, y); } + public virtual void MiddleDoubleMouseClick(int x, int y) { this.MiddleMouseClick(x, y); } + + public virtual void DoClick(int x, int y, MouseKey mouseKey) {} + public virtual void DoDoubleClick(int x, int y, MouseKey mouseKey) {} + + public virtual void FocusGained() {} + public virtual void FocusLost() {} + + public virtual void DoScrollUp() {} + public virtual void DoScrollDown() {} + + public virtual void SetX(int x) { this.SetPos(x, this.Parent != null ? this.ParrentOffsetY : this.Y); } + public virtual void SetY(int y) { this.SetPos(this.Parent != null ? this.ParrentOffsetX : this.X, y); } + public virtual void SetWidth(int w){ this.SetSize(w, this.Height); } + public virtual void SetHeight(int h){ this.SetSize(this.Width, h); } + public virtual void SetFocus() { MrAG.Gui.CurrentFocus = this; } + + public virtual void KeyPress(MrAG.Gui.Key key) {} + } + } +} diff --git a/MrAG/Gui/Button.cs b/MrAG/Gui/Button.cs new file mode 100644 index 0000000..8835ac0 --- /dev/null +++ b/MrAG/Gui/Button.cs @@ -0,0 +1,67 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace MrAG { + public partial class Gui { + public class Button : Base { + public string Text { + get { + return this._text; + } + + set{ + this._text = value; + + if (this.AutoResize) { + this.Width = (int)this.Font.MeasureString(this._text).X; + this.Height = (int)this.Font.MeasureString(this._text).Y; + } + } + } + + public SpriteFont Font = MrAG.Draw.Font; + + public Color TextColor = Color.White; + + public Color BorderColor = Color.LightGray; + + public Color Color = Color.Black; + public Color HoverColor = Color.DarkGray; + public Color ActiveColor = Color.Gray; + + public int BorderSize = 2; + + public MrAG.Draw.TextAlignmentX AlignmentX = MrAG.Draw.TextAlignmentX.Center; + public MrAG.Draw.TextAlignmentY AlignmentY = MrAG.Draw.TextAlignmentY.Center; + + public float Rotation = 0; + public bool AutoResize = false; + + private bool hover; + private bool active; + + private string _text = ""; + + public override void Update() { + this.hover = this.Hovering(); + this.active = this.IsActive(); + + base.Update(); + } + + public override void Draw() { + MrAG.Draw.Box(this.X + this.BorderSize, this.Y + this.BorderSize, this.Width - (this.BorderSize * 2), this.Height - (this.BorderSize * 2), this.hover ? (this.active ? this.ActiveColor : this.HoverColor) : this.Color); + MrAG.Draw.OutlinedBox(this.X, this.Y, this.Width, this.Height, this.BorderSize, this.BorderColor); + + MrAG.Draw.SetFont(this.Font); + MrAG.Draw.Text(this.Text, this.X + (this.Width / 2), this.Y + (this.Height / 2), this.TextColor, this.AlignmentX, this.AlignmentY, this.Rotation); + + base.Draw(); + } + } + } +} diff --git a/MrAG/Gui/Checkbox.cs b/MrAG/Gui/Checkbox.cs new file mode 100644 index 0000000..849e3f3 --- /dev/null +++ b/MrAG/Gui/Checkbox.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace MrAG +{ + public partial class Gui + { + public class CheckBox : Base + { + public bool Checked; + + public Color CheckBorderColor = Color.Gray; + public Color CheckBackgroundColor = Color.Black; + public Color CheckCheckedColor = Color.DarkGray; + + public int BorderSize = 2; + + public Action OnCheckedChange; + + public override void DoClick(int x, int y, MouseKey mouseKey) + { + this.Checked = !this.Checked; + + if (this.OnCheckedChange != null) + this.OnCheckedChange.Invoke(); + + base.DoClick(x, y, mouseKey); + } + + public override void Draw() + { + MrAG.Draw.Box(this.X + this.BorderSize, this.Y + this.BorderSize, this.Width - this.BorderSize - this.BorderSize, this.Height - this.BorderSize - this.BorderSize, this.Checked ? this.CheckCheckedColor : this.CheckBackgroundColor); + MrAG.Draw.OutlinedBox(this.X, this.Y, this.Width, this.Height, this.BorderSize, this.CheckBorderColor); + base.Draw(); + } + } + } +} diff --git a/MrAG/Gui/Dialog.cs b/MrAG/Gui/Dialog.cs new file mode 100644 index 0000000..3353510 --- /dev/null +++ b/MrAG/Gui/Dialog.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; + +namespace MrAG { + public partial class Gui { + public class Dialog { + string Title; + + int AddY = 62; + bool DoingHalf; + bool FullSize; + + public Frame Frame; + + public List