コード例 #1
0
ファイル: GuidUILogic.cs プロジェクト: kingpowervrg/my_seeker
        public override void OnShow(object param)
        {
            base.OnShow(param);
            m_skip_btn.AddClickCallBack(BtnSkip);
            m_mask.AddClickCallBack(BtnMask);

            m_mask.AddDragStartCallBack(DragStart);
            m_mask.AddDragEndCallBack(DragEnd);
            m_mask.AddDragCallBack(Draging);
            if (param != null)
            {
                GuidMaskCommonData maskData = (GuidMaskCommonData)param;
                m_skip_btn.Visible = maskData.m_confGuid.isSkip;
                m_data             = new GuidUIData(maskData.hasEvent, maskData.m_operaType, maskData.m_TypeValue, maskData.eventPassType);
                InitMask(maskData.m_maskdata);
                InitArt(maskData.m_artPos, maskData.m_confGuid);
            }
            ///////////
            m_mask.RawImage.raycastTarget = (m_data.OperaType != GuidEnum.Guid_DragScene);
            if (m_data.OperaType == GuidEnum.Guid_DragScene)
            {
                EngineCoreEvents.InputEvent.OnSwipeBegin += OnSwipeBegin;
                EngineCoreEvents.InputEvent.OnSwipeEnd   += OnSwipeEnd;
            }
        }
コード例 #2
0
 private void InitListener()
 {
     m_add_btn.AddLongClickCallBack(btnLongAddNumber);
     m_reduce_btn.AddLongClickCallBack(btnReduceNumber);
     //m_add_btn.AddClickCallBack(btnAddNumber);
     m_buy_btn.AddClickCallBack(btnBuy);
 }
コード例 #3
0
 private void InitListener()
 {
     m_one_btn.AddClickCallBack(BtnOne);
     m_twoFirst_btn.AddClickCallBack(BtnTwoFirst);
     m_twoSecond_btn.AddClickCallBack(BtnTwoSecond);
     m_close_btn.AddSelectCallBack(onClickClose);
 }
コード例 #4
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            m_use_btn.AddClickCallBack(btnUse);
            m_buy_btn.AddClickCallBack(btnBuy);
            m_limited_buy_btn.AddClickCallBack(btnBuy);
            GameEvents.BuyEvent.OnShopRes        += OnBuyCallback;
            GameEvents.BuyEvent.OnShopReq        += OnRequestCallback;
            GameEvents.Skill_Event.OnSkillFinish += OneUseReqCallback;

            this.SwitchButton();
            if (ShopType.Vit == m_curShopType)
            {
                if (11 == m_itemdata.m_prop.id)
                {
                    this.m_effect.EffectPrefabName = "UI_zengjiatili_pisa.prefab";
                }
                else if (12 == m_itemdata.m_prop.id)
                {
                    this.m_effect.EffectPrefabName = "UI_zengjiatili_huoguo.prefab";
                }
                else
                {
                    this.m_effect.EffectPrefabName = "UI_zengjiatili_tongyong.prefab";
                }
            }

            this.m_effect.Visible = true;
        }
コード例 #5
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            is_fast_buy = false;

            if (null != param)
            {
                is_fast_buy = (bool)param;
            }
            MainPanelInGameUILogic.Show();


            //MessageHandler.RegisterMessageHandler(MessageDefine.MarkeBuyResponse, OnResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.MarketResponse, OnResponse);
            m_close_btn.AddClickCallBack(btnClose);

            if (!ShopHelper.IsShopDataAvaliable(cate))
            {
                requestData();
            }
            else
            {
                ShopPropData crashdata = ShopHelper.getShopData(cate);
                InitData(crashdata);
            }
        }
