Exemplo n.º 1
0
        private void HideParts(SideBarMode mode)
        {
            bool isNormal = mode == SideBarMode.Normal;

            panelNormal.gameObject.SetActive(isNormal);
            panelTournament.gameObject.SetActive(!isNormal);
        }
Exemplo n.º 2
0
        public void FadeIniRatingGains()
        {
            if (Active)
            {
                return;
            }

            module  = (LiveStandingsModule)API.Instance.FindModule("LiveStandings");
            drivers = (DriverModule)API.Instance.FindModule("DriverModule");
            Mode    = SideBarMode.iRating;
            SideBarTitle title = new SideBarTitle(ParentWindow);

            title.VerticalAlignment = VerticalAlignment.Top;
            LayoutRoot.Children.Add(title);
            elements.Add(title);
            title.FadeIn("LIVE iRATING GAINS");

            for (int i = 0; i < Math.Min(drivers.DriversCount, 22); i++)
            {
                LiveStandingsItem item = module.FindDriverByPos(i + 1);
                if (item != null)
                {
                    SpeedElement se = new SpeedElement(ParentWindow, SpeedElement.SpeedElementMode.iRating);
                    se.VerticalAlignment = VerticalAlignment.Top;
                    se.Margin            = new Thickness(0, (i + 1) * 36, 0, 0);
                    LayoutRoot.Children.Add(se);
                    elements.Add(se);
                    se.FadeIn(i + 1, item, (i + 1) * 25);
                }
            }

            Active = true;
        }
Exemplo n.º 3
0
        public void FadeInTopSpeeds()
        {
            if (Active)
            {
                return;
            }

            module = (LiveStandingsModule)API.Instance.FindModule("LiveStandings");
            Mode   = SideBarMode.TopSpeed;
            SideBarTitle title = new SideBarTitle(ParentWindow);

            title.VerticalAlignment = VerticalAlignment.Top;
            LayoutRoot.Children.Add(title);
            elements.Add(title);
            title.FadeIn("TOP SPEEDS kph");

            List <LiveStandingsItem> query = module.OrderByTopSpeed();

            for (int i = 0; i < 10; i++)
            {
                LiveStandingsItem item = query[i];
                if (item.TopSpeed > 0)
                {
                    SpeedElement se = new SpeedElement(ParentWindow, SpeedElement.SpeedElementMode.TopSpeed);
                    se.VerticalAlignment = VerticalAlignment.Top;
                    se.Margin            = new Thickness(0, (i + 1) * 36, 0, 0);
                    LayoutRoot.Children.Add(se);
                    elements.Add(se);
                    se.FadeIn(i + 1, item, (i + 1) * 25);
                }
            }

            Active = true;
        }
Exemplo n.º 4
0
        public void Initailize(SideBarMode mode, Messager messager)
        {
            sideBarMode = mode;
            this.messager = messager;

            HideParts(mode);
            UpdateChatBoxHeight();
        }
Exemplo n.º 5
0
        public void FadeInBattleForPos(int pos, int count)
        {
            this.FirstPos = pos;
            this.Count    = count;

            module = (LiveStandingsModule)API.Instance.FindModule("LiveStandings");
            foreach (LiveStandingsItem item in module.Items)
            {
                item.PositionImprovedBattleFor = item.PositionLostBattleFor = false;
            }

            Mode   = SideBarMode.BattleForPosition;
            Active = true;
            SideBarTitle title = new SideBarTitle(ParentWindow);
            string       t     = "BATTLE FOR ";

            if (pos == 1)
            {
                t += "1st";
            }
            else if (pos == 2)
            {
                t += " 2nd";
            }
            else if (pos == 3)
            {
                t += " 3rd";
            }
            else
            {
                t += pos.ToString("0") + "th";
            }

            title.VerticalAlignment = VerticalAlignment.Top;
            LayoutRoot.Children.Add(title);
            elements.Add(title);
            title.FadeIn(t);

            int j = 1;

            for (int i = pos; i < pos + count; i++)
            {
                LiveStandingsItem item = module.FindDriverByPos(i);
                if (item == null)
                {
                    break;
                }

                BattleElement e = new BattleElement(ParentWindow, this, module);
                e.VerticalAlignment = VerticalAlignment.Top;
                elements.Add(e);
                LayoutRoot.Children.Add(e);
                e.Margin = new Thickness(0, j * 36, 0, 0);
                e.FadeIn(item, j * 25);

                j++;
            }
        }
Exemplo n.º 6
0
        public void FadeInBattleForPos(int pos, int count)
        {
            this.FirstPos = pos;
            this.Count    = count;

            Active = true;
            Mode   = SideBarMode.BattleForPosition;
            SideBarTitle title = new SideBarTitle();
            string       t     = "BATTLE FOR ";

            if (pos == 1)
            {
                t += "1st";
            }
            else if (pos == 2)
            {
                t += " 2nd";
            }
            else if (pos == 3)
            {
                t += " 3rd";
            }
            else
            {
                t += pos.ToString("0") + "th";
            }

            title.VerticalAlignment = VerticalAlignment.Top;
            LayoutRoot.Children.Add(title);
            elements.Add(title);
            title.FadeIn(t);

            if (module == null)
            {
                module = (LiveStandingsModule)TMTVO.Controller.TMTVO.Instance.Api.FindModule("LiveStandings");
            }

            int j = 1;

            for (int i = pos; i < pos + count; i++)
            {
                LiveStandingsItem item = module.FindDriverByPos(i);
                if (item == null)
                {
                    break;
                }

                BattleElement e = new BattleElement(this, module);
                e.VerticalAlignment = VerticalAlignment.Top;
                elements.Add(e);
                LayoutRoot.Children.Add(e);
                e.Margin = new Thickness(0, j * 36, 0, 0);
                e.FadeIn(item, j * 25);

                j++;
            }
        }
Exemplo n.º 7
0
        public void FadeInDriverOverview(LiveStandingsItem driver1, LiveStandingsItem driver2)
        {
            if (driver1 == null && driver2 == null)
            {
                return;
            }

            this.Mode = SideBarMode.DriverOverView;
            Active    = true;
            if (driver1 != null)
            {
                addDriverOverviewElement(driver1, 0);
            }

            if (driver2 != null)
            {
                addDriverOverviewElement(driver2, 1);
            }
        }
Exemplo n.º 8
0
        public void FadeInDriverOverview(LiveStandingsItem driver1, LiveStandingsItem driver2)
        {
            if (driver1 == null && driver2 == null)
            {
                return;
            }

            module    = (LiveStandingsModule)API.Instance.FindModule("LiveStandings");
            this.Mode = SideBarMode.DriverOverView;
            Active    = true;
            if (driver1 != null)
            {
                addDriverOverviewElement(driver1, 0);
            }

            if (driver2 != null)
            {
                addDriverOverviewElement(driver2, 1);
            }
        }