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

                WarningScreen warning = new WarningScreen(game, true, true);
                warning.Metadata = "CL_" + url;
                warning.SetHandlers(DownloadTexturePack, SkipTexturePack, WarningScreenTick);

                warning.SetTextData(
                    "Do you want to download the server's texture pack?",
                    "Texture pack url:", address,
                    "Download size: Determining...");
                game.Gui.ShowWarning(warning);
            }
            else
            {
                DownloadTexturePack(url);
            }
        }
Example #2
0
        internal void MakeWarning(Game game, string plugin)
        {
            WarningScreen warning = new WarningScreen(game, true, false);

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

            warning.SetTextData(
                "&eAre you sure you want to load plugin " + plugin + " ?",
                "Be careful - plugins from strangers may have viruses",
                " or other malicious behaviour.");
            game.Gui.ShowWarning(warning);
        }