コード例 #6
0
        public override void OnShow(object param)
        {
            base.OnShow(param);
            this.m_startComplete = false;
            UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.activity_in, 1.0f, null);

            GameEvents.UIEvents.UI_Activity_Event.OnTweenFinish  += OnTweenFinish;
            GameEvents.UIEvents.UI_Activity_Event.OnClick        += OnClick;
            GameEvents.UIEvents.UI_Activity_Event.OnChooseFinish += OnChooseFinish;

            DragEventTriggerListener.Get(m_scroll_view.gameObject).onDragStart += OnDragStart;


            MessageHandler.RegisterMessageHandler(MessageDefine.SCActivityBaseListResponse, OnResponse);
            m_screenWidth = m_leftPoint_tran.localPosition.x * 2;
            m_startPosX   = m_leftPoint_tran.localPosition.x;
            m_close_btn.AddClickCallBack(OnClose);
            m_delayTime      = m_gridValue.m_delayTime;
            m_chooseQuitTime = m_gridValue.m_chooseQuitTime;
            m_normalQuitTime = m_gridValue.m_normalQuitTime;
            m_GameEffect.EffectPrefabName = "UI_huodong_rukou.prefab";
            CSActivityBaseListRequest req = new CSActivityBaseListRequest();

#if !NETWORK_SYNC || UNITY_EDITOR
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
#else
            GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
#endif
        }
コード例 #7
0
ファイル: CombineView.cs プロジェクト: kingpowervrg/my_seeker
        public override void OnShow(object param)
        {
            base.OnShow(param);

            if (null != param)
            {
                //合成任务指定的合成
                m_fixed_prop_id = (long)param;
            }
            else
            {
                m_fixed_prop_id = CurViewLogic().Fixed_prop_id;
            }

            m_gift_btn.AddClickCallBack(OnGiftClicked);
            m_combine_btn.AddClickCallBack(OnCombineClicked);

            SwitchOutputView(ENUM_COMBINE_TYPE.ALL);

            if (0 != m_fixed_prop_id)
            {
                RefreshLeftToggleByFixedID();
            }
            else
            {
                if (m_left_toggles[0].Checked)
                {
                    m_left_toggles[0].Checked = false;
                }

                m_left_toggles[0].Checked = true;
            }
        }
コード例 #8
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            m_pause_btn.AddClickCallBack(OnBtnGamePauseClick);
            m_input_tex.AddPressUpCallBack(OnTexPointerUp);
            m_input_tex.AddPressDownCallBack(OnTexPointerDown);
            m_input_tex.AddDragCallBack(OnTexDrag);
            m_input_tex.AddDragStartCallBack(OnTexDragStart);
            m_input_tex.AddDragEndCallBack(OnTexDragEnd);
            m_start_view.AddClickCallBack(OnStartViewClicked);
            m_clue_progress_grid.AddClickCallBack(OnProgressClicked);

            m_fly_time_tween_pos.AddTweenCompletedCallback(OnFlyTimeTweenFinished);
            m_start_view_tween_pos.AddTweenCompletedCallback(OnStartViewTweenFinished);

            m_active_item_view_queue.Clear();

            if (null != param)
            {
                List <long> my_param = param as List <long>;
                this.m_scan_id = my_param[0];
            }
            else
            {
                m_scan_id = CurViewLogic().Scan_id;
            }
            Refresh(m_scan_id);

            TimeModule.Instance.SetTimeout(() => { HideStartView(); m_start_view.SetTimeVisible(false); m_fly_time_txt.Visible = true; }, 1.0f);
        }
