Exemple #1
0
    // GUIVIEW INTERFACE

    protected override void OnViewInit()
    {
        base.OnViewInit();

        GUIBase_Widget[] children = Layout.GetComponentsInChildren <GUIBase_Widget>();
        foreach (var child in children)
        {
            switch (child.name)
            {
            case "ZoneControl":
                m_ZoneControl = child.GetComponent <GUIBase_MultiSprite>();
                break;

            case "DeathMatch1st":
                m_DeathMatch[0] = child;
                break;

            case "DeathMatch2nd":
                m_DeathMatch[1] = child;
                break;

            case "DeathMatch3rd":
                m_DeathMatch[2] = child;
                break;
            }
        }

        UserGuide.RegisterAction(m_UserGuideAction);
    }
    // GUICOMPONENT INTERFACE

    protected override bool OnInit()
    {
        if (base.OnInit() == false)
        {
            return(false);
        }

        GUIBase_Widget[] children = Parent.GetComponentsInChildren <GUIBase_Widget>();
        foreach (var child in children)
        {
            switch (child.name)
            {
            case "ZoneControl":
                m_ZoneControl = child.GetComponent <GUIBase_MultiSprite>();
                break;

            case "DeathMatch1st":
                m_DeathMatch[0] = child;
                break;

            case "DeathMatch2nd":
                m_DeathMatch[1] = child;
                break;

            case "DeathMatch3rd":
                m_DeathMatch[2] = child;
                break;
            }
        }

        return(true);
    }
Exemple #3
0
        public FriendLine(GUIBase_Widget inLine)
        {
            Transform trans = inLine.transform;

            m_Line         = inLine;
            m_Nickname     = trans.GetChildComponent <GUIBase_Label>("Username");        // display nickaname first
            m_Username     = trans.GetChildComponent <GUIBase_Label>("Nickname");        // display nickaname second
            m_RankText     = trans.GetChildComponent <GUIBase_Label>("TextRank");
            m_RankIcon     = trans.GetChildComponent <GUIBase_MultiSprite>("PlayerRankPic");
            m_Missions     = trans.GetChildComponent <GUIBase_Label>("Missions");
            m_Online       = trans.GetChildComponent <GUIBase_Label>("OnlineStatus");
            m_Stats        = trans.GetChildComponent <GUIBase_Button>("Stats_Button");
            m_Mail         = trans.GetChildComponent <GUIBase_Button>("SendMail_Button");
            m_Chat         = trans.GetChildComponent <GUIBase_Button>("Chat_Button");
            m_Remove       = trans.GetChildComponent <GUIBase_Button>("Remove_Button");
            m_FacebookName = trans.GetChildComponent <GUIBase_Label>("FacebookName");
            m_FacebookIcon = trans.GetChildComponent <GUIBase_Widget>("FacebookIcon");

            m_Stats.IsDisabled = GuiFrontendIngame.IsVisible;
            m_Mail.IsDisabled  = GuiFrontendIngame.IsVisible;
            m_Chat.IsDisabled  = true;

            m_Stats.RegisterTouchDelegate(Delegate_Stats);
            m_Mail.RegisterTouchDelegate(Delegate_SendMail);
            m_Chat.RegisterTouchDelegate(Delegate_Chat);
            m_Remove.RegisterTouchDelegate(Delegate_Remove);
        }
Exemple #4
0
        //Color						TeamCommandColor = new Color(0, 0.6f, 1.0f, 1.0f);

        // -----
        public RadarFriend(GUIBase_MultiSprite sprite)
        {
            m_MultiSprite = sprite;
            m_Agent       = null;
            m_Used        = false;
            m_Changed     = true;
            m_MultiSprite.Widget.Show(false, false);
        }
