示例#1
0
		/// <summary>
		/// Reads the information in the persistance item and exports it into a new ToolbarInfo class.
		/// </summary>
		public static void ReadInfo(Mobile mob, out ToolbarInfo info)
		{
			EnsureMaxed( mob );
			Account acc = mob.Account as Account;
			info = null;
			for(int i = 0; i < ToolbarHelper.Infos.Info.Count; i++)
			{
				if(ToolbarHelper.Infos.Info[i].Account == acc.Username)
					info = ToolbarHelper.Infos.Info[i];
			}
			if(info == null)
				info = ToolbarInfo.CreateNew(mob, acc);
		}
示例#2
0
        public ToolbarEdit( ToolbarInfo info, bool expanded, List<string> commands, int skin, int columns, int rows, int font, bool[] switches )
            : base(0, 28)
        {
            p_Info = info;
            p_Expanded = expanded;
            p_ExpandedInt = expanded ? 2 : 1;

            p_Font = font;
            p_Phantom = switches[0];
            p_Stealth = switches[1];
            p_Reverse = switches[2];
            p_Lock = switches[3];

            p_Commands = commands;
            p_Skin = skin;
            p_Columns = columns;
            p_Rows = rows;

            AddInit();
            AddControls();
            AddNavigation();
            AddResponses();
            AddEntries();
        }
示例#3
0
 public ToolbarEdit( ToolbarInfo info, List<string> commands, int skin, int columns, int rows, int font, bool[] switches )
     : this(info, false, commands, skin, columns, rows, font, switches)
 {
 }
示例#4
0
 public ToolbarEdit( ToolbarInfo info, bool expanded )
     : this(info, expanded, info.Entries, info.Skin, info.Dimensions[0], info.Dimensions[1], info.Font, new bool[]{ info.Phantom, info.Stealth, info.Reverse, info.Lock })
 {
 }
示例#5
0
 public ToolbarEdit( ToolbarInfo info )
     : this(info, false)
 {
 }
示例#6
0
        public Toolbar(ToolbarInfo info)
            : base(0, 28)
        {
            p_Info = info;

            // Version 1.3
            p_Font = info.Font;
            p_Phantom = info.Phantom;
            p_Stealth = info.Stealth;
            p_Reverse = info.Reverse;
            p_Lock = info.Lock;

            // Version 1.0
            p_Commands = info.Entries;
            p_Skin = info.Skin;
            p_Columns = info.Dimensions[0];
            p_Rows = info.Dimensions[1];

            //original
            //            if( Lock )
            //                Closable = false;
            //AlphaDragon's mod:
            if( Lock )
            {
                Closable = false;
                Disposable = false;
            }
            //I moded end so that will remain even when editing house

            int offset = GumpIDs.Misc[(int)GumpIDs.MiscIDs.ButtonOffset].Content[p_Skin,0];
            int bx = ((offset * 2) + (Columns * 110)), by = ((offset * 2) + (Rows * 24)), byx = by, cy = 0;

            SetCoords( offset );

            if( Reverse )
            {
                cy = InitOptsH;
                by = 0;
            }

            AddPage( 0 );
            AddPage( 1 );
            if( Stealth )
            {
                AddMinimized( by, offset );
                AddPage( 2 );
            }

            AddInitOpts( by, offset );

            AddBackground(0, cy, bx, byx, GumpIDs.Misc[(int)GumpIDs.MiscIDs.Background].Content[p_Skin,0]);

            string font = GumpIDs.Fonts[Font];
            if( Phantom )
                font += "<BASEFONT COLOR=#FFFFFF>";

            int temp = 0, x = 0, y = 0;
            for(int i = 0; i < Columns*Rows; i++)
            {
                x = offset + ((i % Columns) * 110);
                y = offset + (int)(Math.Floor((double)(i / Columns)) * 24) + cy;
                AddButton(x + 1, y, 2445, 2445, temp + 10, GumpButtonType.Reply, 0);
                AddBackground(x, y, 110, 24, GumpIDs.Misc[(int)GumpIDs.MiscIDs.Buttonground].Content[p_Skin,0]);

                if( Phantom )
                {
                    AddImageTiled( x + 2, y + 2, 106, 20, 2624 ); // Alpha Area 1_1
                    AddAlphaRegion( x + 2, y + 2, 106, 20 ); // Alpha Area 1_2
                }

                AddHtml( x + 5, y + 3, 100, 20, String.Format( "<center>{0}{1}", font, Commands[temp]), false, false );
                //AddLabelCropped(x + 5, y + 3, 100, 20, GumpIDs.Misc[(int)GumpIDs.MiscIDs.Color].Content[p_Skin,0], Commands[temp]);

                if( i%Columns == Columns-1 )
                    temp += 9-Columns;
                temp++;
            }

            /*TEST---
            0%5 == 0
            1%5 == 1
            2%5 == 2
            3%5 == 3
            4%5 == 4
            5%5 == 0
            END TEST---*/

            if( !Stealth )
            {
                AddPage(2);
                AddMinimized( by, offset );
            }
        }
示例#7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            ToolbarHelper.Infos = this;

            int count = reader.ReadInt();

            // Version 1.3
            int font = 0;
            bool phantom = true, stealth = false, reverse = false, locked = true;

            // Version 1.0
            string account;
            List<int> dimensions;
            List<string> entries;
            int subcount, skin;
            List<Point3D> points;
            for(int i = 0; i < count; i++)
            {
                switch(version)
                {
                    case 130:
                    {
                        font = reader.ReadInt();
                        phantom = reader.ReadBool();
                        stealth = reader.ReadBool();
                        reverse = reader.ReadBool();
                        locked = reader.ReadBool();
                        goto case 100;
                    }
                    default:
                    case 100:
                    {
                        account = reader.ReadString();

                        dimensions = new List<int>();

                        subcount = reader.ReadInt();
                        for(int j = 0; j < subcount; j++)
                            dimensions.Add(reader.ReadInt());

                        entries = new List<string>();

                        subcount = reader.ReadInt();
                        for(int k = 0; k < subcount; k++)
                            entries.Add(reader.ReadString());

                        skin = reader.ReadInt();

                        points = new List<Point3D>();

                        subcount = reader.ReadInt();
                        for(int l = 0; l < subcount; l++)
                            points.Add(reader.ReadPoint3D());

                        break;
                    }
                }

                ToolbarInfo info = new ToolbarInfo(account, dimensions, entries, skin, points, font, new bool[]{ phantom, stealth, reverse, locked });
            }
        }