コード例 #9
0
        public override void OnShow(object param)
        {
            base.OnShow(param);
            m_is_start_timer        = false;
            m_cur_time              = 0.0f;
            is_token_checked        = false;
            GlobalInfo.GAME_NETMODE = GameNetworkMode.Network;
            CommonHelper.ShowLoading(false);

            m_login_btn.AddClickCallBack(OnNormalVersionClicked);
            m_fackbook_btn.AddClickCallBack(OnFBVersionClicked);

            MessageHandler.RegisterMessageHandler(MessageDefine.SCRegGuestResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCIdentifyCheckRepsonse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCPlayerInfoResponse, OnScResponse);
            //MessageHandler.RegisterMessageHandler(MessageDefine.SCPlayerPropResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCFBLoginResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCFBBindResponse, OnScResponse);
            //MessageHandler.RegisterMessageHandler(MessageDefine.SCNoticeListResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCPlayerGuildResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCGetPushResponse, OnScResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCIdentifyCheckMuiltyMessage, OnScResponse);

            this.m_contentLab.Text = LocalizeModule.Instance.GetString("guide_0_05");


            GameEvents.UIEvents.UI_FB_Event.Listen_FbLoginStatusChanged += SetFBBtnIcon;

            if (null != PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD))
            {
                SwitchBtns(ENUM_BTN_TYPE.E_NO_THIRD);
            }
            else
            {
                SwitchBtns(ENUM_BTN_TYPE.E_ALL);
            }

            if (null != param)
            {
                SwitchBtns(ENUM_BTN_TYPE.E_ALL);

                if (ENUM_ACCOUNT_TYPE.E_GUEST == (ENUM_ACCOUNT_TYPE)(param))
                {
                    LoginUtil.OnAccountChangeToGuest();
                    Debug.LogWarning($"FB : GO TO GUEST IN LOGIN third name is {PlayerPrefTool.GetUsername(ENUM_LOGIN_TYPE.E_THIRD)} , logined { FB.IsLoggedIn}");
                    IntervalSetFBBtnIcon(true);
                    //PregameUILogic.instance.Destory();
                    return;
                }
                else
                {
                    LoginUtil.OnAccountNativeLogin((ENUM_ACCOUNT_TYPE)(param));
                }
            }

            SetFBBtnIcon();
            //PregameUILogic.instance.Destory();
            LocalDataManager.Instance.Is_login = true;
        }
コード例 #10
0
 private void InitEventListener()
 {
     m_addNum_btn.AddLongClickCallBack(OnAddNum);
     m_reduceNum_btn.AddLongClickCallBack(OnReduce);
     m_maxNum_btn.AddClickCallBack(OnMax);
     m_yes_btn.AddClickCallBack(OnSure);
     m_close_btn.AddClickCallBack(OnClose);
 }
コード例 #11
0
ファイル: PromoptView.cs プロジェクト: kingpowervrg/my_seeker
        public override void OnShow(object param)
        {
            base.OnShow(param);

            m_ok_btn.AddClickCallBack(OnOkClicked);
            //m_canel_btn.AddClickCallBack(OnCancelClicked);
            //m_close_btn.AddClickCallBack(OnCancelClicked);
        }
コード例 #12
0
ファイル: GiftListUI.cs プロジェクト: kingpowervrg/my_seeker
        public override void OnShow(object param)
        {
            m_receive_all_btn.AddClickCallBack(OnReceiveAllClick);
#if TEST
            this.Refresh();
#else
            m_gift_grid.Clear();
#endif
        }
コード例 #13
0
 private void InitListener()
 {
     for (int i = 0; i < MaxChooseNum; i++)
     {
         setChooseListener(i);
     }
     //m_next_btn.AddClickCallBack(btnNextPart);
     m_chooseRoot_obj.AddClickCallBack(btnNextPart);
     m_textRoot_obj.AddClickCallBack(btnNextPart);
 }
コード例 #14
0
 public override void OnShow(object param)
 {
     base.OnShow(param);
     m_close_btn.AddClickCallBack(OnCloseClicked);
     m_ui_effect.Visible = true;
     if (null != param)
     {
         m_close_act = param as System.Action <UILogicBase>;
     }
 }
コード例 #15
0
ファイル: ShopUILogic.cs プロジェクト: kingpowervrg/my_seeker
        protected override void InitListener()
        {
            base.InitListener();

            MessageHandler.RegisterMessageHandler(MessageDefine.MarketResponse, OnResponse);
            MessageHandler.RegisterMessageHandler(MessageDefine.MarkeFreshResponse, OnResponse);
            GameEvents.BuyEvent.OnShopRes += OnBuyCallback;
            GameEvents.UIEvents.UI_Shop_Event.OnChooseItem += chooseItem;
            GameEvents.BuyEvent.OnShopReq += OnRequestCallback;
            m_reflash_btn.AddClickCallBack(BtnReflash);
        }
