Пример #1
0
    private void CopyUserId()
    {
        string     result = string.Format(_id.text);
        TextEditor editor = new TextEditor();

        editor.content = new GUIContent(result);
        editor.OnFocus();
        editor.Copy();
        FlowText.ShowMessage(I18NManager.Get("GameMain_CopyIdSucceed"));
    }
Пример #2
0
    private void OnMyBuyElementHandler(BuyElementRes res)
    {
        Debug.Log("OnMyBuyElementHandler");
        GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
        GlobalData.DiaryElementModel.UpdateElement(res.UserElement.ElementId, res.UserElement.Num);
        ElementPB pb = GlobalData.DiaryElementModel.GetElementRuleById(res.UserElement.ElementId);

        CurLoveDiaryEditView.UpdateItemState(pb);
        FlowText.ShowMessage(I18NManager.Get("Common_BuySucceed"));// ("购买成功!");
    }
Пример #3
0
    public static void ShowPropDesc(RewardVo vo)
    {
        Debug.LogWarning("id:" + vo.Id + " res:" + vo.Resource);
        var desc = ClientData.GetItemDescById(vo.Id, vo.Resource);

        if (desc != null)
        {
            FlowText.ShowMessage(desc.ItemDesc);
        }
    }
Пример #4
0
 /// <summary>
 /// 祈福按钮按下
 /// </summary>
 /// <param name="eventData"></param>
 private void OnBlessingDown(PointerEventData eventData)
 {
     if (GlobalData.PlayerModel.PlayerVo.Gem < _curVisitVo.BlessCost)
     {
         FlowText.ShowMessage(I18NManager.Get("Shop_NotEnoughGem"));
         return;
     }
     isButtonDown = true;
     SetButtonHide();
 }
 private void GetTasteCardCallBack(UseVipExperienceRes res)
 {
     FlowText.ShowMessage(I18NManager.Get("Activity_UseVipCardSuccess"));
     GlobalData.PropModel.UpdateProps(new [] { res.UserItem });
     GlobalData.PlayerModel.PlayerVo.UserMonthCard = res.UserMonthCard;
     EventDispatcher.TriggerEvent(EventConst.RefreshActivityImageAndActivityPage);
     //刷新UI!
     View.SetData(_shopModel);
     LoadingOverlay.Instance.Hide();
 }
Пример #6
0
    private void OnUpgradeSupporter(UpgradeDepartmentsRes res)
    {
        LoadingOverlay.Instance.Hide();
        _model.Update(res.MyDepartments);
        GlobalData.PropModel.UpdateProps(new [] { res.UserItem });
        //FlowText.ShowMessage("使用道具成功");
        FlowText.ShowMessage(I18NManager.Get("Supporter_Hint10"));
        View.SetData(_model, res.MyDepartments.DepartmentType);
//		Debug.LogError(res.UserItem);
    }
Пример #7
0
    private void OnElementItemClick(int id)
    {
        Debug.Log("OnElementItemClick........................ id " + id);

        ElementPB elementRule = CalendarDetailVo.GetElementRuleById(id);


        if (GlobalData.DiaryElementModel.IsCanUseElement(id)) //表示需要购买
        {
            if (_curCalendarDetailVo.CurDiaryElementCount.IsUpperLimited(elementRule.ElementType))
            {
                FlowText.ShowMessage(I18NManager.Get("LoveDiary_Hint6"));// ("已达上限!");
                return;
            }

            if (elementRule.ElementType == ElementTypePB.Label)
            {
                CurLoveDiaryEditView.CurLabelElementId = id;
            }
            else
            {
                CurLoveDiaryEditView.AddElement(GetNewDiaryElementPB(id), false);
            }
            _curCalendarDetailVo.CurDiaryElementCount.AddCount(elementRule.ElementType);
            CurLoveDiaryEditView.OperateBottom(false);
            IsModify = true;
        }
        else
        {
            string stype = "";
            switch (elementRule.ElementType)
            {
            case ElementTypePB.Bg:
                stype = I18NManager.Get("LoveDiary_Background");    //"背景";
                break;

            case ElementTypePB.Image:
                stype = I18NManager.Get("LoveDiary_Tags");    //"贴纸";
                break;
            }
            string str = I18NManager.Get("LoveDiary_Hint12") + elementRule.UnlockClaim.Gem + I18NManager.Get("LoveDiary_Hint7") + stype;
            PopupManager.ShowConfirmWindow(str).WindowActionCallback = evt =>
            {
                if (evt != WindowEvent.Ok)
                {
                    return;
                }

                BuyElementReq req = new BuyElementReq();
                req.ElementId = id;
                var dataBytes = NetWorkManager.GetByteData(req);
                NetWorkManager.Instance.Send <BuyElementRes>(CMD.DIARYC_ELEMENTS_BUY, dataBytes, OnMyBuyElementHandler);
            };
        }
    }
 /// <summary>
 /// 跳转到送礼的窗口
 /// </summary>
 private void LevelUpDisiposition()
 {
     if (!GuideManager.IsOpen(ModulePB.Favorability, FunctionIDPB.FavorabilityGifts))
     {
         string desc = GuideManager.GetOpenConditionDesc(ModulePB.Favorability, FunctionIDPB.FavorabilityGifts);
         FlowText.ShowMessage(desc);
         return;
     }
     jumpIndex = curIndex;
     SendMessage(new Message(MessageConst.MODULE_DISIPOSITION_SHOW_GIVEGIFTS, false));
 }