Exemple #5
0
 // -------
 void Awake()
 {
     Parent   = GetComponent <GUIBase_Widget>();
     Active   = GuiBaseUtils.GetChild <GUIBase_Widget>(Parent, "Active");
     Inactive = GuiBaseUtils.GetChild <GUIBase_Widget>(Parent, "Inactive");
     Images   = GuiBaseUtils.GetChild <GUIBase_MultiSprite>(Parent, "Images");
     //Button.RegisterTouchDelegate(upgradeDlgts[i]);
 }
    void SetState(GUIBase_Widget widget, string state)
    {
        GUIBase_MultiSprite sprite = widget ? widget.GetComponentInChildren <GUIBase_MultiSprite>() : null;

        if (sprite != null)
        {
            sprite.State = state;
        }
    }
        public override void Init(GUIBase_Widget root)
        {
            base.Init(root);

            m_ActiveRowBg    = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "ActiveRowBg");
            m_PremiumIcon    = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "PremiumIcon");
            m_NonPremiumIcon = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "NonPremiumIcon");
            m_PlayerRankPic  = GuiBaseUtils.GetChild <GUIBase_MultiSprite>(m_NewRankBonusLabel.Widget, "PlayerRankPic");
        }
Exemple #8
0
        public FriendLine(GUIBase_Widget inLine)
        {
            Transform trans = inLine.transform;

            m_Line     = inLine;
            m_Nickname = trans.GetChildComponent <GUIBase_Label>("Nickname");
            m_RankText = trans.GetChildComponent <GUIBase_Label>("TextRank");
            m_RankIcon = trans.GetChildComponent <GUIBase_MultiSprite>("PlayerRankPic");
            m_Add      = trans.GetChildComponent <GUIBase_Button>("Add_Button");

            m_Add.RegisterTouchDelegate(Delegate_Add);
        }
Exemple #9
0
        public PreyNightmare(GUIBase_Widget root)
        {
            m_Root            = root;
            m_NicknameLabel   = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Name");
            m_KilledByMeLabel = GuiBaseUtils.GetChild <GUIBase_Label>(root, "KilledByMe");
            m_KilledMeLabel   = GuiBaseUtils.GetChild <GUIBase_Label>(root, "KilledMe");
            m_RankLabel       = GuiBaseUtils.GetChild <GUIBase_Label>(root, "RankNum");
            m_RankIcon        = GuiBaseUtils.GetChild <GUIBase_MultiSprite>(root, "RankPic");
            m_FriendIcon      = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "FriendIcon");

            m_KilledByMeLabel.SetNewText("0");
            m_KilledMeLabel.SetNewText("0");
        }
        //--------------------------------------------------------------------------------------------------------------
        public ChartLine(GUIBase_Widget inLineWidget)
        {
            m_LineWidget = inLineWidget;

            GUIBase_Label[]       labels  = m_LineWidget.GetComponentsInChildren <GUIBase_Label>();
            GUIBase_MultiSprite[] sprites = m_LineWidget.GetComponentsInChildren <GUIBase_MultiSprite>();

            foreach (GUIBase_Label l in labels)
            {
                if (l.name == "Stand_Enum")
                {
                    m_OrderLabel = l;
                }
                else if (l.name == "RankNumber")
                {
                    m_RankLabel = l;
                }
                else if (l.name == "Name")
                {
                    m_NameLabel = l;
                }
                else if (l.name == "Score_Enum")
                {
                    m_ScoreLabel = l;
                }
                else if (l.name == "Kills_Enum")
                {
                    m_KillsLabel = l;
                }
                else if (l.name == "Deads_Enum")
                {
                    m_DeadsLabel = l;
                }
            }

            foreach (GUIBase_MultiSprite s in sprites)
            {
                if (s.name == "RankPic")
                {
                    m_RankSprite = s;
                }
                else if (s.name == "PlatformPic")
                {
                    m_PlatformSprite = s;
                }
            }

            m_FriendIcon = GuiBaseUtils.GetChild <GUIBase_Widget>(m_LineWidget, "FriendIcon");
        }
        //public Vector3 spritePos { get { return m_Line.transform.position; } }

        public GuiLine(GUIBase_Widget inLine)
        {
            Transform trans = inLine.transform;

            m_Line               = inLine;
            m_Order              = trans.GetChildComponent <GUIBase_Label>("Order");
            m_RankText           = trans.GetChildComponent <GUIBase_Label>("TextRank");
            m_RankIcon           = trans.GetChildComponent <GUIBase_MultiSprite>("PlayerRankPic");
            m_FriendIcon         = trans.GetChildComponent <GUIBase_Widget>("FriendIcon");
            m_FacebookFriendIcon = trans.GetChildComponent <GUIBase_Widget>("FacebookFriendIcon");
            m_DisplayName        = trans.GetChildComponent <GUIBase_Label>("Nickname");
            m_Score              = trans.GetChildComponent <GUIBase_Label>("Score");
            m_ScoreBarBg         = trans.GetChildComponent <GUIBase_Widget>("ScoreBarBg");
            m_ScoreBarFg         = trans.GetChildComponent <GUIBase_Widget>("ScoreBarFg");
        }
