コード例 #1
0
    public void SetInfo(PAchieve info)
    {
        restrainId = info.id;

        Util.SetText(taskname, Util.Parse <int>(info.name));
        Util.SetText(taskdetail, info.desc);

        Settype(info.achieveLv);//显示等级
        progress.gameObject.SetActive(true);
        my_value.text     = info.finishVal.ToString();
        should_value.text = info.condition.ToString();

        if (info.type == 17)
        {
            double a = info.finishVal / 3600;
            double b = info.condition / 3600;
            my_value.text     = (Math.Floor(a)).ToString();
            should_value.text = (Math.Floor(b)).ToString();
        }
        else
        {
            should_value.text = info.condition.ToString();
        }

        if (!info.hasBar)
        {
            should_value.text = "1";
            if (!Module_Active.instance.CanGetList[info.id])
            {
                my_value.text = "0";
            }
            else
            {
                my_value.text = "1";
            }
        }

        ChangeValue(Util.Parse <int>(my_value.text));//设置进度条
        ChangeState(info);

        get_btn.onClick.RemoveAllListeners();
        get_btn.onClick.AddListener(AwardGet);

        //奖励
        AwardGetSucced succed = reward_group.GetComponentDefault <AwardGetSucced>();

        succed.SetAward(info.reward, child);
    }
コード例 #2
0
    private void SetWuInfo(PActiveBox Info)
    {
        if (Info == null)
        {
            Logger.LogError("award box info is null");
            return;
        }
        AwardGetSucced succed = rewardGroup.GetComponentDefault <AwardGetSucced>();

        succed.SetAward(Info.reward, ShowBox);

        should_active.text = Info.activePoint.ToString();
        receive_btn.gameObject.SetActive(false);//是否能够领取
        if (Util.Parse <int>(my_active.text) >= Info.activePoint)
        {
            receive_btn.gameObject.SetActive(true);
        }
    }
コード例 #3
0
ファイル: DailyInfo.cs プロジェクト: NoeCalmness/CoreFrame
    public void DetailsInfo(PDailyInfo Dailyinfo, PDailyTask info, uint losstime)
    {
        restrainId = info.id;

        Start = false;
        //如果是开启状态 才会进行时间计算
        if (Dailyinfo.isOpen && Dailyinfo.state < 2)
        {
            timeNow = (int)(Dailyinfo.restTime - losstime);
            m_time  = 0;
            if (timeNow > 0)
            {
                ShowTime();
                Start = true;
            }
            else
            {
                remaintime.text = "0";
            }
        }

        //显示具体信息
        type = info.type;
        awardinfo.Clear();
        Util.SetText(taskname, info.name);
        Util.SetText(taskdetail, info.desc);
        if (!info.hasBar)
        {
            progress.gameObject.SetActive(false);
        }
        else
        {
            progress.gameObject.SetActive(true);
            should_value.text = info.condition.ToString();
            ChangeValue((int)Dailyinfo.finishVal);
        }

        if (Dailyinfo.state == 0)
        {
            get_btn.gameObject.SetActive(false);
            go_btn.gameObject.SetActive(true);
        }
        else if (Dailyinfo.state == 1)
        {
            get_btn.gameObject.SetActive(true);
            go_btn.gameObject.SetActive(false);
        }
        if (info.type == 1)
        {
            go_btn.gameObject.SetActive(false);
        }
        get_btn.onClick.RemoveAllListeners();
        go_btn.onClick.RemoveAllListeners();
        get_btn.onClick.AddListener(Dailyget);
        go_btn.onClick.AddListener(Dailygo);

        if (info.reward == null)
        {
            return;
        }

        AwardGetSucced succed = rewardContent.GetComponentDefault <AwardGetSucced>();

        succed.SetAward(info.reward, child);
    }
