Exemplo n.º 1
0
        private void OnReset(object sender, RoutedEventArgs e)
        {
            collected        = 0;
            Collected.Source = data.Numbers[1];
            HintText.Content = "";

            if (data.selected != null)
            {
                for (int i = 0; i < data.SelectedBars.Count; ++i)
                {
                    if (data.Worlds[i] == data.selected)
                    {
                        data.SelectedBars[i].Source = new BitmapImage(new Uri("Images\\VerticalBarWhite.png", UriKind.Relative));
                    }
                }
            }
            data.selected = null;

            for (int i = 0; i < data.Grids.Count; ++i)
            {
                for (int j = data.Grids[i].Children.Count - 1; j >= 0; --j)
                {
                    Item item = data.Grids[i].Children[j] as Item;
                    data.Grids[i].Children.Remove(data.Grids[i].Children[j]);
                    ItemPool.Children.Add(item);

                    item.MouseDown  -= item.Item_Return;
                    item.MouseEnter -= item.Report_Hover;
                    if (data.dragDrop)
                    {
                        item.MouseDoubleClick -= item.Item_Click;
                        item.MouseDoubleClick += item.Item_Click;
                        item.MouseMove        -= item.Item_MouseMove;
                        item.MouseMove        += item.Item_MouseMove;
                    }
                    else
                    {
                        item.MouseDown -= item.Item_MouseDown;
                        item.MouseDown += item.Item_MouseDown;
                        item.MouseUp   -= item.Item_MouseUp;
                        item.MouseUp   += item.Item_MouseUp;
                    }
                }
            }

            // Reset 1st column row heights
            RowDefinitionCollection rows1 = ((data.Grids[0].Parent as Grid).Parent as Grid).RowDefinitions;

            foreach (RowDefinition row in rows1)
            {
                // don't reset turned off worlds
                if (row.Height.Value != 0)
                {
                    row.Height = new GridLength(1, GridUnitType.Star);
                }
            }

            // Reset 2nd column row heights
            RowDefinitionCollection rows2 = ((data.Grids[1].Parent as Grid).Parent as Grid).RowDefinitions;

            foreach (RowDefinition row in rows2)
            {
                // don't reset turned off worlds
                if (row.Height.Value != 0)
                {
                    row.Height = new GridLength(1, GridUnitType.Star);
                }
            }

            ResetHints();

            LevelIcon.Visibility    = Visibility.Hidden;
            Level.Visibility        = Visibility.Hidden;
            StrengthIcon.Visibility = Visibility.Hidden;
            Strength.Visibility     = Visibility.Hidden;
            MagicIcon.Visibility    = Visibility.Hidden;
            Magic.Visibility        = Visibility.Hidden;
            DefenseIcon.Visibility  = Visibility.Hidden;
            Defense.Visibility      = Visibility.Hidden;
            Weapon.Visibility       = Visibility.Hidden;

            // Reset / Turn off auto tracking
            collectedChecks.Clear();
            newChecks.Clear();
            if (aTimer != null)
            {
                aTimer.Stop();
            }

            fireLevel     = 0;
            blizzardLevel = 0;
            thunderLevel  = 0;
            cureLevel     = 0;
            reflectLevel  = 0;
            magnetLevel   = 0;
            tornPageCount = 0;

            double broadcastLeft    = broadcast.Left;
            double broadcastTop     = broadcast.Top;
            bool   broadcastVisible = broadcast.IsVisible;

            broadcast.canClose = true;
            broadcast.Close();
            broadcast      = new BroadcastWindow(data);
            broadcast.Left = broadcastLeft;
            broadcast.Top  = broadcastTop;
            if (broadcastVisible)
            {
                broadcast.Show();
            }
        }