Exemple #12
0
        // ---------------------------------------------------------------------------------------------------------------------
        public FriendLine(GUIBase_Widget line, FriendActionDelegate dlgt)
        {
            m_FriendActionDelegate = dlgt;

            Transform trans = line.transform;

            m_Line       = line;
            m_Highlight  = trans.GetChildComponent <GUIBase_Widget>("SelectedBackground");
            m_Nickname   = trans.GetChildComponent <GUIBase_Label>("Nickname");
            m_RankText   = trans.GetChildComponent <GUIBase_Label>("TextRank");
            m_RankIcon   = trans.GetChildComponent <GUIBase_MultiSprite>("PlayerRankPic");
            m_UnreadMsgs = trans.GetChildComponent <GUIBase_Label>("UnreadMsgs");
            m_Remove     = trans.GetChildComponent <GUIBase_Button>("Remove_Button");

            m_Remove.RegisterTouchDelegate(() => { OnFriendAction(E_FriendAction.Remove); });
        }
Exemple #13
0
        // ---------------------------------------------------------------------------------------------------------------------
        public MessageLine(GUIBase_Widget line, MessageActionDelegate dlgt)
        {
            m_MessageActionDelegate = dlgt;

            Transform trans = line.transform;

            m_Line       = line;
            m_Highlight  = trans.GetChildComponent <GUIBase_Widget>("SelectedBackground");
            m_Sender     = trans.GetChildComponent <GUIBase_Label>("Sender");
            m_SenderIcon = trans.GetChildComponent <GUIBase_MultiSprite>("SenderIcon");
            m_IsReadIcon = trans.GetChildComponent <GUIBase_Sprite>("IsReadIcon");
            m_Subject    = trans.GetChildComponent <GUIBase_Label>("Subject");
            m_Remove     = trans.GetChildComponent <GUIBase_Button>("Remove_Button");

            m_Remove.RegisterTouchDelegate(() => { OnMessageAction(E_MessageAction.Remove); });
        }
