예제 #1
0
        public void showResult(TrackRecords.TrackRecordList recordListToShow, List <int> recordsToHighlight)
        {
            prepareForPanelChange(false);

            Grid_Content.Children.Add(new TrackRecords.RecordDisplayPanel(recordListToShow, recordsToHighlight));
            PanelState = panelState.PostRaceResults;
        }
예제 #2
0
 private void Update()
 {
     if (!MapController.hexSelected)
     {
         currentState = panelState.NONE;
     }
 }
예제 #3
0
 public void Activate(panelState state)
 {
     anim = gameObject.GetComponent<Animator>();
     gameObject.SetActive(true);
     currentState = state;
     anim.Play("PopupOpen");
 }
예제 #4
0
        public void showPostRacePanel(RacerDetails racer, Action <TrackRecords.TrackRecordList, int> postRaceDoneHandler)
        {
            prepareForPanelChange(false);

            Grid_Content.Children.Add(new TrackRecords.PostRacePanel(postRaceDoneHandler, racer));
            PanelState = panelState.PostRaceDisplay;
        }
예제 #5
0
        public void showRaceFactory()
        {
            prepareForPanelChange(true);
            raceConfig = null;

            RaceFactoryPanel toAdd;

            if (ss_isActive && ss_savedPanel != null)
            {
                toAdd       = ss_savedPanel;
                ss_isActive = false;
            }
            else
            {
                toAdd = new RaceFactoryPanel(factoryComplete);
            }

            Grid_Content.Children.Add(toAdd);
            PanelState = panelState.RaceFactory;

            ss_lastActivity = DateTime.Now;

            if (AntPlusRacerConfig.getInstance().RecordScreenSaverTimeout_negativeIsOff > 0)
            {
                ss_ScreenSaverTimer.Start();
            }
        }
예제 #6
0
        public void showRecords()
        {
            if (ss_isActive)
            {
                ss_savedPanel = Grid_Content.Children[0] as RaceFactoryPanel;
            }

            prepareForPanelChange(true);

            Grid_Content.Children.Add(new TrackRecords.RecordDisplayPanel());
            PanelState = panelState.RecordDisplay;
        }
예제 #7
0
 void recordDisplayScreenSaver_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
 {
     if (DateTime.Now.Subtract(ss_lastActivity).TotalSeconds > AntPlusRacerConfig.getInstance().RecordScreenSaverTimeout_negativeIsOff)
     {
         lock (ss_ScreenSaverTimer)
         {
             if (!ss_isActive)
             {
                 ss_lastActivity    = DateTime.Now;
                 ss_ignoreFirstMove = true;
                 ss_isActive        = true;
                 Dispatcher.Invoke((Action)showRecords);
                 PanelState = panelState.ScreenSaverRecordDisplay;
             }
         }
     }
 }
예제 #8
0
        public void showRaces()
        {
            if (raceConfig == null || raceConfig.isRaceFinished)
            {
                showRaceFactory();
                return;
            }

            prepareForPanelChange(false);

            for (int i = 0; i < raceConfig.racerDetails.Count; ++i)
            {
                Grid_Content.RowDefinitions.Add(new RowDefinition()
                {
                    Height = new GridLength(1, GridUnitType.Star)
                });
                Grid.SetRow(raceConfig.racerDetails[i].racePanel, i);
                Grid_Content.Children.Add(raceConfig.racerDetails[i].racePanel);
            }
            PanelState = panelState.Racing;
        }
예제 #9
0
        public void showAntConfig()
        {
            prepareForPanelChange(true);

            UIElement antCfg;

            try
            {
                antCfg = AntConfigPanel.getInstanceForDisplay();
            }
            catch (Exception ex)
            {
                Viewbox vb = new Viewbox();
                vb.Child = new Label()
                {
                    Content = "Error: " + ex.Message
                };
                antCfg = vb;
            }

            Grid_Content.Children.Add(antCfg);
            PanelState = panelState.Config;
        }
예제 #10
0
 public static void SetCurrentState(panelState newState)
 {
     currentState = newState;
 }
예제 #11
0
 public static void SetPanelState(panelState state)
 {
     currentState = state;
 }