コード例 #1
0
    /// <summary>
    /// 强化
    /// </summary>
    void UpdateEnchance()
    {
        ClearEnchanceContext();
        mIsEnableEnchance = false;
        if (mSelectedItem != null)
        {
            //属性
            mEnchanceSelectedAction.SetActionItem(mSelectedItem.GetID());
            string text = mSelectedItem.GetWhiteAttribute(0);
            mEnchanceSelectedAttri1.Text = UIString.Instance.ParserString_Runtime(text);
            text = mSelectedItem.GetWhiteAttribute(1);
            if (text == "")
            {
                mEnchanceSelectedAttri2.Hide(true);
            }
            else
            {
                mEnchanceSelectedAttri2.Hide(false);
                mEnchanceSelectedAttri2.Text = UIString.Instance.ParserString_Runtime(text);
            }

            //效果
            int nEnchanceLevel       = mSelectedItem.GetStrengthLevel() + 1;
            CObject_Item_Equip equip = mSelectedItem as CObject_Item_Equip;
            if (equip != null)
            {
                text = equip.GetStrengthAttributeValue(nEnchanceLevel, 0);
                mEnchanceResultAttri1.Text = UIString.Instance.ParserString_Runtime(text);
                text = equip.GetStrengthAttributeValue(nEnchanceLevel, 1);
                if (text == "")
                {
                    mEnchanceResultAttri2.Hide(true);
                }
                else
                {
                    mEnchanceResultAttri2.Hide(false);
                    mEnchanceResultAttri2.Text = UIString.Instance.ParserString_Runtime(text);
                }
            }
            Item_Enhance itemEnhance = LifeAbility.Instance.Get_Equip_EnhanceLevel(mSelectedItem);
            mEnchanceMoney.Text = itemEnhance.needMoney + "    金钱";

            //是否可强化
            if (mSelectedItem.GetStrengthLevel() < CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Level() &&
                itemEnhance.needMoney <= CObjectManager.Instance.getPlayerMySelf().GetCharacterData().Get_Money())
            {
                mEnchanceOK.controlIsEnabled = true;
            }
        }
    }
コード例 #2
0
    void ClearEnchanseSelected()
    {
        mEnchanseSelectedAction.SetActionItem(-1);
        mEnchanseSelectItemName.Text = "";

        for (int i = 0; i < mEnchanseGemInfo.Length; i++)
        {
            ActionButton gemAction = mEnchanseGemInfo[i].enchanseGem;
            if (gemAction.CurrActionItem != null)
            {
                gemAction.CurrActionItem.DestroyImpl();
            }
            gemAction.SetActionItem(-1);
            gemAction.SetMaskTexture("");

            if (mEnchanseGemInfo[i].bFlag == 1)
            {
                CObject_Item gem = CDataPool.Instance.UserBag_GetItemById(mEnchanseGemInfo[i].nGemType);
                // 需要保留部分数据 [4/25/2012 SUN]
                if (gem != null && mbSelectedItemChanged)
                {
                    gem.isLocked = false;
                    mEnchanseGemInfo[i].nGemType = -1;
                    mEnchanseGemInfo[i].bFlag    = 0;
                }
                else if (gem == null)
                {
                    mEnchanseGemInfo[i].nGemType = -1;
                    mEnchanseGemInfo[i].bFlag    = 0;
                }
            }
            else if (mEnchanseGemInfo[i].bFlag == 2)
            {
                if (mbSelectedItemChanged)
                {
                    mEnchanseGemInfo[i].nGemType = -1;
                    mEnchanseGemInfo[i].bFlag    = 0;
                }
            }
        }
    }
コード例 #3
0
 //清空强化界面
 void ClearEnhance()
 {
     for (int i = 0; i < 10; i++)
     {
         EnhanceNames[i].Text   = "";
         EnchanceLevels[i].Text = "";
         EnchanceRadios[i].Hide(true);
     }
     EnchancePageNum.Text = "1/1";
     Enchancebutton.SetActionItem(-1);
     EnchancePreLevel.Text     = "强化等级:";
     EnchanceCurrentLevel.Text = "";
     EnchanceNextLevel.Text    = "";
 }
コード例 #4
0
 //清空镶嵌界面
 void ClearEnchase()
 {
     for (int i = 0; i < 10; i++)
     {
         EnchaseNames[i].Text = "";
         EnchaseNums[i].Text  = "";
         EnchaseRadios[i].Hide(true);
     }
     EnchaseEquipIcon.SetActionItem(-1);
     for (int i = 0; i < 3; i++)
     {
         SelectStonesBtn[i].Hide(false);
         RemoveBtns[i].Hide(true);
     }
 }
