Example #1
0
    void GetCompoundItem()
    {
        Pathea.Replicator r = replicator;
        // add root item and delete need item

        if (!r.HasEnoughPackage(mGraphCtrl.rootNode.GetItemID(), mGraphCtrl.rootNode.getCount))
        {
            IsCompounding = false;
            //ProgressCount = 0;
            CompoundFixedTimeCount      = 0;
            mCompoundSlider.sliderValue = 0;

            MessageBox_N.ShowOkBox(PELocalization.GetString(8000050));
            return;
        }


        if (mGraphCtrl.isCanCreate())
        {
            if (GameConfig.IsMultiMode == true)
            {
                int num = mGraphCtrl.rootNode.getCount / mGraphCtrl.rootNode.ms.m_productItemCount;
                PlayerNetwork.mainPlayer.RequestMergeSkill(mGraphCtrl.rootNode.ms.id, num);
            }
            else
            {
                r.Run(mGraphCtrl.rootNode.ms.id, mGraphCtrl.rootNode.getCount / mGraphCtrl.rootNode.ms.m_productItemCount);
            }

            GameUI.Instance.mItemPackageCtrl.ResetItem();
            for (int i = 0; i < m_CurScriptMatIDs.Count; i++)
            {
                MissionManager.Instance.ProcessCollectMissionByID(m_CurScriptMatIDs[i]);
            }
        }


        IsCompounding = false;
        //ProgressCount = 0;
        CompoundFixedTimeCount      = 0;
        mCompoundSlider.sliderValue = 0;
    }
Example #2
0
    private void BtnCompoundOnClick()
    {
        if (mGraphCtrl.rootNode == null)
        {
            return;
        }

        Pathea.Replicator r = replicator;
        if (null == r)
        {
            return;
        }

        if (IsCompounding)
        {
            //lz-2016.09.09 如果在制造中就取消制造
            IsCompounding = !replicator.CancelReplicate(mGraphCtrl.rootNode.ms.id);
            return;
        }

        if (!r.HasEnoughPackage(mGraphCtrl.rootNode.GetItemID(), mGraphCtrl.rootNode.getCount))
        {
            MessageBox_N.ShowOkBox(PELocalization.GetString(8000050));
            return;
        }

        if (mGraphCtrl.isCanCreate())
        {
            CompoundFixedTimeCount = Convert.ToInt32(mGraphCtrl.rootNode.ms.timeNeed / 0.02);
            if (RandomMapConfig.useSkillTree)
            {
                if (GameUI.Instance.mSkillWndCtrl._SkillMgr != null)
                {
                    CompoundFixedTimeCount = (int)GameUI.Instance.mSkillWndCtrl._SkillMgr.CheckReduceTime((float)CompoundFixedTimeCount);
                }
            }
            replicator.StartReplicate(mGraphCtrl.rootNode.ms.id, mGraphCtrl.rootNode.getCount / mGraphCtrl.rootNode.ms.m_productItemCount);
            IsCompounding = true;
        }
    }