コード例 #16
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            MessageHandler.RegisterMessageHandler(MessageDefine.SCCanTaskResponse, OnReponse);

            m_pool_task_btn.AddClickCallBack(OnTaskClicked);
            m_branch_role_task_btn.AddClickCallBack(OnTaskClicked);
            m_branch_tool_task_btn.AddClickCallBack(OnTaskClicked);
            m_pool_reward_btn.AddClickCallBack(OnRewardClicked);
            m_branch_reward_btn.AddClickCallBack(OnRewardClicked);
        }
コード例 #17
0
 public override void OnShow(object param)
 {
     base.OnShow(param);
     m_Close_btn.AddClickCallBack(OnClose);
     m_BG_img.AddClickCallBack(OnClose);
     this.m_canVisible        = true;
     this.OnShowTweenFinished = ShowTweenFinished;
     if (param != null)
     {
         AchievementMsg msg = (AchievementMsg)param;
         SetData(msg);
     }
 }
コード例 #18
0
            public override void OnShow(object param)
            {
                base.OnShow(param);
                m_NextBtn.Visible = false;
                //Debug.Log("OnShow ====== " + Widget.name);
                m_NextBtn.AddClickCallBack(OnNextBtn);
                GameEvents.UIEvents.UI_StartCartoon_Event.OnNextClick += OnNextClick;
#if UNITY_EDITOR
                GameEvents.UIEvents.UI_StartCartoon_Event.OnSkipCurrentCapter += OnSkipCurrentCapter;
#endif
                this.m_childPanels = gameObject.GetComponentsInChildren <StartCartoonDelayTime>();
                this.m_maxTime     = GetComponent <StartCartoonDelayTime>().m_delayTime;
                this.m_lockTime    = Time.time;
            }
コード例 #19
0
 private void RegistListener()
 {
     MessageHandler.RegisterMessageHandler(MessageDefine.LottoBuyResponse, OnResponse);
     MessageHandler.RegisterMessageHandler(MessageDefine.LottoResponse, OnResponse);
     m_page_btn[0].AddChangeCallBack(BtnCoinPage);
     m_page_btn[1].AddChangeCallBack(BtnCashPage);
     m_buy_btn.AddClickCallBack(BtnBuy);
     m_detail_btn.AddClickCallBack(BtnDetail);
     m_close_btn.AddClickCallBack(BtnClose);
     m_detail_root.AddClickCallBack(BtnDetail);
     GameEvents.UIEvents.UI_SLots_Events.OnAgain += OnAgain;
     GameEvents.UIEvents.UI_SLots_Events.OnOK    += OnOK;
     //GameEvents.UIEvents.UI_SLots_Events.OnResultOpen += OnResultOpen;
 }
コード例 #20
0
ファイル: LoseView.cs プロジェクト: kingpowervrg/my_seeker
        public override void OnShow(object param)
        {
            base.OnShow(param);

            if (null != param)
            {
                var ret = param as WinFailData;

                this.m_mode = ret.m_mode;
                m_data      = ret;
            }

            m_close_btn.AddClickCallBack(OnCloseClicked);
        }
コード例 #21
0
        public override void OnShow(object param)
        {
            base.OnShow(param);
            UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.title_in, 1.0f, null);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCTitleResponse, OnRespone);
            GameEvents.UIEvents.UI_PlayerTitle_Event.OnChoose += OnChoose;
            m_close_btn.AddClickCallBack(OnClose);
            //ConfTitle.array
            CSTitleRequest req = new CSTitleRequest();

#if !NETWORK_SYNC || UNITY_EDITOR
            GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req);
#else
            GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
#endif
        }
