Exemplo n.º 1
0
        public void Setup(AbilityParam ability_param, bool is_derive_ability, bool is_enable, bool is_locked, bool has_derive_ability)
        {
            this.mAbilityParam     = ability_param;
            this.mIsEnable         = is_enable;
            this.mHasDeriveAbility = has_derive_ability;
            if (is_locked)
            {
                this.mLockImage.SetActive(is_locked);
            }
            else
            {
                this.mDisableMask.SetActive(!this.mIsEnable);
            }
            if (Object.op_Inequality((Object)this.mUnitIcon, (Object)null))
            {
                this.mUnitIcon.SetActive(DataSource.FindDataOfClass <UnitParam>(((Component)this).get_gameObject(), (UnitParam)null) != null);
            }
            if (Object.op_Inequality((Object)this.mJobIcon, (Object)null))
            {
                this.mJobIcon.SetActive(DataSource.FindDataOfClass <JobParam>(((Component)this).get_gameObject(), (JobParam)null) != null);
            }
            if (!Object.op_Inequality((Object)this.mConditionsText, (Object)null))
            {
                return;
            }
            AbilityConditions abilityConditions = new AbilityConditions();

            abilityConditions.Setup(ability_param, MonoSingleton <GameManager> .Instance.MasterParam);
            this.mConditionsText.set_text(abilityConditions.MakeConditionsText());
        }
Exemplo n.º 2
0
        public string MakeConditionsText()
        {
            StringBuilder stringBuilder = new StringBuilder();
            string        empty         = string.Empty;

            if (this.enableCondsSex)
            {
                string str = AbilityConditions.SexToString(this.m_CondsSex);
                empty += LocalizedText.Get("sys.ABILITY_CONDS_SEX", new object[1]
                {
                    (object)str
                });
            }
            if (this.enableCondsElem)
            {
                string str = AbilityConditions.ElementToString(this.m_CondsElem);
                empty += LocalizedText.Get("sys.ABILITY_CONDS_ELEMENT", new object[1]
                {
                    (object)str
                });
            }
            if (this.enableCondsBirth)
            {
                empty += LocalizedText.Get("sys.ABILITY_CONDS_BIRTH", new object[1]
                {
                    (object)this.enableCondsBirth
                });
            }
            if (this.enableCondsUnits)
            {
                if (this.enableCondsJobs)
                {
                    using (List <UnitParam> .Enumerator enumerator1 = this.m_CondsUnits.GetEnumerator())
                    {
                        while (enumerator1.MoveNext())
                        {
                            UnitParam current1 = enumerator1.Current;
                            using (List <JobParam> .Enumerator enumerator2 = this.m_CondsJobs.GetEnumerator())
                            {
                                while (enumerator2.MoveNext())
                                {
                                    JobParam current2 = enumerator2.Current;
                                    if (!string.IsNullOrEmpty(empty))
                                    {
                                        string str = AbilityConditions.InternalMakeConditionsText(LocalizedText.Get("sys.ABILITY_CONDS_UNIT", new object[1]
                                        {
                                            (object)current1.name
                                        }), LocalizedText.Get("sys.ABILITY_CONDS_JOB", new object[1]
                                        {
                                            (object)current2.name
                                        }), empty);
                                        stringBuilder.Append(str);
                                        stringBuilder.Append("\n");
                                    }
                                    else
                                    {
                                        string str = AbilityConditions.InternalMakeConditionsText(LocalizedText.Get("sys.ABILITY_CONDS_UNIT", new object[1]
                                        {
                                            (object)current1.name
                                        }), LocalizedText.Get("sys.ABILITY_CONDS_JOB", new object[1]
                                        {
                                            (object)current2.name
                                        }));
                                        stringBuilder.Append(str);
                                        stringBuilder.Append("\n");
                                    }
                                }
                            }
                        }
                    }
                }
                else
                {
                    using (List <UnitParam> .Enumerator enumerator = this.m_CondsUnits.GetEnumerator())
                    {
                        while (enumerator.MoveNext())
                        {
                            UnitParam current = enumerator.Current;
                            if (!string.IsNullOrEmpty(empty))
                            {
                                string str = AbilityConditions.InternalMakeConditionsText(LocalizedText.Get("sys.ABILITY_CONDS_UNIT", new object[1]
                                {
                                    (object)current.name
                                }), empty);
                                stringBuilder.Append(str);
                                stringBuilder.Append("\n");
                            }
                            else
                            {
                                string str = AbilityConditions.InternalMakeConditionsText(LocalizedText.Get("sys.ABILITY_CONDS_UNIT", new object[1]
                                {
                                    (object)current.name
                                }));
                                stringBuilder.Append(str);
                                stringBuilder.Append("\n");
                            }
                        }
                    }
                }
            }
            else if (this.enableCondsJobs)
            {
                using (List <JobParam> .Enumerator enumerator = this.m_CondsJobs.GetEnumerator())
                {
                    while (enumerator.MoveNext())
                    {
                        JobParam current = enumerator.Current;
                        if (!string.IsNullOrEmpty(empty))
                        {
                            string str = AbilityConditions.InternalMakeConditionsText(LocalizedText.Get("sys.ABILITY_CONDS_JOB", new object[1]
                            {
                                (object)current.name
                            }), empty);
                            stringBuilder.Append(str);
                            stringBuilder.Append("\n");
                        }
                        else
                        {
                            string str = AbilityConditions.InternalMakeConditionsText(LocalizedText.Get("sys.ABILITY_CONDS_JOB", new object[1]
                            {
                                (object)current.name
                            }));
                            stringBuilder.Append(str);
                            stringBuilder.Append("\n");
                        }
                    }
                }
            }
            else if (!string.IsNullOrEmpty(empty))
            {
                string str = AbilityConditions.InternalMakeConditionsText(empty);
                stringBuilder.Append(str);
                stringBuilder.Append("\n");
            }
            else
            {
                string str = LocalizedText.Get("sys.ABILITY_CONDS_NO_CONDS");
                stringBuilder.Append(str);
                stringBuilder.Append("\n");
            }
            return(stringBuilder.ToString());
        }