Пример #9
0
    private void OnGetMailClearRes(MailClearRes res)
    {
        foreach (var t in res.UserMails)
        {
            _model.DeleteUserMails(t.Id);
        }

        Debug.LogError("用户的邮件数量===>" + _model.UserMails.Count);
        Winodw.SetData(_model.UserMailState, _model.UserMails);
        FlowText.ShowMessage(I18NManager.Get("Mail_DeletSucceed"));
    }
 private void GetGrowthFund(GrowthFundAwardRes res)
 {
     FlowText.ShowMessage(I18NManager.Get("Task_ReceiveRewardSuccess"));
     RewardUtil.AddReward(res.Awards);
     //GlobalData.ActivityModel.UpdateGrowthData(res.UserGrowthFund);
     _growthCapitalModel.UpdateGrowthData(res.UserGrowthFund);
     _growthCapitalModel.GrowthFunVos.Sort();
     View.SetData(_growthCapitalModel.GrowthFunVos);
     LoadingOverlay.Instance.Hide();
     SendMessage(new Message(MessageConst.CMD_ACTIVITY_REFRESH_ACTIVITYTOGGLE_REDDOT));
 }
Пример #11
0
    private void BuyGold(GameObject go)
    {
        AudioManager.Instance.PlayEffect(AudioManager.Instance.DefaultButtonEffect);
        if (!GuideManager.IsPass1_9())
        {
            FlowText.ShowMessage(I18NManager.Get("Guide_Battle6", "1-9"));
            return;
        }

        SendMessage(new Message(MessageConst.CMD_MAIN_SHOW_BUY_GOLD));
    }
Пример #12
0
 private void SetMaskOnClick()
 {
     for (int i = 0; i < _togglesTran.childCount; i++)
     {
         var mask = _togglesTran.GetChild(i).Find("Mask").gameObject;
         PointerClickListener.Get(mask).onClick = go =>
         {
             FlowText.ShowMessage(I18NManager.Get("StarActivity_Hint"));
         };
     }
 }
Пример #13
0
    private void Awake()
    {
        _consumeItemImg = transform.GetRawImage("ConsumeItem/Icon");
        _consumeItemNum = transform.GetText("ConsumeItem/Num");
        _parent         = transform.Find("ScrollRect/Content");

        PointerClickListener.Get(transform.Find("ConsumeItem").gameObject).onClick = go =>
        {
            FlowText.ShowMessage(I18NManager.Get("ActivityMusicTemplate_ExchangeShopTitle"));
        };
    }
 private void OnRewardClick()
 {
     PointerClickListener.Get(_item.gameObject).onClick = go =>
     {
         var desc = ClientData.GetItemDescById(_data.Rewards[0].Id, _data.Rewards[0].Resource);
         if (desc != null)
         {
             FlowText.ShowMessage(desc.ItemDesc);
         }
     };
 }
Пример #15
0
    private void OnCloth()
    {
        if (!GuideManager.IsOpen(ModulePB.Favorability, FunctionIDPB.FavorabilityClothes))
        {
            string desc = GuideManager.GetOpenConditionDesc(ModulePB.Favorability, FunctionIDPB.FavorabilityClothes);
            FlowText.ShowMessage(desc);
            return;
        }

        SendMessage(new Message(MessageConst.MODULE_DISIPOSITION_SHOW_CLOTHPANEL_BTN));
    }