Exemplo n.º 2
0
        private void InitData()
        {
            data = new Data();

            data.Worlds.Add(SorasHeart);
            data.Worlds.Add(DriveForms);
            data.Worlds.Add(SimulatedTwilightTown);
            data.Worlds.Add(TwilightTown);
            data.Worlds.Add(HollowBastion);
            data.Worlds.Add(BeastsCastle);
            data.Worlds.Add(OlympusColiseum);
            data.Worlds.Add(Agrabah);
            data.Worlds.Add(LandofDragons);
            data.Worlds.Add(HundredAcreWood);
            data.Worlds.Add(PrideLands);
            data.Worlds.Add(DisneyCastle);
            data.Worlds.Add(HalloweenTown);
            data.Worlds.Add(PortRoyal);
            data.Worlds.Add(SpaceParanoids);
            data.Worlds.Add(TWTNW);
            data.Worlds.Add(Atlantica);
            data.Worlds.Add(GoA);

            data.Hints.Add(SorasHeartHint);
            data.Hints.Add(DriveFormsHint);
            data.Hints.Add(SimulatedTwilightTownHint);
            data.Hints.Add(TwilightTownHint);
            data.Hints.Add(HollowBastionHint);
            data.Hints.Add(BeastsCastleHint);
            data.Hints.Add(OlympusColiseumHint);
            data.Hints.Add(AgrabahHint);
            data.Hints.Add(LandofDragonsHint);
            data.Hints.Add(HundredAcreWoodHint);
            data.Hints.Add(PrideLandsHint);
            data.Hints.Add(DisneyCastleHint);
            data.Hints.Add(HalloweenTownHint);
            data.Hints.Add(PortRoyalHint);
            data.Hints.Add(SpaceParanoidsHint);
            data.Hints.Add(TWTNWHint);
            data.Hints.Add(AtlanticaHint);

            data.Grids.Add(SorasHeartGrid);
            data.Grids.Add(DriveFormsGrid);
            data.Grids.Add(SimulatedTwilightTownGrid);
            data.Grids.Add(TwilightTownGrid);
            data.Grids.Add(HollowBastionGrid);
            data.Grids.Add(BeastsCastleGrid);
            data.Grids.Add(OlympusColiseumGrid);
            data.Grids.Add(AgrabahGrid);
            data.Grids.Add(LandofDragonsGrid);
            data.Grids.Add(HundredAcreWoodGrid);
            data.Grids.Add(PrideLandsGrid);
            data.Grids.Add(DisneyCastleGrid);
            data.Grids.Add(HalloweenTownGrid);
            data.Grids.Add(PortRoyalGrid);
            data.Grids.Add(SpaceParanoidsGrid);
            data.Grids.Add(TWTNWGrid);
            data.Grids.Add(AtlanticaGrid);
            data.Grids.Add(GoAGrid);

            data.SelectedBars.Add(SorasHeartBar);
            data.SelectedBars.Add(DriveFormsBar);
            data.SelectedBars.Add(SimulatedTwilightTownBar);
            data.SelectedBars.Add(TwilightTownBar);
            data.SelectedBars.Add(HollowBastionBar);
            data.SelectedBars.Add(BeastsCastleBar);
            data.SelectedBars.Add(OlympusBar);
            data.SelectedBars.Add(AgrabahBar);
            data.SelectedBars.Add(LandofDragonsBar);
            data.SelectedBars.Add(HundredAcreWoodBar);
            data.SelectedBars.Add(PrideLandsBar);
            data.SelectedBars.Add(DisneyCastleBar);
            data.SelectedBars.Add(HalloweenTownBar);
            data.SelectedBars.Add(PortRoyalBar);
            data.SelectedBars.Add(SpaceParanoidsBar);
            data.SelectedBars.Add(TWTNWBar);
            data.SelectedBars.Add(AtlanticaBar);
            data.SelectedBars.Add(GoABar);

            data.Reports.Add(Report1);
            data.Reports.Add(Report2);
            data.Reports.Add(Report3);
            data.Reports.Add(Report4);
            data.Reports.Add(Report5);
            data.Reports.Add(Report6);
            data.Reports.Add(Report7);
            data.Reports.Add(Report8);
            data.Reports.Add(Report9);
            data.Reports.Add(Report10);
            data.Reports.Add(Report11);
            data.Reports.Add(Report12);
            data.Reports.Add(Report13);

            data.ReportAttemptVisual.Add(Attempts1);
            data.ReportAttemptVisual.Add(Attempts2);
            data.ReportAttemptVisual.Add(Attempts3);
            data.ReportAttemptVisual.Add(Attempts4);
            data.ReportAttemptVisual.Add(Attempts5);
            data.ReportAttemptVisual.Add(Attempts6);
            data.ReportAttemptVisual.Add(Attempts7);
            data.ReportAttemptVisual.Add(Attempts8);
            data.ReportAttemptVisual.Add(Attempts9);
            data.ReportAttemptVisual.Add(Attempts10);
            data.ReportAttemptVisual.Add(Attempts11);
            data.ReportAttemptVisual.Add(Attempts12);
            data.ReportAttemptVisual.Add(Attempts13);

            data.TornPages.Add(TornPage1);
            data.TornPages.Add(TornPage2);
            data.TornPages.Add(TornPage3);
            data.TornPages.Add(TornPage4);
            data.TornPages.Add(TornPage5);

            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\QuestionMark.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\0.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\1.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\2.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\3.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\4.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\5.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\6.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\7.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\8.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\9.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\10.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\11.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\12.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\13.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\14.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\15.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\16.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\17.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\18.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\19.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\20.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\21.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\22.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\23.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\24.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\25.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\26.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\27.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\28.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\29.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\30.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\31.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\32.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\33.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\34.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\35.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\36.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\37.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\38.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\39.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\40.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\41.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\42.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\43.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\44.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\45.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\46.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\47.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\48.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\49.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\50.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\51.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\52.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\53.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\54.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\55.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\56.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\57.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\58.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\59.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\60.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\61.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\62.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\63.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\64.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\65.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\66.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\67.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\68.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\69.png", UriKind.Relative)));
            data.Numbers.Add(new BitmapImage(new Uri("Images\\Numbers\\70.png", UriKind.Relative)));

            foreach (ContentControl item in ItemPool.Children)
            {
                if (item is Item)
                {
                    data.Items.Add(item as Item);
                }
            }

            broadcast = new BroadcastWindow(data);
        }