Esempio n. 1
0
    E_MPGameType GetGameWithXpBonus()
    {
        PlayerPersistantInfo ppi = PPIManager.Instance.GetLocalPPI();

        if (ppi == null)
        {
            return(E_MPGameType.None);
        }

        int rank = ppi.Rank;

        for (E_MPGameType gameType = E_MPGameType.DeathMatch; gameType < E_MPGameType.None; ++gameType)
        {
            GameTypeInfo gameInfo = GameInfoSettings.GetGameInfo(gameType);
            if (gameInfo == null)
            {
                continue;
            }
            if (gameInfo.MinimalDesiredRankToPlay > rank)
            {
                continue;
            }
            if (ppi.IsFirstGameToday(gameType) == false)
            {
                continue;
            }

            return(gameType);
        }

        return(E_MPGameType.None);
    }
Esempio n. 2
0
    // PRIVATE METHODS

    void UpdateButtonStates()
    {
        FtueAction.Base      action = Ftue.ActiveAction ?? Ftue.PendingAction;
        PlayerPersistantInfo ppi    = PPIManager.Instance.GetLocalPPI();
        ZoneControlInfo      zcInfo = GameInfoSettings.GetGameInfo <ZoneControlInfo>();
        int maxRank   = PlayerPersistantInfo.MAX_RANK;
        int rank      = ppi != null ? ppi.Rank : 1;
        int minRankZC = zcInfo != null?Mathf.Clamp(zcInfo.MinimalDesiredRankToPlay, 1, maxRank) : 1;

        bool disabled   = !LobbyClient.IsConnected;
        bool highlight  = action != null && action.ShouldBeIngame || action is FtueAction.RankUp ? true : false;
        bool disableDM  = disabled;
        bool tutorialZC = Ftue.IsActionFinished <FtueAction.ZoneControl>() ? false : true;
        bool unlockedZC = rank >= minRankZC ? true : false;

        if (tutorialZC == true && Ftue.IsActionActive <FtueAction.ZoneControl>() == false)
        {
            unlockedZC = false;
        }

        bool highlightDM = unlockedZC == false ? highlight : false;
        bool disableZC   = unlockedZC == true ? disabled : true;
        bool highlightZC = unlockedZC == true ? highlight : false;
        bool showBlurbDM = ppi != null && ppi.IsFirstGameToday(E_MPGameType.DeathMatch) ? true : false;
        bool showBlurbZC = ppi != null && ppi.IsFirstGameToday(E_MPGameType.ZoneControl) ? unlockedZC : false;
        bool showLockZC  = zcInfo != null && unlockedZC == false ? true : false;

        m_ButtonPlayDM.IsDisabled    = disableDM;
        m_ButtonPlayDM.animate       = true;
        m_ButtonPlayDM.isHighlighted = action is FtueAction.DeathMatch || highlightDM ? !disableDM : false;
        ShowWidget(m_PlayDMBlurb, showBlurbDM);

        m_ButtonPlayZC.IsDisabled    = disableZC;
        m_ButtonPlayZC.animate       = true;
        m_ButtonPlayZC.isHighlighted = action is FtueAction.ZoneControl || highlightZC ? !disableZC : false;
        m_PlayZCLock.Show(showLockZC, tutorialZC && rank >= minRankZC ? -1 : minRankZC);
        ShowWidget(m_PlayZCBlurb, showBlurbZC);
    }