Exemple #14
0
    // PUBLIC METHODS

    public void SetData(int rank, int points)
    {
        //bool isMajorRank = PlayerPersistantInfo.IsMajorRank(rank);

        GUIBase_MultiSprite sprite = GuiBaseUtils.GetControl <GUIBase_MultiSprite>(Layout, PLAYERRANKPIC);

        sprite.State = string.Format("Rank_{0}", Mathf.Min(rank, sprite.Count - 1).ToString("D2"));

        GUIBase_Label label     = GuiBaseUtils.GetControl <GUIBase_Label>(Layout, POINTS_LABEL);
        var           animation = MFGuiManager.AnimateWidget(label, 0, points);

        if (animation != null)
        {
            animation.Duration  = m_CountDownDuration;
            animation.AudioClip = m_CountDownSound;
        }

#if (!UNITY_EDITOR) && (UNITY_ANDROID || UNITY_IPHONE)
        // set visibility of info text
        Layout.GetWidget(WOULDPOSTIT_NOTIFY).Show(true, true);
        string postMessage = string.Format(TextDatabase.instance[01150011], CloudUser.instance.nickName, rank);
        // register delegate for facebook button
        m_FacebookButton.Widget.Show(true, true);
        m_FacebookButton.RegisterTouchDelegate(() =>
        {
            m_FacebookButton.SetDisabled(true);
            StartCoroutine(sendMessage(rank.ToString()));
        });

        m_TwitterButton.Widget.Show(true, true);
        m_TwitterButton.RegisterTouchDelegate(() =>
        {
            m_TwitterButton.SetDisabled(true);
            TwitterUtils.PostMessage(postMessage, (success) =>
            {
                if (m_TwitterButton.Widget.Visible == true)
                {
                    m_TwitterButton.SetDisabled(!success);
                }
            });
        });
#else
        m_FacebookButton.Widget.Show(false, true);
        m_TwitterButton.Widget.Show(false, true);
#endif
    }
    // GUIOVERLAY INTERFACE

    protected override void OnViewInit()
    {
        // anchor status bar to the top of the screen
        Transform trans    = Layout.transform;
        Vector3   position = trans.position;

        position.y     = 0;
        trans.position = position;

        //
        base.OnViewInit();

        // cache controls
        m_GoldButton          = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, "Gold", false);
        m_MoneyButton         = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, "Money", false);
        m_LevelLabel          = GuiBaseUtils.GetControl <GUIBase_Label>(Layout, "TextRank", false);
        m_LevelPic            = GuiBaseUtils.GetControl <GUIBase_MultiSprite>(Layout, "PlayerRankPic", false);
        m_XPLabel             = GuiBaseUtils.GetControl <GUIBase_Label>(Layout, "TextXP", false);
        m_PlayerButton        = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, "Player", false);
        m_EmptyBar            = Layout.GetWidget("EmptyBar", false);
        m_FullBar             = Layout.GetWidget("FullBar", false);
        m_PremiumButton       = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, "Premium", false);
        m_PremiumActiveButton = GuiBaseUtils.GetControl <GUIBase_Button>(Layout, "PremiumActive", false);
        m_PremiumBackground   = Layout.GetWidget("Background_Premium");
        m_FreeBackground      = Layout.GetWidget("Background_Free");
        m_NextSpawn_Label     = GuiBaseUtils.GetControl <GUIBase_Label>(Layout, "NextSpawn", false);

        // set initial visibility depend on build stage
        bool isBeta = BuildInfo.Version.Stage == BuildInfo.Stage.Beta;

        SetWidgetInitialVisibility(Layout.GetWidget("Feedback_Button", false), true, isBeta);
        SetWidgetInitialVisibility(Layout.GetWidget("ShadowGunLogo"), true, isBeta || GuiFrontendIngame.IsVisible);
        if (m_GoldButton != null)
        {
            SetWidgetInitialVisibility(m_GoldButton.Widget, true, !isBeta && GuiFrontendMain.IsVisible);
        }
        if (m_MoneyButton != null)
        {
            SetWidgetInitialVisibility(m_MoneyButton.Widget, true, !isBeta && GuiFrontendMain.IsVisible);
        }
        SetWidgetInitialVisibility(Layout.GetWidget("XP", false), true, !isBeta && GuiFrontendMain.IsVisible);

        CloudUser.authenticationChanged   += OnUserAuthenticationChanged;
        PPIManager.localPlayerInfoChanged += OnLocalPlayerInfoChanged;
    }
Exemple #16
0
        public Row(int index, GUIBase_Widget root, RoundFinalResult.PlayerResult player, bool localPlayer)
        {
            m_Index         = index;
            m_LocalPlayer   = localPlayer;
            m_Player        = player;
            m_Root          = root;
            m_NicknameLabel = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Name");
            m_StandLabel    = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Stand_Enum");
            m_ScoreLabel    = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Score_Enum");
            m_KillsLabel    = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Kills_Enum");
            m_DeadsLabel    = GuiBaseUtils.GetChild <GUIBase_Label>(root, "Deads_Enum");
            m_RankLabel     = GuiBaseUtils.GetChild <GUIBase_Label>(root, "RankNumber");
            m_RankIcon      = GuiBaseUtils.GetChild <GUIBase_MultiSprite>(root, "RankPic");
            m_PlatformIcon  = GuiBaseUtils.GetChild <GUIBase_MultiSprite>(root, "PlatformPic");
            m_FriendIcon    = GuiBaseUtils.GetChild <GUIBase_Widget>(root, "FriendIcon");

            m_Root.Show(false, true);
        }
Exemple #17
0
        void CollectControls(Transform trans)
        {
            foreach (Transform child in trans)
            {
                switch (child.name)
                {
                case "Name":
                    m_Name = child.GetComponent <GUIBase_Label>();
                    break;

                case "Text":
                    m_Text = child.GetComponent <GUIBase_TextArea>();
                    break;

                case "PlayerRankPic":
                    m_RankIcon = child.GetComponent <GUIBase_MultiSprite>();
                    break;

                case "TextRank":
                    m_RankText = child.GetComponent <GUIBase_Label>();
                    break;

                case "HighlightBackground":
                    m_HighlightBkg = child.GetComponent <GUIBase_Widget>();
                    break;

                case "Buttons":
                    //m_ButtonsHolder = child.GetComponent<GUIBase_Widget>();
                    CollectButtons(child);
                    break;

                case "Content":
                    m_ContentHolder = child.GetComponent <GUIBase_Widget>();
                    CollectControls(child);
                    break;

                default:
                    break;
                }
            }
        }
