Ejemplo n.º 1
0
        private void btnAddBeat_Click(object sender, RoutedEventArgs e)
        {
            BeatContainer container = new BeatContainer();

            TimePanel.SetPosition(container, VideoPlayer.GetPosition());
            TimePanel.SetDuration(container, TimeSpan.FromSeconds(1));
            timePanel.Children.Add(container);
        }
Ejemplo n.º 2
0
 void ResourceContainer_Scroll(object sender, ScrollEventArgs e)
 {
     ResourceNamePanel.Top = ResourcePanel.Top;
     TaskPanel.Left        = ResourcePanel.Left;
     if (e.ScrollOrientation == ScrollOrientation.HorizontalScroll)
     {
         TimePanel.Refresh();
     }
     ShowScrollBar(TaskContainer.Handle, (int)ScrollBarDirection.SB_HORZ, false);
 }
Ejemplo n.º 3
0
        void RefreshState()
        {
            if (tasks == null || resources == null)
            {
                return;
            }
            GetTimeUnit(out MinorTimeUnit, out TimeUnitCountPerMajorUnit);
            int width = 0;

            for (int i = 0; i < tasks.Length; i++)
            {
                width = Math.Max(width, (int)((tasks[i].PlannedDuration + tasks[i].PlannedStart) * ScaleFactor));
            }
            int rowCount = tasks.Length + 1;

            width = width + 200;
            width = Math.Max(width, TaskContainer.Width);

            int height = TimeRowHeight + rowCount * RowHeight;

            height         = Math.Max(height, TaskContainer.Height);
            TaskPanel.Size = new Size(width, height);

            TaskNamePanel.Size = new Size(
                Math.Max(nameColumnWidth, TaskNamePanel.Width),
                Math.Max(RowHeight * tasks.Length + TimeRowHeight, TaskNamePanel.Height));

            rowCount = 0;
            for (int i = 0; i < resources.Length; i++)
            {
                rowCount += resources[i].Count;
            }
            ResourceNamePanel.Size = new Size(
                Math.Max(nameColumnWidth, ResourceNamePanel.Width),
                Math.Max(RowHeight * rowCount, ResourceNamePanel.Height));
            width              = Math.Max(width, ResourceContainer.Width);
            height             = Math.Max(RowHeight * rowCount, ResourceContainer.Height);
            ResourcePanel.Size = new Size(
                width,
                height);

            TaskContainer.HorizontalScroll.Enabled = false;
            TaskContainer.HorizontalScroll.Visible = false;

            LeftContainer.Width = nameColumnWidth;

            TaskPanel.Refresh();
            TaskNamePanel.Refresh();
            ResourceNamePanel.Refresh();
            ResourcePanel.Refresh();
            TimePanel.Refresh();
            ShowScrollBar(TaskContainer.Handle, (int)ScrollBarDirection.SB_HORZ, false);
        }
Ejemplo n.º 4
0
        public DistanceGauge()
        {
            InitializeComponent();

            DistanceLine.EnableFluidVisibilityAnimation(showFromScale: 0.4f, hideToScale: 0.4f, showDuration: 400, hideDuration: 400);
            ElevationPanel.EnableFluidVisibilityAnimation(showDuration: 400, hideDuration: 400);
            TimeCaption.EnableFluidVisibilityAnimation(showDuration: 400, hideDuration: 400);
            DistanceCaption.EnableFluidVisibilityAnimation(showDuration: 400, hideDuration: 400);

            TimeCaption.EnableImplicitAnimation(VisualPropertyType.Offset, duration: 400);
            TimePanel.EnableImplicitAnimation(VisualPropertyType.Offset, duration: 400);
            DistanceCaption.EnableImplicitAnimation(VisualPropertyType.Offset, duration: 400);
            DistancePanel.EnableImplicitAnimation(VisualPropertyType.Offset, duration: 400);
        }
Ejemplo n.º 5
0
 private void btnSpecifyTime_Click(object sender, EventArgs e)
 {
     TimePanel.Visible = true;
     TimePanel.BringToFront();
 }
