Exemplo n.º 1
0
        public InfoGump(GameObject obj) : base(0, 0)
        {
            X                = 200;
            Y                = 100;
            CanMove          = true;
            AcceptMouseInput = false;
            Add(new GameBorder(0, 0, WIDTH, HEIGHT, 4));

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                Alpha = 0.5f
            });

            Add(new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                Alpha = 0.5f
            });
            Add(new Label("Object Information", true, 1153, font: 3)
            {
                X = 20, Y = 10
            });
            Add(new Line(20, 30, WIDTH - 50, 1, 0xFFFFFFFF));

            _scrollArea = new ScrollArea(20, 35, WIDTH - 40, HEIGHT - 45, true)
            {
                AcceptMouseInput = true
            };
            Add(_scrollArea);

            Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj);

            if (dict != null)
            {
                foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key))
                {
                    ScrollAreaItem areaItem = new ScrollAreaItem();

                    Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder)
                    {
                        X = 2
                    };
                    areaItem.Add(label);

                    int height = label.Height;

                    label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200)
                    {
                        X = 200
                    };

                    if (label.Height > 0)
                    {
                        height = label.Height;
                    }

                    areaItem.Add(label);
                    areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    _scrollArea.Add(areaItem);
                }
            }
        }
Exemplo n.º 2
0
        public InspectorGump(GameObject obj) : base(0, 0)
        {
            X                      = 200;
            Y                      = 100;
            _obj                   = obj;
            CanMove                = true;
            AcceptMouseInput       = false;
            CanCloseWithRightClick = true;
            Add(new BorderControl(0, 0, WIDTH, HEIGHT, 4));

            Add
            (
                new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                Alpha = 0.5f
            }
            );

            Add
            (
                new GumpPicTiled(4, 4, WIDTH - 8, HEIGHT - 8, 0x0A40)
            {
                Alpha = 0.5f
            }
            );

            Add(new Label(ResGumps.ObjectInformation, true, 1153, font: 3)
            {
                X = 20, Y = 10
            });
            Add(new Line(20, 30, WIDTH - 50, 1, 0xFFFFFFFF));

            Add
            (
                new NiceButton(WIDTH - 115, 5, 100, 25, ButtonAction.Activate, ResGumps.Dump)
            {
                ButtonParameter = 0
            }
            );

            _scrollArea = new ScrollArea(20, 35, WIDTH - 40, HEIGHT - 45, true)
            {
                AcceptMouseInput = true
            };

            Add(_scrollArea);

            Dictionary <string, string> dict = ReflectionHolder.GetGameObjectProperties(obj);

            if (dict != null)
            {
                foreach (KeyValuePair <string, string> item in dict.OrderBy(s => s.Key))
                {
                    ScrollAreaItem areaItem = new ScrollAreaItem();

                    Label label = new Label(item.Key + ":", true, 33, font: 1, style: FontStyle.BlackBorder)
                    {
                        X = 2
                    };

                    areaItem.Add(label);

                    int height = label.Height;

                    label = new Label(item.Value, true, 1153, font: 1, style: FontStyle.BlackBorder, maxwidth: WIDTH - 65 - 200)
                    {
                        X = 200,
                        AcceptMouseInput = true
                    };

                    label.MouseUp += OnLabelClick;

                    if (label.Height > 0)
                    {
                        height = label.Height;
                    }

                    areaItem.Add(label);
                    areaItem.Add(new Line(0, height + 2, WIDTH - 65, 1, Color.Gray.PackedValue));

                    _scrollArea.Add(areaItem);
                }
            }
        }
Exemplo n.º 3
0
        public CoreMethods(CoreTypes types)
        {
            Contract.ThrowIfNull(types);

            PhpValue = new PhpValueHolder(types);
            PhpAlias = new PhpAliasHolder(types);
            PhpArray = new PhpArrayHolder(types);
            IPhpArray = new IPhpArrayHolder(types);
            PhpNumber = new PhpNumberHolder(types);
            PhpString = new PhpStringHolder(types);
            Operators = new OperatorsHolder(types);
            Ctors = new ConstructorsHolder(types);
            Context = new ContextHolder(types);
            Dynamic = new DynamicHolder(types);
            Reflection = new ReflectionHolder(types);
        }