Example #1
0
        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);
        }
Example #2
0
        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 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");
		}