Beispiel #1
0
        public void GetGumpCode(TMQueryPage page)
        {
            sk = page.Skin;
            page.AddTitle("Shard Message Options", "Control");
            //page.AddLabel(75, 90, 192, @"Shard Settings:");
            //page.AddImage(227, 148, 1143);
            SkillSettings.DoTell("GetCoord: " + sk.GetCoord("Control", "X"));
            page.AddLabel(sk.SelectStartX, 115, sk.White, @"Use Shard Info:");
            page.AddCheck(sk.SelectStartX + 100, 115, sk.genericSelectUp, sk.genericSelectDn, SkillSettings.IsSharded, 1000);

            page.AddLabel(sk.SelectStartX, 140, sk.White, @"Not Yours: ");
            page.AddImageTiled(sk.SelectStartX + 100, 140, 332, 20, 3004);
            page.AddTextEntry(sk.SelectStartX + 100, 140, 330, 20, sk.White, 2001, @"" + SkillSettings.NotYoursMessage);

            page.AddLabel(sk.SelectStartX, 170, sk.White, @"How To Use: ");
            page.AddImageTiled(sk.SelectStartX + 100, 170, 332, 20, 3004);
            page.AddTextEntry(sk.SelectStartX + 100, 170, 330, 20, sk.White, 2002, @"" + SkillSettings.HowToUseMessage);

            page.AddLabel(sk.SelectStartX, 200, sk.White, @"No Ticket: ");
            page.AddImageTiled(sk.SelectStartX + 100, 200, 332, 20, 3004);
            page.AddTextEntry(sk.SelectStartX + 100, 200, 330, 20, sk.White, 2003, @"" + SkillSettings.NoTicketMessage);

            page.AddSuperButton(sk.NextButtonSX - page.X, sk.NextButtonSY - 15, sk.NextButtonSH, sk.NextButtonSW, sk.ButtonOverlay, sk.ButtonUnderID, sk.ButtonUnderIDPress, "APPLY", GumpButtonType.Reply, 1, 0);

            //page.AddButton(450, 380, 238, 239, 1, GumpButtonType.Reply, 1);
            //page.AddLabel(335, 380, 0, @"Apply Settings");
        }