コード例 #22
0
        public override void OnShow(object param)
        {
            ShowConfirmRedPoint(false);
            ShowApplyRedPoint(PlayerPrefTool.GetIsThereNewApply());
            ShowGiftRedPoint(PlayerPrefTool.GetIsThereNewGift());
            this.SwitchUI(FRIEND_UI_TOGGLE_TYPE.Added);

            m_toggle_info.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Added, LocalizeModule.Instance.GetString("friend_1"), true, OnToggleClick);
            m_toggle_application.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Agreeing, LocalizeModule.Instance.GetString("friend_2"), false, OnToggleClick);
            m_toggle_confirm.Refresh((int)FRIEND_UI_TOGGLE_TYPE.Addinfo, LocalizeModule.Instance.GetString("friend_3"), false, OnToggleClick);
            m_view_gifts_toggle.Refresh((int)FRIEND_UI_TOGGLE_TYPE.gift, LocalizeModule.Instance.GetString("friend_receive"), false, OnToggleClick);
            m_add_friend_toggle.Refresh((int)FRIEND_UI_TOGGLE_TYPE.scarch, LocalizeModule.Instance.GetString("friend_invite_btn"), false, OnToggleClick);
            m_application_switch.AddClickCallBack(OnApplicationToggleClicked);
            m_ignore_all_btn.AddClickCallBack(OnIgnoreAllClick);
            m_recommend_btn.AddClickCallBack(OnRecommendClick);

        }
コード例 #23
0
        private void RegisterMessage()
        {
            GameEvents.UIEvents.UI_GameEntry_Event.OnOpenPanel       += OnOpenPanel;
            GameEvents.UIEvents.UI_GameEntry_Event.OnControlActivity += OnControlActivity;
#if OFFICER_SYS
            GameEvents.RedPointEvents.User_OnNewPoliceEvent += OnNewPolice;
#endif
            GameEvents.RedPointEvents.User_OnNewFriendEvent              += OnNewFriend;
            GameEvents.RedPointEvents.User_OnNewAchievementEvent         += OnNewAchievement;
            GameEvents.RedPointEvents.User_OnNewActivityEvent            += OnNewActivityEvent;
            GameEvents.UIEvents.UI_GameEntry_Event.GetCurrentGameEntryUI += GetCurrentGameEntryUI;
            //GameEvents.UI_Guid_Event.OnSeekOpenClose += OnSeekOpenClose;
            GameEvents.UI_Guid_Event.OnMainIconUnLockComplete         += OnMainIconUnLockComplete;
            GameEvents.UIEvents.UI_PushGift_Event.OnGo                += ShowPushGiftView;
            GameEvents.UIEvents.UI_Bonus_Pop_View_Event.Listen_OnShow += OnShowBonusPopView;
            GameEvents.UIEvents.UI_GameEntry_Event.OnMainCityHint     += OnMainCityHint;
            GameEvents.RedPointEvents.User_OnNewChapterEvent          += User_OnNewChapterEvent;
            GameEvents.RedPointEvents.User_OnNewChapterBannerEvent    += User_OnNewChapterBannerEvent;
            GameEvents.IAPEvents.OnTransactionDone += DisableItem;
            GameEvents.UIEvents.UI_GameEntry_Event.OnLockMainIcon += OnLockMainIcon;
#if OFFICER_SYS
            GameEvents.UIEvents.UI_GameEntry_Event.OnNewPoliceEffect += OnNewPoliceEffect;
#endif
            GameEvents.UIEvents.UI_GameEntry_Event.OnOpenBottomButton       += OpenBottomButton;
            GameEvents.UIEvents.UI_Bonus_Pop_View_Event.BonusPopViewVisible += BonusPopViewVisible;

            GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected += OnCombineTipsShow;
            GameEvents.UIEvents.UI_GameEntry_Event.OnMaskBGVisible += OnMaskBGVisible;
            GameEvents.UIEvents.UI_Common_Event.OnCommonUIVisible  += OnCommonUIVisible;
            m_activity_btn.AddClickCallBack(BtnActivity);
            for (int i = 0; i < MAXPANEL; i++)
            {
                if (m_panelMsg[i] != 0)
                {
                    MessageHandler.RegisterMessageHandler(m_panelMsg[i], GameEntryHelper.TransPanel);
                }
            }

            m_push_gift_btn.AddClickCallBack(OnPushGiftClicked);
            MessageHandler.RegisterMessageHandler(MessageDefine.SCGetPushResponse, OnPushGiftRsp);


            //MessageHandler.RegisterMessageHandler(MessageDefine.SCAutoOpenGiftDropResp, CommonHelper.OnOpenAutoGiftCallback);
        }
