Esempio n. 1
0
        public override void OnEnter()
        {
            var data   = m_UI.data as ExploreData;
            var deploy = ExplorePlaceDeploy.GetInfo(data.PlaceId);

            m_UI.m_LabelPlaceName.SetText(deploy.Name);
            m_UI.m_LabelPlaceLevel.SetValue(deploy.Level);
            m_UI.m_LabelExploreProgress.SetValue(0);
            m_UI.m_LabelCost.SetText(deploy.Cost);

            m_UI.m_BtnSelectLeft.touchable  = false;
            m_UI.m_BtnSelectRight.touchable = false;

            if (data.PupilId1 > 0)
            {
                var pupil = PupilDeploy.GetInfo(data.PupilId1);
                m_UI.m_BtnSelectLeft.m_ViewState.selectedIndex = 1;
                m_UI.m_BtnSelectLeft.m_LoaderPupil.icon        = UIUtil.GetPupilBodyUrl(pupil.Sex);
            }
            else
            {
                m_UI.m_BtnSelectLeft.m_ViewState.selectedIndex = 0;
            }

            if (data.PupilId2 > 0)
            {
                var pupil = PupilDeploy.GetInfo(data.PupilId2);
                m_UI.m_BtnSelectRight.m_ViewState.selectedIndex = 1;
                m_UI.m_BtnSelectRight.m_LoaderPupil.icon        = UIUtil.GetPupilBodyUrl(pupil.Sex);
            }
            else
            {
                m_UI.m_BtnSelectRight.m_ViewState.selectedIndex = 0;
            }
        }
Esempio n. 2
0
        private void OnItemRenderer(int index, GObject obj)
        {
            var id     = m_UI.m_PlaceList.GetData <int>(index);
            var deploy = ExplorePlaceDeploy.GetInfo(id);
            var item   = obj as UI_PlaceSelectItem;

            item.m_LabelName.SetText(deploy.Name);
            item.m_LabelLevel.SetValue(deploy.Level);
            item.m_LabelProgress.SetValue(0);
        }
Esempio n. 3
0
    public void RefreshCond()
    {
        var data = m_UI.data as ExploreData;

        if (data.PlaceId <= 0)
        {
            m_UI.m_LabelSuccessRate.SetValue(0);
            return;
        }

        var placeDeploy = ExplorePlaceDeploy.GetInfo(data.PlaceId);

        int[] conds = new int[5] {
            0, 0, 0, 0, 0
        };

        var pupil1 = PupilProxy.instance.getPupilInfo(data.PupilId1);

        if (pupil1 != null)
        {
            var deploy = PupilDeploy.GetInfo(pupil1.DId);
            conds[0] += (pupil1.GetCombat() > placeDeploy.Combat) ? 1 : 0;
            conds[1] += (deploy.Sex == placeDeploy.Sex) ? 1 : 0;
            conds[2] += 1;
            conds[3] += (pupil1.GetAttr(EAttrType.NeiGong) > placeDeploy.NeiGong) ? 1 : 0;
            conds[4] += (pupil1.GetAttr(EAttrType.WaiGong) > placeDeploy.WaiGong) ? 1 : 0;
        }

        var pupil2 = PupilProxy.instance.getPupilInfo(data.PupilId2);

        if (pupil2 != null)
        {
            var deploy = PupilDeploy.GetInfo(pupil2.DId);
            conds[0] += (pupil2.GetCombat() > placeDeploy.Combat) ? 1 : 0;
            conds[1] += (deploy.Sex == placeDeploy.Sex) ? 1 : 0;
            conds[2] += 1;
            conds[3] += (pupil2.GetAttr(EAttrType.NeiGong) > placeDeploy.NeiGong) ? 1 : 0;
            conds[4] += (pupil2.GetAttr(EAttrType.WaiGong) > placeDeploy.WaiGong) ? 1 : 0;
        }

        m_UI.m_Combat.selectedIndex  = (conds[0] > 0) ? 1 : 0;
        m_UI.m_Sex.selectedIndex     = (conds[1] > 0) ? 1 : 0;
        m_UI.m_WuXue.selectedIndex   = (conds[2] > 0) ? 1 : 0;
        m_UI.m_NeiGong.selectedIndex = (conds[3] > 0) ? 1 : 0;
        m_UI.m_WaiGong.selectedIndex = (conds[4] > 0) ? 1 : 0;

        var rate = 0;

        for (int i = 0; i < 5; i++)
        {
            rate += conds[i];
        }
        rate *= 10;
        m_UI.m_LabelSuccessRate.SetValue(rate);
    }
Esempio n. 4
0
    public override void OnRefresh()
    {
        var placeDeploy = ExplorePlaceDeploy.GetInfo(m_ExploreData.PlaceId);

        m_UI.m_LabelPlaceName.SetText(placeDeploy.Name);

        m_UI.m_IconReward1.icon  = UIUtil.GetGoodsUrl(EGoodsType.XinFa, 1);
        m_UI.m_IconReward1.title = "";
        m_UI.m_IconReward2.icon  = UIUtil.GetGoodsUrl(EGoodsType.CanBen, 1);
        m_UI.m_IconReward2.title = "";
        m_UI.m_IconReward3.icon  = UIUtil.GetGoodsUrl(EGoodsType.HuoBi, 1);
        m_UI.m_IconReward3.title = "3000";
    }
Esempio n. 5
0
    public override void Execute(INotification notification)
    {
        var exploreData = notification.Body as ExploreData;

        if (exploreData.PupilId1 <= 0 && exploreData.PupilId2 <= 0)
        {
            WinCenter.inst.ShowTips("还没有选择弟子!");
            return;
        }

        var explorePlaceDeploy = ExplorePlaceDeploy.GetInfo(exploreData.PlaceId);

        var userProxy = Facade.RetrieveProxy(UserProxy.Name) as UserProxy;

        userProxy.costGold(explorePlaceDeploy.Cost);

        var exploreProxy = Facade.RetrieveProxy(ExploreProxy.Name) as ExploreProxy;

        exploreProxy.StartExplore(exploreData);

        // 数据更新
        AppFacade.getInstance().DataUpdated();
    }
Esempio n. 6
0
        public override void OnEnter()
        {
            var data   = m_UI.data as ExploreData;
            var deploy = ExplorePlaceDeploy.GetInfo(data.PlaceId);

            m_UI.m_LabelPlaceName.SetText(deploy.Name);
            m_UI.m_LabelPlaceLevel.SetValue(deploy.Level);
            m_UI.m_LabelExploreProgress.SetValue(0);
            m_UI.m_LabelCost.SetText(deploy.Cost);

            m_UI.m_LabelCombat.SetText(deploy.Combat);
            m_UI.m_LabelSex.SetText((deploy.Sex == ESex.Man) ? "男性" : "女性");
            m_UI.m_LabelNeiGong.SetValue(deploy.NeiGong);
            m_UI.m_LabelWaiGong.SetValue(deploy.WaiGong);

            m_UI.m_Combat.selectedIndex  = 0;
            m_UI.m_Sex.selectedIndex     = 0;
            m_UI.m_WuXue.selectedIndex   = 0;
            m_UI.m_NeiGong.selectedIndex = 0;
            m_UI.m_WaiGong.selectedIndex = 0;

            m_UI.m_LeftNameAndCancel.visible  = false;
            m_UI.m_RightNameAndCancel.visible = false;
        }