Beispiel #2
0
        public void GetGumpCode(TMQueryPage page)
        {
            Page = page;
            SkillSettings.DoTell("GetGumpCode, Skill Gump.");
            if (Profile == null)
            {
                try
                {
                    Dictionary <string, object> h = (Dictionary <string, object>)Page.GetValueSet();
                    Profile = (SkillProfile)h["Profile"];
                    Skin    = (TMSS4Skin)h["Skin"];
                    Session = (TMSkillSession)h["Session"];
                }
                catch (Exception e)
                {
                    SkillSettings.DoTell("Error when generating skill gump: " + e);
                    return;
                }
            }
            if (Profile == null)
            {
                SkillSettings.DoTell("Profile is still null. Cannot continue."); return;
            }
            if (!Profile.SkillEnable)
            {
                SkillSettings.DoTell("Skills not enabled on this profile.");
                return;
            }
            this.Dragable = false;
            Page.BaseSkinByType(this);
            Page.AddTitle("Skill Gump for " + Profile.ProfileName + ": ", "Control", this);
            if (Profile.IconID > 0)
            {
                SkillSettings.DoTell("Adding Icon: " + Profile.IconID);
                Page.AddIcon(Profile.IconID, "Control", this);
            }
            this.AddLabel(35, Skin.GetCoord("Control", "H") - 40, Skin.HighlightText, "Profile Maximum: " + Profile.SkillPoints + " pts");
            ButtonInfo inf2 = Skin.ButtonInfo["SessionAddButton"];

            SkillSettings.DoTell("Inf2: X: " + inf2.X + " Y: " + inf2.Y + " W: " + inf2.W + " H: " + inf2.H + " BG: " + inf2.bgID + " TX: " + inf2.text);
            Page.AddSuperButton(inf2.X, Page.Y + inf2.Y, inf2.H, inf2.W, inf2.bgID, Skin.ListUnderButtonN, Skin.ListUnderButtonP, Skin.AddLabel, GumpButtonType.Reply, 1, 0, this);
            IEnumerator ie = Profile.MasterHash.GetEnumerator();
            GumpList    l  = new GumpList(this, "details", this.Skin);

            l.numperpage = 8;
            l.AddColumn("Skill Name");
            l.AddColumn("Skill Value");
            l.AddColumn("Weight");
            l.AddColumn("Select");
            l.SetColumnCount(4);
            l.ChangeColumnWidth(0, 200);
            l.X            = Skin.SelectStartX;
            l.Y            = Skin.SelectStartY;
            l.ShowDividers = true;
            int colcount = 3;             // at least columns for title, value, and checkbox.

            if (Profile.CapEnable)
            {
                colcount++;
            }
            if (Profile.WeightEnable)
            {
                colcount++;
            }
            l.SetColumnCount(colcount);
            int checkID = 0;

            if (!Profile.Manual)
            {
                checkID = 1000;
            }
            else
            {
                checkID = 3000;
            }
            Dictionary <string, TMUsedInfo> selitem = Session.HasSelectedItems(Profile.ProfileName);

            SkillSettings.DoTell(" Selitem debug: " + selitem.Count + " Profile: " + Profile.ProfileName + " TSP: " + Session.totalSelectedPoints);
            IEnumerator selitemie = selitem.GetEnumerator();

            while (selitemie.MoveNext())
            {
                SkillSettings.DoTell(" - " + ((KeyValuePair <string, TMUsedInfo>)selitemie.Current).Value.SkillName + " Value: " + ((KeyValuePair <string, TMUsedInfo>)selitemie.Current).Value.SkillValue);
            }
            while (ie.MoveNext())
            {
                TMSkillInfo inf = (TMSkillInfo)((KeyValuePair <string, TMSkillInfo>)ie.Current).Value;

                /*
                 * if (y % sk.NumPerPage == 0)
                 * {Page.SetupPage(thisProfile.ProfileName, y == 0, thisProfile.MasterHash.Count - y < sk.NumPerPage ? true : false, page); page++;}
                 * Page.AddEntryCheck( 0, y%sk.NumPerPage, sk.SelectUp, sk.SelectDn, false, (1000 * page) + (y % sk.NumPerPage), ""+inf.SkillName, ""+inf.SkillWeight, ""+inf.SkillValue );
                 * y++;*/
                GumpListEntry e = new GumpListEntry(0, 0, l, Skin.EntryDefaultWidth, Skin.EntryDefaultHeight);

                e.AddColumn(inf.SkillName);
                e.AddColumn("" + inf.SkillValue);
                if (Profile.CapEnable)
                {
                    e.AddColumn("" + inf.SkillCap);
                }
                if (Profile.WeightEnable)
                {
                    e.AddColumn("" + inf.SkillWeight);
                }
                if (!Profile.Manual)
                {
                    e.AddColumn(new GumpCheck(-2, 0, Skin.EntryDefaultCheckUp, Skin.EntryDefaultCheckDn, selitem.ContainsKey(inf.SkillName), checkID));
                }
                else
                {
                    e.AddColumn(new GumpTextEntry(0, 0, 30, Skin.EntryDefaultHeight, Skin.NormalText, checkID, ""));
                }

                checkID++;
                l.Add(e);
            }
            l.CommitList();
            Session.Mobile.SendGump(this);
        }
		public void GetGumpCode(TMQueryPage page)
		{
			sk = page.Skin;
			page.AddTitle("Shard Message Options", "Control");
			//page.AddLabel(75, 90, 192, @"Shard Settings:");
			//page.AddImage(227, 148, 1143);
			SkillSettings.DoTell("GetCoord: " + sk.GetCoord("Control", "X"));
			page.AddLabel(sk.SelectStartX, 115, sk.White, @"Use Shard Info:");
			page.AddCheck(sk.SelectStartX + 100, 115, sk.genericSelectUp, sk.genericSelectDn, SkillSettings.IsSharded, 1000);

			page.AddLabel(sk.SelectStartX, 140, sk.White, @"Not Yours: ");
			page.AddImageTiled(sk.SelectStartX + 100, 140, 332, 20, 3004);
			page.AddTextEntry(sk.SelectStartX + 100, 140, 330, 20, sk.White, 2001, @"" + SkillSettings.NotYoursMessage);

			page.AddLabel(sk.SelectStartX, 170, sk.White, @"How To Use: ");
			page.AddImageTiled(sk.SelectStartX + 100, 170, 332, 20, 3004);
			page.AddTextEntry(sk.SelectStartX + 100, 170, 330, 20, sk.White, 2002, @"" + SkillSettings.HowToUseMessage);

			page.AddLabel(sk.SelectStartX, 200, sk.White, @"No Ticket: ");
			page.AddImageTiled(sk.SelectStartX + 100, 200, 332, 20, 3004);
			page.AddTextEntry(sk.SelectStartX + 100, 200, 330, 20, sk.White, 2003, @"" + SkillSettings.NoTicketMessage);

			page.AddSuperButton(sk.NextButtonSX - page.X, sk.NextButtonSY - 15, sk.NextButtonSH, sk.NextButtonSW, sk.ButtonOverlay, sk.ButtonUnderID, sk.ButtonUnderIDPress, "APPLY", GumpButtonType.Reply, 1, 0);

			//page.AddButton(450, 380, 238, 239, 1, GumpButtonType.Reply, 1);
			//page.AddLabel(335, 380, 0, @"Apply Settings");
		}