예제 #1
0
 public void OnGiveItemBtnClick()
 {
     GlobalMenuManager.Instance.RemoveCache("LTBountyTaskConversationUI");
     if (EB.Time.Now > mNextRequestTime)
     {
         MessageTemplateManager.ShowMessage(eMessageUIType.MessageDialogue_1, EB.Localizer.GetString("ID_codefont_in_LTBountyTaskConversationController_6504"), delegate(int result) {
             if (result == 0)
             {
                 OnCancelButtonClick();
             }
         });
         return;
     }
     if (mItemEnough)
     {
         if (BtnClickLimit)
         {
             return;
         }
         BtnClickLimit = true;
         GiveReq.parameters[0].parameter = LTBountyTaskHudController.TaskID().ToString();
         GiveReq.SendRequest();
     }
     else
     {
         MessageTemplateManager.ShowMessage(eMessageUIType.FloatingText, EB.Localizer.GetString("ID_codefont_in_LTBountyTaskConversationController_6902"));
     }
 }
예제 #2
0
        void InitSpecialEventData()
        {
            mGetRewardsByGiveItem = LTBountyTaskHudController.GetRewardDatas();
            Hashtable giveItemData;

            DataLookupsCache.Instance.SearchDataByID <Hashtable>(string.Format("tasks.{0}.event_count.give_item", LTBountyTaskHudController.TaskID()), out giveItemData);
            int itemId                  = EB.Dot.Integer("item_id", giveItemData, 0);
            int needNum                 = EB.Dot.Integer("target_num", giveItemData, 0);
            int haveItemNum             = GameItemUtil.GetInventoryItemNum(itemId);
            EconemyItemTemplate itemTpl = EconemyTemplateManager.Instance.GetItem(itemId);

            ContentLabel.Text = string.Format(EB.Localizer.GetString("ID_codefont_in_LTBountyTaskConversationController_2609"), needNum, itemTpl.Name);
            ContentLabel.mDMono.transform.GetComponent <UIWidget>().width = ContentWidth - GiveItem.Frame.width;
            GiveItem.LTItemData = new LTShowItemData(itemId.ToString(), needNum, LTShowItemType.TYPE_GAMINVENTORY, false);

            mItemEnough         = haveItemNum >= needNum;
            GiveItem.Count.text = string.Format("[{0}]{1}[-]/{2}", mItemEnough ? LT.Hotfix.Utility.ColorUtility.GreenColorHexadecimal : LT.Hotfix.Utility.ColorUtility.RedColorHexadecimal, haveItemNum, needNum);
            LTPartnerDataManager.Instance.itemNeedCount = needNum;
            if (mItemEnough)
            {
                SpecialEventFuncNode.transform.GetChild(0).gameObject.CustomSetActive(true);
                SpecialEventFuncNode.transform.GetChild(1).gameObject.CustomSetActive(false);
                SpecialEventFuncNode.GetComponent <UIGrid>().Reposition();
            }
            else
            {
                SpecialEventFuncNode.transform.GetChild(0).gameObject.CustomSetActive(false);
                SpecialEventFuncNode.transform.GetChild(1).gameObject.CustomSetActive(true);
                SpecialEventFuncNode.GetComponent <UIGrid>().Reposition();
            }
        }
예제 #3
0
 public void RequestBountyTaskCombat(System.Action <Response> callback)
 {
     EB.Sparx.Request request = m_endPoint.Post("/mhjtasks/startBountyTaskCombat");   ///fastcampaign/requestPvECombatTransition
     request.AddData("task_id", LTBountyTaskHudController.TaskID().ToString());
     request.AddData("mainlandId", MainLandLogic.GetInstance().CurrentSceneName);
     m_endPoint.Service(request, callback);
 }
