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);
            }
        }
Example #2
0
 private void CheckForEvents()
 {
     if (activeEvent == Events.None)
     {
         if (random.Next(1, 25000) == 1)
         {
             activeEvent = Events.AsteroidField;
             WarningOverlay.ShowWarning(3 * 60);
         }
     }
 }
Example #3
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);
        }
Example #4
0
        public HomeState()
        {
            gameObjects.AddChild(new SpriteGameObject("Sprites/Backgrounds/spr_play", Depth.Backgroud));

            getBallButton = new Button("Sprites/Buttons/spr_btn_get_ball", Depth.Button);
            getBallButton.SetOriginToRightTop();
            getBallButton.LocalPosition = new Vector2(680, 170);

            changeBallButton = new Button("Sprites/Buttons/spr_btn_change_ball", Depth.Button);
            changeBallButton.SetOriginToLeftBottom();
            changeBallButton.LocalPosition = new Vector2(100, 940);

            playButton = new Button("Sprites/Buttons/spr_btn_play", Depth.Button);
            playButton.SetOriginToRightBottom();
            playButton.LocalPosition = new Vector2(600, 940);

            logo = new SpriteGameObject("Sprites/UI/spr_logo_name", Depth.Button);
            logo.SetOriginToCenter();
            logo.LocalPosition = new Vector2(350, 550);
            gameObjects.AddChild(logo);

            moneyText = new TextGameObject("Fonts/PlayMoney", Depth.Button, Color.White, TextGameObject.HorizontalAlignment.Left, TextGameObject.VerticalAlignment.Center);
            gameObjects.AddChild(moneyText);
            moneyText.LocalPosition = new Vector2(120, 1132);


            gameObjects.AddChild(getBallButton);
            gameObjects.AddChild(changeBallButton);
            gameObjects.AddChild(playButton);

            getBallOverlay = new GetBallOverlay();
            gameObjects.AddChild(getBallOverlay);

            confirmOverlay = new ConfirmOverlay(getBallOverlay);
            gameObjects.AddChild(confirmOverlay);

            warningOverlay = new WarningOverlay();
            gameObjects.AddChild(warningOverlay);

            Reset();
        }