Пример #16
0
//    private void ShowReward()
//    {
//        if (_model.Mission.Status == MissionStatusPB.StatusUnclaimed) //未领取
//        {
//            LoadingOverlay.Instance.Show();
//
//            byte[] data = NetWorkManager.GetByteData(new CardMemoriesMissionReceiveReq
//            {
//                MissionId = _model.Mission.MissionId
//            });
//            NetWorkManager.Instance.Send<CardMemoriesMissionReceiveRes>(CMD.CARDMEMORIESC_CARDMEMORIESMISSIONRECEIVE,
//                data,
//                res =>
//                {
//                    LoadingOverlay.Instance.Hide();
//
//                    RecolletionMissionWindow win =
//                        PopupManager.ShowWindow<RecolletionMissionWindow>(
//                            "Recollection/Prefabs/RecolletionMissionWindow");
//
//                    win.ShowReward(res.Award);
//                    win. MaskColor = new Color(0, 0, 0, 0.6f);
//                    UpdataAward(res.Award);
//                    View.SetRewardBtn(MissionStatusPB.StatusBeRewardedWith);
//
//
//                });
//        }
//        else  //领取或者未完成
//        {
//            RecolletionMissionWindow win =
//                PopupManager.ShowWindow<RecolletionMissionWindow>("Recollection/Prefabs/RecolletionMissionWindow");
//            win.MaskColor = new Color(0, 0, 0, 0.6f);
//            win.SetData(_model.GetCurrentMission(), _model.Mission);
//        }
//    }

    /// <summary>
    /// 更新奖励道具
    /// </summary>
//    private void UpdataAward(RepeatedField<AwardPB> awardPbs)
//    {
//
//        for (int i = 0; i < awardPbs.Count; i++)
//        {
//            switch (awardPbs[i].Resource)
//            {
//                case ResourcePB.Item:
//                    GlobalData.PropModel.AddProp(awardPbs[i]);
//                    break;
//                case ResourcePB.Power:
//                    GlobalData.PlayerModel.AddPower(awardPbs[i].Num);
//                    break;
//                case ResourcePB.Gem:
//                    GlobalData.PlayerModel.UpdateUserGem(awardPbs[i].Num);
//                    break;
//            }
//        }
//
//
//    }



    private void OnBuyEnergySuccess(BuyMemoriesConsumeRes res)
    {
        SdkHelper.StatisticsAgent.OnPurchase("星缘回忆碎片购买", _model.GetEnergyGem());


        GlobalData.PlayerModel.UpdateUserPower(res.UserPower);
        GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);

        FlowText.ShowMessage(I18NManager.Get("Common_BuySucceed"));

        _model.UpdateInfo(res.UserCardMemoriesInfo);
    }
Пример #17
0
    /// <summary>
    /// 购买礼包
    /// </summary>
    /// <param name="product"></param>
    /// <param name="payType"></param>
    public void PayGift(ProductVo product, PayAgent.PayType payType = PayAgent.PayType.None)
    {
        this.payType = payType;

        if (product.ProductType != CommodityTypePB.Gift)
        {
            FlowText.ShowMessage("商品类型不是礼包!");
            return;
        }

        CreateOrder(product);
    }
Пример #18
0
    private void OnResolve(ResolveRes res)
    {
        AudioManager.Instance.PlayEffect("cardResolve");
        FlowText.ShowMessage(I18NManager.Get("Card_ResolveSuccess"));
        GlobalData.PropModel.UpdateProps(res.UserItems.ToArray());

        GlobalData.CardModel.UpdateUserCards(res.UserCards.ToArray());

        View.SetData(GlobalData.CardModel.ResolveCardList, GlobalData.CardModel.CurPlayerPb);

        View.InitProps();
    }