コード例 #4
0
    public void SetInfo(PCooperateInfo info, Action <CooperationTask> monShow)
    {
        if (info == null)
        {
            Logger.LogError("server info is null");
            return;
        }
        CooperationTask task = Module_Active.instance.coopTaskBase.Find(a => a.ID == info.taskId);

        if (task == null)
        {
            Logger.LogError("configuration is not have this id");
            return;
        }
        Get();
        monShowList = monShow;

        Util.SetText(m_name, task.name);
        if (string.IsNullOrEmpty(task.icon))
        {
            Logger.LogError(" this task no icon");
        }
        UIDynamicImage.LoadImage(m_monsterImg, task.icon);

        Util.SetText(m_invateTxt, ConfigText.GetDefalutString(223, 38), task.limitLevel);
        m_taskOne.gameObject.SetActive(true);
        m_coop.gameObject.SetActive(task.type == 1);
        m_taskTwo.gameObject.SetActive(task.type == 1);
        m_invate.gameObject.SetActive(info.friendId == 0 && task.type == 1 && info.state == 0);
        m_player.gameObject.SetActive(info.friendId != 0 && task.type == 1 && info.state == 0);
        m_reward.gameObject.SetActive(info.state == 1);
        m_offPlane.gameObject.SafeSetActive(info.state == 2);

        AwardGetSucced succed = m_showReward.GetComponentDefault <AwardGetSucced>();

        succed.SetAward(task.reward, showReward, false);

        if (task.conditions == null || task.conditions.Length < 1)
        {
            Logger.LogError("monster info is error");
            return;
        }
        if (task.type == 2 && task.conditions.Length >= 1)
        {
            SetValue(task.conditions[0], 0, m_oneTxt, m_oneSlider, m_oneValue, info.selfFinishVal);
        }
        else if (task.type == 1 && task.conditions.Length > 1)
        {
            var self      = task.conditions[0];
            var friend    = task.conditions[1];
            var ids       = info.friendId;
            var selfValue = info.selfFinishVal;
            var fValue    = info.assistFinishVal;
            if (Module_Player.instance.id_ != info.ownerId)
            {
                self      = task.conditions[1];
                friend    = task.conditions[0];
                ids       = info.ownerId;
                selfValue = info.assistFinishVal;
                fValue    = info.selfFinishVal;
            }
            SetValue(self, 0, m_oneTxt, m_oneSlider, m_oneValue, selfValue);
            SetValue(friend, 1, m_twoTxt, m_twoSlider, m_twoValue, fValue);
            if (ids != 0)
            {
                var f = Module_Friend.instance.FriendList.Find(a => a.roleId == ids);
                if (f != null)
                {
                    m_invateName.text = f.name;
                    headBoxFriend headBox = m_HeadBox.gameObject.GetComponentDefault <headBoxFriend>();
                    headBox.HeadBox(f.headBox);
                    Module_Avatar.SetClassAvatar(m_HeadAvatar, f.proto, false, f.gender);
                }
            }
        }
        m_invateBtn.onClick.RemoveAllListeners();
        m_invateBtn.onClick.AddListener(delegate
        {
            Module_Active.instance.CheckTaskID = info.uid;
            Module_Active.instance.GetCanInvate(info.taskId);
        });
        m_monsterBtn.onClick.RemoveAllListeners();
        m_monsterBtn.onClick.AddListener(delegate
        {
            //出现怪物详情界面
            if (!Module_Active.instance.collTask.ContainsKey(task.ID))
            {
                var idnex = 0;
                if (Module_Player.instance.id_ != info.ownerId)
                {
                    idnex = 1;
                }
                Module_Active.instance.GetMonsterShow(task.ID, task.conditions[idnex].monsterId);
            }
            Module_Active.instance.CoopShowList.Clear();
            Module_Active.instance.GetAllMonsterStage(task.ID);

            monShowList(task);
        });
        m_rewardBtn.onClick.RemoveAllListeners();
        m_rewardBtn.onClick.AddListener(delegate
        {
            Module_Active.instance.GetCoopReward(info.uid);
        });
        m_playerBtn.onClick.RemoveAllListeners();
        m_playerBtn.onClick.AddListener(delegate
        {
            if (Module_Player.instance.id_ != info.ownerId)
            {
                Module_Global.instance.ShowMessage(223, 46);                                            //无权踢出
            }
            else
            {
                if (CanKickedOut(info.acceptTime) && info.state == 0)
                {
                    Window_Alert.ShowAlert(ConfigText.GetDefalutString(223, 40), true, true, true, () =>
                    {
                        Module_Active.instance.KickedOutFriend(info.uid, info.friendId);
                    }, null, "", "");
                }
                else
                {
                    Module_Global.instance.ShowMessage(223, 43); //未到时间 或者 已经可领取
                }
            }
        });
    }