Beispiel #1
0
        private void CreateHeroPreview(uint heroId, int i)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_heroInitChooseFormPath);

            if (form != null)
            {
                string            name       = string.Format("RawImage{0}", i);
                GameObject        gameObject = form.transform.Find(name).gameObject;
                CUIRawImageScript component  = gameObject.GetComponent <CUIRawImageScript>();
                ObjData           data       = CUICommonSystem.GetHero3DObj(heroId, true);
                if (data.Object != null)
                {
                    component.AddGameObject(name, data.Object, Vector3.zero, Quaternion.identity, data.Object.transform.localScale);
                    this.cacheObjList.Add(data.Object);
                    CUIEventScript script3 = gameObject.GetComponent <CUIEventScript>();
                    if (script3 == null)
                    {
                        script3 = gameObject.AddComponent <CUIEventScript>();
                        script3.Initialize(form);
                    }
                    stUIEventParams eventParams = new stUIEventParams {
                        heroId = heroId
                    };
                    script3.SetUIEvent(enUIEventType.Click, enUIEventID.Hero_Init_Select, eventParams);
                }
            }
        }
Beispiel #2
0
        public static void SetMapElement_EventParam(CUIEventScript evtCom, bool bAlien, MinimapSys.ElementType type, uint objID = 0u, uint targetHeroID = 0u)
        {
            if (evtCom == null || type == MinimapSys.ElementType.None)
            {
                return;
            }
            stUIEventParams onClickEventParams = default(stUIEventParams);

            onClickEventParams.tag     = ((!bAlien) ? 0 : 1);
            onClickEventParams.tag2    = (int)type;
            onClickEventParams.tagUInt = objID;
            onClickEventParams.heroId  = targetHeroID;
            if (type == MinimapSys.ElementType.Dragon_3 || type == MinimapSys.ElementType.Dragon_5_big || type == MinimapSys.ElementType.Dragon_5_small)
            {
                onClickEventParams.tag3 = 2;
            }
            else if (type == MinimapSys.ElementType.Tower || type == MinimapSys.ElementType.Base)
            {
                onClickEventParams.tag3 = ((!bAlien) ? 2 : 3);
            }
            else if (type == MinimapSys.ElementType.Hero)
            {
                onClickEventParams.tag3 = ((!bAlien) ? 2 : 5);
            }
            evtCom.m_onClickEventParams = onClickEventParams;
        }
        public static void TryToValidate(enOpPurpose purpose, enUIEventID confirmEventID, stUIEventParams confirmEventParams = default(stUIEventParams))
        {
            CSecurePwdSystem instance = Singleton <CSecurePwdSystem> .GetInstance();

            if (instance.EnableStatus == PwdStatus.Enable)
            {
                CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CSecurePwdSystem.sValidatePwdFormPath, false, true);

                if (cUIFormScript == null)
                {
                    return;
                }
                Transform transform  = cUIFormScript.transform.Find("pnlBg/Panel_Main/BtnConfirm");
                Transform transform2 = cUIFormScript.transform.Find("pnlBg/Panel_Main/BtnCancel");
                if (transform == null || transform2 == null)
                {
                    return;
                }
                CUIEventScript component  = transform.GetComponent <CUIEventScript>();
                CUIEventScript component2 = transform2.GetComponent <CUIEventScript>();
                if (component == null || component2 == null)
                {
                    return;
                }
                confirmEventParams.srcUIEventID = confirmEventID;
                component.SetUIEvent(enUIEventType.Up, enUIEventID.SecurePwd_OnValidateConfirm, confirmEventParams);
            }
            else
            {
                confirmEventParams.srcUIEventID = confirmEventID;
                string text = Singleton <CTextManager> .GetInstance().GetText(CSecurePwdSystem.s_OpRiskNameKeys[(int)purpose]);

                Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.SecurePwd_OnValidateConfirm, enUIEventID.SecurePwd_OpenSetPwdForm, confirmEventParams, "暂时不用", "前往设置", true);
            }
        }
