public void SendSignReq(int signFlag, MonthSign monthSign)
 {
     this.monthSignCache = monthSign;
     NetworkManager.Send(new SignReq
     {
         signFlag = signFlag
     }, ServerType.Data);
 }
Exemple #2
0
    public void SetUI(MonthSign monthSign, bool haveSign, bool canSign, bool canResign, int day)
    {
        this.monthSignCache = monthSign;
        this.dayindex       = day + 1;
        this.TextDay.set_text(string.Format("第{0}天", this.dayindex.ToString()));
        Items items = DataReader <Items> .Get(monthSign.itemId);

        ResourceManager.SetSprite(this.ImageIcon, GameDataUtils.GetIcon(items.icon));
        this.ImageIcon.SetNativeSize();
        ResourceManager.SetSprite(this.ImageFrame, GameDataUtils.GetItemFrame(items.id));
        if (monthSign.itemNum <= 1)
        {
            this.TextNum.get_gameObject().SetActive(false);
        }
        else
        {
            this.TextNum.get_gameObject().SetActive(true);
            this.TextNum.set_text(monthSign.itemNum.ToString());
        }
        if (monthSign.doubleMinVip != 0)
        {
            this.Vip.get_gameObject().SetActive(true);
            string text = "V" + monthSign.doubleMinVip + GameDataUtils.GetChineseContent(502207, false);
            this.VipText.set_text(text);
        }
        else
        {
            this.Vip.get_gameObject().SetActive(false);
        }
        this.state = MonthSignInChildItem.MonthSignInChildItemState.None;
        this.BtnRewardDetail.set_enabled(true);
        this.ResignIn.get_gameObject().SetActive(false);
        this.ItemSelect.get_gameObject().SetActive(false);
        this.CanSignObj.SetActive(false);
        if (haveSign)
        {
            this.ItemSelect.get_gameObject().SetActive(true);
            this.state = MonthSignInChildItem.MonthSignInChildItemState.HaveSign;
        }
        else if (canSign)
        {
            this.state = MonthSignInChildItem.MonthSignInChildItemState.CanSign;
        }
        else if (canResign)
        {
            this.ResignIn.get_gameObject().SetActive(true);
            this.state = MonthSignInChildItem.MonthSignInChildItemState.CanResign;
        }
        if (canSign)
        {
            this.ShowFx(true);
            this.CanSignObj.SetActive(true);
        }
        else
        {
            this.ShowFx(false);
        }
    }
Exemple #3
0
    private Cell CellForRow_MonthSign(ListView listView, int row)
    {
        string text = "cell";
        Cell   cell = listView.CellForReuseIndentify(text);

        if (cell == null)
        {
            cell          = new Cell(listView);
            cell.identify = text;
            GameObject instantiate2Prefab = ResourceManager.GetInstantiate2Prefab("ItemMonthSignIn");
            cell.content = instantiate2Prefab;
            instantiate2Prefab.set_name("ItemMonthSignIn" + row);
            instantiate2Prefab.GetComponent <RectTransform>().set_localScale(new Vector3(1f, 1f, 1f));
        }
        if (SignInManager.Instance.monthSignInfo == null)
        {
            return(cell);
        }
        ItemMonthSignIn component = cell.content.GetComponent <ItemMonthSignIn>();

        for (int i = 0; i < 5; i++)
        {
            int num = row * 5 + i;
            MonthSignInChildItem monthSignInChildItem = component.childItems.get_Item(i);
            if (row * 5 + i >= this.listMonthSign.get_Count())
            {
                monthSignInChildItem.get_gameObject().SetActive(false);
            }
            else
            {
                bool canSign   = false;
                bool canResign = false;
                bool haveSign  = false;
                if (num + 1 - SignInManager.Instance.monthSignInfo.signDays <= 0)
                {
                    haveSign = true;
                }
                else if (num - SignInManager.Instance.monthSignInfo.signDays == 0 && !SignInManager.Instance.monthSignInfo.isSign)
                {
                    canSign = true;
                }
                else if (num - SignInManager.Instance.monthSignInfo.signDays == 0 && SignInManager.Instance.monthSignInfo.repairNum > 0)
                {
                    canResign = true;
                }
                monthSignInChildItem.get_gameObject().SetActive(true);
                MonthSign monthSign = this.listMonthSign.get_Item(row * 5 + i);
                monthSignInChildItem.SetUI(monthSign, haveSign, canSign, canResign, num);
                monthSignInChildItem.BtnRewardDetail.onClickCustom = new ButtonCustom.VoidDelegateObj(this.OnClickBtnRewardDetail);
                monthSignInChildItem.BtnReSignIn.onClickCustom     = new ButtonCustom.VoidDelegateObj(this.OnClickBtnReSignIn);
            }
        }
        return(cell);
    }
Exemple #4
0
    private void CollectThisMonthSignData()
    {
        if (SignInManager.Instance.monthSignInfo == null)
        {
            return;
        }
        this.listMonthSign.Clear();
        List <MonthSign> dataList = DataReader <MonthSign> .DataList;
        int       year            = SignInManager.Instance.monthSignInfo.year;
        int       month           = SignInManager.Instance.monthSignInfo.month;
        MonthSign monthSign       = dataList.Find((MonthSign a) => a.date.get_Item(0) == year && a.date.get_Item(1) == month && a.date.get_Item(2) == 1);

        while (monthSign != null && monthSign.date.get_Item(0) == year && monthSign.date.get_Item(1) == month)
        {
            this.listMonthSign.Add(monthSign);
            if (monthSign.id == monthSign.nextID)
            {
                break;
            }
            monthSign = ((!DataReader <MonthSign> .Contains(monthSign.nextID)) ? null : DataReader <MonthSign> .Get(monthSign.nextID));
        }
    }