Example #1
0
    private void showAward()
    {
        int          index        = 0;
        int          inter        = 0;
        NoticeSample noticeSample = null;

        showPrizes.Clear();
        while (index < NoticeManagerment.Instance.noticeLimit.Count)
        {
            noticeSample = NoticeSampleManager.Instance.getNoticeSampleBySid(NoticeManagerment.Instance.noticeLimit[index].sid);
            if (noticeSample != null && noticeSample.name.Contains(LanguageConfigManager.Instance.getLanguage("StarSoulWindow_tap_hunt")))
            {
                hountSid = noticeSample.sid;
                inter    = NoticeManagerment.Instance.noticeLimit[index].integral;
                RankAward rankAward = LucklyActivityAwardConfigManager.Instance.updateAwardDateByIntegral(hountSid, inter);
                if (rankAward != null)
                {
                    ListKit.AddRange(showPrizes, AllAwardViewManagerment.Instance.exchangeArrayToList(rankAward.prizes));
                }
                NoticeManagerment.Instance.noticeLimit.RemoveAt(index);
                index--;
            }
            index++;
        }
        if (hountSid != 0)
        {
            (FPortManager.Instance.getFPort("LuckyXianshiFPort") as LuckyXianshiFPort).access(hountSid, setIntegralRank, 3);
        }

        //if(showPrizes.Count > 0){
        //    UiManager.Instance.openDialogWindow<AllAwardViewWindow>((win)=>{
        //        win.Initialize(showPrizes,LanguageConfigManager.Instance.getLanguage("notice_xianshi_01",integral.ToString()));
        //    });
        //}
    }
    /// <summary>
    /// 初始化容器
    /// </summary>
    /// <param name="tapIndex">Tap index.</param>
    public void initContent(int tapIndex)
    {
        resetContentsActive();
        GameObject content = getContent(tapIndex);

        switch (tapIndex)
        {
        case TAP_RINK_CONTENT:
            RankingForActiveContent csp = content.GetComponent <RankingForActiveContent> ();
            csp.init(this, openType);
            int       minIntegral = 0;
            RankAward rankAward   = LucklyActivityAwardConfigManager.Instance.getFirstSource(openType);
            if (rankAward != null)
            {
                minIntegral = rankAward.needSource;
            }
            csp.rankTextLabel.text = LanguageConfigManager.Instance.getLanguage("luckinfo", minIntegral.ToString());
            if (useType == 3 || useType == 4)
            {
                csp.rankTextLabel.text = descInfo.Replace("%1", minIntegral.ToString());
            }
            break;

        case TAP_SOURCE_CONTENT:
            SourceForActiveContent cms = content.GetComponent <SourceForActiveContent> ();
            cms.init(this, openType, mySource, useType);
            break;
        }
    }
Example #3
0
    private void showAward()
    {
        int          index        = 0;
        int          inter        = 0;
        NoticeSample noticeSample = null;

        showPrizes.Clear();
        //List<PrizeSample> showPrizes = new List<PrizeSample> ();
        while (index < NoticeManagerment.Instance.noticeLimit.Count)
        {
            noticeSample = NoticeSampleManager.Instance.getNoticeSampleBySid(NoticeManagerment.Instance.noticeLimit[index].sid);
            if (noticeSample != null && noticeSample.name.Contains(LanguageConfigManager.Instance.getLanguage("AlchemyContent_continueButton")))
            {
                lianjinSid = noticeSample.sid;
                inter      = NoticeManagerment.Instance.noticeLimit[index].integral;
                RankAward rankAward = LucklyActivityAwardConfigManager.Instance.updateAwardDateByIntegral(lianjinSid, inter);
                if (rankAward != null)
                {
                    ListKit.AddRange(showPrizes, AllAwardViewManagerment.Instance.exchangeArrayToList(rankAward.prizes));
                }
                NoticeManagerment.Instance.noticeLimit.RemoveAt(index);
                index--;
            }
            index++;
        }
        if (lianjinSid != 0)
        {
            (FPortManager.Instance.getFPort("LuckyXianshiFPort") as LuckyXianshiFPort).access(lianjinSid, setIntegralRank, 4);
        }
    }
    /** 更新排行榜文本 */
    private void updateRankText()
    {
        int       minIntegral = 0;
        RankAward rankAward   = LucklyActivityAwardConfigManager.Instance.getFirstSource(openType);

        if (rankAward != null)
        {
            minIntegral = rankAward.needSource;
        }
//		if(openType ==2)
        rankTextLabel.text = LanguageConfigManager.Instance.getLanguage("luckinfo", Convert.ToString(minIntegral));
    }