Ejemplo n.º 6
0
        public override void Update(GameTime gameTime)
        {
            for (int S = ListEnemySpawner.Count - 1; S >= 0; --S)
            {
                ListEnemySpawner[S].Update(gameTime);
            }

            SuperTank2.SlowDownSpecialActive = false;

            for (int V = 0; V < Vehicule.ArrayVehicule.Length; V++)
            {
                Vehicule.ArrayVehicule[V].BackgroundSpeed = new Vector2(Background2D.MoveSpeed.X, Background2D.MoveSpeed.Y);
                Vehicule.ArrayVehicule[V].Update(gameTime);
            }

            float TimeEllapsed = gameTime.ElapsedGameTime.Milliseconds * 0.0625f;

            if (SuperTank2.SlowDownSpecialActive)
            {
                TimeEllapsed *= 0.5f;
            }

            Background2D.Update(gameTime);

            for (int E = 0; E < Enemy.ListEnemy.Count; E++)
            {
                if (Enemy.ListEnemy[E].IsAlive)
                {
                    Enemy.ListEnemy[E].Update(TimeEllapsed);

                    for (int V = 0; V < Vehicule.ArrayVehicule.Length; V++)
                    {
                        if (Vehicule.ArrayVehicule[V].VehiculeResist > 0)
                        {
                            if (Enemy.ListEnemy[E].PixelIntersect(Vehicule.ArrayVehicule[V]))
                            {
                                sndHit.Play();
                                Enemy.ListEnemy[E].Resist -= 10;

                                if (Enemy.ListEnemy[E].Resist <= 0)
                                {
                                    Enemy.ListEnemy[E].Destroyed(Vehicule.ArrayVehicule[V]);
                                }

                                if (Vehicule.ArrayVehicule[V].Protec > 0)
                                {
                                    Vehicule.ArrayVehicule[V].Protec -= 1;
                                }
                                else
                                {
                                    Vehicule.ArrayVehicule[V].VehiculeResist -= 1;
                                }
                            }
                        }
                    }
                }
            }

            for (int A = 0; A < EnemyAttack.ListEnemyAttack.Count; A++)
            {
                if (EnemyAttack.ListEnemyAttack[A].Resist > 0)
                {
                    EnemyAttack.ListEnemyAttack[A].Update(TimeEllapsed);

                    for (int V = 0; V < Vehicule.ArrayVehicule.Length; V++)
                    {
                        if (Vehicule.ArrayVehicule[V].VehiculeResist > 0)
                        {
                            bool AttackHit;
                            if (EnemyAttack.ListEnemyAttack[A].AttackType == EnemyAttack.AttackTypes.Laser)
                            {
                                AttackHit = EnemyAttack.ListEnemyAttack[A].CollisionBox.Intersects(Vehicule.ArrayVehicule[V].CollisionBox);
                            }
                            else
                            {
                                if (EnemyAttack.ListEnemyAttack[A].PixelIntersect(Vehicule.ArrayVehicule[V]))
                                {
                                    EnemyAttack.ListEnemyAttack[A].Resist = 0;
                                    EnemyAttack.ListEnemyAttack[A].Destroyed(Vehicule.ArrayVehicule[V]);
                                    AttackHit = true;
                                }
                                else
                                {
                                    AttackHit = false;
                                }
                            }
                            if (AttackHit)
                            {
                                sndHit.Play();
                                Vehicule.ArrayVehicule[V].VehiculeResist -= EnemyAttack.ListEnemyAttack[A].Damage;
                                for (int i = 0; i < EnemyAttack.ListEnemyAttack[A].Damage; i++)
                                {
                                    new FlameParticle(EnemyAttack.ListEnemyAttack[A].Position, SuperTank2.Randomizer.Next(360) * SuperTank2.DegToRad, SuperTank2.Randomizer.NextDouble() * 5).AddParticule();
                                }
                            }
                        }
                    }
                }
            }

            Particule.UpdateParticles(gameTime);

            for (int S = 0; S < Smoke.ListSmoke.Count; S++)
            {
                if (Smoke.ListSmoke[S].IsAlive)
                {
                    Smoke.ListSmoke[S].Update(gameTime);
                }
            }

            for (int E = 0; E < Explosion.ListExplosion.Count; E++)
            {
                if (Explosion.ListExplosion[E].IsAlive)
                {
                    Explosion.ListExplosion[E].Update(gameTime);
                }
            }

            for (int E = 0; E < GroundExplosion.ListGroundExplosion.Count; E++)
            {
                if (GroundExplosion.ListGroundExplosion[E].IsAlive)
                {
                    GroundExplosion.ListGroundExplosion[E].Position.X -= Background2D.MoveSpeed.X;
                    if (GroundExplosion.ListGroundExplosion[E].Position.X < -50)
                    {
                        GroundExplosion.ListGroundExplosion[E].IsAlive = false;
                    }
                }
            }

            for (int B = 0; B < ListBackgroundObject.Count; B++)
            {
                if (ListBackgroundObject[B].IsAlive)
                {
                    ListBackgroundObject[B].Position.X -= 5;
                    if (ListBackgroundObject[B].Position.X < -200)
                    {
                        ListBackgroundObject[B].IsAlive = false;
                    }
                }
            }

            for (int T = 0; T < ListTimePanel.Count; T++)
            {
                ListTimePanel[T].Position.X -= Background2D.MoveSpeed.X;
                if (ListTimePanel[T].Position.X < -50)
                {
                    ListTimePanel.RemoveAt(T--);
                }
            }

            for (int P = 0; P < PowerUp.ListPowerUp.Count; P++)
            {
                if (PowerUp.ListPowerUp[P].VisibleTime > 0)
                {
                    PowerUp.ListPowerUp[P].UpdateTransformationMatrix();

                    for (int V = 0; V < Vehicule.ArrayVehicule.Length; V++)
                    {
                        if (PowerUp.ListPowerUp[P].PixelIntersect(Vehicule.ArrayVehicule[V]))
                        {
                            if (Vehicule.ArrayVehicule[V].ActivatePowerUp(PowerUp.ListPowerUp[P].PowerUpType))
                            {
                                PowerUp.ListPowerUp[P].VisibleTime = 0;
                            }
                        }
                    }
                    if (PowerUp.ListPowerUp[P].Position.Y > 750)
                    {
                        --PowerUp.ListPowerUp[P].VisibleTime;
                    }
                    else
                    {
                        PowerUp.ListPowerUp[P].Position.Y += 1;
                    }
                }
            }

            if (TimeBeforeBoss % TimeBeforeTimePanel == 0 && TimeBeforeBoss > 0)
            {
                TimePanel NewTimePanel = new TimePanel(new Vector2(1024, 655));
                NewTimePanel.Text = TimeBeforeBoss / TimeBeforeTimePanel + " km";
                ListTimePanel.Add(NewTimePanel);
            }
            --TimeBeforeBoss;
        }