コード例 #24
0
ファイル: WinView.cs プロジェクト: kingpowervrg/my_seeker
        public override void OnShow(object param)
        {
            base.OnShow(param);

            if (null != param)
            {
                var ret = param as WinFailData;

                this.m_mode = ret.m_mode;
                m_data      = ret;
            }
            m_win_continue_btn.AddClickCallBack(ContinueClicked);

            //m_win_effect.Visible = true;

            m_lvl_up_reward_view.gameObject.transform.localPosition = Vector3.zero;
            m_lvl_up_reward_cg.alpha = 1.0f;


            m_cur_step = 0;
            UiStepTo(++m_cur_step);
        }
コード例 #25
0
ファイル: GuidUIClick.cs プロジェクト: kingpowervrg/my_seeker
 protected override void OnOpenUI(GUIFrame uiLogic)
 {
     m_tog = uiLogic.LogicHandler.Make <GameToggleButton>(m_CurConf.btnName[0]);
     if (m_tog != null)
     {
         m_srcTran = m_tog.gameObject.transform;
         m_tog.AddChangeCallBack(OnToggle);
     }
     else
     {
         m_btn = uiLogic.LogicHandler.Make <GameButton>(m_CurConf.btnName[0]);
         if (m_btn != null)
         {
             m_srcTran = m_btn.gameObject.transform;
             m_btn.AddClickCallBack(OnBtn);
         }
     }
     m_TweenScale              = m_srcTran.gameObject.AddComponent <TweenScale>();
     m_TweenScale.To           = Vector3.one * 1.1f;
     m_TweenScale.m_tweenStyle = UITweenerBase.TweenStyle.Loop;
     m_TweenScale.Duration     = 2f;
     base.OnOpenUI(uiLogic);
 }
コード例 #26
0
        public override void OnShow(object param)
        {
            base.OnShow(param);
            m_action_btn.AddClickCallBack(OnClick);
            m_btn_play_video.AddClickCallBack(OnVideoPlayClick);
            m_btn_close_video.AddClickCallBack(OnVideoCloseClick);
            m_btnClose.AddClickCallBack(OnRootCloseClick);
            this.m_btnClose.Visible = GlobalInfo.GAME_NETMODE == GameNetworkMode.Network;

            if (null != param)
            {
                List <long> my_param = param as List <long>;
                this.m_task_id = my_param[1];
            }

            //if (-1 == m_task_id)
            //{
            //    //不是从任务展示界面来的,不用翻转
            //    BgShowAlpha(false);
            //    PanelDelayShowAlpha(0.0f);
            //    PanelDelayShowScale(0.0f);
            //    PanelTurnToOne(false);
            //    PanelGoDown(true);
            //}
            //else
            //{
            //    //需要翻转

            //    BgShowAlpha(true);
            //    PanelDelayShowAlpha(0.2f);
            //    PanelDelayShowScale(0.5f);
            //    PanelGoDown(false);
            //    PanelTurnToZero(false);
            //    PanelTurnToOne(true);
            //}
        }
コード例 #27
0
 public override void OnShow(object param)
 {
     m_del_btn.AddClickCallBack(OnDelClick);
     m_ok_btn.AddClickCallBack(OnOKClick);
 }
コード例 #28
0
ファイル: CartoonUI.cs プロジェクト: kingpowervrg/my_seeker
 public override void OnShow(object param)
 {
     m_play_btn.AddClickCallBack(OnPlayClicked);
     m_reset_btn.AddClickCallBack(OnResetClicked);
 }
コード例 #29
0
 public override void OnShow(object param)
 {
     base.OnShow(param);
     m_buy_btn.AddClickCallBack(btnBuy);
 }
