Exemple #1
0
        // Token: 0x060021AB RID: 8619 RVA: 0x0009EAF8 File Offset: 0x0009CCF8
        private void AssignStatToStrip([CanBeNull] StatSheet srcStatSheet, [NotNull] StatDef statDef, GameObject destStatStrip)
        {
            string arg = "0";
            ulong  num = 0UL;

            if (srcStatSheet != null)
            {
                arg = srcStatSheet.GetStatDisplayValue(statDef);
                num = srcStatSheet.GetStatPointValue(statDef);
            }
            string @string = Language.GetString(statDef.displayToken);
            string text    = string.Format(Language.GetString("STAT_NAME_VALUE_FORMAT"), @string, arg);

            destStatStrip.transform.Find("StatNameLabel").GetComponent <TextMeshProUGUI>().text = text;
            string string2 = Language.GetString("STAT_POINTS_FORMAT");

            destStatStrip.transform.Find("PointValueLabel").GetComponent <TextMeshProUGUI>().text = string.Format(string2, num);
        }
Exemple #2
0
        // Token: 0x060021AA RID: 8618 RVA: 0x0009E870 File Offset: 0x0009CA70
        private void SetPlayerInfo([CanBeNull] RunReport.PlayerInfo playerInfo)
        {
            ulong num = 0UL;

            if (playerInfo != null)
            {
                StatSheet statSheet = playerInfo.statSheet;
                this.AllocateStatStrips(this.statsToDisplay.Length);
                for (int i = 0; i < this.statsToDisplay.Length; i++)
                {
                    string  text    = this.statsToDisplay[i];
                    StatDef statDef = StatDef.Find(text);
                    if (statDef == null)
                    {
                        Debug.LogWarningFormat("GameEndReportPanelController.SetStatSheet: Could not find stat def \"{0}\".", new object[]
                        {
                            text
                        });
                    }
                    else
                    {
                        this.AssignStatToStrip(statSheet, statDef, this.statStrips[i]);
                        num += statSheet.GetStatPointValue(statDef);
                    }
                }
                int unlockableCount = statSheet.GetUnlockableCount();
                int num2            = 0;
                for (int j = 0; j < unlockableCount; j++)
                {
                    if (!statSheet.GetUnlockable(j).hidden)
                    {
                        num2++;
                    }
                }
                this.AllocateUnlockStrips(num2);
                int num3 = 0;
                for (int k = 0; k < unlockableCount; k++)
                {
                    UnlockableDef unlockable = statSheet.GetUnlockable(k);
                    if (!unlockable.hidden)
                    {
                        this.AssignUnlockToStrip(unlockable, this.unlockStrips[num3]);
                        num3++;
                    }
                }
                if (this.itemInventoryDisplay)
                {
                    this.itemInventoryDisplay.SetItems(playerInfo.itemAcquisitionOrder, playerInfo.itemAcquisitionOrder.Length, playerInfo.itemStacks);
                    this.itemInventoryDisplay.UpdateDisplay();
                }
            }
            else
            {
                this.AllocateStatStrips(0);
                this.AllocateUnlockStrips(0);
                if (this.itemInventoryDisplay)
                {
                    this.itemInventoryDisplay.ResetItems();
                }
            }
            string @string = Language.GetString("STAT_POINTS_FORMAT");

            this.totalPointsLabel.text = string.Format(@string, num);
            GameObject gameObject = null;

            if (playerInfo != null)
            {
                gameObject = BodyCatalog.GetBodyPrefab(playerInfo.bodyIndex);
            }
            string  arg     = "";
            Texture texture = null;

            if (gameObject)
            {
                texture = gameObject.GetComponent <CharacterBody>().portraitIcon;
                arg     = Language.GetString(gameObject.GetComponent <CharacterBody>().baseNameToken);
            }
            string string2 = Language.GetString("STAT_CLASS_NAME_FORMAT");

            this.playerBodyLabel.text            = string.Format(string2, arg);
            this.playerBodyPortraitImage.texture = texture;
            GameObject gameObject2 = null;

            if (playerInfo != null)
            {
                gameObject2 = BodyCatalog.GetBodyPrefab(playerInfo.killerBodyIndex);
            }
            string  arg2     = "";
            Texture texture2 = null;

            if (gameObject2)
            {
                texture2 = gameObject2.GetComponent <CharacterBody>().portraitIcon;
                arg2     = Language.GetString(gameObject2.GetComponent <CharacterBody>().baseNameToken);
            }
            string string3 = Language.GetString("STAT_KILLER_NAME_FORMAT");

            this.killerBodyLabel.text            = string.Format(string3, arg2);
            this.killerBodyPortraitImage.texture = texture2;
            this.killerPanelObject.SetActive(gameObject2);
        }