Пример #19
0
    /// <summary>
    /// 处理View消息
    /// </summary>
    /// <param name="message"></param>
    public override void OnMessage(Message message)
    {
        string name = message.Name;

        object[] body = message.Params;
        switch (name)
        {
        case MessageConst.CMD_CARD_UPGRADE_STAR:
            UpgradeStar((UserCardVo)message.Body);
            break;

        case MessageConst.CMD_CARD_EVOLUTION:
            OpenEvoWindow((UserCardVo)body[0]);
            break;

        case MessageConst.CMD_CARD_LOVE:
            //现在就要跳转到恋爱模块

            ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_LOVEAPPOINTMENT, false, true, (AppointmentRuleVo)body[0]);

            break;

        case MessageConst.CMD_CARD_UPGRADE_LEVEL:
            UserCardVo vo;
            vo = (UserCardVo)body[0];
            if (body.Length > 1 && (int)body[2] <= 0)
            {
                FlowText.ShowMessage(I18NManager.Get("LoveAppointment_Hint5"));
                DoGiftTrigger(vo.CardVo.Player);
                return;
            }
            AddExp(vo, (int)body[1], (int)body[2]);
            break;

        case MessageConst.CMD_CARD_UPGRADE_ONELEVEL:
            UpgradeOneLevel((UserCardVo)body[0]);
            break;

        case MessageConst.CMD_CARD_GET_MORE_PROPS:
            ShowObtainWindow((UpgradeStarRequireVo)body[0], (int)body[1]);
            break;

        case MessageConst.CMD_CARD_CHOOSE_EVO:
            ShowChooseEvo((int[])body[0]);
            break;

        case MessageConst.CMD_CARD_SHOPSTARUPPREVIEW:
            //ShowStarUpPreview((UserCardVo)body[0]);

            ShowCardAwardPreview((UserCardVo)body[0]);
            break;
        }
    }
Пример #20
0
        private static void OnError(DownloadItem item)
        {
            Debug.LogError("下载压缩包失败:" + item.Url + " ErrorText:" + item.ErrorText);

            FlowText.ShowMessage(I18NManager.Get("Download_ErrorAndRetry"));

            if (_onError != null)
            {
                _onError.Invoke(item.Url + " " + item.ErrorText);
                _onError = null;
            }
        }
Пример #21
0
 private void SendGift()
 {
     if (!GuideManager.IsOpen(ModulePB.Favorability, FunctionIDPB.FavorabilityGifts))
     {
         string desc = GuideManager.GetOpenConditionDesc(ModulePB.Favorability, FunctionIDPB.FavorabilityGifts);
         FlowText.ShowMessage(desc);
         return;
     }
     _btn.gameObject.SetActive(false);
     //发送进入送礼界面的消息
     SendMessage(new Message(MessageConst.CMD_FACORABLILITY_ENTER_SEND_GIVE_GIFTS, Message.MessageReciverType.DEFAULT, _redHeart.gameObject, false));
 }
Пример #22
0
    private void Play(int times)
    {
        if (_userCardVo == null)
        {
            FlowText.ShowMessage(I18NManager.Get("Recollection_Hint2"));//("请选择将回忆的星缘");
            return;
        }


        SendMessage(new Message(MessageConst.MODULE_RECOLLECTION_PLAY, Message.MessageReciverType.CONTROLLER, times,
                                _userCardVo));
    }
Пример #23
0
 private void GotoCard()
 {
     if (_curCardVo == null)
     {
         FlowText.ShowMessage(I18NManager.Get("FavorabilityMain_GUESSStaredge")); //暂无星缘
     }
     else
     {
         jumpIndex = curIndex;
         SendMessage(new Message(MessageConst.CMD_FACORABLILITY_JUMPTOCRADS, _curCardVo));
     }
 }
Пример #24
0
    public void SetData(FirstRechargeVO vO)
    {
        _icon.texture = ResourceManager.Load <Texture>(vO.RewardVo.IconPath, ModuleConfig.MODULE_ACTIVITY);
        _icon.GetComponent <RectTransform>().sizeDelta = new Vector2(200, 200);
        _num.text = vO.RewardVo.Num.ToString();


        if (vO.RewardVo.Resource != ResourcePB.Card)
        {
            PointerClickListener.Get(gameObject).onClick = go => { FlowText.ShowMessage(ClientData.GetItemDescById(vO.RewardVo.Id, vO.RewardVo.Resource).ItemDesc); };
        }
    }