コード例 #30
0
        public override void OnShow(object param)
        {
            base.OnShow(param);

            GameEvents.UIEvents.UI_GameEntry_Event.OnMaskBGVisible.SafeInvoke(true);
            //GameEvents.UIEvents.UI_Common_Event.OnCommonUIVisible.SafeInvoke(false);
            BgHideAlpha(false);
            PanelTurnToOne(false);

            m_btn.AddClickCallBack(OnClicked);
            m_tips_btn.AddClickCallBack(OnClicked);
            m_close_btn.AddClickCallBack(OnCloseClicked);
            if (null != param)
            {
                var input_param = param as AcceptTaskParam;
                m_taskInfo     = input_param.m_taskInfo;
                m_btn_act      = input_param.m_close_act;
                m_isAcceptTask = input_param.isAcceptTask;
            }
            this.m_completeTaskTipsLabel.Visible = !m_isAcceptTask;
            this.m_tips_txt.Visible = m_isAcceptTask;
            if (m_isAcceptTask)
            {
                this.m_btnLable.Text = "Action !";
            }
            else
            {
                this.m_btnLable.Text = "Complete !";
            }
            ConfTask confTask = ConfTask.Get(this.m_taskInfo.TaskConfID);

            this.m_desc_txt.Text = LocalizeModule.Instance.GetString(confTask.descs);
            this.m_name_txt.Text = LocalizeModule.Instance.GetString(confTask.name);
            this.m_tips_txt.Text = LocalizeModule.Instance.GetString("activity_drop_taskdec_1");


            List <RewardWrapper> task_rewards = new List <RewardWrapper>();

            if (m_isAcceptTask)
            {
                task_rewards = GetAcceptTaskDropItem(confTask);
            }
            else
            {
                task_rewards = GetCompleteTaskDropItem();
            }

            if (task_rewards.Count > 0)
            {
                m_reward_grid.EnsureSize <DropItemIcon>(task_rewards.Count);
                for (int i = 0; i < m_reward_grid.ChildCount; ++i)
                {
                    var view = m_reward_grid.GetChild <DropItemIcon>(i);
                    view.InitSprite(task_rewards[i].m_icon, task_rewards[i].m_num, task_rewards[i].m_id);
                    view.Visible = true;
                }
            }
            else
            {
                m_reward_grid.Clear();
            }



            List <iconAndName> conditions = new List <iconAndName>();

            if (m_taskInfo.CompleteConditionList.Count > 0)
            {
                foreach (var complete_condition in m_taskInfo.CompleteConditionList)
                {
                    if (complete_condition.GetType() == typeof(TaskCompleteItems))
                    {
                        //收集物品
                        TaskCompleteItems collectDataInfo = complete_condition as TaskCompleteItems;

                        List <ItemWrapper> collectItemList = collectDataInfo.TaskCompleteData;

                        string collect_icon, collect_name;
                        int    collect_type;

                        foreach (var collect in collectItemList)
                        {
                            GetIconAndName(collect.ItemID, out collect_icon, out collect_name, out collect_type);

                            conditions.Add(new iconAndName()
                            {
                                m_icon = collect_icon,
                                m_name = collect_name,
                                m_type = collect_type,
                            });
                        }
                    }
                    else if (complete_condition.GetType() == typeof(TaskCompleteByScan))
                    {
                        //尸检
                        TaskCompleteByScan collectDataInfo = complete_condition as TaskCompleteByScan;
                        long scan_id = (long)collectDataInfo.TaskCompleteData;

                        var all_types_clues = ScanDataManager.Instance.Examin_clue_datas(scan_id);

                        var all_clues = new HashSet <long>();

                        foreach (var kvp in all_types_clues)
                        {
                            all_clues.UnionWith(kvp.Value);
                        }

                        var scan_clues = from i in all_clues
                                         select new iconAndName()
                        {
                            m_icon = ConfFindClue.Get(i).icon,
                            m_name = LocalizeModule.Instance.GetString(ConfFindClue.Get(i).name),
                        };

                        foreach (var item in scan_clues)
                        {
                            conditions.Add(item);
                        }
                    }
                }
            }


            m_aim_grid.EnsureSize <AimItemView>(conditions.Count);

            for (int i = 0; i < m_aim_grid.ChildCount; ++i)
            {
                m_aim_grid.GetChild <AimItemView>(i).Refresh(conditions[i].m_icon, conditions[i].m_name);
                m_aim_grid.GetChild <AimItemView>(i).Visible = true;
            }

            if (m_isAcceptTask)
            {
                m_titleGet.Visible = false;
                ShowAcceptTaskTips();
                ShowTaskTitle(confTask.rewardTitleId);
            }
        }