示例#1
0
        public static void AppendTo(this GumpHtmlLocalized g, IGumpWriter disp, List <string> strings)
        {
            switch (g.Type)
            {
            case GumpHtmlLocalizedType.Plain:
            {
                disp.AppendLayout(GumpHtmlLocalized.LayoutNamePlain);

                disp.AppendLayout(g.X);
                disp.AppendLayout(g.Y);
                disp.AppendLayout(g.Width);
                disp.AppendLayout(g.Height);
                disp.AppendLayout(g.Number);
                disp.AppendLayout(g.Background);
                disp.AppendLayout(g.Scrollbar);

                break;
            }

            case GumpHtmlLocalizedType.Color:
            {
                disp.AppendLayout(GumpHtmlLocalized.LayoutNameColor);

                disp.AppendLayout(g.X);
                disp.AppendLayout(g.Y);
                disp.AppendLayout(g.Width);
                disp.AppendLayout(g.Height);
                disp.AppendLayout(g.Number);
                disp.AppendLayout(g.Background);
                disp.AppendLayout(g.Scrollbar);
                disp.AppendLayout(g.Color);

                break;
            }

            case GumpHtmlLocalizedType.Args:
            {
                disp.AppendLayout(GumpHtmlLocalized.LayoutNameArgs);

                disp.AppendLayout(g.X);
                disp.AppendLayout(g.Y);
                disp.AppendLayout(g.Width);
                disp.AppendLayout(g.Height);
                disp.AppendLayout(g.Background);
                disp.AppendLayout(g.Scrollbar);
                disp.AppendLayout(g.Color);
                disp.AppendLayout(g.Number);
                disp.AppendLayout(g.Args);

                break;
            }
            }
        }
示例#2
0
        public static void AppendTo(this GumpHtmlLocalized g, IGumpWriter disp, List <string> strings)
        {
            switch (g.Type)
            {
            case GumpHtmlLocalizedType.Plain:
            {
                disp.AppendLayout(Gump.StringToBuffer("xmfhtmlgump"));

                disp.AppendLayout(g.X);
                disp.AppendLayout(g.Y);
                disp.AppendLayout(g.Width);
                disp.AppendLayout(g.Height);
                disp.AppendLayout(g.Number);
                disp.AppendLayout(g.Background);
                disp.AppendLayout(g.Scrollbar);

                break;
            }

            case GumpHtmlLocalizedType.Color:
            {
                disp.AppendLayout(Gump.StringToBuffer("xmfhtmlgumpcolor"));

                disp.AppendLayout(g.X);
                disp.AppendLayout(g.Y);
                disp.AppendLayout(g.Width);
                disp.AppendLayout(g.Height);
                disp.AppendLayout(g.Number);
                disp.AppendLayout(g.Background);
                disp.AppendLayout(g.Scrollbar);
                disp.AppendLayout(g.Color);

                break;
            }

            case GumpHtmlLocalizedType.Args:
            {
                disp.AppendLayout(Gump.StringToBuffer("xmfhtmltok"));

                disp.AppendLayout(g.X);
                disp.AppendLayout(g.Y);
                disp.AppendLayout(g.Width);
                disp.AppendLayout(g.Height);
                disp.AppendLayout(g.Background);
                disp.AppendLayout(g.Scrollbar);
                disp.AppendLayout(g.Color);
                disp.AppendLayout(g.Number);
                disp.AppendLayout(g.Args);

                break;
            }
            }
        }
示例#3
0
 public virtual void Write(string name, GumpHtmlLocalized e)
 {
     CreateElement(e);
     SetAttribute("name", name);
     SetAttribute("x", e.X);
     SetAttribute("y", e.Y);
     SetAttribute("width", e.Width);
     SetAttribute("height", e.Height);
     SetAttribute("scrollbar", e.Scrollbar);
     SetAttribute("background", e.Background);
     SetAttribute("value", e.Number);
     SetAttribute("args", e.Args);
     Append();
 }