Пример #25
0
    private void DressUpSucceed(DressUpRes res)
    {
        GlobalData.FavorabilityMainModel.UpdataCurrentRoleVo(res.UserFavorability);
        GlobalData.PropModel.UpdateProps(res.UserItems);
        GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);

        var curRoleVo = GlobalData.FavorabilityMainModel.CurrentRoleVo;

        View.SetInfo(curRoleVo, _model.GetBgImagePath(curRoleVo.Apparel[1]));

        FlowText.ShowMessage(I18NManager.Get("Common_SaveSucceed"));
    }
Пример #26
0
 private void RefreshBtn()
 {
     if (_pb == null)
     {
         FlowText.ShowMessage("今日无剩余刷新次数");
     }
     else
     {
         //发送打开确认弹窗
         SendMessage(new Message(MessageConst.CMD_TRAININGROOM_EXCHANGESHOP_OPEN_REFRESH_NOTARIZE_WINDOW));
     }
 }
Пример #27
0
    private void OnCompound(CompoundRes res)
    {
        //同步版号包
        //GlobalData.CardModel.UpdateUserCardsByIdAndNum(res.UserCards[0].CardId,res.UserCards[0].Num);
//		var usercardvo=new UserCardPB[]{};
//		for (int i = 0; i < res.UserCards.Count; i++)
//		{
//			usercardvo[i] = res.UserCards[i].Clone();
//		}


        GlobalData.CardModel.UpdateUserCards(res.UserCards.ToArray());


        GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);

        for (int i = 0; i < _puzzleList.Count; i++)
        {
            if (_puzzleList[i].CardId == res.UserPuzzle.CardId)
            {
                if (res.UserPuzzle.Num == 0)
                {
                    _puzzleList.RemoveAt(i);
                }
                else
                {
                    _puzzleList[i].Num = res.UserPuzzle.Num;
                }
                break;
            }
        }
        SendMessage(new Message(MessageConst.CMD_CARD_REFRESH_USER_CARDS));
        FlowText.ShowMessage(I18NManager.Get("Card_Compound"));
        Action finish = () =>
        {
            AudioManager.Instance.PlayEffect("compoundPuzzle");

            if (GlobalData.CardModel.GetUserCardById(res.UserPuzzle.CardId).CardVo.Credit <= CreditPB.Sr)
            {
                EventDispatcher.TriggerEvent(EventConst.ShowStoreScore);
            }
        };
        List <AwardPB> Awards = new List <AwardPB>();
        AwardPB        pb     = new AwardPB();

        pb.ResourceId = res.UserPuzzle.CardId;
        pb.Resource   = ResourcePB.Card;
        Awards.Add(pb);
        ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD, false, false, "DrawCard_CardShow", Awards, finish);
        _puzzleList.Sort();
        View.SetData(_puzzleList);
    }
Пример #28
0
 private void GetPowerResCallback(GetPowerRes res)
 {
     LoadingOverlay.Instance.Hide();
     FlowText.ShowMessage(I18NManager.Get("Friend_ReceiveSuccess"));
     _friendModel.UpdateFriendInfo(res.UserFriend);
     _friendModel.DailyPower = res.DailyPower;
     FriendsMainView.SetData(_friendModel);
     GlobalData.PlayerModel.AddPower(1);
     if (_friendModel.GetPowerSendFriend().Count == 0)
     {
         GlobalData.DepartmentData.CanGetFriendsPower = false;
     }
 }
Пример #29
0
 private void SendAllPowerCallback(SendAllPowerRes res)
 {
     LoadingOverlay.Instance.Hide();
     //FlowText.ShowMessage(I18NManager.Get("Friend_ReceiveSuccess"));
     _friendModel.UpdateFriendInfo(res.UserFriends);
     GlobalData.PlayerModel.UpdateUserMoney(res.UserMoney);
     FriendsMainView.SetData(_friendModel);
     FlowText.ShowMessage("成功赠送体力");
     if (_friendModel.GetPowerSendFriend().Count == 0)
     {
         GlobalData.DepartmentData.CanGetFriendsPower = false;
     }
 }
Пример #30
0
        public override void OnCheckOrdersSuccess(CheckOrderRess resList)
        {
            base.OnCheckOrdersSuccess(resList);
            if (Balance > 0)
            {
                FlowText.ShowMessage(I18NManager.Get("Pay_TencentBalance"));

                foreach (var res in resList.CheckOrderRess_)
                {
                    Balance -= res.Amount;
                }
            }
        }