コード例 #5
0
 void ClearShengDangContext()
 {
     mSDSelectedAction.SetActionItem(-1);
     mSDSelectedAttriDesc.Text  = "";
     mSDSelectedAttriDesc2.Text = "";
     foreach (ActionButton action in mSDMaterials)
     {
         action.SetActionItem(-1);
     }
     foreach (SpriteText text in mSDMaterialTexts)
     {
         text.Text = "";
     }
     mSDPreviewAction.SetActionItem(-1);
     mSDPreviewAttriDesc.Text  = "";
     mSDPreviewAttriDesc2.Text = "";
 }
コード例 #6
0
    void OnEnchanseTakeOff(ref POINTER_INFO ptr)
    {
        if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP)
        {
            string name   = ptr.targetObj.name;
            string index  = name.Remove(0, 2);
            int    nIndex = int.Parse(index) - 1;
            if (nIndex >= 0 && nIndex < mEnchanseGemInfo.Length)
            {
                if (mEnchanseGemInfo[nIndex].bFlag == GEM_ENCHANSE)
                {
                    CObject_Item gem = CDataPool.Instance.UserBag_GetItemById(mEnchanseGemInfo[nIndex].nGemType);
                    if (gem != null)
                    {
                        gem.isLocked = false;
                    }

                    // 直接清除显示 [5/3/2012 SUN]
                    ActionButton gemAction = mEnchanseGemInfo[nIndex].enchanseGem;
                    if (gemAction.CurrActionItem != null)
                    {
                        gemAction.CurrActionItem.DestroyImpl();
                    }
                    gemAction.SetActionItem(-1);
                    gemAction.SetMaskTexture("");

                    mEnchanseGemInfo[nIndex].bFlag    = GEM_NONE;
                    mEnchanseGemInfo[nIndex].nGemType = -1;
                }
                else if (mEnchanseGemInfo[nIndex].enchanseGem.CurrActionItem != null)
                {
                    mEnchanseGemInfo[nIndex].bFlag    = GEM_TAKEOFF;
                    mEnchanseGemInfo[nIndex].nGemType = -1;
                }

                UpdateEnchanseGemStates();
            }

            //todo update takeoff selected
        }
    }
コード例 #7
0
    public ActionButton yuPeiBtn;    //玉佩
    void Equip_RefreshEquip()
    {
        CActionItem weapon = CActionSystem.Instance.EnumAction(0, ActionNameType.Equip);

        if (weaponBtn != null)
        {
            if (weapon != null)
            {
                weaponBtn.UpdateItemFromAction(weapon);
                SetLocked(weaponBtn, weapon);
            }
            else
            {
                weaponBtn.SetActionItem(-1);
            }
        }
        CActionItem cap = CActionSystem.Instance.EnumAction(1, ActionNameType.Equip);

        if (capBtn != null)
        {
            if (cap != null)
            {
                capBtn.UpdateItemFromAction(cap);
                SetLocked(capBtn, cap);
            }
            else
            {
                capBtn.SetActionItem(-1);
            }
        }
        CActionItem armor = CActionSystem.Instance.EnumAction(2, ActionNameType.Equip);

        if (armorBtn != null)
        {
            if (armor != null)
            {
                armorBtn.UpdateItemFromAction(armor);
                SetLocked(armorBtn, armor);
            }
            else
            {
                armorBtn.SetActionItem(-1);
            }
        }
        CActionItem boot = CActionSystem.Instance.EnumAction(4, ActionNameType.Equip);

        if (bootBtn != null)
        {
            if (boot != null)
            {
                bootBtn.UpdateItemFromAction(boot);
                SetLocked(bootBtn, boot);
            }
            else
            {
                bootBtn.SetActionItem(-1);
            }
        }
        CActionItem shoulder = CActionSystem.Instance.EnumAction(15, ActionNameType.Equip);

        if (shoulderBtn != null)
        {
            if (shoulder != null)
            {
                shoulderBtn.UpdateItemFromAction(shoulder);
                SetLocked(shoulderBtn, shoulder);
            }
            else
            {
                shoulderBtn.SetActionItem(-1);
            }
        }
        CActionItem ring = CActionSystem.Instance.EnumAction(6, ActionNameType.Equip);

        if (ringBtn != null)
        {
            if (ring != null)
            {
                ringBtn.UpdateItemFromAction(ring);
                SetLocked(ringBtn, ring);
            }
            else
            {
                ringBtn.SetActionItem(-1);
            }
        }
        CActionItem necklace = CActionSystem.Instance.EnumAction(7, ActionNameType.Equip);

        if (necklaceBtn != null)
        {
            if (necklace != null)
            {
                necklaceBtn.UpdateItemFromAction(necklace);
                SetLocked(necklaceBtn, necklace);
            }
            else
            {
                necklaceBtn.SetActionItem(-1);
            }
        }
        CActionItem back = CActionSystem.Instance.EnumAction(5, ActionNameType.Equip);

        if (backBtn != null)
        {
            if (back != null)
            {
                backBtn.UpdateItemFromAction(back);
                SetLocked(backBtn, back);
            }
            else
            {
                backBtn.SetActionItem(-1);
            }
        }
        CActionItem yupei = CActionSystem.Instance.EnumAction(13, ActionNameType.Equip);

        if (yuPeiBtn != null)
        {
            if (yupei != null)
            {
                yuPeiBtn.UpdateItemFromAction(yupei);
                SetLocked(yuPeiBtn, yupei);
            }
            else
            {
                yuPeiBtn.SetActionItem(-1);
            }
        }
        CActionItem wrist = CActionSystem.Instance.EnumAction(3, ActionNameType.Equip);

        if (wristBtn != null)
        {
            if (wrist != null)
            {
                wristBtn.UpdateItemFromAction(wrist);
                SetLocked(wristBtn, wrist);
            }
            else
            {
                wristBtn.SetActionItem(-1);
            }
        }
    }