Beispiel #4
0
    protected override void Update()
    {
        if (base.isInitialize)
        {
            base.Update();
            return;
        }
        CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CHeroSelectNormalSystem.s_heroSelectFormPath);

        if (form != null)
        {
            int  index = (int)base.currentConf.Param[0];
            bool flag  = base.currentConf.Param[1] > 0;
            bool flag2 = base.currentConf.Param[2] > 0;
            if (flag2)
            {
                uint heroID = (uint)base.currentConf.Param[0];
                index = Singleton <CHeroSelectBaseSystem> .get_instance().GetCanUseHeroIndex(heroID);
            }
            string name = "PanelLeft/ListHostHeroInfo";
            if (flag)
            {
                name = "PanelLeft/ListHostHeroInfoFull";
            }
            Transform transform = form.transform.FindChild(name);
            if (transform != null)
            {
                CUIListScript component = transform.gameObject.GetComponent <CUIListScript>();
                if (component != null)
                {
                    CUIListElementScript elemenet = component.GetElemenet(index);
                    if (elemenet != null)
                    {
                        Transform transform2 = elemenet.transform.Find("heroItemCell");
                        if (transform2 != null)
                        {
                            GameObject gameObject = transform2.gameObject;
                            if (gameObject.activeInHierarchy)
                            {
                                CUIEventScript component2 = gameObject.GetComponent <CUIEventScript>();
                                if (component2 != null && !component2.enabled)
                                {
                                    this.CompleteHandler();
                                }
                                else
                                {
                                    base.AddHighLightGameObject(gameObject, true, form, true);
                                    base.Initialize();
                                }
                            }
                        }
                    }
                    else
                    {
                        this.CompleteHandler();
                    }
                }
            }
        }
    }
Beispiel #5
0
 public static void SetMapElement_EventParam(GameObject obj, bool bAlien, MinimapSys.ElementType type, uint objID = 0, uint targetHeroID = 0)
 {
     if ((type != MinimapSys.ElementType.None) && (obj != null))
     {
         CUIEventScript component = obj.GetComponent <CUIEventScript>();
         if (component != null)
         {
             stUIEventParams @params = new stUIEventParams {
                 tag     = !bAlien ? 0 : 1,
                 tag2    = (int)type,
                 tagUInt = objID,
                 heroId  = targetHeroID
             };
             if (((type == MinimapSys.ElementType.Dragon_3) || (type == MinimapSys.ElementType.Dragon_5_big)) || (type == MinimapSys.ElementType.Dragon_5_small))
             {
                 @params.tag3 = 2;
             }
             else if ((type == MinimapSys.ElementType.Tower) || (type == MinimapSys.ElementType.Base))
             {
                 @params.tag3 = !bAlien ? 2 : 3;
             }
             else if (type == MinimapSys.ElementType.Hero)
             {
                 @params.tag3 = !bAlien ? 2 : 5;
             }
             component.m_onClickEventParams = @params;
         }
     }
 }
Beispiel #6
0
        public void ActivateLearnBtn(SkillSlotType inSlotType, bool bActivate, bool bAll)
        {
            NewbieGuideManager.CloseGuideForm();
            if (!bAll && (inSlotType < SkillSlotType.SLOT_SKILL_1 || inSlotType > SkillSlotType.SLOT_SKILL_3))
            {
                return;
            }
            List <GameObject> list = this.QuerySkillButtons(inSlotType, bAll);

            for (int i = 0; i < list.get_Count(); i++)
            {
                GameObject gameObject = list.get_Item(i);
                if (gameObject != null)
                {
                    Transform transform = gameObject.transform.FindChild("LearnBtn");
                    if (!(transform == null))
                    {
                        GameObject gameObject2 = transform.gameObject;
                        Button     component   = gameObject2.GetComponent <Button>();
                        if (component)
                        {
                            component.enabled = bActivate;
                        }
                        CUIEventScript component2 = gameObject2.GetComponent <CUIEventScript>();
                        if (component2)
                        {
                            component2.enabled = bActivate;
                        }
                    }
                }
            }
        }
 private void OnBreakListItemEnable(CUIEvent uiEvent)
 {
     if (((this.m_breakDetailIndex >= 0) && (this.m_breakDetailIndex < this.m_breakSymbolList.Length)) && ((this.m_breakSymbolList[this.m_breakDetailIndex] != null) && (null != uiEvent.m_srcWidget)))
     {
         int srcWidgetIndexInBelongedList = uiEvent.m_srcWidgetIndexInBelongedList;
         if ((srcWidgetIndexInBelongedList >= 0) && (srcWidgetIndexInBelongedList < this.m_breakSymbolList[this.m_breakDetailIndex].Count))
         {
             CBreakSymbolItem item = this.m_breakSymbolList[this.m_breakDetailIndex][srcWidgetIndexInBelongedList];
             if ((item != null) && (item.symbol != null))
             {
                 Transform transform = uiEvent.m_srcWidget.transform.Find("itemCell");
                 this.m_symbolSys.m_symbolWearCtrl.SetSymbolListItem(uiEvent.m_srcFormScript, transform.gameObject, item.symbol);
                 Transform transform2 = transform.Find("selectFlag");
                 if (transform2 != null)
                 {
                     CUIEventScript component = transform2.GetComponent <CUIEventScript>();
                     if (component != null)
                     {
                         stUIEventParams eventParams = new stUIEventParams {
                             tag = srcWidgetIndexInBelongedList
                         };
                         component.SetUIEvent(enUIEventType.Click, enUIEventID.Symbol_BreakListItemSelToggle, eventParams);
                     }
                     transform2.GetComponent <Toggle>().isOn = item.bBreakToggle;
                 }
             }
         }
     }
 }
