コード例 #1
0
        public void GetGumpCode(TMQueryPage page)
        {
            page.BaseSkinByType(this);
            int      i  = 0;
            GumpList gl = new GumpList(this, "details", page.Skin);

            gl.X = page.Skin.SelectStartX;
            gl.Y = page.Skin.SelectStartY;
            gl.AddColumn("Super Profiles Available");
            gl.AddColumn("Item Profile Setter");
            gl.AddColumn("Set As Default");
            gl.columns = 3;

            while (i < profilenames.Count)
            {
                GumpListEntry gle = new GumpListEntry(0, 0, gl, 250, 20);
                gle.AddColumn("Set " + profilenames[i] + " on an item");
                gle.AddColumn(new GumpButton(0, 0, page.Skin.SelectDn, page.Skin.SelectUp, i + 1, GumpButtonType.Reply, 0));
                //gle.AddColumn(new GumpButton(0, 0, page.Skin.SelectDn, page.Skin.SelectUp, (i + 1)*-1, GumpButtonType.Reply, 0));
                GumpListEntry gl2 = new GumpListEntry(0, 0, gl, 250, 20);
                gl2.AddColumn("Set " + profilenames[i] + " as default");
                gl2.AddColumn(new GumpButton(0, 0, page.Skin.SelectDn, page.Skin.SelectUp, (i + 1) * -1, GumpButtonType.Reply, 0));
                gl.Add(gle);
                gl.Add(gl2);
                i++;
            }
            gl.CommitList();


            page.Mobile.SendGump(this);
        }
コード例 #2
0
        public ListTestGump() : base(0, 0)
        {
            SkillSettings.DoTell("Setting up new ListTestGump.");
            BaseSkin skin = SkinHelper.getSkin(SkillSettings.ControlSkinName);

            this.AddBackground(0, 0, 500, 500, 9270);
            GumpList list = new GumpList(this, "details", skin);

            SkillSettings.DoTell("List Created.");
            GumpListEntry e1 = new GumpListEntry(0, 0, list, skin.EntryDefaultWidth, skin.EntryDefaultHeight);

            e1.AddColumn("This is a column.");
            e1.AddColumn("This is a 2nd column.");
            e1.AddColumn("This is the 3rd column.");
            SkillSettings.DoTell("Entry 1 Created.");
            GumpListEntry e2 = new GumpListEntry(0, 0, list, skin.EntryDefaultWidth, skin.EntryDefaultHeight);

            e2.AddColumn("This is r2 c1.");
            e2.AddColumn("this is r2 c2.");
            e2.AddColumn("this is r2 c3.");
            SkillSettings.DoTell("Entry 2 Created.");
            list.Add(e1);
            list.Add(e2);
            SkillSettings.DoTell("Entries added to list.");
            list.AddColumn("1st column.");
            list.AddColumn("2nd column.");
            list.AddColumn("3rd column.");
            SkillSettings.DoTell("List columns added.");
            list.columns = 3;
            list.CommitList();
        }
コード例 #3
0
        public void GetGumpCode(TMQueryPage page)
        {
            page.BaseSkinByType(this);
            int      i  = 0;
            GumpList gl = new GumpList(this, "details", page.Skin);

            gl.X = page.Skin.SelectStartX;
            gl.Y = page.Skin.SelectStartY;
            gl.AddColumn("Skins Available");

            gl.SetColumnCount(2);
            gl.columnWidths[0] = page.Skin.ListWidth - 100;
            gl.columnWidths[1] = 100;

            while (i < skinnames.Count)
            {
                if (SkinHelper.skList[skinnames[i]] is TMSS4Skin)
                {
                    GumpListEntry gle = new GumpListEntry(0, 0, gl, 250, 20);
                    gle.AddColumn("Set " + skinnames[i] + " on item");
                    gle.AddColumn(new GumpButton(0, 0, page.Skin.SelectDn, page.Skin.SelectUp, i + 1, GumpButtonType.Reply, 0));
                    GumpListEntry gl2 = new GumpListEntry(0, 0, gl, 250, 20);
                    gl2.AddColumn("Set " + skinnames[i] + " as default");
                    gl2.AddColumn(new GumpButton(0, 0, page.Skin.SelectDn, page.Skin.SelectUp, (i + 1) * -1, GumpButtonType.Reply, 0));
                    gl.Add(gle);
                    gl.Add(gl2);
                }
                i++;
            }
            gl.CommitList();

            page.Mobile.SendGump(this);
        }