Ejemplo n.º 7
0
        private void UpdateTimer_Tick(object sender, EventArgs e)
        {
            // Update current time of day.
            this.CurrentTime.Text = CurrentSystem.GetTimeOfDay();

            // Grab the skin context.
            var skin = this.CurrentSystem.GetSkinContext();

            // If we're in unity mode...
            if (_inUnity)
            {
                // then we become transparent.
                this.BackgroundImage = null;
                this.BackColor       = this.TransparencyKey;
            }
            else
            {
                // Otherwise, we get a wallpaper.
                if (skin.HasImage("desktopbackground"))
                {
                    if (this.BackgroundImage != skin.GetImage("desktopbackground"))
                    {
                        this.BackgroundImage = skin.GetImage("desktopbackground");
                    }
                    this.BackgroundImageLayout = skin.GetSkinData().desktopbackgroundlayout;
                }
                else
                {
                    this.BackgroundImage = null;
                    this.BackColor       = skin.GetSkinData().desktopbackgroundcolour;
                }
            }

            // Do we have the desktop panel?
            if (CurrentSystem.HasShiftoriumUpgrade("desktoppanel"))
            {
                // Set the desktop panel background
                if (skin.HasImage("desktoppanel"))
                {
                    if (DesktopPanel.BackgroundImage != skin.GetImage("desktoppanel"))
                    {
                        DesktopPanel.BackgroundImage = skin.GetImage("desktoppanel");
                    }
                    DesktopPanel.BackgroundImageLayout = skin.GetSkinData().desktoppanellayout;
                    DesktopPanel.BackColor             = Color.Transparent;
                }
                else
                {
                    DesktopPanel.BackgroundImage = null;
                    DesktopPanel.BackColor       = skin.GetSkinData().desktoppanelcolour;
                }

                // Set the height of the desktop panel.
                DesktopPanel.Height = skin.GetSkinData().desktoppanelheight;

                // Position the desktop panel.
                if (skin.GetSkinData().desktoppanelposition == "Top")
                {
                    DesktopPanel.Dock = DockStyle.Top;
                }
                else
                {
                    DesktopPanel.Dock = DockStyle.Bottom;
                }

                // Show it.
                DesktopPanel.Show();
            }
            else
            {
                // Hide it.
                DesktopPanel.Hide();
            }

            // Do we have the panel clock?
            if (CurrentSystem.HasShiftoriumUpgrade("desktoppanelclock"))
            {
                CurrentTime.ForeColor = skin.GetSkinData().clocktextcolour;
                if (skin.HasImage("panelclock"))
                {
                    TimePanel.BackColor = Color.Transparent;
                    if (TimePanel.BackgroundImage != skin.GetImage("panelclock"))
                    {
                        TimePanel.BackgroundImage = skin.GetImage("panelclock");
                    }
                    TimePanel.BackgroundImageLayout = skin.GetSkinData().panelclocklayout;
                }
                else
                {
                    TimePanel.BackColor       = skin.GetSkinData().clockbackgroundcolor;
                    TimePanel.BackgroundImage = null;
                }

                if (CurrentTime.Font.Name != skin.GetSkinData().panelclocktextfont || CurrentTime.Font.Size != skin.GetSkinData().panelclocktextsize || CurrentTime.Font.Style != skin.GetSkinData().panelclocktextstyle)
                {
                    CurrentTime.Font = new Font(skin.GetSkinData().panelclocktextfont, skin.GetSkinData().panelclocktextsize, skin.GetSkinData().panelclocktextstyle);
                }

                TimePanel.Width  = CurrentTime.Width + 3;
                CurrentTime.Left = 0;
                CurrentTime.Top  = skin.GetSkinData().panelclocktexttop;

                TimePanel.Show();
            }
            else
            {
                TimePanel.Hide();
            }

            // Set up the panel buttons.
            if (CurrentSystem.HasShiftoriumUpgrade("panelbuttons"))
            {
                PanelButtonList.Padding = new Padding(skin.GetSkinData().panelbuttoninitialgap, 0, 0, 0);

                PanelButtonList.Show();
            }
            else
            {
                PanelButtonList.Hide();
            }

            // Do we have an app launcher?
            if (CurrentSystem.HasShiftoriumUpgrade("applaunchermenu"))
            {
                // Set up the font.
                string    appFontName  = skin.GetSkinData().applicationbuttontextfont;
                int       appFontSize  = skin.GetSkinData().applicationbuttontextsize;
                FontStyle appFontStyle = skin.GetSkinData().applicationbuttontextstyle;


                if (AppLauncherMenu.Font.Name != appFontName || AppLauncherMenu.Font.Size != appFontSize || AppLauncherMenu.Font.Style != appFontStyle)
                {
                    AppLauncherMenu.Font = new Font(appFontName, appFontSize, appFontStyle);
                }

                string    appItemFontName  = skin.GetSkinData().launcheritemfont;
                int       appItemFontSize  = skin.GetSkinData().launcheritemsize;
                FontStyle appItemFontStyle = skin.GetSkinData().launcheritemstyle;

                foreach (var child in AppLauncherMenu.DropDownItems)
                {
                    if (child is ToolStripMenuItem)
                    {
                        ToolStripMenuItem menuItem = child as ToolStripMenuItem;
                        if (menuItem.Font.Name != appItemFontName || menuItem.Font.Size != appItemFontSize || menuItem.Font.Style != appItemFontStyle)
                        {
                            menuItem.Font = new Font(appItemFontName, appItemFontSize, appItemFontStyle);
                        }
                        menuItem.ForeColor = skin.GetSkinData().launcheritemcolour;
                    }
                }



                if (skin.HasImage("applauncher"))
                {
                    AppLauncherMenu.Text       = "";
                    AppLauncherStrip.BackColor = Color.Transparent;
                    if (AppLauncherStrip.BackgroundImage != skin.GetImage("applauncher"))
                    {
                        AppLauncherStrip.BackgroundImage = skin.GetImage("applauncher");
                    }
                    AppLauncherStrip.BackgroundImageLayout = skin.GetSkinData().applauncherlayout;
                }
                else
                {
                    AppLauncherStrip.BackColor       = skin.GetSkinData().applauncherbuttoncolour;
                    AppLauncherStrip.Text            = skin.GetSkinData().applicationlaunchername;
                    AppLauncherStrip.BackgroundImage = null;
                }

                AppLauncherMenu.Height  = skin.GetSkinData().applicationbuttonheight;
                AppLauncherHolder.Width = skin.GetSkinData().applaunchermenuholderwidth;
                AppLauncherMenu.Width   = AppLauncherHolder.Width;
                AppLauncherStrip.Width  = AppLauncherHolder.Width;
                AppLauncherStrip.Height = AppLauncherMenu.Height;

                AppLauncherHolder.Show();
            }
            else
            {
                AppLauncherHolder.Hide();
            }

            // Has the amount of children (windows) in the workspace changed?
            if (_lastWorkspaceChildCount != CurrentSystem.GetWindows().Count)
            {
                // Update it.
                _lastWorkspaceChildCount = CurrentSystem.GetWindows().Count;

                // Reset panel buttons.
                this.ResetPanelButtons();
            }

            // Tells any open programs that we've updated.
            this.CurrentSystem.UpdateDesktop();
        }
Ejemplo n.º 8
0
 private void Awake()
 {
     Instance = this;
 }