Exemplo n.º 1
0
        public void Fill(CharacterSpell p_spell)
        {
            m_name.UpdateText(LocaManager.GetText(p_spell.NameKey));
            Single num = m_outerPadding + m_name.Size.y + m_innerPadding;

            m_itemSlot.SetSpell(p_spell.StaticData.Icon);
            m_itemSlot.HideItem();
            m_itemSlot.UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
            m_description.MinHeight     = m_itemSlot.Size.y;
            m_description.VerticalAlign = TooltipGroup.Align.CENTER;
            if (p_spell.StaticData.ManaCost > 0)
            {
                m_description.UpdateText(LocaManager.GetText("SPELLBOOK_SPELL_MANA", p_spell.StaticData.ManaCost));
            }
            else
            {
                m_description.UpdateText(LocaManager.GetText("SPELL_DESCRIPTION_MANA_ALL"));
            }
            m_description.UpdatePositionY(-num);
            num += m_description.Size.y + m_innerPadding;
            Character selectedCharacter = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter;
            Single    magicFactor       = p_spell.GetMagicFactor(selectedCharacter, false, 0);

            m_details.UpdateText(p_spell.GetDescription(magicFactor));
            m_details.UpdatePositionY(-num);
            num += m_details.Size.y + m_innerPadding;
            m_requirements.SetVisible(true);
            SkillStaticData staticData = StaticDataHandler.GetStaticData <SkillStaticData>(EDataType.SKILL, (Int32)p_spell.StaticData.SkillID);
            String          text       = LocaManager.GetText(staticData.Name);
            String          text2      = LocaManager.GetText("SKILL_TIER_" + (Int32)p_spell.StaticData.Tier);
            Boolean         flag;

            if (p_spell.StaticData.ClassOnly == EClass.NONE)
            {
                flag = IsSkillRequirementFulfilled((Int32)p_spell.StaticData.SkillID, p_spell.StaticData.Tier);
                m_requirements.UpdateText(LocaManager.GetText("SKILL_TIER_REQUIREMENT_TT", text, text2));
            }
            else
            {
                flag = selectedCharacter.Class.IsAdvanced;
                String str = (selectedCharacter.Gender != EGender.MALE) ? "_F" : "_M";
                if (p_spell.StaticData.SkillID == ESkillID.SKILL_WARFARE)
                {
                    m_requirements.UpdateText(LocaManager.GetText("ABILITY_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
                else
                {
                    m_requirements.UpdateText(LocaManager.GetText("SPELL_REQUIREMENT_ADVANCED_CLASS" + str, selectedCharacter.Name, LocaManager.GetText(selectedCharacter.Class.AdvancedNameKey + str)));
                }
            }
            m_requirements.UpdatePositionY(-num);
            m_requirements.Label.color = ((!flag) ? Color.red : Color.white);
            num += m_requirements.Size.y + m_innerPadding;
            m_background.Scale(m_name.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Exemplo n.º 2
0
        public void Fill(TooltipType p_type, EPotionTarget p_attribute, Int32 p_currentIncrease, Character p_character, DummyCharacter p_dummy)
        {
            Init();
            m_atrribute = p_attribute;
            Single num = m_outerPadding + m_innerPadding;

            m_currentIncrease = p_currentIncrease;
            m_currentHeader.UpdatePositionY(-num);
            m_currentHeader.UpdateText(LocaManager.GetText("ATTRIBUTE_CURRENT"));
            num += m_currentHeader.Size.y + m_innerPadding;
            m_currentText.UpdatePositionY(-num);
            FillDescription(m_currentText, m_currentIncrease, p_character, p_dummy, false);
            num += m_currentText.Size.y + m_innerPadding;
            m_changeHeader.UpdatePositionY(-num);
            if (p_type == TooltipType.CURRENT_EFFECT_NEXT)
            {
                m_changeHeader.UpdateText(LocaManager.GetText("ATTRIBUTE_NEXT"));
            }
            else
            {
                m_changeHeader.UpdateText(LocaManager.GetText("ATTRIBUTE_PREV"));
            }
            num += m_changeHeader.Size.y + m_innerPadding;
            m_changeText.UpdatePositionY(-num);
            if (p_type == TooltipType.CURRENT_EFFECT_NEXT)
            {
                FillDescription(m_changeText, m_currentIncrease + 1, p_character, p_dummy, true);
            }
            else
            {
                FillDescription(m_changeText, m_currentIncrease - 1, p_character, p_dummy, true);
            }
            num += m_changeText.Size.y + m_innerPadding;
            m_background.Scale(m_currentHeader.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Exemplo n.º 3
0
        public void Fill(String objectNote, String userNote)
        {
            Single  num  = m_outerPadding + m_innerPadding;
            Single  num2 = 0f;
            Boolean flag = !String.IsNullOrEmpty(objectNote);

            m_objectNote.SetVisible(flag);
            if (flag)
            {
                m_objectNote.UpdatePositionY(-num);
                m_objectNote.UpdateText(objectNote);
                num += m_objectNote.Size.y + m_innerPadding;
                num2 = m_objectNote.Size.x;
            }
            Boolean flag2 = !String.IsNullOrEmpty(userNote);

            m_userNote.SetVisible(flag2);
            if (flag2)
            {
                m_userNote.UpdatePositionY(-num);
                m_userNote.UpdateText(userNote);
                num += m_userNote.Size.y + m_innerPadding;
                num2 = m_userNote.Size.x;
            }
            m_background.Scale(num2 + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Exemplo n.º 4
0
        public void Fill(String p_caption, String p_description, ESize p_size)
        {
            Single num  = m_outerPadding + m_innerPadding;
            Single num2 = 0f;
            Single horizontalScaleFactor;

            if (p_size == ESize.SMALL)
            {
                horizontalScaleFactor = 0.5f;
            }
            else if (p_size == ESize.MEDIUM)
            {
                horizontalScaleFactor = 0.75f;
            }
            else
            {
                horizontalScaleFactor = 1f;
            }
            Boolean flag = p_caption != String.Empty;

            m_caption.SetVisible(flag);
            if (flag)
            {
                m_caption.UpdatePositionY(-num);
                m_caption.HorizontalScaleFactor = horizontalScaleFactor;
                m_caption.UpdateText(p_caption);
                num += m_caption.Size.y + m_innerPadding;
                num2 = m_caption.Size.x;
            }
            Boolean flag2 = p_description != String.Empty;

            m_description.SetVisible(flag2);
            if (flag2)
            {
                m_description.UpdatePositionY(-num);
                m_description.HorizontalScaleFactor = horizontalScaleFactor;
                m_description.UpdateText(p_description);
                num += m_description.Size.y + m_innerPadding;
                num2 = m_description.Size.x;
            }
            m_background.Scale(num2 + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Exemplo n.º 5
0
        public void Fill(Skill p_skill, TooltipType p_type, Boolean p_isDefault)
        {
            Init();
            Single  num  = m_outerPadding + m_innerPadding;
            Boolean flag = p_type != TooltipType.CURRENT_EFFECT_NEXT || p_skill.Tier >= ETier.NOVICE;

            m_name.SetVisible(flag);
            if (flag)
            {
                m_name.UpdatePositionY(-num);
                FillSkillName(p_skill, p_type);
                num += m_name.Size.y + m_innerPadding;
            }
            Boolean flag2 = p_type == TooltipType.BASE || p_type == TooltipType.PARTY_CREATION;

            m_itemSlot.SetVisible(flag2);
            m_level.SetVisible(flag2);
            if (flag2)
            {
                m_itemSlot.UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
                m_itemSlot.SetItem(p_skill.Icon);
                m_level.VerticalAlign = TooltipGroup.Align.CENTER;
                m_level.MinHeight     = m_itemSlot.Size.y;
                m_level.UpdatePositionY(-num);
                FillSkillLevel(p_skill, p_type, p_isDefault);
                num += m_level.Size.y + m_innerPadding;
            }
            Boolean flag3 = p_type == TooltipType.BASE || p_type == TooltipType.PARTY_CREATION || p_type == TooltipType.CURRENT_EFFECT_PREV || (p_type == TooltipType.CURRENT_EFFECT_NEXT && p_skill.Tier >= ETier.NOVICE);

            m_description.SetVisible(flag3);
            if (flag3)
            {
                m_description.UpdatePositionY(-num);
                FillSkillDescription(p_skill, p_type, p_isDefault);
                num += m_description.Size.y + m_innerPadding;
            }
            Boolean flag4 = p_type == TooltipType.CURRENT_EFFECT_NEXT || (p_type == TooltipType.CURRENT_EFFECT_PREV && p_skill.Level > 1);

            m_subHeadLine.SetVisible(flag4);
            if (flag4)
            {
                m_subHeadLine.UpdatePositionY(-num);
                if (p_type == TooltipType.CURRENT_EFFECT_NEXT)
                {
                    m_subHeadLine.UpdateText(LocaManager.GetText("SKILL_NEXT_INCREASE"));
                }
                else
                {
                    m_subHeadLine.UpdateText(LocaManager.GetText("SKILL_PREV_INCREASE"));
                }
                num += m_subHeadLine.Size.y + m_innerPadding;
            }
            Boolean flag5 = (p_type != TooltipType.CURRENT_EFFECT_PREV || p_skill.Level > 1) && (p_type != TooltipType.PARTY_CREATION || IsMagicSchoolSkill(p_skill));

            m_effect.SetVisible(flag5);
            if (flag5)
            {
                m_effect.UpdatePositionY(-num);
                FillSkillEffect(p_skill, p_type);
                num += m_effect.Size.y + m_innerPadding;
            }
            Boolean flag6 = p_type == TooltipType.PARTY_CREATION && IsMagicSchoolSkill(p_skill);
            Int32   num2  = 0;

            for (Int32 i = 0; i < m_spellSlot.Length; i++)
            {
                m_spellSlot[i].SetVisible(false);
                m_spellName[i].SetVisible(false);
            }
            if (flag6)
            {
                foreach (SkillEffectStaticData skillEffectStaticData in p_skill.Tier1Effects)
                {
                    if (skillEffectStaticData.Type == ESkillEffectType.LEARN_SPELL)
                    {
                        Int32          p_spellType    = (Int32)skillEffectStaticData.Value;
                        CharacterSpell characterSpell = SpellFactory.CreateCharacterSpell((ECharacterSpell)p_spellType);
                        m_spellSlot[num2].SetVisible(true);
                        m_spellSlot[num2].UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
                        m_spellSlot[num2].SetItem(characterSpell.StaticData.Icon);
                        m_spellName[num2].SetVisible(true);
                        m_spellName[num2].VerticalAlign = TooltipGroup.Align.CENTER;
                        m_spellName[num2].MinHeight     = m_spellSlot[num2].Size.y;
                        m_spellName[num2].UpdatePositionY(-num);
                        m_spellName[num2].UpdateText(LocaManager.GetText(characterSpell.NameKey));
                        num += m_spellName[num2].Size.y + m_innerPadding;
                        num2++;
                    }
                }
            }
            m_background.Scale(m_name.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }
Exemplo n.º 6
0
        public void Fill(EQuickActionType p_action)
        {
            if (m_descriptionValues == null)
            {
                m_descriptionValues    = new String[9];
                m_descriptionValues[0] = "[00FF00]";
                m_descriptionValues[1] = "[80FF80]";
                m_descriptionValues[2] = "[FF0000]";
                m_descriptionValues[3] = "[FFC080]";
                m_descriptionValues[4] = "[FFFF80]";
                m_descriptionValues[5] = "[80FFFF]";
                m_descriptionValues[6] = "[-]";
            }
            m_name.UpdateText(LocaManager.GetText("STANDARD_ACTION_" + p_action));
            Single num = m_outerPadding + m_name.Size.y + m_innerPadding;

            switch (p_action)
            {
            case EQuickActionType.ATTACK:
                m_itemSlot.SetSpell("SPL_action_melee");
                m_itemSlot.HideItem();
                break;

            case EQuickActionType.ATTACKRANGED:
                m_itemSlot.SetSpell("SPL_action_ranged");
                m_itemSlot.HideItem();
                break;

            case EQuickActionType.USE_BEST_MANAPOTION:
            {
                m_itemSlot.SetSpell("SPL_action_bestpotion");
                Potion bestPotion = LegacyLogic.Instance.WorldManager.Party.GetBestPotion(EPotionType.MANA_POTION, null);
                if (bestPotion != null)
                {
                    m_itemSlot.SetItem(bestPotion.Icon);
                }
                else
                {
                    m_itemSlot.SetItem("ITM_consumable_potion_mana_1");
                }
                break;
            }

            case EQuickActionType.USE_BEST_HEALTHPOTION:
            {
                m_itemSlot.SetSpell("SPL_action_bestpotion");
                Potion bestPotion2 = LegacyLogic.Instance.WorldManager.Party.GetBestPotion(EPotionType.HEALTH_POTION, null);
                if (bestPotion2 != null)
                {
                    m_itemSlot.SetItem(bestPotion2.Icon);
                }
                else
                {
                    m_itemSlot.SetItem("ITM_consumable_potion_health_1");
                }
                break;
            }

            case EQuickActionType.DEFEND:
                m_itemSlot.SetSpell("SPL_action_defend");
                m_itemSlot.HideItem();
                break;
            }
            m_itemSlot.UpdatePosition(new Vector3(-m_name.Size.x / 2f, -num, 0f));
            m_description.MinHeight     = m_itemSlot.Size.y;
            m_description.VerticalAlign = TooltipGroup.Align.CENTER;
            m_description.UpdateText("-");
            m_description.UpdatePositionY(-num);
            num += m_description.Size.y + m_innerPadding;
            if (p_action == EQuickActionType.ATTACKRANGED)
            {
                m_descriptionValues[7] = LegacyLogic.Instance.WorldManager.Party.SelectedCharacter.FightValues.RangedAttackRange.ToString();
                m_descriptionValues[8] = (ConfigManager.Instance.Game.RangedAttackMeleeMalus * 100f).ToString();
            }
            else if (p_action == EQuickActionType.DEFEND)
            {
                m_descriptionValues[7] = (ConfigManager.Instance.Game.DefendEvadeBonus * 100f).ToString();
                m_descriptionValues[8] = (ConfigManager.Instance.Game.DefendBlockBonus * 100f).ToString();
            }
            else
            {
                m_descriptionValues[7] = String.Empty;
            }
            m_details.UpdateText(LocaManager.GetText("STANDARD_ACTION_" + p_action + "_TT", m_descriptionValues));
            m_details.UpdatePositionY(-num);
            num += m_details.Size.y + m_innerPadding;
            m_requirements.SetVisible(false);
            m_background.Scale(m_name.Size.x + m_outerPadding * 2f, num - m_innerPadding + m_outerPadding);
        }