示例#4
0
        protected override void CompileLayout(SuperGumpLayout layout)
        {
            base.CompileLayout(layout);

            if (Sources == null)
            {
                return;
            }

            Sources.ForEach(
                source =>
            {
                if (source == null || source.IsDisposed || !source.Compiled || !source.IsOpen)
                {
                    return;
                }

                source.Entries.For(
                    (i, src) =>
                {
                    if (src is GumpPage)
                    {
                        GumpPage e = (GumpPage)src;
                        layout.Add(source.Serial + "/" + i + "/GumpPage", () => AddPage(e.Page));
                    }
                    else if (src is GumpTooltip)
                    {
                        GumpTooltip e = (GumpTooltip)src;
                        layout.Add(source.Serial + "/" + i + "/GumpTooltip", () => AddTooltip(e.Number));
                    }
                    else if (src is GumpBackground)
                    {
                        GumpBackground e = (GumpBackground)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpBackground", () => AddBackground(e.X, e.Y, e.Width, e.Height, e.GumpID));
                    }
                    else if (src is GumpAlphaRegion)
                    {
                        GumpAlphaRegion e = (GumpAlphaRegion)src;
                        layout.Add(source.Serial + "/" + i + "/GumpAlphaRegion", () => AddAlphaRegion(e.X, e.Y, e.Width, e.Height));
                    }
                    else if (src is GumpItem)
                    {
                        GumpItem e = (GumpItem)src;
                        layout.Add(source.Serial + "/" + i + "/GumpItem", () => AddItem(e.X, e.Y, e.ItemID, e.Hue));
                    }
                    else if (src is GumpImage)
                    {
                        GumpImage e = (GumpImage)src;
                        layout.Add(source.Serial + "/" + i + "/GumpImage", () => AddImage(e.X, e.Y, e.GumpID, e.Hue));
                    }
                    else if (src is GumpImageTiled)
                    {
                        GumpImageTiled e = (GumpImageTiled)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpImageTiled", () => AddImageTiled(e.X, e.Y, e.Width, e.Height, e.GumpID));
                    }
                    else if (src is GumpImageTileButton)
                    {
                        GumpImageTileButton e = (GumpImageTileButton)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpImageTileButton",
                            () =>
                            AddImageTiledButton(
                                e.X, e.Y, e.NormalID, e.PressedID, e.ButtonID, e.Type, e.Param, e.ItemID, e.Hue, e.Width, e.Height));
                    }
                    else if (src is GumpLabel)
                    {
                        GumpLabel e = (GumpLabel)src;
                        layout.Add(source.Serial + "/" + i + "/GumpLabel", () => AddLabel(e.X, e.Y, e.Hue, e.Text));
                    }
                    else if (src is GumpLabelCropped)
                    {
                        GumpLabelCropped e = (GumpLabelCropped)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpLabelCropped",
                            () => AddLabelCropped(e.X, e.Y, e.Width, e.Height, e.Hue, e.Text));
                    }
                    else if (src is GumpHtml)
                    {
                        GumpHtml e = (GumpHtml)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpHtml",
                            () => AddHtml(e.X, e.Y, e.Width, e.Height, e.Text, e.Background, e.Scrollbar));
                    }
                    else if (src is GumpHtmlLocalized)
                    {
                        GumpHtmlLocalized e = (GumpHtmlLocalized)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpHtmlLocalized",
                            () => AddHtmlLocalized(e.X, e.Y, e.Width, e.Height, e.Number, e.Args, e.Color, e.Background, e.Scrollbar));
                    }
                    else if (src is GumpButton)
                    {
                        GumpButton e = (GumpButton)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpButton",
                            () => AddButton(e.X, e.Y, e.NormalID, e.PressedID, e.ButtonID, source.Buttons.GetValue(e)));
                    }
                    else if (src is GumpCheck)
                    {
                        GumpCheck e = (GumpCheck)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpCheck",
                            () => AddCheck(e.X, e.Y, e.InactiveID, e.ActiveID, e.SwitchID, e.InitialState, source.Switches.GetValue(e)));
                    }
                    else if (src is GumpRadio)
                    {
                        GumpRadio e = (GumpRadio)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpRadio",
                            () => AddRadio(e.X, e.Y, e.InactiveID, e.ActiveID, e.SwitchID, e.InitialState, source.Radios.GetValue(e)));
                    }
                    else if (src is GumpTextEntry)
                    {
                        GumpTextEntry e = (GumpTextEntry)src;
                        layout.Add(
                            source.Serial + "/" + i + "/GumpTextEntry",
                            () => AddTextEntry(e.X, e.Y, e.Width, e.Height, e.Hue, e.EntryID, e.InitialText, source.TextInputs.GetValue(e)));
                    }
                    else if (src is GumpTextEntryLimited)
                    {
                        GumpTextEntryLimited e = (GumpTextEntryLimited)src;
                        var action             = source.LimitedTextInputs.GetValue(e);

                        layout.Add(
                            source.Serial + "/" + i + "/GumpTextEntryLimited",
                            () => AddTextEntryLimited(e.X, e.Y, e.Width, e.Height, e.Hue, e.EntryID, e.InitialText, e.Size, action));
                    }
                });

                layout.Add(
                    source.Serial + "/frame",
                    () =>
                {
                    AddImageTiled(source.X, source.Y, source.OuterWidth, 2, 11340);                                     //top
                    AddImageTiled(source.X + source.OuterWidth, source.Y, 2, source.OuterHeight, 11340);                //right
                    AddImageTiled(source.X, source.Y + source.OuterHeight, source.OuterWidth, 2, 11340);                //bottom
                    AddImageTiled(source.X, source.Y, 2, source.OuterHeight, 11340);                                    //left
                });
            });
        }