Example #5
0
    //得到积分奖励
    public RankAward getSourceByIntegral(int type, int integral)
    {
        RankAward tmp = null;
        int       cur = 0;

        for (int i = 0; i < sourceList.Count; i++)
        {
            if (sourceList[i].noticeSid == type && sourceList[i].needSource >= integral && sourceList[i].needSource > cur)
            {
                tmp = sourceList[i];
                cur = sourceList[i].needSource;
            }
        }
        return(tmp);
    }
Example #6
0
    private void parseSource(string str)
    {
        RankAward bb = new RankAward();

        String[] strArr = str.Split('|');
        bb.type       = StringKit.toInt(strArr[0]);
        bb.noticeSid  = StringKit.toInt(strArr[1]);     //0是装备积分 1是卡片积分
        bb.needSource = StringKit.toInt(strArr[2]);
        bb.awardSid   = StringKit.toInt(strArr[3]);
        bb.prizes     = parsePrizes(strArr[4]);
        if (sourceList == null)
        {
            sourceList = new List <RankAward> ();
        }
        sourceList.Add(bb);
    }
Example #7
0
    private void parseRink(string str)
    {
        RankAward bb = new RankAward();

        String[] strArr = str.Split('|');
        bb.type      = StringKit.toInt(strArr[0]);
        bb.noticeSid = StringKit.toInt(strArr[1]);      //0是装备积分 1是卡片积分(活动Sid)
        bb.rinkNum   = StringKit.toInt(strArr[2]);
        bb.dec       = strArr[3];
        bb.prizes    = parsePrizes(strArr[4]);
        if (list == null)
        {
            list = new List <RankAward> ();
        }
        list.Add(bb);
    }
Example #8
0
    /** 更新描述 */
    private void updateDescText()
    {
        int       minIntegral = 0;
        RankAward sourceAward = LucklyActivityAwardConfigManager.Instance.getFirstSource(notice.sid);

        if (sourceAward != null)
        {
            minIntegral = sourceAward.needSource;
        }
        if (luckySample.idsType == "2")
        {
            descText.text = LanguageConfigManager.Instance.getLanguage("luckyEquipContent_desc", Convert.ToString(minIntegral));
        }
        else if (luckySample.idsType == "3" || luckySample.idsType == "4")
        {
            descText.text = luckySample.luckyPoints [0].Replace('~', '\n');
        }
    }
 /** 更新积分条目 */
 private void updateSource(RankAward tl)
 {
     resetSprite();
     if (!tl.isAward)
     {
         uncomplate.SetActive(true);
     }
     else
     {
         complated.SetActive(true);
     }
     sourceNum.text = tl.needSource.ToString();
     Utils.DestoryChilds(content.gameObject);
     for (int i = 0; i < tl.prizes.Length; i++)
     {
         PrizeSample ps  = tl.prizes[i];
         GameObject  obj = NGUITools.AddChild(content.gameObject, goodsViewPrefab);
         GoodsView   sc  = obj.GetComponent <GoodsView>();
         sc.init(ps);
         sc.fatherWindow = winn;
         content.GetComponent <UIGrid>().repositionNow = true;
     }
 }
 /// <summary>
 /// 更新排行条目
 /// </summary>
 /// <param name="tl">Tl.</param>
 private void updateRank(RankAward tl)
 {
     if (tl.rinkNum == 1)
     {
         rinkNum.gameObject.SetActive(false);
         firstAwardLogo.gameObject.SetActive(true);
     }
     else
     {
         rinkNum.gameObject.SetActive(true);
         firstAwardLogo.gameObject.SetActive(false);
         rinkNum.text = tl.dec;
     }
     Utils.DestoryChilds(content.gameObject);
     for (int i = 0; i < tl.prizes.Length; i++)
     {
         PrizeSample ps  = tl.prizes[i];
         GameObject  obj = NGUITools.AddChild(content.gameObject, goodsViewPrefab);
         GoodsView   sc  = obj.GetComponent <GoodsView>();
         sc.init(ps);
         sc.fatherWindow = winn;
         content.GetComponent <UIGrid>().repositionNow = true;
     }
 }
 /// <summary>
 /// 更新奖励条目
 /// </summary>
 /// <param name="tl">排行奖励</param>
 /// <param name="win">父窗口</param>
 /// <param name="source">积分</param>
 public void updateAwardItem(RankAward tl, WindowBase win, int source)
 {
     winn     = win;
     mySource = source;
     updateSource(tl);
 }
 /// <summary>
 /// 更新奖励条目
 /// </summary>
 /// <param name="tl">排行奖励</param>
 /// <param name="win">父窗口</param>
 public void updateAwardItem(RankAward tl, WindowBase win)
 {
     winn = win;
     updateRank(tl);
 }