public ToolbarEdit(ToolbarInfo info, bool expanded)
			: base(0, 28)
		{
			_Info = info;

			_Expanded = expanded;
			_ExpandedInt = expanded ? 2 : 1;

			AddInit();
			AddControls();
			AddNavigation();
			AddResponses();
			AddEntries();
		}
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					{
						_ToolbarInfo = new ToolbarInfo(reader);
						break;
					}
			}
		}
		public ToolbarModule(Mobile from)
			: base(from)
		{
			_ToolbarInfo = ToolbarInfo.CreateNew(from);
		}
		public ToolbarEdit(ToolbarInfo info)
			: this(info, false)
		{ }
Example #5
0
        public ToolbarGump(ToolbarInfo info)
            : base(0, 28)
        {
            _Info = info;

            if (_Info.Lock)
            {
                Closable = false;
                Disposable = false;
            }

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

            SetCoords(offset);

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

            AddPage(0);
            AddPage(1);

            if (_Info.Stealth)
            {
                AddMinimized(by, offset);
                AddPage(2);
            }

            AddInitOpts(by, offset);

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

            string font = GumpIDs.Fonts[_Info.Font];

            if (_Info.Phantom)
            {
                font += "<BASEFONT COLOR=#FFFFFF>";
            }

            int temp = 0, x, y;

            for (int i = 0; i < _Info.Rows * _Info.Collumns; i++)
            {
                x = offset + ((i % _Info.Rows) * 110);
                y = offset + (int)(Math.Floor((double)(i / _Info.Rows)) * 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[_Info.Skin, 0]);

                if (_Info.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, _Info.Entries[temp]), false, false);
                //AddLabelCropped(x + 5, y + 3, 100, 20, GumpIDs.Misc[(int)GumpIDs.MiscIDs.Color].Content[p_Skin,0], Commands[temp]);

                if (i % _Info.Rows == _Info.Rows - 1)
                {
                    temp += 9 - _Info.Rows;
                }

                ++temp;
            }

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

            if (_Info.Stealth)
            {
                return;
            }

            AddPage(2);
            AddMinimized(by, offset);
        }