Beispiel #8
0
        public static void RefreshSymbolItem(ResSymbolInfo symbolInfo, GameObject widget, CUIFormScript form, enSymbolMakeSource source = enSymbolMakeSource.SymbolManage)
        {
            if (symbolInfo == null || widget == null)
            {
                return;
            }
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM);
            CUseable          useableByBaseID  = useableContainer.GetUseableByBaseID(5, symbolInfo.dwID);
            Image             component        = widget.transform.Find("iconImage").GetComponent <Image>();
            Text      component2 = widget.transform.Find("countText").GetComponent <Text>();
            Text      component3 = widget.transform.Find("nameText").GetComponent <Text>();
            Text      component4 = widget.transform.Find("descText").GetComponent <Text>();
            Transform transform  = widget.transform.Find("Price");

            if (transform != null)
            {
                Text componetInChild = Utility.GetComponetInChild <Text>(transform.gameObject, "Text");
                if (componetInChild != null)
                {
                    componetInChild.text = symbolInfo.dwMakeCoin.ToString();
                }
                CUIEventScript component5 = transform.GetComponent <CUIEventScript>();
                if (component5 != null)
                {
                    stUIEventParams eventParams = default(stUIEventParams);
                    eventParams.symbolTransParam.symbolCfgInfo = symbolInfo;
                    component5.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_ListItemClick, eventParams);
                }
            }
            component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, symbolInfo.dwIcon), form, true, false, false, false);
            component2.text = ((useableByBaseID == null) ? "0" : useableByBaseID.m_stackCount.ToString());
            component3.text = symbolInfo.szName;
            component4.text = CSymbolSystem.GetSymbolAttString(symbolInfo.dwID, true);
            CUIEventScript component6 = widget.GetComponent <CUIEventScript>();

            if (component6 != null)
            {
                stUIEventParams eventParams2 = default(stUIEventParams);
                eventParams2.symbolTransParam.symbolCfgInfo = symbolInfo;
                component6.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_ListItemClick, eventParams2);
            }
            if (source == enSymbolMakeSource.Mall)
            {
                CUICommonSystem.PlayAnimator(widget, "Symbol_Normal");
            }
            else if (useableByBaseID != null)
            {
                CUICommonSystem.PlayAnimator(widget, "Symbol_Normal");
            }
            else
            {
                CUICommonSystem.PlayAnimator(widget, "Symbol_Disabled");
            }
        }
Beispiel #9
0
 public CDButton(GameObject button)
 {
     if (button != null)
     {
         this.m_button      = button;
         this.m_buttonImage = this.m_button.GetComponent <Image>();
         DebugHelper.Assert(this.m_buttonImage != null, "CDButton, m_buttonImage == null");
         Transform transform = button.transform.FindChild("high");
         if (transform != null)
         {
             this.m_highLightImage = transform.gameObject.GetComponent <Image>();
         }
         Transform transform2 = button.transform.FindChild("icon");
         if (transform2 != null)
         {
             this.m_iconImage = transform2.gameObject.GetComponent <Image>();
         }
         Transform transform3 = button.transform.FindChild("cd");
         if (transform3 != null)
         {
             this.m_cooldownImage = transform3.gameObject.GetComponent <Image>();
         }
         this.m_uiEventScript = button.GetComponent <CUIEventScript>();
         DebugHelper.Assert(this.m_uiEventScript != null, "CDButton, m_uiEventScript == null");
     }
 }
