Exemple #1
0
        public void AddCountdown()
        {
            TimeSpan left = (Battle.StartTime + TimeSpan.FromMinutes(VvVBattle.Duration)) - DateTime.UtcNow;

            Countdown = new GumpHtml(210, 21, 233, 347, "<basefont color=#FF0000>" + String.Format("{0:mm\\:ss}", left), false, false);

            Add(Countdown);
        }
Exemple #2
0
 public static void AppendTo(this GumpHtml g, IGumpWriter disp, List <string> strings)
 {
     disp.AppendLayout(GumpHtml.LayoutName);
     disp.AppendLayout(g.X);
     disp.AppendLayout(g.Y);
     disp.AppendLayout(g.Width);
     disp.AppendLayout(g.Height);
     disp.AppendLayout(strings.Intern(g.Text));
     disp.AppendLayout(g.Background);
     disp.AppendLayout(g.Scrollbar);
 }
Exemple #3
0
 public virtual void Write(string name, GumpHtml 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);
     SetValue(e.Text);
     Append();
 }
Exemple #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
                });
            });
        }