Exemple #1
0
        private static string GetElementString(int element, BBGumpItem G_Item)
        {
            switch (element)
            {
            case 0: return("AddBackground(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpWidth + ", " + G_Item.GumpHeight + ", " + G_Item.GumpID1 + ");");

            case 1: return("AddAlphaRegion(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpWidth + ", " + G_Item.GumpHeight + ");");

            case 2: return("AddImage(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpID1 + ");");

            case 3: return("AddImageTiled(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpWidth + ", " + G_Item.GumpHeight + ", " + G_Item.GumpID1 + ");");

            case 4: return("AddLabel(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpHue + ", " + G_Item.GumpText + ");");

            case 5: return("AddLabelCropped(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpWidth + ", " + G_Item.GumpHeight + ", " + G_Item.GumpHue + ", " + G_Item.GumpText + ");");

            case 6: return("AddTextEntry(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpWidth + ", " + G_Item.GumpHeight + ", " + G_Item.GumpHue + ", 0, " + G_Item.GumpText + ", " + G_Item.GumpText.Length + ");");

            case 7: return("AddHtml(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpWidth + ", " + G_Item.GumpHeight + ", " + G_Item.GumpText + ", false, false);");

            case 8: return("AddItem(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpID1 + ", " + G_Item.GumpHue + ");");

            case 9: return("AddButton(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpID1 + ", " + G_Item.GumpID2 + ", 0, GumpButtonType.Reply, 0);");

            case 10: return("AddRadio(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpID1 + ", " + G_Item.GumpID2 + ", true, 0);");

            case 11: return("AddCheck(" + G_Item.GumpPositionX + ", " + G_Item.GumpPositionY + ", " + G_Item.GumpID1 + ", " + G_Item.GumpID2 + ", true, 0);");

            default: return("");
            }
        }
Exemple #2
0
        public void MoveGump(int GumpIndex, int x, int y)
        {
            BBGumpItem gumpItem = GumpItems[GumpIndex];

            gumpItem.GumpPositionX += x;

            gumpItem.GumpPositionY += y;

            RefreshAllGumps();
        }
Exemple #3
0
        public void LoadBox()
        {
            Item[] getGumpItems = FindItemsByType(typeof(BBGumpItem));

            if (getGumpItems != null && getGumpItems.Length > 0)
            {
                GumpItems = new List <BBGumpItem>();

                foreach (Item item in getGumpItems)
                {
                    if (item is BBGumpItem)
                    {
                        BBGumpItem BBG = item as BBGumpItem;

                        GumpItems.Add(BBG);
                    }
                }

                GumpItems.Sort();
            }
        }
Exemple #4
0
        public void MoveElement(int layer, int direction)
        {
            if (GumpItems == null || GumpItems.Count < 0)
            {
                return;
            }

            int oldIndex = layer;

            int newIndex = layer + direction;

            if (newIndex < 0 || newIndex >= GumpItems.Count)
            {
                return;
            }

            BBGumpItem element = GumpItems[oldIndex];

            GumpItems.Remove(element);
            GumpItems.Insert(newIndex, element);
            RefreshAllGumps();
        }
Exemple #5
0
        public void DeleteElement(int GumpIndex)
        {
            if (GumpIndex < GumpItems.Count && GumpIndex >= 0)
            {
                BBGumpItem item = GumpItems[GumpIndex];

                GumpItems.RemoveAt(GumpIndex);

                item.Delete();

                if (GumpItems.Count <= 0)
                {
                    PlayerMobile pm = RootParent as PlayerMobile;

                    pm.CloseAllGumps();

                    Delete();
                }
                else
                {
                    RefreshAllGumps();
                }
            }
        }