コード例 #8
0
    /// <summary>
    /// 升档
    /// </summary>
    void UpdateShengDang()
    {
        ClearShengDangContext();
        mIsEnableSD = false;
        if (mSelectedItem != null)
        {
            mSDSelectedAction.SetActionItem(mSelectedItem.GetID());
            string text = mSelectedItem.GetWhiteAttribute(0);
            mSDSelectedAttriDesc.Text = UIString.Instance.ParserString_Runtime(text);
            text = mSelectedItem.GetWhiteAttribute(1);
            if (text == "")
            {
                mSDSelectedAttriDesc2.Hide(true);
            }
            else
            {
                mSDSelectedAttriDesc2.Hide(false);
                mSDSelectedAttriDesc2.Text = UIString.Instance.ParserString_Runtime(text);
            }


            CActionItem actionItem = LifeAbility.Instance.GetEquipUpdatePreView(mSDSelectedAction.CurrActionItem.GetID());
            if (actionItem != null)
            {
                mSDPreviewAction.SetActionItemByActionId(actionItem.GetID());

                CObject_Item previewItem = mSDPreviewAction.CurrActionItem.GetImpl() as CObject_Item;
                if (previewItem != null)
                {
                    text = previewItem.GetWhiteAttribute(0);
                    mSDPreviewAttriDesc.Text = UIString.Instance.ParserString_Runtime(text);
                    text = previewItem.GetWhiteAttribute(1);
                    if (text == "")
                    {
                        mSDPreviewAttriDesc2.Hide(true);
                    }
                    else
                    {
                        mSDPreviewAttriDesc2.Text = UIString.Instance.ParserString_Runtime(text);
                        mSDPreviewAttriDesc2.Hide(false);
                    }
                }
            }

            int nPrescrId = LifeAbility.Instance.GetPrescrID(mSelectedItem.GetIdTable());
            if (nPrescrId == -1)
            {
                NoPrescrHandler(mSelectedItem.GetIdTable());
                mSDOK.controlIsEnabled = false;
                return;
            }
            NoPrescrHandler(-1);
            //材料
            int nCount = LifeAbility.Instance.GetPrescrStuffCount(nPrescrId);
            //int nMaterial = -1;
            for (int i = 1; i < nCount; i++) //第一个材料为当前装备,跳过不显示
            {
                Stuff stuff = LifeAbility.Instance.GetPrescrStuff(i, nPrescrId);
                if (stuff.nID == -1)
                {
                    mSDMaterials[i - 1].SetActionItem(-1);
                    mSDMaterialTexts[i - 1].Text = "";
                    continue;
                }
                bool bCreateNew = true;
                if (mSDMaterials[i - 1].CurrActionItem != null)
                {
                    if (mSDMaterials[i - 1].CurrActionItem.GetIDTable() == stuff.nID)
                    {
                        bCreateNew = false;
                    }
                    else
                    {
                        mSDMaterials[i - 1].CurrActionItem.DestroyImpl();
                    }
                }
                if (bCreateNew)
                {
                    CObject_Item     pItemObj1   = ObjectSystem.Instance.NewItem((uint)stuff.nID);
                    CActionItem_Item actionItem1 = CActionSystem.Instance.GetAction_ItemID(pItemObj1.GetID(), false);

                    mSDMaterials[i - 1].SetActionItemByActionId(actionItem1.GetID());
                }

                int count = CDataPool.Instance.UserBag_CountItemByIDTable(stuff.nID);
                if (count >= stuff.nNum)
                {
                    count       = stuff.nNum;
                    mIsEnableSD = true;
                }
                else
                {
                    mIsEnableSD = false;
                }
                mSDMaterialTexts[i - 1].Text = count + "/" + stuff.nNum;
            }

            mSDOK.controlIsEnabled = mIsEnableSD;
        }
    }