Exemple #18
0
        public Table(GUIBase_Widget inRootWidget)
        {
            m_RootWidget = inRootWidget;

            GUIBase_Label[]       labels  = m_RootWidget.GetComponentsInChildren <GUIBase_Label>();
            GUIBase_MultiSprite[] sprites = m_RootWidget.GetComponentsInChildren <GUIBase_MultiSprite>();

            foreach (GUIBase_Label l in labels)
            {
                if (l.name == "RankNum")
                {
                    m_RankLabel = l;
                }
                else if (l.name == "Name")
                {
                    m_NameLabel = l;
                }
                else if (l.name == "KilledMe")
                {
                    m_KilledMeLabel = l;
                }
                else if (l.name == "KilledByMe")
                {
                    m_KilledByMeLabel = l;
                }
            }

            foreach (GUIBase_MultiSprite s in sprites)
            {
                if (s.name == "RankPic")
                {
                    m_RankSprite = s;
                }
            }

            m_FriendIcon = GuiBaseUtils.GetChild <GUIBase_Widget>(m_RootWidget, "FriendIcon");
        }
Exemple #19
0
        // -------
        void ApplyTeamCommand()
        {
            GUIBase_MultiSprite  sprite = m_MultiSprite;
            PlayerPersistantInfo ppi    = PPIManager.Instance.GetPPI(Player.LocalInstance.networkView.owner);
            E_Team playerTeam           = (ppi != null) ? ppi.Team : E_Team.None;

            switch (m_Command)
            {
            case E_CommandID.Affirmative:
                sprite.State = "Affirmative";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.Attack:
                sprite.State = "Attack";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.Back:
                sprite.State = "Back";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.CoverMe:
                sprite.State = "CoverMe";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.Help:
                sprite.State = "Help";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Widget.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.Medic:
                sprite.State = "Medic";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.Negative:
                sprite.State = "Negative";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            case E_CommandID.OutOfAmmo:
                sprite.State = "OutOfAmmo";
                sprite.Widget.m_GuiWidgetLayer = 7;
                //sprite.Color = TeamCommandColor;
                //sprite.StartCoroutine( PulseObject(sprite.Widget) );
                break;

            default:
                if (m_Command != E_CommandID.Max)
                {
                    Debug.LogWarning("Unknown enum: " + m_Command);
                }
                sprite.State = "Normal";
                sprite.Widget.m_GuiWidgetLayer = 6;
                //sprite.StopAllCoroutines();
                break;
            }
            sprite.Color = ZoneControlFlag.Colors[playerTeam];
            sprite.Widget.SetModify();
        }
