public void GetGumpCode(TMQueryPage page) { object o = page.GetValueSet(); Page = page; this.Dragable = false; if (o is TMSkillSession) { Session = (TMSkillSession)o; prof = Session.Profile; } Page.BaseSkinByType(this); if (prof == null) { SkillSettings.DoTell("Invalid profile to set up Master."); return; } TMSS4Skin sk = Session.Skin; Page.AddSuperButton(sk.FinishButtonX, sk.FinishButtonY, sk.FinishButtonH, sk.FinishButtonW, sk.ButtonOverlay, sk.ButtonUnderID, sk.ButtonUnderID, sk.FinishLabel, GumpButtonType.Reply, 101, 0, this); AddLabel(sk.PointsLabelX, sk.PointsLabelY, sk.Red, sk.PointsLabel + " " + Session.totalSelectedPoints + " / " + Session.totalAllowedPoints); AddPage(1); IEnumerator ie = prof.getProfileList(); int count = prof.subProfiles.Count; int i = 0; int pageid = 1; int pagesubcount = 0; //Add button for stats. Page.AddSuperButton(sk.ProfileX, sk.ProfileY + ((i % 6) * (sk.ProfileSpacer + sk.ProfileButtonH)), sk.ProfileButtonH, sk.ProfileButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "Stats", GumpButtonType.Reply, i + 1, 0, this); i++; pagesubcount++; while (ie.MoveNext()) { string blah = ((SkillProfile)((KeyValuePair <string, SkillProfile>)ie.Current).Value).ProfileName; SkillSettings.DoTell2("Master gump debug: " + blah); Page.AddSuperButton(sk.ProfileX, sk.ProfileY + ((i % 6) * (sk.ProfileSpacer + sk.ProfileButtonH)), sk.ProfileButtonH, sk.ProfileButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + blah, GumpButtonType.Reply, i + 1, 0, this); i++; pagesubcount++; if (pagesubcount == 5) { pagesubcount = 0; } if (pagesubcount == 1) { Page.AddSuperButton(sk.FinishButtonX, sk.FinishButtonY, sk.FinishButtonH, sk.FinishButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.FinishLabel, GumpButtonType.Reply, 101, 0, this); } if (pagesubcount == 0) { pageid++; AddPage(pageid); Page.AddSuperButton(sk.NextButtonMX, sk.NextButtonMY, sk.NextButtonMH, sk.NextButtonMW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.NextTextM, GumpButtonType.Page, 0, pageid + 1, this); if (pageid != 1) { Page.AddSuperButton(sk.PrevButtonMX, sk.PrevButtonMY, sk.PrevButtonMH, sk.PrevButtonMW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.PrevTextM, GumpButtonType.Page, 0, pageid - 1, this); } } } Session.Mobile.SendGump(this); }
public TMSkillSession(Mobile m, BaseTMSkillItem item) { int points = 0; try { string name = item.Profile.ProfileName; if (SkillProfileHelper.Profiles.ContainsKey(name)) { points = SkillProfileHelper.Profiles[name].SkillPoints; SkillSettings.DoTell("Profile Direct Query - Points: "+points+" for " +name ); } else SkillSettings.DoTell("Name "+name+" not present in Profiles."); } catch (Exception e ){ SkillSettings.DoTell("Exception while getting profile by item's profile name. "+e); } if (item.Profile == null) { SkillSettings.DoTell("Invalid Profile value. It will be reset to the default."); } if (item.Skin == null) { SkillSettings.DoTell("Invalid Skin value. It will be reset to the default."); } m_Item = item; m_Mobile = m; if (item.Profile == null && SkillProfileHelper.Supers[SkillSettings.CCProfileName] != null) Profile = SkillProfileHelper.Supers[SkillSettings.CCProfileName]; else if (SkillProfileHelper.Supers[SkillSettings.CCProfileName] == null) { SkillSettings.DoTell("Invalid Profile cannot be remedied." ); invalidated = true; return; } else Profile = (SuperSkillProfile)item.Profile; if (m_Item.Points > 0) totalAllowedPoints = m_Item.Points; else { SkillSettings.DoTell("Item's points are <= 0, Profile " + Profile.ProfileName + "'s SkillPoints value: " + points + " will be used."); totalAllowedPoints = points; } if (totalAllowedPoints <= 0) { SkillSettings.DoTell("Invalid Points value. Cannot continue session."); invalidated = true; } if (item.Skin == "" || item.Skin == null) Skin = (TMSS4Skin)SkinHelper.getSkin(SkillSettings.CCSkinName); else { try { Skin = (TMSS4Skin)SkinHelper.getSkin(item.Skin); } catch { Skin = (TMSS4Skin)SkinHelper.getSkin(SkillSettings.CCSkinName); } } }
public static void SaveSelf(SuperSkillProfile profile) { if (!Directory.Exists("TMSS/SkillProfiles")) { Directory.CreateDirectory("TMSS/SkillProfiles"); } string FileName = profile.ProfileName + ".spr"; string path = @"TMSS/SkillProfiles/[SUPER]" + FileName; if (File.Exists(path)) { File.Delete(path); } DateTime start = DateTime.Now; bool G = !File.Exists(path); Console.Write(" - Saving TMSS Super Skill Profile " + profile.ProfileName + "..."); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = " "; XmlWriter write = XmlWriter.Create(path, settings); //Writing write.WriteStartElement("TMSuperProfile"); IEnumerator val = profile.getProfileList(); write.WriteStartElement("ProfileName"); write.WriteValue(profile.ProfileName); write.WriteEndElement(); write.WriteStartElement("Count"); write.WriteValue(profile.subProfiles.Count); write.WriteEndElement(); while (val.MoveNext()) { write.WriteStartElement("SubProfile"); write.WriteValue(((KeyValuePair <string, SkillProfile>)val.Current).Value.ProfileName); write.WriteEndElement(); } write.WriteEndElement(); write.Close(); SkillProfileHelper.SkillProfileSaver(profile); Console.WriteLine("done"); }
public void GetGumpCode( TMQueryPage page ) { object o = page.GetValueSet(); Page = page; this.Dragable = false; if (o is TMSkillSession) { Session = (TMSkillSession)o; prof = Session.Profile; } Page.BaseSkinByType(this); if (prof == null) { SkillSettings.DoTell("Invalid profile to set up Master."); return; } TMSS4Skin sk = Session.Skin; Page.AddSuperButton(sk.FinishButtonX, sk.FinishButtonY, sk.FinishButtonH, sk.FinishButtonW, sk.ButtonOverlay, sk.ButtonUnderID, sk.ButtonUnderID, sk.FinishLabel, GumpButtonType.Reply, 101, 0, this); AddLabel(sk.PointsLabelX, sk.PointsLabelY, sk.Red, sk.PointsLabel+" "+Session.totalSelectedPoints+" / "+Session.totalAllowedPoints); AddPage( 1 ); IEnumerator ie = prof.getProfileList(); int count = prof.subProfiles.Count; int i = 0; int pageid = 1; int pagesubcount = 0; //Add button for stats. Page.AddSuperButton(sk.ProfileX, sk.ProfileY + ((i % 6) * (sk.ProfileSpacer + sk.ProfileButtonH)), sk.ProfileButtonH, sk.ProfileButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "Stats", GumpButtonType.Reply, i + 1, 0, this); i++; pagesubcount++; while (ie.MoveNext() ) { string blah = ((SkillProfile)((KeyValuePair<string,SkillProfile>)ie.Current).Value).ProfileName; SkillSettings.DoTell2("Master gump debug: "+blah); Page.AddSuperButton(sk.ProfileX, sk.ProfileY + ((i % 6) * (sk.ProfileSpacer + sk.ProfileButtonH)), sk.ProfileButtonH, sk.ProfileButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + blah, GumpButtonType.Reply, i + 1, 0, this); i++; pagesubcount++; if( pagesubcount == 5 ) pagesubcount = 0; if( pagesubcount == 1 ) Page.AddSuperButton(sk.FinishButtonX, sk.FinishButtonY, sk.FinishButtonH, sk.FinishButtonW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.FinishLabel, GumpButtonType.Reply, 101, 0, this); if (pagesubcount == 0) { pageid++; AddPage(pageid); Page.AddSuperButton(sk.NextButtonMX, sk.NextButtonMY, sk.NextButtonMH, sk.NextButtonMW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.NextTextM, GumpButtonType.Page, 0, pageid + 1,this); if (pageid != 1) Page.AddSuperButton(sk.PrevButtonMX, sk.PrevButtonMY, sk.PrevButtonMH, sk.PrevButtonMW, sk.ProfileNormalID, sk.SelectUnderlay, sk.SelectUnderlay, "" + sk.PrevTextM, GumpButtonType.Page, 0, pageid - 1, this); } } Session.Mobile.SendGump(this); }
public static void SkillTest_OnCommand(CommandEventArgs e) { //ListTestGump g = new ListTestGump(); if (QueryPageHelper.PluginExists("TMSkill")) { Dictionary <string, object> t = new Dictionary <string, object>(); t.Add("Skin", SkinHelper.getSkin(SkillSettings.ControlSkinName)); t.Add("Mobile", e.Mobile); SuperSkillProfile p = (SuperSkillProfile)SkillProfileHelper.getProfile("Default Profile"); SkillProfile sp = p.getProfile(0); t.Add("Profile", sp); TMQueryPage pg = new TMQueryPage("TMSS Skill Gump", t); //e.Mobile.SendGump(pg); } else { DoTell("Error when creating Skill Gump. Plugin does not exist."); return; } }
public static void LoadSelf(FileInfo fileName) { string path = fileName.FullName; if (!File.Exists(path)) { Console.WriteLine("ERROR: Super Profile Not Found "); return; } XmlReaderSettings settings = new XmlReaderSettings(); XmlReader read = XmlReader.Create(path, settings); read.ReadStartElement("TMSuperProfile"); read.ReadStartElement("ProfileName"); string name = read.ReadContentAsString(); read.ReadEndElement(); SkillSettings.SystemWrite("Loading SuperProfile " + name); SuperSkillProfile profile = new SuperSkillProfile(name); read.ReadStartElement("Count"); int count = read.ReadContentAsInt(); read.ReadEndElement(); int curr = 0; while (curr < count) { read.ReadStartElement("SubProfile"); profile.addProfile((string)read.ReadContentAsString()); //.ReadContentAsString()); read.ReadEndElement(); curr++; } read.ReadEndElement(); read.Close(); SkillProfileHelper.SkillProfileLoader(profile.ProfileName, false); RegisterSuperProfile(profile); }
public TMSkillSession(Mobile m, BaseTMSkillItem item) { int points = 0; try { string name = item.Profile.ProfileName; if (SkillProfileHelper.Profiles.ContainsKey(name)) { points = SkillProfileHelper.Profiles[name].SkillPoints; SkillSettings.DoTell("Profile Direct Query - Points: " + points + " for " + name); } else { SkillSettings.DoTell("Name " + name + " not present in Profiles."); } } catch (Exception e) { SkillSettings.DoTell("Exception while getting profile by item's profile name. " + e); } if (item.Profile == null) { SkillSettings.DoTell("Invalid Profile value. It will be reset to the default."); } if (item.Skin == null) { SkillSettings.DoTell("Invalid Skin value. It will be reset to the default."); } m_Item = item; m_Mobile = m; if (item.Profile == null && SkillProfileHelper.Supers[SkillSettings.CCProfileName] != null) { Profile = SkillProfileHelper.Supers[SkillSettings.CCProfileName]; } else if (SkillProfileHelper.Supers[SkillSettings.CCProfileName] == null) { SkillSettings.DoTell("Invalid Profile cannot be remedied."); invalidated = true; return; } else { Profile = (SuperSkillProfile)item.Profile; } if (m_Item.Points > 0) { totalAllowedPoints = m_Item.Points; } else { SkillSettings.DoTell("Item's points are <= 0, Profile " + Profile.ProfileName + "'s SkillPoints value: " + points + " will be used."); totalAllowedPoints = points; } if (totalAllowedPoints <= 0) { SkillSettings.DoTell("Invalid Points value. Cannot continue session."); invalidated = true; } if (item.Skin == "" || item.Skin == null) { Skin = (TMSS4Skin)SkinHelper.getSkin(SkillSettings.CCSkinName); } else { try { Skin = (TMSS4Skin)SkinHelper.getSkin(item.Skin); } catch { Skin = (TMSS4Skin)SkinHelper.getSkin(SkillSettings.CCSkinName); } } }
public static SuperSkillProfile GenInitialProfile() { Console.WriteLine(" - TMSS|4 Default Profile Generation In Progress..."); //SkillProfile profile = new SkillProfile("Default Profile"); SuperSkillProfile defprof = new SuperSkillProfile("Default Profile"); SkillProfile miscProf = new SkillProfile("Miscellaneous"); miscProf.addCompleteEntry(true, 100, 1.0, 10, 0); //0 miscProf.addCompleteEntry(true, 100, 1.0, 10, 7); //7 miscProf.addCompleteEntry(true, 100, 1.0, 10, 8); //8 miscProf.addCompleteEntry(true, 100, 1.0, 10, 11); //11 miscProf.addCompleteEntry(true, 100, 1.0, 10, 13); //13 miscProf.addCompleteEntry(true, 100, 1.0, 10, 17); //17 miscProf.addCompleteEntry(true, 100, 1.0, 10, 18); //18 miscProf.addCompleteEntry(true, 100, 1.0, 10, 20); //20 miscProf.addCompleteEntry(true, 100, 1.0, 10, 24); //24 miscProf.addCompleteEntry(true, 100, 1.0, 10, 25); //25 miscProf.addCompleteEntry(true, 100, 1.0, 10, 26); //26 miscProf.addCompleteEntry(true, 100, 1.0, 10, 28); //28 miscProf.addCompleteEntry(true, 100, 1.0, 10, 29); //29 miscProf.addCompleteEntry(true, 100, 1.0, 10, 33); //33 miscProf.addCompleteEntry(true, 100, 1.0, 10, 34); //34 miscProf.addCompleteEntry(true, 100, 1.0, 10, 37); //37 miscProf.addCompleteEntry(true, 100, 1.0, 10, 39); //39 miscProf.addCompleteEntry(true, 100, 1.0, 10, 45); //45 miscProf.addCompleteEntry(true, 100, 1.0, 10, 46); //46 miscProf.addCompleteEntry(true, 100, 1.0, 10, 47); //47 miscProf.addCompleteEntry(true, 100, 1.0, 10, 48); //48 miscProf.addCompleteEntry(true, 100, 1.0, 10, 49); //49 miscProf.addCompleteEntry(true, 100, 1.0, 10, 50); //50 miscProf.addCompleteEntry(true, 100, 1.0, 10, 51); //51 miscProf.addCompleteEntry(true, 100, 1.0, 10, 52); //52 miscProf.addCompleteEntry(true, 100, 1.0, 10, 53); //53 miscProf.addCompleteEntry(true, 100, 1.0, 10, 54); //54 miscProf.IconID = 2287; RegisterProfile(miscProf); defprof.addProfile(miscProf); SkillProfile comRate = new SkillProfile("Combat Ratings"); comRate.addCompleteEntry(true, 100, 1.0, 10, 31); //31 comRate.addCompleteEntry(true, 100, 1.0, 10, 42); //42 comRate.addCompleteEntry(true, 100, 1.0, 10, 41); //41 comRate.addCompleteEntry(true, 100, 1.0, 10, 5); //5 comRate.addCompleteEntry(true, 100, 1.0, 10, 40); //40 comRate.addCompleteEntry(true, 100, 1.0, 10, 27); //27 comRate.addCompleteEntry(true, 100, 1.0, 10, 43); //43 comRate.IconID = 5585; RegisterProfile(comRate); defprof.addProfile(comRate); SkillProfile actions = new SkillProfile("Actions"); actions.addCompleteEntry(true, 100, 1.0, 10, 35); //35 actions.addCompleteEntry(true, 100, 1.0, 10, 6); //6 actions.addCompleteEntry(true, 100, 1.0, 10, 10); //10 actions.addCompleteEntry(true, 100, 1.0, 10, 12); //12 actions.addCompleteEntry(true, 100, 1.0, 10, 14); //14 actions.addCompleteEntry(true, 100, 1.0, 10, 15); //15 actions.addCompleteEntry(true, 100, 1.0, 10, 21); //21 actions.addCompleteEntry(true, 100, 1.0, 10, 23); //23 actions.addCompleteEntry(true, 100, 1.0, 10, 9); //9 actions.addCompleteEntry(true, 100, 1.0, 10, 30); //30 actions.addCompleteEntry(true, 100, 1.0, 10, 22); //22 actions.addCompleteEntry(true, 100, 1.0, 10, 32); //32 actions.addCompleteEntry(true, 100, 1.0, 10, 38); //38 actions.IconID = 20998; RegisterProfile(actions); defprof.addProfile(actions); SkillProfile loreKnow = new SkillProfile("Lore & Knowledge"); loreKnow.addCompleteEntry(true, 100, 1.0, 10, 1); //1 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 2); //2 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 4); //4 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 16); //16 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 19); //19 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 3); //3 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 36); //36 loreKnow.IconID = 23014; RegisterProfile(loreKnow); defprof.addProfile(loreKnow); SuperProfileHelper.RegisterSuperProfile(defprof); SuperProfileHelper.SaveSelf(defprof); Console.WriteLine("done"); //writeFile(profile, true); return(defprof); }
internal static void RegisterSuperProfile(SuperSkillProfile sprofile) { //SuperProfileHelper.SaveSelf(sprofile); SkillProfileHelper.AddNewProfile(sprofile, true); }
public static SuperSkillProfile GenInitialProfile() { Console.WriteLine(" - TMSS|4 Default Profile Generation In Progress..."); //SkillProfile profile = new SkillProfile("Default Profile"); SuperSkillProfile defprof = new SuperSkillProfile( "Default Profile" ); SkillProfile miscProf = new SkillProfile ("Miscellaneous"); miscProf.addCompleteEntry(true, 100, 1.0, 10, 0);//0 miscProf.addCompleteEntry(true, 100, 1.0, 10, 7);//7 miscProf.addCompleteEntry(true, 100, 1.0, 10, 8);//8 miscProf.addCompleteEntry(true, 100, 1.0, 10, 11);//11 miscProf.addCompleteEntry(true, 100, 1.0, 10, 13);//13 miscProf.addCompleteEntry(true, 100, 1.0, 10, 17);//17 miscProf.addCompleteEntry(true, 100, 1.0, 10, 18);//18 miscProf.addCompleteEntry(true, 100, 1.0, 10, 20);//20 miscProf.addCompleteEntry(true, 100, 1.0, 10, 24);//24 miscProf.addCompleteEntry(true, 100, 1.0, 10, 25);//25 miscProf.addCompleteEntry(true, 100, 1.0, 10, 26);//26 miscProf.addCompleteEntry(true, 100, 1.0, 10, 28);//28 miscProf.addCompleteEntry(true, 100, 1.0, 10, 29);//29 miscProf.addCompleteEntry(true, 100, 1.0, 10, 33);//33 miscProf.addCompleteEntry(true, 100, 1.0, 10, 34);//34 miscProf.addCompleteEntry(true, 100, 1.0, 10, 37);//37 miscProf.addCompleteEntry(true, 100, 1.0, 10, 39);//39 miscProf.addCompleteEntry(true, 100, 1.0, 10, 45);//45 miscProf.addCompleteEntry(true, 100, 1.0, 10, 46);//46 miscProf.addCompleteEntry(true, 100, 1.0, 10, 47);//47 miscProf.addCompleteEntry(true, 100, 1.0, 10, 48);//48 miscProf.addCompleteEntry(true, 100, 1.0, 10, 49);//49 miscProf.addCompleteEntry(true, 100, 1.0, 10, 50);//50 miscProf.addCompleteEntry(true, 100, 1.0, 10, 51);//51 miscProf.addCompleteEntry(true, 100, 1.0, 10, 52);//52 miscProf.addCompleteEntry(true, 100, 1.0, 10, 53);//53 miscProf.addCompleteEntry(true, 100, 1.0, 10, 54);//54 miscProf.IconID = 2287; RegisterProfile( miscProf ); defprof.addProfile( miscProf ); SkillProfile comRate = new SkillProfile( "Combat Ratings" ); comRate.addCompleteEntry(true, 100, 1.0, 10, 31);//31 comRate.addCompleteEntry(true, 100, 1.0, 10, 42);//42 comRate.addCompleteEntry(true, 100, 1.0, 10, 41);//41 comRate.addCompleteEntry(true, 100, 1.0, 10, 5);//5 comRate.addCompleteEntry(true, 100, 1.0, 10, 40);//40 comRate.addCompleteEntry(true, 100, 1.0, 10, 27);//27 comRate.addCompleteEntry(true, 100, 1.0, 10, 43);//43 comRate.IconID = 5585; RegisterProfile( comRate ); defprof.addProfile( comRate ); SkillProfile actions = new SkillProfile( "Actions" ); actions.addCompleteEntry(true, 100, 1.0, 10, 35);//35 actions.addCompleteEntry(true, 100, 1.0, 10, 6);//6 actions.addCompleteEntry(true, 100, 1.0, 10, 10);//10 actions.addCompleteEntry(true, 100, 1.0, 10, 12);//12 actions.addCompleteEntry(true, 100, 1.0, 10, 14);//14 actions.addCompleteEntry(true, 100, 1.0, 10, 15);//15 actions.addCompleteEntry(true, 100, 1.0, 10, 21);//21 actions.addCompleteEntry(true, 100, 1.0, 10, 23);//23 actions.addCompleteEntry(true, 100, 1.0, 10, 9);//9 actions.addCompleteEntry(true, 100, 1.0, 10, 30);//30 actions.addCompleteEntry(true, 100, 1.0, 10, 22);//22 actions.addCompleteEntry(true, 100, 1.0, 10, 32);//32 actions.addCompleteEntry(true, 100, 1.0, 10, 38);//38 actions.IconID = 20998; RegisterProfile( actions ); defprof.addProfile( actions ); SkillProfile loreKnow = new SkillProfile( "Lore & Knowledge" ); loreKnow.addCompleteEntry(true, 100, 1.0, 10, 1);//1 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 2);//2 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 4);//4 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 16);//16 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 19);//19 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 3);//3 loreKnow.addCompleteEntry(true, 100, 1.0, 10, 36);//36 loreKnow.IconID = 23014; RegisterProfile( loreKnow ); defprof.addProfile( loreKnow ); SuperProfileHelper.RegisterSuperProfile(defprof); SuperProfileHelper.SaveSelf(defprof); Console.WriteLine("done"); //writeFile(profile, true); return defprof; }
public static void LoadSelf(FileInfo fileName) { string path = fileName.FullName; if (!File.Exists(path)) { Console.WriteLine("ERROR: Super Profile Not Found "); return; } XmlReaderSettings settings = new XmlReaderSettings(); XmlReader read = XmlReader.Create(path, settings); read.ReadStartElement("TMSuperProfile"); read.ReadStartElement("ProfileName"); string name = read.ReadContentAsString(); read.ReadEndElement(); SkillSettings.SystemWrite("Loading SuperProfile " + name); SuperSkillProfile profile = new SuperSkillProfile(name); read.ReadStartElement("Count"); int count = read.ReadContentAsInt(); read.ReadEndElement(); int curr = 0; while (curr < count) { read.ReadStartElement("SubProfile"); profile.addProfile((string)read.ReadContentAsString());//.ReadContentAsString()); read.ReadEndElement(); curr++; } read.ReadEndElement(); read.Close(); SkillProfileHelper.SkillProfileLoader(profile.ProfileName, false); RegisterSuperProfile(profile); }
public static void SaveSelf(SuperSkillProfile profile) { if (!Directory.Exists("TMSS/SkillProfiles")) Directory.CreateDirectory("TMSS/SkillProfiles"); string FileName = profile.ProfileName + ".spr"; string path = @"TMSS/SkillProfiles/[SUPER]" + FileName; if( File.Exists( path ) ) File.Delete( path ); DateTime start = DateTime.Now; bool G = !File.Exists(path); Console.Write(" - Saving TMSS Super Skill Profile " + profile.ProfileName + "..."); XmlWriterSettings settings = new XmlWriterSettings(); settings.Indent = true; settings.IndentChars = " "; XmlWriter write = XmlWriter.Create(path, settings); //Writing write.WriteStartElement("TMSuperProfile"); IEnumerator val = profile.getProfileList(); write.WriteStartElement("ProfileName"); write.WriteValue(profile.ProfileName); write.WriteEndElement(); write.WriteStartElement("Count"); write.WriteValue(profile.subProfiles.Count); write.WriteEndElement(); while (val.MoveNext()) { write.WriteStartElement("SubProfile"); write.WriteValue(((KeyValuePair<string, SkillProfile>)val.Current).Value.ProfileName); write.WriteEndElement(); } write.WriteEndElement(); write.Close(); SkillProfileHelper.SkillProfileSaver( profile ); Console.WriteLine("done"); }