コード例 #4
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);
        }
コード例 #5
0
        public void GetGumpCode(TMQueryPage page)
        {
            Page          = page;
            this.Dragable = false;
            object o = page.GetValueSet();

            if (o is TMSkillSession)
            {
                Session = (TMSkillSession)o;
            }
            else
            {
                SkillSettings.SystemWrite("Error. No valid Session."); return;
            }
            if (!Session.Profile.StatEnable)
            {
                return;
            }
            Page.BaseSkinByType(this);
            Page.AddTitle("Stats: ", "Control", this);
            if (!Session.Profile.StatForce)
            {
                this.AddLabel(50, 70, Session.Skin.HighlightText, "Overall Max: " + Session.Profile.StatSum + " pts");
            }
            else
            {
                this.AddLabel(50, 70, Session.Skin.HighlightText, "Overall Requirement: " + Session.Profile.StatSum + " pts");
            }
            ButtonInfo inf2 = Session.Skin.ButtonInfo["StatAddButton"];

            Page.AddSuperButton(inf2.X, Page.Y + inf2.Y, inf2.H, inf2.W, inf2.bgID, Session.Skin.ListUnderButtonN, Session.Skin.ListUnderButtonP, Session.Skin.AddLabel, GumpButtonType.Reply, 1, 0, this);
            Dictionary <string, int> statvals = Session.Stats;
            GumpList g = new GumpList(this, "details", Session.Skin);

            g.SetColumnCount(3);
            g.AddColumn("Stat:");
            g.AddColumn("Max Value: ");
            g.AddColumn("Enter Value: ");
            GumpListEntry str = new GumpListEntry(0, 0, g, Session.Skin.EntryDefaultWidth, Session.Skin.EntryDefaultHeight);

            str.AddColumn("Strength");
            str.AddColumn("Max: " + Session.Profile.StrVal);
            str.AddColumn(new GumpTextEntry(0, 0, 25, Session.Skin.EntryDefaultHeight, Session.Skin.NormalText, 1000, statvals.ContainsKey("Strength") ? "" + statvals["Strength"]:""));
            GumpListEntry dex = new GumpListEntry(0, 0, g, Session.Skin.EntryDefaultWidth, Session.Skin.EntryDefaultHeight);

            dex.AddColumn("Dexterity");
            dex.AddColumn("Max: " + Session.Profile.DexVal);
            dex.AddColumn(new GumpTextEntry(0, 0, 25, Session.Skin.EntryDefaultHeight, Session.Skin.NormalText, 2000, statvals.ContainsKey("Dexterity") ? "" + statvals["Dexterity"] : ""));
            GumpListEntry intel = new GumpListEntry(0, 0, g, Session.Skin.EntryDefaultWidth, Session.Skin.EntryDefaultHeight);

            intel.AddColumn("Intelligence");
            intel.AddColumn("Max: " + Session.Profile.IntVal);
            intel.AddColumn(new GumpTextEntry(0, 0, 25, Session.Skin.EntryDefaultHeight, Session.Skin.NormalText, 3000, statvals.ContainsKey("Intelligence") ? "" + statvals["Intelligence"] : ""));
            g.Add(str);
            g.Add(dex);
            g.Add(intel);
            g.ShowDividers = true;
            g.X            = Session.Skin.SelectStartX;
            g.Y            = Session.Skin.SelectStartY;
            g.CommitList();
            Session.Mobile.SendGump(this);
        }