Exemple #20
0
    // IGUIPAGEPLAYERSTATS INTERFACE

    void IGuiPagePlayerStats.Refresh(PlayerPersistantInfo ppi)
    {
        // collected values

        int            thisRankExperience = PlayerPersistantInfo.GetPlayerMinExperienceForRank(Mathf.Clamp(ppi.Rank, 1, PlayerPersistantInfo.MAX_RANK));
        int            nextRankExperience = PlayerPersistantInfo.GetPlayerMinExperienceForRank(Mathf.Clamp(ppi.Rank + 1, 1, PlayerPersistantInfo.MAX_RANK));
        PPIPlayerStats stats          = ppi.Statistics;
        float          totalTimeSpent = stats.GetTimeSpent();
        float          totalShots     = stats.GetShots();
        float          totalKills     = stats.GetKills();

        PPIPlayerStats.GameData dm = stats.GetGameData(E_MPGameType.DeathMatch);
        PPIPlayerStats.GameData zc = stats.GetGameData(E_MPGameType.ZoneControl);

        // computed values

        float computedKillRatio = totalTimeSpent > 0 ? totalKills / totalTimeSpent : 0.0f;
        int   computedAccurancy = totalShots > 0 ? Mathf.RoundToInt((stats.GetHits() / (float)totalShots) * 100) : 0;
        int   dmSpentMinutes    = Mathf.RoundToInt((float)System.TimeSpan.FromMinutes(dm.TimeSpent).TotalMinutes);
        int   dmSpentHours      = Mathf.RoundToInt((float)System.TimeSpan.FromMinutes(dm.TimeSpent).TotalHours);
        int   zcSpentMinutes    = Mathf.RoundToInt((float)System.TimeSpan.FromMinutes(zc.TimeSpent).TotalMinutes);
        int   zcSpentHours      = Mathf.RoundToInt((float)System.TimeSpan.FromMinutes(zc.TimeSpent).TotalHours);
        int   totalSpentMinutes = dmSpentMinutes + zcSpentMinutes;
        int   totalSpentHours   = dmSpentHours + zcSpentHours;

        int dmTimeSpentUnitTextId;

        if (dmSpentHours == 1)
        {
            dmTimeSpentUnitTextId = 01160038;
        }
        else if (dmSpentHours > 0)
        {
            dmTimeSpentUnitTextId = 01160019;
        }
        else if (dmSpentMinutes == 1)
        {
            dmTimeSpentUnitTextId = 01160039;
        }
        else
        {
            dmTimeSpentUnitTextId = 01160033;
        }

        int zcTimeSpentUnitTextId;

        if (zcSpentHours == 1)
        {
            zcTimeSpentUnitTextId = 01160038;
        }
        else if (zcSpentHours > 0)
        {
            zcTimeSpentUnitTextId = 01160019;
        }
        else if (zcSpentMinutes == 1)
        {
            zcTimeSpentUnitTextId = 01160039;
        }
        else
        {
            zcTimeSpentUnitTextId = 01160033;
        }

        int timeSpentUnitTextId;

        if (totalSpentHours == 1)
        {
            timeSpentUnitTextId = 01160035;
        }
        else if (totalSpentHours > 0)
        {
            timeSpentUnitTextId = 01160014;
        }
        else if (totalSpentMinutes == 1)
        {
            timeSpentUnitTextId = 01160037;
        }
        else
        {
            timeSpentUnitTextId = 01160036;
        }

        // rank

        GUIBase_MultiSprite rank = GuiBaseUtils.GetControl <GUIBase_MultiSprite>(Layout, "PlayerRankPic");

        rank.State = string.Format("Rank_{0}", Mathf.Min(ppi.Rank, rank.Count - 1).ToString("D2"));

        SetText("Rank_Enum", ppi.Rank.ToString("D2"));

        // experience

        SetText("XPEarned_Enum", ppi.Experience.ToString());
        SetText("XPLeft_Label", string.Format(TextDatabase.instance[1160015], Mathf.Max(0, nextRankExperience - ppi.Experience)));
        SetProgress("XPBarFg", "XPBarBg", ppi.Experience - thisRankExperience, nextRankExperience - thisRankExperience);

        // kills

        SetText("Kills_Enum", stats.GetKills().ToString());
        SetText("KillRatio_Enum", computedKillRatio.ToString("0.0"));

        // deaths

        SetText("Deaths_Enum", stats.GetDeaths().ToString());

        // score

        SetText("TotalScore_Enum", stats.GetScore().ToString());
        SetText("GoldEarned_Enum", stats.GetGolds().ToString());
        SetText("MoneyEarned_Enum", stats.GetMoney().ToString());
        SetText("Accuracy_Enum", computedAccurancy.ToString());
        SetText("Shotsfired_Enum", totalShots.ToString());
        SetText("Headshots_Enum", stats.GetHeadshots().ToString());

        // time spent

        SetText("TotalTime_Enum", totalSpentHours > 0 ? totalSpentHours.ToString() : totalSpentMinutes.ToString());
        SetText("TotalTime_Units", TextDatabase.instance[timeSpentUnitTextId]);
        SetText("DMTime_Enum", string.Format(TextDatabase.instance[dmTimeSpentUnitTextId], dmSpentHours > 0 ? dmSpentHours : dmSpentMinutes));
        SetText("ZCTime_Enum", string.Format(TextDatabase.instance[zcTimeSpentUnitTextId], zcSpentHours > 0 ? zcSpentHours : zcSpentMinutes));
    }