Beispiel #10
0
 private void _show_BoxNode(int index, string icon, COM_LEVEL_STATUS state, bool bCheckBox = false)
 {
     if (this.boxNodeList != null && index >= 0 && index < this.boxNodeList.get_Count())
     {
         GameObject gameObject = this.boxNodeList.get_Item(index);
         if (gameObject == null)
         {
             return;
         }
         gameObject.CustomSetActive(true);
         CUIEventScript component = gameObject.GetComponent <CUIEventScript>();
         if (component == null)
         {
             return;
         }
         if (bCheckBox)
         {
             component.enabled = true;
         }
         else
         {
             component.enabled = (state == 1);
         }
         this._show_Node_ByState(gameObject, bCheckBox, state);
     }
 }
Beispiel #11
0
        public void Draw()
        {
            CUIListScript component = this.m_cuiForm.GetWidget(0).GetComponent <CUIListScript>();

            int[] numArray = new int[] { 100, 200, 300, 400, 500, 600 };
            component.SetElementAmount(numArray.Length);
            for (byte i = 0; i < numArray.Length; i = (byte)(i + 1))
            {
                CUIListElementScript elemenet = component.GetElemenet(i);
                CUIEventScript       script3  = elemenet.gameObject.GetComponent <CUIEventScript>();
                if (script3 == null)
                {
                    script3 = elemenet.gameObject.AddComponent <CUIEventScript>();
                    script3.Initialize(elemenet.m_belongedFormScript);
                }
                stUIEventParams eventParams = new stUIEventParams();
                int             num2        = numArray[i] / 10;
                eventParams.tag = numArray[i];
                script3.SetUIEvent(enUIEventType.Click, enUIEventID.Purchase_BuyDiamond, eventParams);
                Text text  = elemenet.gameObject.transform.Find("pnlPrice/txtQuantity").GetComponent <Text>();
                Text text2 = elemenet.gameObject.transform.Find("pnlPrice/txtPrice").GetComponent <Text>();
                text.text  = numArray[i].ToString();
                text2.text = num2.ToString();
            }
        }
Beispiel #12
0
    private void SetBlockButtonBlocked(GameObject blockNode, bool bHasBlocked)
    {
        if (blockNode == null)
        {
            return;
        }
        CUIEventScript component = blockNode.GetComponent <CUIEventScript>();

        if (component != null)
        {
            component.enabled = !bHasBlocked;
        }
        Button component2 = blockNode.GetComponent <Button>();

        if (component2 != null)
        {
            CUICommonSystem.SetButtonEnableWithShader(component2, !bHasBlocked, true);
        }
        string text       = bHasBlocked ? "已屏蔽" : "屏蔽";
        Text   component3 = blockNode.transform.Find("Text").GetComponent <Text>();

        if (component3 != null)
        {
            component3.set_text(text);
        }
    }
        public void On_Drop_ListElement_Enable(CUIEvent uievent)
        {
            int            srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList;
            CUIEventScript component         = uievent.m_srcWidgetScript.GetComponent <CUIEventScript>();
            CUIComponent   component2        = component.m_widgets[0].GetComponent <CUIComponent>();
            CUIEventScript component3        = component2.m_widgets[7].GetComponent <CUIEventScript>();
            ulong          commonUInt64Param = component3.m_onClickEventParams.commonUInt64Param1;
            uint           tagUInt           = component3.m_onClickEventParams.tagUInt;

            if (Singleton <CFriendContoller> .instance.model.FRData.GetCfr(commonUInt64Param, tagUInt) == null)
            {
                return;
            }
            Text component4 = uievent.m_srcWidget.transform.Find("Text").GetComponent <Text>();

            if (component4 != null)
            {
                CFriendRelationship.FRConfig cFGByIndex = Singleton <CFriendContoller> .instance.model.FRData.GetCFGByIndex(srcWidgetIndexInBelongedList);

                if (cFGByIndex != null)
                {
                    component4.set_text(cFGByIndex.cfgRelaStr);
                }
            }
        }