예제 #4
0
        public IEnumerator CreateBuddyModel()
        {
            m_LobbyTexture.uvRect = new Rect(0.0f, 0.0f, 1.0f, 1.0f);
            var charTpl  = LTBountyTaskHudController.GetFirstMonsterInfoTpl();
            var heroInfo = Hotfix_LT.Data.CharacterTemplateManager.Instance.GetHeroInfo(charTpl.id);

            ModelName = charTpl.model_name;
            LTUIUtil.SetText(SpeakNameLabel, charTpl.name);
            if (!string.IsNullOrEmpty(heroInfo.portrait))
            {
                m_LobbyTexture.gameObject.CustomSetActive(false);
                m_SpriteIcon.gameObject.CustomSetActive(true);
                m_SpriteIcon.spriteName = heroInfo.portrait;
                m_IsInited = true;
                TweenPosition TP = m_SpriteIcon.transform.GetComponent <TweenPosition>();
                if (TP != null)
                {
                    TP.PlayForward();
                }
            }
            else
            {
                m_SpriteIcon.gameObject.CustomSetActive(false);
                m_LobbyTexture.gameObject.CustomSetActive(true);
                LobbyCameraData lobby_cam = heroInfo.lobby_camera;

                Loader = new GM.AssetLoader <GameObject>("UI3DLobby", controller.gameObject);
                UI3DLobby.Preload(ModelName);
                yield return(Loader);

                if (Loader.Success)
                {
                    Loader.Instance.transform.parent = m_LobbyTexture.transform;
                    Lobby = Loader.Instance.GetMonoILRComponent <UI3DLobby>();
                }

                if (Lobby != null)
                {
                    Lobby.VariantName = ModelName;

                    Lobby.SetCameraPos(lobby_cam.Position);
                    Lobby.SetCameraRot(lobby_cam.Rotation);
                    Lobby.SetCameraMode(lobby_cam.Size, lobby_cam.Orthographic);

                    Lobby.ConnectorTexture = m_LobbyTexture;

                    while (Lobby.Current.character == null)
                    {
                        yield return(null);
                    }
                    m_IsInited = true;
                    TweenPosition TP = m_LobbyTexture.transform.GetComponent <TweenPosition>();
                    if (TP != null)
                    {
                        TP.PlayForward();
                    }
                }
            }
        }
예제 #5
0
 public override void OnFetchData(EB.Sparx.Response res, int reqInstanceID)
 {
     if (res.sucessful)
     {
         VictoryAnimNode.CustomSetActive(true);
         FusionAudio.PostEvent("MUS/CombatView/Stinger/Victory", controller.gameObject, true);
         LTBountyTaskHudController.DeleteMonster(mNpcLocator);
         GameDataSparxManager.Instance.ProcessIncomingData(res.result, true);
     }
     else
     {
         res.CheckAndShowModal();
         BtnClickLimit = false;
     }
 }
예제 #6
0
        void AddTaskRefreshExcuter()
        {
            string taskRefreshTime;

            DataLookupsCache.Instance.SearchDataByID <string>("userTaskStatus.refreshTaskTime", out taskRefreshTime);
            Hashtable rule = Johny.HashtablePool.Claim();

            rule.Add("regular", TimerScheduler.AmendCronFormat(taskRefreshTime));
            rule.Add("url", "/mhjtasks/refreshTaskState");
            CronRefreshExcuter excuter = new CronRefreshExcuter("refreshTaskState");

            excuter.Init(rule, delegate(Hashtable hash) {
                string npcLocator;
                DataLookupsCache.Instance.SearchDataByID <string>(string.Format("tasks.{0}.event_count.locator", LTBountyTaskHudController.TaskID()), out npcLocator);
                LTBountyTaskHudController.DeleteMonster(npcLocator);
                DataLookupsCache.Instance.CacheData("user_prize_data.taskliveness_reward", string.Empty);      //重置任务完成情况
                DataLookupsCache.Instance.CacheData("user_prize_data.taskliveness.curr", 0);
                DataLookupsCache.Instance.CacheData("user_prize_data.taskliveness_week_reward", string.Empty); //重置任务完成情况
                DataLookupsCache.Instance.CacheData("user_prize_data.taskweekliveness.curr", 0);
                DataLookupsCache.Instance.CacheData("task_refresh", 1);
            });
            AddCronRefreshExcuter(excuter);
        }
예제 #7
0
        public override void SetMenuData(object param)
        {
            //Bug解决
            mDialogueFinishCallback = null;
            ShowOK        = false;
            BtnClickLimit = false;

            mNextRequestTime = AutoRefreshingManager.Instance.GetCronRefreshExcuter("refreshTaskState").NextRequestTime;

            DataLookupsCache.Instance.SearchDataByID <string>(string.Format("tasks.{0}.event_count.locator", LTBountyTaskHudController.TaskID()), out mNpcLocator);
            mDialogueFinishCallback = param as System.Action;
            if (mDialogueFinishCallback != null)
            {
                InitDialogueData();
                PlayDialogue();
                SpecialEventFuncNode.gameObject.CustomSetActive(false);
                GiveItem.mDMono.gameObject.CustomSetActive(false);
                DialogueBlock.GetComponent <BoxCollider>().enabled = true;
            }
            else
            {
                InitSpecialEventData();
                DialogueBlock.GetComponent <BoxCollider>().enabled = false;
            }
            base.SetMenuData(param);
        }