void about_Click(object sender, EventArgs e)
        {
            var info = Rodent.DeviceInfo;
            var data = new SplashData()
            {
                Developer = info.Developer,
                Plugin    = info.Name,
                Version   = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(),
                Website   = "www.analogwindow.com"
            };

            var splash = new Splash(SplashBitmap, data);

            splash.Left = Width / 2 - splash.Width / 2;
            splash.Top  = TopH + (Height - TopH) / 2 - splash.Height / 2;
            Controls.Add(splash);
            splash.BringToFront();
        }
Exemple #2
0
        private void Go()
        {
            splashscreen = new Splash();
            splashscreen.Show();
            splashscreen.BringToFront();
            splashscreen.Refresh();
            Core.Init(null, null, null, new ProgressHandler(UpdateMessage), true);
            world = new WorldDefinition(new Distance(150, 150, 7), 3);
            WorldDefinition.World = world;
            mainWindowMDI         = new MainWindow();
            timer = new System.Windows.Forms.Timer();
            Events.KeyboardDown    += new EventHandler <KeyboardEventArgs>(this.KeyDown);
            Events.MouseButtonDown +=
                new EventHandler <MouseButtonEventArgs>(this.MouseButtonDown);
            Events.MouseButtonUp +=
                new EventHandler <MouseButtonEventArgs>(this.MouseButtonUp);
            Events.Quit          += new EventHandler <QuitEventArgs>(this.Quit);
            Events.Tick          += new EventHandler <TickEventArgs>(this.Tick);
            Events.VideoResize   += new EventHandler <SdlDotNet.Graphics.VideoResizeEventArgs>(this.Resize);
            Events.MusicFinished +=
                new EventHandler <MusicFinishedEventArgs>(this.MusicFinished);
            Events.MouseMotion     += new EventHandler <MouseMotionEventArgs>(this.MouseMotion);
            dragStartMousePosition  = new Point(0, 0);
            dragStartScrollPosition = new Point(0, 0);
            ScrollPosition          = new Point(0, 0);
            this.width  = Properties.Settings.Default.RenderWindowWidth;
            this.height = Properties.Settings.Default.RenderWindowHeight;

            try
            {
                SdlDotNet.Graphics.Video.WindowIcon();
                SdlDotNet.Graphics.Video.WindowCaption = Translation.GetString("MAIN_WINDOW_TITLE");
                SdlDotNet.Graphics.Video.Initialize();
                splashscreen.BringToFront();
            }
            catch
            {
                MessageBox.Show(Translation.GetString("SDL_NOT_FOUND"));
                return;
            }

            Mixer.Initialize();

            SdlMixer.MusicFinishedDelegate musicStopped = new SdlMixer.MusicFinishedDelegate(MusicHasStopped);
            SdlMixer.Mix_HookMusicFinished(musicStopped);


            screen = SdlDotNet.Graphics.Video.SetVideoMode(width, height, currentBpp, true);
            screen.SourceColorKey = Color.Magenta;
            IntPtr videoInfoPointer = Sdl.SDL_GetVideoInfo();

            if (videoInfoPointer != IntPtr.Zero)
            {
                videoInfo   = (Sdl.SDL_VideoInfo)Marshal.PtrToStructure(videoInfoPointer, typeof(Sdl.SDL_VideoInfo));
                pixelFormat = (Sdl.SDL_PixelFormat)Marshal.PtrToStructure(videoInfo.vfmt, typeof(Sdl.SDL_PixelFormat));
            }
            splashscreen.status.AppendText("FreeTrain SDL Starting...");
            splashscreen.status.AppendText("\n");
            splashscreen.Refresh();

            FinalDraw();

            splashscreen.status.AppendText("Loading plugins...");
            splashscreen.status.AppendText("\n");
            splashscreen.Refresh();
            FinalDraw();


            weatherOverlay = NullWeatherOverlay.theInstance;
            FinalDraw();
            qView = new QuarterViewDrawer(world, new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8));
            qView.OffscreenBuffer = new Surface(world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8, screen.CreateCompatibleSurface().Pixels);
            qView.OffscreenBuffer.SourceColorKey = Color.Magenta;
            qView.RecreateDrawBuffer(new Size(width, height), true);
            splashscreen.status.AppendText("Creating Map...");
            splashscreen.status.AppendText("\n");
            splashscreen.Refresh();
            FinalDraw();

            qView.Draw(new Rectangle(0, 0, world.Size.x * 32 - 16, (world.Size.y - 2 * world.Size.z - 1) * 8), null);
            timer.Tick    += new EventHandler(TimerTick);
            timer.Interval = 33;
            timer.Enabled  = true;
            timer.Start();

            mainWindowMDI.Show();
            splashscreen.BringToFront();
            splashscreen.Close();

            Events.Run();
        }
Exemple #3
0
 public virtual void Show(string message)
 {
     Splash.Show();
     Splash.BringToFront();
     label.Text = message;
 }