Beispiel #14
0
 public void ActivateLearnBtn(SkillSlotType inSlotType, bool bActivate, bool bAll)
 {
     if (bAll || ((inSlotType >= SkillSlotType.SLOT_SKILL_1) && (inSlotType <= SkillSlotType.SLOT_SKILL_3)))
     {
         List <GameObject> list = this.QuerySkillButtons(inSlotType, bAll);
         for (int i = 0; i < list.Count; i++)
         {
             GameObject obj2 = list[i];
             if (obj2 != null)
             {
                 Transform transform = obj2.transform.FindChild("LearnBtn");
                 if (transform != null)
                 {
                     GameObject gameObject = transform.gameObject;
                     Button     component  = gameObject.GetComponent <Button>();
                     if (component != null)
                     {
                         component.enabled = bActivate;
                     }
                     CUIEventScript script = gameObject.GetComponent <CUIEventScript>();
                     if (script != null)
                     {
                         script.enabled = bActivate;
                     }
                 }
             }
         }
     }
 }
        public static void RefreshSymbolItem(ResSymbolInfo symbolInfo, GameObject widget, CUIFormScript form)
        {
            if ((symbolInfo != null) && (widget != null))
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    CUseable useableByBaseID = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableByBaseID(COM_ITEM_TYPE.COM_OBJTYPE_ITEMSYMBOL, symbolInfo.dwID);
                    Image    component       = widget.transform.Find("iconImage").GetComponent <Image>();
                    Text     text            = widget.transform.Find("countText").GetComponent <Text>();
                    Text     text2           = widget.transform.Find("nameText").GetComponent <Text>();
                    Text     text3           = widget.transform.Find("descText").GetComponent <Text>();
                    component.SetSprite(string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Icon_Dir, symbolInfo.dwIcon), form, true, false, false);
                    text.text  = (useableByBaseID == null) ? string.Empty : useableByBaseID.m_stackCount.ToString();
                    text2.text = symbolInfo.szName;
                    text3.text = CSymbolSystem.GetSymbolAttString(symbolInfo.dwID, true);
                    CUIEventScript script = widget.GetComponent <CUIEventScript>();
                    if (script != null)
                    {
                        stUIEventParams eventParams = new stUIEventParams();
                        eventParams.symbolTransParam.symbolCfgInfo = symbolInfo;
                        script.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_ListItemClick, eventParams);
                    }
                    if (useableByBaseID != null)
                    {
                        CUICommonSystem.PlayAnimator(widget, "Symbol_Normal");
                    }
                    else
                    {
                        CUICommonSystem.PlayAnimator(widget, "Symbol_Disabled");
                    }
                }
            }
        }
    protected override void Update()
    {
        if (base.isInitialize)
        {
            base.Update();
            return;
        }
        CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(FightForm.s_battleUIForm);

        if (form != null)
        {
            Transform transform = form.GetWidget(54).transform;
            this.info        = transform.FindChild("info").gameObject;
            this.highlighter = transform.FindChild("highlighter").gameObject;
            if (this.info && this.highlighter)
            {
                this.info.CustomSetActive(true);
                this.highlighter.CustomSetActive(true);
                this.eventScript = transform.GetComponent <CUIEventScript>();
                CUIEventScript expr_B2 = this.eventScript;
                expr_B2.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(expr_B2.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
                Singleton <CTimerManager> .GetInstance().AddTimer(15000, 1, new CTimer.OnTimeUpHandler(this.OnTimeUp));
            }
        }
        base.isInitialize = true;
        base.isGuiding    = true;
        NewbieGuideScriptControl.CloseGuideForm();
    }
        private void CreateHeroPreview(uint heroId, int i)
        {
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(HeroChooseLogic.s_heroInitChooseFormPath);

            if (form == null)
            {
                return;
            }
            string            name       = string.Format("RawImage{0}", i);
            GameObject        gameObject = form.transform.Find(name).gameObject;
            CUIRawImageScript component  = gameObject.GetComponent <CUIRawImageScript>();
            ObjData           hero3DObj  = CUICommonSystem.GetHero3DObj(heroId, true);

            if (hero3DObj.Object == null)
            {
                return;
            }
            component.AddGameObject(name, hero3DObj.Object, Vector3.zero, Quaternion.identity, hero3DObj.Object.transform.localScale);
            this.cacheObjList.Add(hero3DObj.Object);
            CUIEventScript cUIEventScript = gameObject.GetComponent <CUIEventScript>();

            if (cUIEventScript == null)
            {
                cUIEventScript = gameObject.AddComponent <CUIEventScript>();
                cUIEventScript.Initialize(form);
            }
            cUIEventScript.SetUIEvent(enUIEventType.Click, enUIEventID.Hero_Init_Select, new stUIEventParams
            {
                heroId = heroId
            });
        }
Beispiel #18
0
 private void TryToAddClickEvent()
 {
     List <GameObject> .Enumerator enumerator = ms_highlitGo.GetEnumerator();
     while (enumerator.MoveNext())
     {
         GameObject current = enumerator.Current;
         if (current != null)
         {
             CUIEventScript component = current.GetComponent <CUIEventScript>();
             if (component != null)
             {
                 component.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(component.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
             }
             CUIMiniEventScript script2 = current.GetComponent <CUIMiniEventScript>();
             if (script2 != null)
             {
                 script2.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Combine(script2.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
             }
             if ((component == null) && (script2 == null))
             {
                 CUIMiniEventScript local1 = current.AddComponent <CUIMiniEventScript>();
                 local1.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Combine(local1.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
             }
         }
     }
     if (this.m_completeType == ECompleteType.ClickAnyWhere)
     {
         Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Dialogue_AnyWhereClick, new CUIEventManager.OnUIEventHandler(this.AnyWhereClick));
     }
 }
        private static void SetEvtParam(GameObject obj, ulong ullUid, uint dwLogicWorldId)
        {
            CUIEventScript component = obj.GetComponent <CUIEventScript>();

            component.m_onClickEventParams.commonUInt64Param2 = ullUid;
            component.m_onClickEventParams.taskId             = dwLogicWorldId;
        }
Beispiel #20
0
 public CSignalButton(GameObject button, int signalID)
 {
     this.m_signalID = signalID;
     if (button != null)
     {
         this.m_button      = button;
         this.m_buttonImage = this.m_button.GetComponent <Image>();
         Transform transform = button.transform.FindChild("high");
         if (transform != null)
         {
             this.m_highLightImage = transform.gameObject.GetComponent <Image>();
         }
         Transform transform2 = button.transform.FindChild("icon");
         if (transform2 != null)
         {
             this.m_iconImage = transform2.gameObject.GetComponent <Image>();
         }
         Transform transform3 = button.transform.FindChild("cd");
         if (transform3 != null)
         {
             this.m_cooldownImage = transform3.gameObject.GetComponent <Image>();
         }
         this.m_uiEventScript = button.GetComponent <CUIEventScript>();
     }
 }
Beispiel #21
0
 private void TryToAddClickEvent()
 {
     List <GameObject> .Enumerator enumerator = NewbieGuideBaseScript.ms_highlitGo.GetEnumerator();
     while (enumerator.MoveNext())
     {
         GameObject current = enumerator.get_Current();
         if (!(current == null))
         {
             CUIEventScript component = current.GetComponent <CUIEventScript>();
             if (component != null)
             {
                 CUIEventScript cUIEventScript = component;
                 cUIEventScript.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(cUIEventScript.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
             }
             CUIMiniEventScript cUIMiniEventScript = current.GetComponent <CUIMiniEventScript>();
             if (cUIMiniEventScript != null)
             {
                 CUIMiniEventScript cUIMiniEventScript2 = cUIMiniEventScript;
                 cUIMiniEventScript2.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Combine(cUIMiniEventScript2.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
             }
             if (component == null && cUIMiniEventScript == null)
             {
                 cUIMiniEventScript = current.AddComponent <CUIMiniEventScript>();
                 CUIMiniEventScript cUIMiniEventScript3 = cUIMiniEventScript;
                 cUIMiniEventScript3.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Combine(cUIMiniEventScript3.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
             }
         }
     }
     if (this.m_completeType == NewbieGuideBaseScript.ECompleteType.ClickAnyWhere)
     {
         Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Dialogue_AnyWhereClick, new CUIEventManager.OnUIEventHandler(this.AnyWhereClick));
     }
 }
Beispiel #22
0
        private void refreshButtonState(int timeToBuy)
        {
            if (this.m_FormScript == null)
            {
                return;
            }
            GameObject      gameObject     = this.m_FormScript.transform.Find("Bg/Bg1/ButtonGroup/Button_BuyTen").gameObject;
            CUIEventScript  cUIEventScript = gameObject.GetComponent <CUIEventScript>();
            stUIEventParams eventParams    = default(stUIEventParams);

            if (cUIEventScript == null)
            {
                cUIEventScript = gameObject.AddComponent <CUIEventScript>();
                cUIEventScript.Initialize(this.m_FormScript);
            }
            if (base.IsHaveEnoughTimes(timeToBuy))
            {
                gameObject.GetComponent <Image>().color = new Color(1f, 1f, 1f, 1f);
                eventParams.tag = 1;
            }
            else
            {
                gameObject.GetComponent <Image>().color = new Color(0f, 1f, 1f, 1f);
                eventParams.tag = 0;
            }
            cUIEventScript.SetUIEvent(enUIEventType.Click, enUIEventID.Purchase_BuyCoinTen, eventParams);
        }
Beispiel #23
0
        public static bool Bind(GameObject target, string hyperlink)
        {
            int num;

            if (string.IsNullOrEmpty(hyperlink))
            {
                return(false);
            }
            char[]   separator = new char[] { '|' };
            string[] strArray  = hyperlink.Split(separator);
            if (strArray.Length != 2)
            {
                return(false);
            }
            if (!int.TryParse(strArray[0], out num))
            {
                return(false);
            }
            char[]             chArray2           = new char[] { ',' };
            string[]           strArray2          = strArray[1].Split(chArray2);
            CUIEventScript     component          = target.GetComponent <CUIEventScript>();
            stUIEventParams    eventParams        = new stUIEventParams();
            COM_HYPERLINK_TYPE com_hyperlink_type = (COM_HYPERLINK_TYPE)num;

            if (com_hyperlink_type != COM_HYPERLINK_TYPE.COM_HYPERLINK_TYPE_GUILD_INVITE)
            {
                if (com_hyperlink_type != COM_HYPERLINK_TYPE.COM_HYPERLINK_TYPE_PREGUILD_INVITE)
                {
                    return(false);
                }
            }
            else
            {
                if (strArray2.Length != 4)
                {
                    return(false);
                }
                ulong num3 = ulong.Parse(strArray2[0]);
                int   num4 = int.Parse(strArray2[1]);
                ulong num5 = ulong.Parse(strArray2[2]);
                int   num6 = int.Parse(strArray2[3]);
                eventParams.commonUInt64Param1 = num3;
                eventParams.tag = num4;
                eventParams.commonUInt64Param2 = num5;
                eventParams.tag2 = num6;
                component.SetUIEvent(enUIEventType.Click, enUIEventID.Guild_Hyperlink_Search_Guild, eventParams);
                return(true);
            }
            if (strArray2.Length != 1)
            {
                return(false);
            }
            ulong num8 = ulong.Parse(strArray2[0]);

            eventParams.commonUInt64Param1 = num8;
            component.SetUIEvent(enUIEventType.Click, enUIEventID.Guild_Hyperlink_Search_PrepareGuild, eventParams);
            return(true);
        }
Beispiel #24
0
        public static void SetPveHeroItemData(CUIFormScript formScript, GameObject listItem, IHeroData data)
        {
            if (listItem == null || data == null)
            {
                return;
            }
            bool      bPlayerOwn = data.bPlayerOwn;
            Transform transform  = listItem.transform;
            Transform transform2 = transform.Find("heroProficiencyImg");
            Transform transform3 = transform.Find("heroProficiencyBgImg");

            CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform2.gameObject, (int)data.proficiencyLV);
            CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform3.gameObject, (int)data.proficiencyLV, false);
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo != null)
            {
                transform3.GetComponent <Image>().color = ((!masterRoleInfo.IsHaveHero(data.cfgID, true)) ? CUIUtility.s_Color_GrayShader : Color.white);
                transform2.GetComponent <Image>().color = ((!masterRoleInfo.IsHaveHero(data.cfgID, true)) ? CUIUtility.s_Color_GrayShader : Color.white);
            }
            bool flag  = false;
            bool flag2 = false;

            if (masterRoleInfo != null)
            {
                flag  = masterRoleInfo.IsFreeHero(data.cfgID);
                flag2 = masterRoleInfo.IsCreditFreeHero(data.cfgID);
                bool flag3 = masterRoleInfo.IsValidExperienceHero(data.cfgID);
                CUICommonSystem.SetHeroItemImage(formScript, listItem, masterRoleInfo.GetHeroSkinPic(data.cfgID), enHeroHeadType.enBust, !bPlayerOwn && !flag && !flag3, true);
            }
            GameObject gameObject = transform.Find("profession").gameObject;

            CUICommonSystem.SetHeroJob(formScript, gameObject, (enHeroJobType)data.heroType);
            Text component = transform.Find("heroNameText").GetComponent <Text>();

            component.text = data.heroName;
            Transform transform4 = transform.Find("TxtFree");
            Transform transform5 = transform.Find("TxtCreditFree");

            if (transform4 != null)
            {
                transform4.gameObject.CustomSetActive(flag && !flag2);
            }
            if (transform5 != null)
            {
                transform5.gameObject.CustomSetActive(flag2);
            }
            GameObject gameObject2 = transform.Find("imgExperienceMark").gameObject;

            gameObject2.CustomSetActive(data.IsValidExperienceHero());
            CUIEventScript  component2  = listItem.GetComponent <CUIEventScript>();
            stUIEventParams eventParams = default(stUIEventParams);

            eventParams.openHeroFormPar.heroId  = data.cfgID;
            eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.HeroListClick;
            component2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams);
        }
    private void OnTimeUp(int delt)
    {
        CUIEventScript expr_06 = this.eventScript;

        expr_06.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Remove(expr_06.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
        this.info.CustomSetActive(false);
        this.highlighter.CustomSetActive(false);
        MonoSingleton <NewbieGuideManager> .GetInstance().StopCurrentGuide();
    }
 private void SetState(PlayerHead.HeadState hs)
 {
     if (hs != this._state)
     {
         this._state = hs;
         CUIEventScript component = base.GetComponent <CUIEventScript>();
         component.enabled = (this._state == PlayerHead.HeadState.Normal || this._state == PlayerHead.HeadState.ReviveReady);
     }
 }
    protected override void ClickHandler(CUIEvent uiEvent)
    {
        CUIEventScript expr_06 = this.eventScript;

        expr_06.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Remove(expr_06.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
        this.info.CustomSetActive(false);
        this.highlighter.CustomSetActive(false);
        this.CompleteHandler();
    }
Beispiel #28
0
 public void Clear()
 {
     this.m_buttonImage    = null;
     this.m_iconImage      = null;
     this.m_highLightImage = null;
     this.m_cooldownImage  = null;
     this.m_uiEventScript  = null;
     this.m_button         = null;
 }
 private void SetEventParams(CUIEventScript com, CMail mail)
 {
     com.m_onClickEventParams.heroId             = (uint)mail.bMapType;
     com.m_onClickEventParams.weakGuideId        = mail.dwMapId;
     com.m_onClickEventParams.tag2               = (int)mail.relationType;
     com.m_onClickEventParams.tagUInt            = mail.dwGameSvrEntity;
     com.m_onClickEventParams.commonUInt64Param1 = mail.uid;
     com.m_onClickEventParams.taskId             = mail.dwLogicWorldID;
     com.m_onClickEventParams.tag3               = (int)mail.inviteType;
 }
Beispiel #30
0
 public static void SetObservers(GameObject root, int maxNum, ListView <MemberInfo> memberList, MemberInfo masterMember)
 {
     if (maxNum > 0)
     {
         root.CustomSetActive(true);
         CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(root, "SlotList");
         componetInChild.SetElementAmount(maxNum);
         MemberInfo[] infoArray = new MemberInfo[maxNum];
         for (int i = 0; i < memberList.Count; i++)
         {
             MemberInfo info = memberList[i];
             if ((info != null) && (info.dwPosOfCamp < maxNum))
             {
                 infoArray[info.dwPosOfCamp] = info;
             }
         }
         int num2 = 0;
         for (int j = 0; j < maxNum; j++)
         {
             MemberInfo         info2      = infoArray[j];
             GameObject         gameObject = componetInChild.GetElemenet(j).gameObject;
             bool               bActive    = null != info2;
             CUIHttpImageScript script2    = Utility.GetComponetInChild <CUIHttpImageScript>(gameObject, "Icon");
             Text               text       = Utility.GetComponetInChild <Text>(gameObject, "Name");
             CUIEventScript     script3    = Utility.GetComponetInChild <CUIEventScript>(gameObject, "SitDown");
             CUIEventScript     script4    = Utility.GetComponetInChild <CUIEventScript>(gameObject, "KickOut");
             script2.gameObject.CustomSetActive(bActive);
             text.gameObject.CustomSetActive(bActive);
             script3.gameObject.CustomSetActive(!bActive);
             script4.gameObject.CustomSetActive((bActive && (info2 != masterMember)) && Singleton <CRoomSystem> .GetInstance().IsSelfRoomOwner);
             if (bActive)
             {
                 text.text = info2.MemberName;
                 script2.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(info2.MemberHeadUrl));
                 num2++;
             }
             if (script3.gameObject.activeSelf)
             {
                 script3.m_onClickEventID         = enUIEventID.Room_Observe_Seat;
                 script3.m_onClickEventParams.tag = j;
             }
             if (script4.gameObject.activeSelf)
             {
                 script4.m_onClickEventID         = enUIEventID.Room_Observe_Kick;
                 script4.m_onClickEventParams.tag = j;
             }
         }
         Utility.GetComponetInChild <Text>(root, "PersonCount").text = num2 + "/" + maxNum;
     }
     else
     {
         root.CustomSetActive(false);
     }
 }