protected internal void RetrieveTexturePack(string url)
        {
            if (!game.AcceptedUrls.HasEntry(url) && !game.DeniedUrls.HasEntry(url))
            {
                game.Downloader.AsyncGetContentLength(url, true, "CL_" + url);
                string address = url;
                if (url.StartsWith("https://"))
                {
                    address = url.Substring(8);
                }
                if (url.StartsWith("http://"))
                {
                    address = url.Substring(7);
                }

                WarningOverlay warning = new WarningOverlay(game, true, true);
                warning.Metadata = "CL_" + url;
                warning.SetHandlers(DownloadTexturePack, SkipTexturePack);
                warning.OnRenderFrame = WarningScreenTick;
                warning.lines[0]      = "Do you want to download the server's texture pack?";

                warning.lines[1] = "Texture pack url:";
                warning.lines[2] = address;
                warning.lines[3] = "Download size: Determining...";
                game.Gui.ShowOverlay(warning);
            }
            else
            {
                DownloadTexturePack(url);
            }
        }
Exemple #2
0
        internal void MakeWarning(Game game, string plugin)
        {
            WarningOverlay warning = new WarningOverlay(game, true, false);

            warning.Metadata = plugin;
            warning.SetHandlers(Accept, Deny);

            warning.lines[0] = "&eAre you sure you want to load plugin " + plugin + " ?";
            warning.lines[1] = "Be careful - plugins from strangers may have viruses";
            warning.lines[2] = " or other malicious behaviour.";
            game.Gui.ShowOverlay(warning);
        }