Ejemplo n.º 1
0
    /** 领取奖励 */
    public void receiveAward(PrizesGridItem gridItem, object awardObj)
    {
        if (!(awardObj is Vip))
        {
            return;
        }
        Vip activeVip = awardObj as Vip;

        if (UserManager.Instance.self.vipLevel >= activeVip.vipLevel)
        {
            /** 检查仓库容量是否可以接受奖励*/
            string checkResult = "";
            if (StorageManagerment.Instance.checkStoreFull(gridItem.getPrizes(), out checkResult))
            {
                UiManager.Instance.createMessageLintWindow(checkResult + LanguageConfigManager.Instance.getLanguage("storeFull_msg_01"));
                return;
            }
            VipFPort port = FPortManager.Instance.getFPort("VipFPort") as VipFPort;
            port.get_gift(() => {
                PrizeSample[] ps = VipManagerment.Instance.getVipbyLevel(activeVip.vipLevel).prizes;
                UiManager.Instance.createPrizeMessageLintWindow(ps);
                bool isOpenHeroRoad = HeroRoadManagerment.Instance.isOpenHeroRoad(ps);
                if (isOpenHeroRoad)
                {
                    UiManager.Instance.openDialogWindow <MessageLineWindow>((win) => {
                        win.Initialize(LanguageConfigManager.Instance.getLanguage("HeroRoad_open"));
                    });
                }
                if (fatherWindow is VipAwardViewWindow)
                {
                    VipAwardViewWindow vipwin = fatherWindow as VipAwardViewWindow;
                    vipwin.updateUI();
                }
            }, VipManagerment.Instance.getVipbyLevel(activeVip.vipLevel).vipAwardSid);
        }
        else
        {
            UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("s0316"));
        }
    }
Ejemplo n.º 2
0
 //展示界面点击领取
 private void getVipAward()
 {
     //vip等级允许领取
     //if(true) 当从vipAwardWindow领取时
     if (UserManager.Instance.self.vipLevel >= ActiveShowItem.getVip().vipLevel)
     {
         VipFPort port = FPortManager.Instance.getFPort("VipFPort") as VipFPort;
         port.get_gift(() => {
             UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                 win.Initialize(LanguageConfigManager.Instance.getLanguage("s0120"));
                 bool isOpenHeroRoad = checkOpenHeroRoad(VipManagerment.Instance.getVipbyLevel(ActiveShowItem.getVip().vipLevel).prizes);
                 if (isOpenHeroRoad)
                 {
                     win.Initialize(LanguageConfigManager.Instance.getLanguage("HeroRoad_open"));
                 }
             });
             updateVipAwardInfo();
         }, VipManagerment.Instance.getVipbyLevel(ActiveShowItem.getVip().vipLevel).vipAwardSid);
     }
     else
     {
         UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("s0316"));
     }
 }