Ejemplo n.º 1
0
 private void InitSelfFuncList()
 {
     DebugHelper.Assert(this.m_panelObj != null);
     if (this.m_panelObj != null)
     {
         Transform          transform = this.m_panelObj.transform.FindChild("SelfFuncList");
         CUIMiniEventScript component = transform.GetChild(0).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        inList    = new ECheatAct[3];
         inList[1] = ECheatAct.FullHp;
         inList[2] = ECheatAct.FullEp;
         component.m_onClickEventParams.tag  = this.CheatActListToMask(inList);
         component.m_onClickEventParams.tag2 = this.ActTarListToMask(new EActTarget[1]);
         CUIMiniEventScript script2   = transform.GetChild(1).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        actArray2 = new ECheatAct[] { ECheatAct.SetLevel, ECheatAct.FullHp, ECheatAct.FullEp };
         script2.m_onClickEventParams.tag  = this.CheatActListToMask(actArray2);
         script2.m_onClickEventParams.tag2 = this.ActTarListToMask(new EActTarget[1]);
         script2.m_onClickEventParams.tag3 = 1;
         CUIMiniEventScript script3   = transform.GetChild(2).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        actArray3 = new ECheatAct[] { ECheatAct.ToggleZeroCd };
         script3.m_onClickEventParams.tag  = this.CheatActListToMask(actArray3);
         script3.m_onClickEventParams.tag2 = this.ActTarListToMask(new EActTarget[1]);
         this.m_cdBtnToggle = script3.gameObject;
         CUIMiniEventScript script4   = transform.GetChild(3).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        actArray4 = new ECheatAct[] { ECheatAct.ToggleInvincible };
         script4.m_onClickEventParams.tag  = this.CheatActListToMask(actArray4);
         script4.m_onClickEventParams.tag2 = this.ActTarListToMask(new EActTarget[1]);
         this.m_invincibleBtnToggle        = script4.gameObject;
     }
 }
Ejemplo n.º 2
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));
     }
 }
Ejemplo n.º 3
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));
     }
 }
Ejemplo n.º 4
0
        public void CheckActPlayModeTipsForPvpEntry()
        {
            uint num = 0u;

            uint.TryParse(Singleton <CTextManager> .get_instance().GetText("MapID_PVP_Fire"), ref num);
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(CMatchingSystem.PATH_MATCHING_ENTRY);

            if (form && !CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform = form.transform.Find("panelGroup1/btnGroup/ButtonEntertain/ActModePanel");
                if (transform)
                {
                    transform.gameObject.CustomSetActive(this.IsHaveEntertrainModeOpen());
                }
            }
            if (form)
            {
                CUIMiniEventScript component  = form.transform.FindChild("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>();
                CUIMiniEventScript component2 = form.transform.FindChild("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>();
                CUIMiniEventScript component3 = form.transform.FindChild("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>();
                this.refreshEntertainMentOpenStateUI(component.gameObject, component.m_onClickEventParams.tagUInt);
                this.refreshEntertainMentOpenStateUI(component2.gameObject, component2.m_onClickEventParams.tagUInt);
                this.refreshEntertainMentOpenStateUI(component3.gameObject, component3.m_onClickEventParams.tagUInt);
                if (CSysDynamicBlock.bLobbyEntryBlocked)
                {
                    component3.gameObject.CustomSetActive(false);
                }
            }
        }
Ejemplo n.º 5
0
 private void InitHostileFuncList()
 {
     DebugHelper.Assert(this.m_panelObj != null);
     if (this.m_panelObj != null)
     {
         Transform          transform = this.m_panelObj.transform.FindChild("HostileFuncList");
         CUIMiniEventScript component = transform.GetChild(0).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        inList    = new ECheatAct[3];
         inList[1] = ECheatAct.FullHp;
         inList[2] = ECheatAct.FullEp;
         component.m_onClickEventParams.tag = this.CheatActListToMask(inList);
         EActTarget[] targetArray1 = new EActTarget[] { EActTarget.Hostile };
         component.m_onClickEventParams.tag2 = this.ActTarListToMask(targetArray1);
         CUIMiniEventScript script2   = transform.GetChild(1).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        actArray2 = new ECheatAct[] { ECheatAct.SetLevel, ECheatAct.FullHp, ECheatAct.FullEp };
         script2.m_onClickEventParams.tag = this.CheatActListToMask(actArray2);
         EActTarget[] targetArray2 = new EActTarget[] { EActTarget.Hostile };
         script2.m_onClickEventParams.tag2 = this.ActTarListToMask(targetArray2);
         script2.m_onClickEventParams.tag3 = 1;
         CUIMiniEventScript script3   = transform.GetChild(2).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        actArray3 = new ECheatAct[] { ECheatAct.ToggleAi };
         script3.m_onClickEventParams.tag = this.CheatActListToMask(actArray3);
         EActTarget[] targetArray3 = new EActTarget[] { EActTarget.Hostile };
         script3.m_onClickEventParams.tag2 = this.ActTarListToMask(targetArray3);
         this.m_aiBtnToggle = script3.gameObject;
     }
 }
Ejemplo n.º 6
0
        private void InitGeneralFuncList()
        {
            DebugHelper.Assert(this.m_panelObj != null);
            if (this.m_panelObj == null)
            {
                return;
            }
            Transform          transform = this.m_panelObj.transform.FindChild("GeneralFuncList");
            CUIMiniEventScript component = transform.GetChild(0).GetComponent <CUIMiniEventScript>();

            component.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[]
            {
                CTrainingHelper.ECheatAct.ToggleSoldier,
                CTrainingHelper.ECheatAct.ResetSoldier
            });
            component.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[1]);
            this.m_soldierBtnToggle             = component.gameObject;
            CUIMiniEventScript component2 = transform.GetChild(1).GetComponent <CUIMiniEventScript>();

            component2.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[]
            {
                CTrainingHelper.ECheatAct.AddGold
            });
            component2.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[1]);
            component2.m_onClickEventParams.tag3 = 1000;
        }
Ejemplo n.º 7
0
        public void CheckActPlayModeTipsForPvpEntry()
        {
            uint result = 0;

            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_Fire"), out result);
            stMatchOpenInfo matchOpenState = CUICommonSystem.GetMatchOpenState(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_ENTERTAINMENT, result);
            CUIFormScript   form           = Singleton <CUIManager> .instance.GetForm(CMatchingSystem.PATH_MATCHING_ENTRY);

            if ((form != null) && !CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform = form.transform.Find("panelGroup1/btnGroup/Button1/ActModePanel");
                if (transform != null)
                {
                    transform.gameObject.CustomSetActive(matchOpenState.matchState == enMatchOpenState.enMatchOpen_InActiveTime);
                }
            }
            if (form != null)
            {
                Transform transform2 = form.transform.Find("panelGroup2/btnGroup/Button5");
                Transform transform3 = form.transform.Find("panelGroup2/btnGroup/Button5/Lock");
                Transform transform4 = form.transform.Find("panelGroup2/btnGroup/Button5/Open");
                if (transform2 != null)
                {
                    CUIMiniEventScript component = transform2.GetComponent <CUIMiniEventScript>();
                    if (((transform3 != null) && (transform4 != null)) && (component != null))
                    {
                        transform2.gameObject.CustomSetActive(false);
                        transform3.gameObject.CustomSetActive(false);
                        transform4.gameObject.CustomSetActive(false);
                        component.enabled = false;
                        if (matchOpenState.matchState == enMatchOpenState.enMatchOpen_InActiveTime)
                        {
                            CUICommonSystem.SetTextContent(transform4.Find("Text").gameObject, matchOpenState.descStr);
                            transform4.gameObject.CustomSetActive(true);
                            transform2.gameObject.CustomSetActive(true);
                            component.enabled = true;
                            if (CSysDynamicBlock.bLobbyEntryBlocked)
                            {
                                Transform transform5 = transform4.FindChild("Image");
                                Transform transform6 = transform4.FindChild("TextOpen");
                                if ((transform5 != null) && (transform6 != null))
                                {
                                    transform5.gameObject.CustomSetActive(false);
                                    transform6.gameObject.CustomSetActive(false);
                                }
                            }
                        }
                        else if (matchOpenState.matchState == enMatchOpenState.enMatchOpen_NotInActiveTime)
                        {
                            CUICommonSystem.SetTextContent(transform3.Find("Text").gameObject, matchOpenState.descStr);
                            transform3.gameObject.CustomSetActive(true);
                            transform2.gameObject.CustomSetActive(true);
                        }
                    }
                }
            }
        }
Ejemplo n.º 8
0
        public void refreshEntertainMentOpenStateUI(GameObject btn, uint mapId)
        {
            if (btn == null)
            {
                return;
            }
            Transform transform = btn.transform;

            if (transform)
            {
                Transform          transform2     = transform.FindChild("Lock");
                Transform          transform3     = transform.FindChild("Open");
                Transform          transform4     = transform.FindChild("NotOpen");
                stMatchOpenInfo    matchOpenState = CUICommonSystem.GetMatchOpenState(4, mapId);
                CUIMiniEventScript component      = transform.GetComponent <CUIMiniEventScript>();
                if (transform2 && transform3 && component)
                {
                    transform.gameObject.CustomSetActive(false);
                    transform2.gameObject.CustomSetActive(false);
                    transform3.gameObject.CustomSetActive(false);
                    if (transform4)
                    {
                        transform4.gameObject.CustomSetActive(false);
                    }
                    component.m_onClickEventParams.commonBool = false;
                    if (matchOpenState.matchState == enMatchOpenState.enMatchOpen_InActiveTime)
                    {
                        CUICommonSystem.SetTextContent(transform3.Find("Text").gameObject, matchOpenState.descStr);
                        transform3.gameObject.CustomSetActive(true);
                        transform.gameObject.CustomSetActive(true);
                        component.m_onClickEventParams.commonBool = true;
                        if (CSysDynamicBlock.bLobbyEntryBlocked)
                        {
                            Transform transform5 = transform3.FindChild("Image");
                            Transform transform6 = transform3.FindChild("TextOpen");
                            if (transform5 && transform6)
                            {
                                transform5.gameObject.CustomSetActive(false);
                                transform6.gameObject.CustomSetActive(false);
                            }
                        }
                    }
                    else if (matchOpenState.matchState == enMatchOpenState.enMatchOpen_NotInActiveTime)
                    {
                        CUICommonSystem.SetTextContent(transform2.Find("Text").gameObject, matchOpenState.descStr);
                        transform2.gameObject.CustomSetActive(true);
                        transform.gameObject.CustomSetActive(true);
                    }
                    else if (transform4)
                    {
                        transform.gameObject.CustomSetActive(true);
                        transform4.gameObject.CustomSetActive(true);
                    }
                }
            }
        }
Ejemplo n.º 9
0
 public void refreshEntertainMentOpenStateUI(GameObject btn, uint mapId)
 {
     if (btn != null)
     {
         Transform       transform      = btn.transform;
         Transform       transform2     = transform.FindChild("Lock");
         Transform       transform3     = transform.FindChild("Open");
         Transform       transform4     = transform.FindChild("NotOpen");
         stMatchOpenInfo matchOpenState = CUICommonSystem.GetMatchOpenState(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_ENTERTAINMENT, mapId);
         if (transform != null)
         {
             CUIMiniEventScript component = transform.GetComponent <CUIMiniEventScript>();
             if (((transform2 != null) && (transform3 != null)) && (component != null))
             {
                 transform.gameObject.CustomSetActive(false);
                 transform2.gameObject.CustomSetActive(false);
                 transform3.gameObject.CustomSetActive(false);
                 if (transform4 != null)
                 {
                     transform4.gameObject.CustomSetActive(false);
                 }
                 component.m_onClickEventParams.commonBool = false;
                 if (matchOpenState.matchState == enMatchOpenState.enMatchOpen_InActiveTime)
                 {
                     CUICommonSystem.SetTextContent(transform3.Find("Text").gameObject, matchOpenState.descStr);
                     transform3.gameObject.CustomSetActive(true);
                     transform.gameObject.CustomSetActive(true);
                     component.m_onClickEventParams.commonBool = true;
                     if (CSysDynamicBlock.bLobbyEntryBlocked)
                     {
                         Transform transform5 = transform3.FindChild("Image");
                         Transform transform6 = transform3.FindChild("TextOpen");
                         if ((transform5 != null) && (transform6 != null))
                         {
                             transform5.gameObject.CustomSetActive(false);
                             transform6.gameObject.CustomSetActive(false);
                         }
                     }
                 }
                 else if (matchOpenState.matchState == enMatchOpenState.enMatchOpen_NotInActiveTime)
                 {
                     CUICommonSystem.SetTextContent(transform2.Find("Text").gameObject, matchOpenState.descStr);
                     transform2.gameObject.CustomSetActive(true);
                     transform.gameObject.CustomSetActive(true);
                 }
                 else if (transform4 != null)
                 {
                     transform.gameObject.CustomSetActive(true);
                     transform4.gameObject.CustomSetActive(true);
                 }
             }
         }
     }
 }
Ejemplo n.º 10
0
    private void TryToRemoveClickEvent()
    {
        bool flag = false;
        int  num  = 0;

        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.Remove(cUIEventScript.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
                    flag = true;
                }
                CUIMiniEventScript component2 = current.GetComponent <CUIMiniEventScript>();
                if (component2 != null)
                {
                    CUIMiniEventScript cUIMiniEventScript = component2;
                    cUIMiniEventScript.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Remove(cUIMiniEventScript.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
                    flag = true;
                }
                Toggle component3 = current.GetComponent <Toggle>();
                if (component3 != null)
                {
                    component3.set_isOn(false);
                    Toggle component4 = NewbieGuideBaseScript.ms_originalGo.get_Item(num).GetComponent <Toggle>();
                    if (component4 != null)
                    {
                        component4.set_isOn(true);
                    }
                }
                if (!flag)
                {
                }
                num++;
            }
        }
        if (this.m_completeType == NewbieGuideBaseScript.ECompleteType.ClickAnyWhere)
        {
            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Dialogue_AnyWhereClick, new CUIEventManager.OnUIEventHandler(this.AnyWhereClick));
        }
    }
Ejemplo n.º 11
0
        private void InitHostileFuncList()
        {
            DebugHelper.Assert(this.m_panelObj != null);
            if (this.m_panelObj == null)
            {
                return;
            }
            Transform          transform = this.m_panelObj.transform.FindChild("HostileFuncList");
            CUIMiniEventScript component = transform.GetChild(0).GetComponent <CUIMiniEventScript>();

            component.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[]
            {
                CTrainingHelper.ECheatAct.LevelUp,
                CTrainingHelper.ECheatAct.FullHp,
                CTrainingHelper.ECheatAct.FullEp
            });
            component.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[]
            {
                CTrainingHelper.EActTarget.Hostile
            });
            CUIMiniEventScript component2 = transform.GetChild(1).GetComponent <CUIMiniEventScript>();

            component2.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[]
            {
                CTrainingHelper.ECheatAct.SetLevel,
                CTrainingHelper.ECheatAct.FullHp,
                CTrainingHelper.ECheatAct.FullEp
            });
            component2.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[]
            {
                CTrainingHelper.EActTarget.Hostile
            });
            component2.m_onClickEventParams.tag3 = 1;
            CUIMiniEventScript component3 = transform.GetChild(2).GetComponent <CUIMiniEventScript>();

            component3.m_onClickEventParams.tag = this.CheatActListToMask(new CTrainingHelper.ECheatAct[]
            {
                CTrainingHelper.ECheatAct.ToggleAi
            });
            component3.m_onClickEventParams.tag2 = this.ActTarListToMask(new CTrainingHelper.EActTarget[]
            {
                CTrainingHelper.EActTarget.Hostile
            });
            this.m_aiBtnToggle = component3.gameObject;
        }
Ejemplo n.º 12
0
 private void TryToAddClickEvent(uint id, GameObject EffectObj)
 {
     if (EffectObj != null)
     {
         CUIEventScript componentInParent = EffectObj.GetComponentInParent <CUIEventScript>();
         if (componentInParent != null)
         {
             componentInParent.m_onClickEventParams.weakGuideId = id;
             componentInParent.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(componentInParent.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
         }
         CUIMiniEventScript script2 = EffectObj.GetComponentInParent <CUIMiniEventScript>();
         if (script2 != null)
         {
             script2.m_onClickEventParams.weakGuideId = id;
             script2.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Combine(script2.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
         }
     }
 }
Ejemplo n.º 13
0
 private void InitGeneralFuncList()
 {
     DebugHelper.Assert(this.m_panelObj != null);
     if (this.m_panelObj != null)
     {
         Transform          transform = this.m_panelObj.transform.FindChild("GeneralFuncList");
         CUIMiniEventScript component = transform.GetChild(0).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        inList    = new ECheatAct[] { ECheatAct.ToggleSoldier, ECheatAct.ResetSoldier };
         component.m_onClickEventParams.tag  = this.CheatActListToMask(inList);
         component.m_onClickEventParams.tag2 = this.ActTarListToMask(new EActTarget[1]);
         this.m_soldierBtnToggle             = component.gameObject;
         CUIMiniEventScript script2   = transform.GetChild(1).GetComponent <CUIMiniEventScript>();
         ECheatAct[]        actArray2 = new ECheatAct[] { ECheatAct.AddGold };
         script2.m_onClickEventParams.tag  = this.CheatActListToMask(actArray2);
         script2.m_onClickEventParams.tag2 = this.ActTarListToMask(new EActTarget[1]);
         script2.m_onClickEventParams.tag3 = 0x3e8;
     }
 }
Ejemplo n.º 14
0
    private void TryToRemoveClickEvent()
    {
        bool flag = false;
        int  num  = 0;

        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.Remove(component.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
                    flag = true;
                }
                CUIMiniEventScript script2 = current.GetComponent <CUIMiniEventScript>();
                if (script2 != null)
                {
                    script2.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Remove(script2.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
                    flag            = true;
                }
                Toggle toggle = current.GetComponent <Toggle>();
                if (toggle != null)
                {
                    toggle.isOn = false;
                    Toggle toggle2 = ms_originalGo[num].GetComponent <Toggle>();
                    if (toggle2 != null)
                    {
                        toggle2.isOn = true;
                    }
                }
                if (!flag)
                {
                }
                num++;
            }
        }
        if (this.m_completeType == ECompleteType.ClickAnyWhere)
        {
            Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Dialogue_AnyWhereClick, new CUIEventManager.OnUIEventHandler(this.AnyWhereClick));
        }
    }
Ejemplo n.º 15
0
 public void RemoveEffectByHilight(GameObject hilighter)
 {
     if (hilighter != null)
     {
         uint           weakGuideId       = 0u;
         CUIEventScript componentInParent = hilighter.transform.parent.GetComponentInParent <CUIEventScript>();
         if (componentInParent != null)
         {
             weakGuideId = componentInParent.m_onClickEventParams.weakGuideId;
             CUIEventScript cUIEventScript = componentInParent;
             cUIEventScript.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Remove(cUIEventScript.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
         }
         CUIMiniEventScript componentInParent2 = hilighter.transform.parent.GetComponentInParent <CUIMiniEventScript>();
         if (componentInParent2 != null)
         {
             weakGuideId = componentInParent2.m_onClickEventParams.weakGuideId;
             CUIMiniEventScript cUIMiniEventScript = componentInParent2;
             cUIMiniEventScript.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Remove(cUIMiniEventScript.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
         }
         this.RemoveEffect(weakGuideId);
     }
 }
Ejemplo n.º 16
0
    private void TryToAddClickEvent(uint id, GameObject EffectObj)
    {
        if (EffectObj == null)
        {
            return;
        }
        CUIEventScript componentInParent = EffectObj.GetComponentInParent <CUIEventScript>();

        if (componentInParent != null)
        {
            componentInParent.m_onClickEventParams.weakGuideId = id;
            CUIEventScript expr_2D = componentInParent;
            expr_2D.onClick = (CUIEventScript.OnUIEventHandler)Delegate.Combine(expr_2D.onClick, new CUIEventScript.OnUIEventHandler(this.ClickHandler));
        }
        CUIMiniEventScript componentInParent2 = EffectObj.GetComponentInParent <CUIMiniEventScript>();

        if (componentInParent2 != null)
        {
            componentInParent2.m_onClickEventParams.weakGuideId = id;
            CUIMiniEventScript expr_6E = componentInParent2;
            expr_6E.onClick = (CUIMiniEventScript.OnUIEventHandler)Delegate.Combine(expr_6E.onClick, new CUIMiniEventScript.OnUIEventHandler(this.ClickHandler));
        }
    }
Ejemplo n.º 17
0
        public static void InitMatchingEntry(CUIFormScript form)
        {
            if (form != null)
            {
                Transform transform = form.transform;
                uint[]    numArray  = new uint[0x13];
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_1V1"), out numArray[0]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_3V3"), out numArray[1]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), out numArray[2]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), out numArray[3]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), out numArray[4]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), out numArray[5]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), out numArray[6]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), out numArray[7]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), out numArray[8]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), out numArray[9]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), out numArray[10]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), out numArray[11]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), out numArray[12]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), out numArray[13]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5"), out numArray[14]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_MELEE"), out numArray[15]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_Fire"), out numArray[0x10]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Clone"), out numArray[0x11]);
                uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5CD"), out numArray[0x12]);
                CUIMiniEventScript[] scriptArray = new CUIMiniEventScript[] {
                    transform.Find("panelGroup2/btnGroup/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup2/btnGroup/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button2").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup2/btnGroup/Button4").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup2/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                    transform.Find("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>(), transform.Find("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>()
                };
                for (int i = 0; i < numArray.Length; i++)
                {
                    scriptArray[i].m_onClickEventParams.tagUInt = numArray[i];
                    scriptArray[i].m_onClickEventParams.tag     = (int)mapDifficultyList[i];
                }
                transform.Find("panelGroup1/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
                transform.Find("panelGroup1/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
                transform.Find("panelGroup1/btnGroup/ButtonEntertain").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 3;
                transform.Find("panelGroup3/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 0;
                transform.Find("panelGroup3/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
                transform.Find("panelGroup3/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
                transform.Find("panelGroup3/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 3;
                transform.FindChild("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 0;
                transform.FindChild("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 1;
                transform.FindChild("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 2;
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

                if (masterRoleInfo != null)
                {
                    GameObject gameObject = transform.FindChild("CoinAndExp/DoubleCoin").gameObject;
                    GameObject obj3       = transform.FindChild("CoinAndExp/DoubleExp").gameObject;
                    obj3.CustomSetActive(false);
                    gameObject.CustomSetActive(false);
                    masterRoleInfo.UpdateCoinAndExpValidTime();
                    if (masterRoleInfo.HaveExtraCoin())
                    {
                        gameObject.CustomSetActive(true);
                        string str  = string.Empty;
                        string str2 = string.Empty;
                        if (masterRoleInfo.GetCoinExpireHours() > 0)
                        {
                            str = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleCoinExpireTimeTips"), masterRoleInfo.GetCoinExpireHours() / 0x18, masterRoleInfo.GetCoinExpireHours() % 0x18);
                        }
                        if (masterRoleInfo.GetCoinWinCount() > 0)
                        {
                            str2 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleCoinCountWinTips"), masterRoleInfo.GetCoinWinCount());
                        }
                        if (string.IsNullOrEmpty(str))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", str2), enUseableTipsPos.enBottom);
                        }
                        else if (string.IsNullOrEmpty(str2))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", str), enUseableTipsPos.enBottom);
                        }
                        else
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}\n{1}", str, str2), enUseableTipsPos.enBottom);
                        }
                    }
                    if (masterRoleInfo.HaveExtraExp())
                    {
                        obj3.CustomSetActive(true);
                        string str5 = string.Empty;
                        string str6 = string.Empty;
                        if (masterRoleInfo.GetExpExpireHours() > 0)
                        {
                            str5 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpExpireTimeTips"), masterRoleInfo.GetExpExpireHours() / 0x18, masterRoleInfo.GetExpExpireHours() % 0x18);
                        }
                        if (masterRoleInfo.GetExpWinCount() > 0)
                        {
                            str6 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpCountWinTips"), masterRoleInfo.GetExpWinCount());
                        }
                        if (string.IsNullOrEmpty(str5))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, obj3, string.Format("{0}", str6), enUseableTipsPos.enBottom);
                        }
                        else if (string.IsNullOrEmpty(str6))
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, obj3, string.Format("{0}", str5), enUseableTipsPos.enBottom);
                        }
                        else
                        {
                            CUICommonSystem.SetCommonTipsEvent(form, obj3, string.Format("{0}\n{1}", str5, str6), enUseableTipsPos.enBottom);
                        }
                    }
                    if (CSysDynamicBlock.bLobbyEntryBlocked)
                    {
                        Transform transform2 = form.transform.Find("panelBottom/btnShop");
                        if (transform2 != null)
                        {
                            transform2.gameObject.CustomSetActive(false);
                        }
                        Transform transform3 = form.transform.Find("CoinAndExp");
                        if (transform3 != null)
                        {
                            transform3.gameObject.CustomSetActive(false);
                        }
                    }
                    GameObject obj4 = form.gameObject.transform.Find("Panel").gameObject;
                    obj4.transform.Find("Name").gameObject.GetComponent <Text>().text = masterRoleInfo.Name;
                    ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));
                    DebugHelper.Assert(dataByKey != null);
                    DebugHelper.Assert(dataByKey.dwNeedExp > 0);
                    obj4.transform.Find("DegreeBarBg/bar").gameObject.GetComponent <RectTransform>().sizeDelta = new Vector2(204f * Math.Min((float)1f, (float)((masterRoleInfo.PvpExp * 1f) / ((float)dataByKey.dwNeedExp))), 19f);
                    obj4.transform.Find("DegreeTitle").gameObject.CustomSetActive(false);
                    if (masterRoleInfo.PvpLevel >= GameDataMgr.acntPvpExpDatabin.Count())
                    {
                        obj4.transform.Find("DegreeNum").gameObject.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("PVP_Level_Max");
                    }
                    else
                    {
                        obj4.transform.Find("DegreeNum").gameObject.GetComponent <Text>().text = string.Format("{0}/{1}", masterRoleInfo.PvpExp, dataByKey.dwNeedExp);
                    }
                    obj4.transform.Find("DegreeIcon").gameObject.CustomSetActive(false);
                    MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.enterPvpEntry, new uint[0]);
                }
            }
        }
Ejemplo n.º 18
0
    private void AddHighlightInternal(GameObject baseGo, CUIFormScript inOriginalForm, bool cloneEvent, bool bShowFinger)
    {
        this.PreHighlight();
        if (baseGo != null)
        {
            NewbieGuideBaseScript.ms_originalGo.Add(baseGo);
        }
        NewbieGuideBaseScript.ms_originalForm = inOriginalForm;
        this.OpenGuideForm();
        if (NewbieGuideScriptControl.FormGuideMask == null)
        {
            NewbieGuideScriptControl.OpenGuideForm();
        }
        List <GameObject> .Enumerator enumerator = NewbieGuideBaseScript.ms_originalGo.GetEnumerator();
        int num = 0;

        while (enumerator.MoveNext())
        {
            GameObject current = enumerator.get_Current();
            if (!(current == null))
            {
                GameObject gameObject = Object.Instantiate(current) as GameObject;
                if (!(gameObject == null))
                {
                    RectTransform rectTransform = gameObject.transform as RectTransform;
                    rectTransform.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                    rectTransform.SetSiblingIndex(1);
                    rectTransform.localScale = current.transform.localScale;
                    RectTransform rectTransform2 = current.transform as RectTransform;
                    rectTransform.pivot     = rectTransform2.pivot;
                    rectTransform.sizeDelta = rectTransform2.sizeDelta;
                    LayoutElement component = current.GetComponent <LayoutElement>();
                    if (component != null && rectTransform.sizeDelta == Vector2.zero)
                    {
                        rectTransform.sizeDelta = new Vector2(component.get_preferredWidth(), component.get_preferredHeight());
                    }
                    rectTransform.position = current.transform.position;
                    Vector2 screenPoint   = CUIUtility.WorldToScreenPoint(inOriginalForm.GetCamera(), current.transform.position);
                    Vector3 worldPosition = CUIUtility.ScreenToWorldPoint(NewbieGuideScriptControl.FormGuideMask.GetCamera(), screenPoint, rectTransform.position.z);
                    NewbieGuideScriptControl.FormGuideMask.InitializeWidgetPosition(gameObject, worldPosition);
                    gameObject.CustomSetActive(false);
                    if (cloneEvent)
                    {
                        CUIEventScript component2 = current.GetComponent <CUIEventScript>();
                        CUIEventScript component3 = gameObject.GetComponent <CUIEventScript>();
                        if (component2 && component3)
                        {
                            component3.m_onDownEventParams      = component2.m_onDownEventParams;
                            component3.m_onUpEventParams        = component2.m_onUpEventParams;
                            component3.m_onClickEventParams     = component2.m_onClickEventParams;
                            component3.m_onHoldStartEventParams = component2.m_onHoldStartEventParams;
                            component3.m_onHoldEventParams      = component2.m_onHoldEventParams;
                            component3.m_onHoldEndEventParams   = component2.m_onHoldEndEventParams;
                            component3.m_onDragStartEventParams = component2.m_onDragStartEventParams;
                            component3.m_onDragEventParams      = component2.m_onDragEventParams;
                            component3.m_onDragEndEventParams   = component2.m_onDragEndEventParams;
                            component3.m_onDropEventParams      = component2.m_onDropEventParams;
                            component3.m_closeFormWhenClicked   = component2.m_closeFormWhenClicked;
                            component3.m_belongedFormScript     = component2.m_belongedFormScript;
                            component3.m_belongedListScript     = component2.m_belongedListScript;
                            component3.m_indexInlist            = component2.m_indexInlist;
                        }
                        CUIMiniEventScript component4 = current.GetComponent <CUIMiniEventScript>();
                        CUIMiniEventScript component5 = gameObject.GetComponent <CUIMiniEventScript>();
                        if (component4 && component5)
                        {
                            component5.m_onDownEventParams    = component4.m_onDownEventParams;
                            component5.m_onUpEventParams      = component4.m_onUpEventParams;
                            component5.m_onClickEventParams   = component4.m_onClickEventParams;
                            component5.m_closeFormWhenClicked = component4.m_closeFormWhenClicked;
                            component5.m_belongedFormScript   = component4.m_belongedFormScript;
                            component5.m_belongedListScript   = component4.m_belongedListScript;
                            component5.m_indexInlist          = component4.m_indexInlist;
                        }
                    }
                    else
                    {
                        CUIEventScript component6 = gameObject.GetComponent <CUIEventScript>();
                        if (component6)
                        {
                            component6.enabled = false;
                        }
                        CUIMiniEventScript component7 = gameObject.GetComponent <CUIMiniEventScript>();
                        if (component7)
                        {
                            component7.enabled = false;
                        }
                    }
                    gameObject.CustomSetActive(true);
                    CUIAnimatorScript component8 = current.GetComponent <CUIAnimatorScript>();
                    if (component8 != null)
                    {
                        CUICommonSystem.PlayAnimator(gameObject, component8.m_currentAnimatorStateName);
                    }
                    NewbieGuideBaseScript.ms_highlitGo.Add(gameObject);
                    if (bShowFinger)
                    {
                        GameObject gameObject2 = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject;

                        if (gameObject2 != null)
                        {
                            GameObject gameObject3 = Object.Instantiate(gameObject2) as GameObject;
                            if (gameObject3 != null)
                            {
                                gameObject3.transform.SetParent(gameObject.transform);
                                Transform transform = gameObject3.transform;
                                switch (this.currentConf.wFlipType)
                                {
                                case 0:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipNone;
                                    break;

                                case 1:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipX;
                                    break;

                                case 2:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipY;
                                    break;

                                case 3:
                                    transform.localScale = NewbieGuideBaseScript.s_FlipXY;
                                    break;
                                }
                                gameObject3.transform.position = gameObject.transform.position;
                                (gameObject3.transform as RectTransform).anchoredPosition = new Vector2((float)this.currentConf.iOffsetHighLightX, (float)this.currentConf.iOffsetHighLightY);
                                if (!this.DoesShowArrow())
                                {
                                    gameObject3.transform.FindChild("Panel/ImageFinger").gameObject.CustomSetActive(false);
                                }
                                NewbieGuideBaseScript.ms_highlighter.Add(gameObject3);
                            }
                        }
                    }
                    if (num == 0 && this.currentConf.wSpecialTip != 0)
                    {
                        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig((uint)this.currentConf.wSpecialTip);

                        if (specialTipConfig != null && specialTipConfig.bGuideTextPos > 0)
                        {
                            GameObject gameObject4 = NewbieGuideBaseScript.InstantiateGuideText(specialTipConfig, gameObject, NewbieGuideScriptControl.FormGuideMask, inOriginalForm);
                            if (gameObject4 != null)
                            {
                                NewbieGuideBaseScript.ms_guideTextList.Add(gameObject4);
                                gameObject4.CustomSetActive(false);
                            }
                        }
                    }
                    num++;
                }
            }
        }
    }
Ejemplo n.º 19
0
        public static void InitMatchingEntry(CUIFormScript form)
        {
            if (form == null)
            {
                return;
            }
            Transform transform = form.transform;

            uint[] array = new uint[23];
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_1V1"), ref array[0]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_3V3"), ref array[1]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[2]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[3]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_1V1_1"), ref array[4]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[5]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[6]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_3V3Team_1"), ref array[7]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[8]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[9]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5Team_1"), ref array[10]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[11]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[12]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_Melee_Team_1"), ref array[13]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5"), ref array[14]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_MELEE"), ref array[15]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_Fire"), ref array[16]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Clone"), ref array[17]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5CD"), ref array[18]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_PVP_5V5Miwu"), ref array[19]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[20]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[21]);
            uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Robot_5V5TeamMiwu_1"), ref array[22]);
            CUIMiniEventScript[] array2 = new CUIMiniEventScript[]
            {
                transform.Find("panelGroup2/btnGroup/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button1/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button2/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button4/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button3/btnGrp/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button4").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup2/btnGroup/Button5").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button1").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button2").GetComponent <CUIMiniEventScript>(),
                transform.Find("panelGroup3/btnGroup/Button5/btnGrp/Button3").GetComponent <CUIMiniEventScript>()
            };
            for (int i = 0; i < array.Length; i++)
            {
                array2[i].m_onClickEventParams.tagUInt = array[i];
                array2[i].m_onClickEventParams.tag     = (int)CMatchingView.mapDifficultyList[i];
            }
            transform.Find("panelGroup1/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
            transform.Find("panelGroup1/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
            transform.Find("panelGroup1/btnGroup/ButtonEntertain").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 3;
            transform.Find("panelGroup3/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 0;
            transform.Find("panelGroup3/btnGroup/Button2").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 1;
            transform.Find("panelGroup3/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 2;
            transform.Find("panelGroup3/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 3;
            transform.Find("panelGroup3/btnGroup/Button5").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag         = 4;
            transform.FindChild("panelGroup5/btnGroup/Button1").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 0;
            transform.FindChild("panelGroup5/btnGroup/Button3").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 1;
            transform.FindChild("panelGroup5/btnGroup/Button4").GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag    = 2;
            CMatchingView.ShowDefaultHeadImgStartLogicLadderLevel = (int)CLadderSystem.GetGradeDataByShowGrade((int)GameDataMgr.GetGlobeValue(RES_GLOBAL_CONF_TYPE.RES_GLOBAL_CONF_TYPE_SHOW_DEFAULT_HEADIMG_START_LADDERLEVEL)).bLogicGrade;
            CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo();

            if (masterRoleInfo == null)
            {
                return;
            }
            GameObject gameObject  = transform.FindChild("CoinAndExp/DoubleCoin").gameObject;
            GameObject gameObject2 = transform.FindChild("CoinAndExp/DoubleExp").gameObject;

            gameObject2.CustomSetActive(false);
            gameObject.CustomSetActive(false);
            masterRoleInfo.UpdateCoinAndExpValidTime();
            if (masterRoleInfo.HaveExtraCoin())
            {
                gameObject.CustomSetActive(true);
                string text  = string.Empty;
                string text2 = string.Empty;
                if (masterRoleInfo.GetCoinExpireHours() > 0)
                {
                    string text3 = Singleton <CTextManager> .GetInstance().GetText("DoubleCoinExpireTimeTips");

                    text = string.Format(text3, masterRoleInfo.GetCoinExpireHours() / 24, masterRoleInfo.GetCoinExpireHours() % 24);
                }
                if (masterRoleInfo.GetCoinWinCount() > 0u)
                {
                    string text4 = Singleton <CTextManager> .GetInstance().GetText("DoubleCoinCountWinTips");

                    text2 = string.Format(text4, masterRoleInfo.GetCoinWinCount());
                }
                if (string.IsNullOrEmpty(text))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", text2), enUseableTipsPos.enBottom);
                }
                else if (string.IsNullOrEmpty(text2))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}", text), enUseableTipsPos.enBottom);
                }
                else
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject, string.Format("{0}\n{1}", text, text2), enUseableTipsPos.enBottom);
                }
            }
            if (masterRoleInfo.HaveExtraExp())
            {
                gameObject2.CustomSetActive(true);
                string text5 = string.Empty;
                string text6 = string.Empty;
                if (masterRoleInfo.GetExpExpireHours() > 0)
                {
                    text5 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpExpireTimeTips"), masterRoleInfo.GetExpExpireHours() / 24, masterRoleInfo.GetExpExpireHours() % 24);
                }
                if (masterRoleInfo.GetExpWinCount() > 0u)
                {
                    text6 = string.Format(Singleton <CTextManager> .GetInstance().GetText("DoubleExpCountWinTips"), masterRoleInfo.GetExpWinCount());
                }
                if (string.IsNullOrEmpty(text5))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}", text6), enUseableTipsPos.enBottom);
                }
                else if (string.IsNullOrEmpty(text6))
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}", text5), enUseableTipsPos.enBottom);
                }
                else
                {
                    CUICommonSystem.SetCommonTipsEvent(form, gameObject2, string.Format("{0}\n{1}", text5, text6), enUseableTipsPos.enBottom);
                }
            }
            if (CSysDynamicBlock.bLobbyEntryBlocked)
            {
                Transform transform2 = form.transform.Find("panelBottom/btnShop");
                if (transform2)
                {
                    transform2.gameObject.CustomSetActive(false);
                }
                Transform transform3 = form.transform.Find("CoinAndExp");
                if (transform3)
                {
                    transform3.gameObject.CustomSetActive(false);
                }
            }
            GameObject gameObject3 = form.gameObject.transform.Find("Panel").gameObject;

            gameObject3.transform.Find("Name").gameObject.GetComponent <Text>().set_text(masterRoleInfo.Name);
            ResAcntPvpExpInfo dataByKey = GameDataMgr.acntPvpExpDatabin.GetDataByKey((uint)((byte)masterRoleInfo.PvpLevel));

            DebugHelper.Assert(dataByKey != null);
            DebugHelper.Assert(dataByKey.dwNeedExp > 0u);
            GameObject gameObject4 = gameObject3.transform.Find("DegreeBarBg/bar").gameObject;

            gameObject4.GetComponent <RectTransform>().sizeDelta = new Vector2(204f * Math.Min(1f, masterRoleInfo.PvpExp * 1f / dataByKey.dwNeedExp), 19f);
            gameObject3.transform.Find("DegreeTitle").gameObject.CustomSetActive(false);
            if ((ulong)masterRoleInfo.PvpLevel >= (ulong)((long)GameDataMgr.acntPvpExpDatabin.Count()))
            {
                gameObject3.transform.Find("DegreeNum").gameObject.GetComponent <Text>().set_text(Singleton <CTextManager> .GetInstance().GetText("PVP_Level_Max"));
            }
            else
            {
                gameObject3.transform.Find("DegreeNum").gameObject.GetComponent <Text>().set_text(string.Format("{0}/{1}", masterRoleInfo.PvpExp, dataByKey.dwNeedExp));
            }
            gameObject3.transform.Find("DegreeIcon").gameObject.CustomSetActive(false);
            MonoSingleton <NewbieGuideManager> .GetInstance().CheckTriggerTime(NewbieGuideTriggerTimeType.enterPvpEntry, new uint[0]);
        }
Ejemplo n.º 20
0
    private void AddHighlightInternal(GameObject baseGo, CUIFormScript inOriginalForm, bool cloneEvent, params GameObject[] addGo)
    {
        this.PreHighlight();
        if (baseGo != null)
        {
            ms_originalGo.Add(baseGo);
        }
        if (addGo != null)
        {
            ms_originalGo.AddRange(addGo);
        }
        ms_originalForm = inOriginalForm;
        this.OpenGuideForm();
        if (NewbieGuideScriptControl.FormGuideMask == null)
        {
            NewbieGuideScriptControl.OpenGuideForm();
        }
        List <GameObject> .Enumerator enumerator = ms_originalGo.GetEnumerator();
        int num = 0;

        while (enumerator.MoveNext())
        {
            GameObject current = enumerator.Current;
            if (current != null)
            {
                GameObject widget = UnityEngine.Object.Instantiate(current) as GameObject;
                if (widget != null)
                {
                    RectTransform transform = widget.transform as RectTransform;
                    transform.SetParent(NewbieGuideScriptControl.FormGuideMask.transform);
                    transform.SetSiblingIndex(1);
                    transform.localScale = current.transform.localScale;
                    RectTransform transform2 = current.transform as RectTransform;
                    transform.pivot     = transform2.pivot;
                    transform.sizeDelta = transform2.sizeDelta;
                    LayoutElement component = current.GetComponent <LayoutElement>();
                    if ((component != null) && (transform.sizeDelta == Vector2.zero))
                    {
                        transform.sizeDelta = new Vector2(component.preferredWidth, component.preferredHeight);
                    }
                    transform.position = current.transform.position;
                    Vector2 screenPoint   = CUIUtility.WorldToScreenPoint(inOriginalForm.GetCamera(), current.transform.position);
                    Vector3 worldPosition = CUIUtility.ScreenToWorldPoint(NewbieGuideScriptControl.FormGuideMask.GetCamera(), screenPoint, transform.position.z);
                    NewbieGuideScriptControl.FormGuideMask.InitializeWidgetPosition(widget, worldPosition);
                    widget.CustomSetActive(false);
                    if (cloneEvent)
                    {
                        CUIEventScript script  = current.GetComponent <CUIEventScript>();
                        CUIEventScript script2 = widget.GetComponent <CUIEventScript>();
                        if ((script != null) && (script2 != null))
                        {
                            script2.m_onDownEventParams      = script.m_onDownEventParams;
                            script2.m_onUpEventParams        = script.m_onUpEventParams;
                            script2.m_onClickEventParams     = script.m_onClickEventParams;
                            script2.m_onHoldStartEventParams = script.m_onHoldStartEventParams;
                            script2.m_onHoldEventParams      = script.m_onHoldEventParams;
                            script2.m_onHoldEndEventParams   = script.m_onHoldEndEventParams;
                            script2.m_onDragStartEventParams = script.m_onDragStartEventParams;
                            script2.m_onDragEventParams      = script.m_onDragEventParams;
                            script2.m_onDragEndEventParams   = script.m_onDragEndEventParams;
                            script2.m_onDropEventParams      = script.m_onDropEventParams;
                            script2.m_closeFormWhenClicked   = script.m_closeFormWhenClicked;
                            script2.m_belongedFormScript     = script.m_belongedFormScript;
                            script2.m_belongedListScript     = script.m_belongedListScript;
                            script2.m_indexInlist            = script.m_indexInlist;
                        }
                        CUIMiniEventScript script3 = current.GetComponent <CUIMiniEventScript>();
                        CUIMiniEventScript script4 = widget.GetComponent <CUIMiniEventScript>();
                        if ((script3 != null) && (script4 != null))
                        {
                            script4.m_onDownEventParams    = script3.m_onDownEventParams;
                            script4.m_onUpEventParams      = script3.m_onUpEventParams;
                            script4.m_onClickEventParams   = script3.m_onClickEventParams;
                            script4.m_closeFormWhenClicked = script3.m_closeFormWhenClicked;
                            script4.m_belongedFormScript   = script3.m_belongedFormScript;
                            script4.m_belongedListScript   = script3.m_belongedListScript;
                            script4.m_indexInlist          = script3.m_indexInlist;
                        }
                    }
                    else
                    {
                        CUIEventScript script5 = widget.GetComponent <CUIEventScript>();
                        if (script5 != null)
                        {
                            script5.enabled = false;
                        }
                        CUIMiniEventScript script6 = widget.GetComponent <CUIMiniEventScript>();
                        if (script6 != null)
                        {
                            script6.enabled = false;
                        }
                    }
                    widget.CustomSetActive(true);
                    CUIAnimatorScript script7 = current.GetComponent <CUIAnimatorScript>();
                    if (script7 != null)
                    {
                        CUICommonSystem.PlayAnimator(widget, script7.m_currentAnimatorStateName);
                    }
                    ms_highlitGo.Add(widget);
                    GameObject content = Singleton <CResourceManager> .GetInstance().GetResource("UGUI/Form/System/Dialog/WeakGuideHighlighter.prefab", typeof(GameObject), enResourceType.UIPrefab, false, false).m_content as GameObject;

                    if (content != null)
                    {
                        GameObject item = UnityEngine.Object.Instantiate(content) as GameObject;
                        if (item != null)
                        {
                            item.transform.SetParent(widget.transform);
                            Transform transform3 = item.transform;
                            switch (this.currentConf.wFlipType)
                            {
                            case 0:
                                transform3.localScale = s_FlipNone;
                                break;

                            case 1:
                                transform3.localScale = s_FlipX;
                                break;

                            case 2:
                                transform3.localScale = s_FlipY;
                                break;

                            case 3:
                                transform3.localScale = s_FlipXY;
                                break;
                            }
                            item.transform.position = widget.transform.position;
                            (item.transform as RectTransform).anchoredPosition = new Vector2((float)this.currentConf.iOffsetHighLightX, (float)this.currentConf.iOffsetHighLightY);
                            if (!this.DoesShowArrow())
                            {
                                item.transform.FindChild("Panel/ImageFinger").gameObject.CustomSetActive(false);
                            }
                            ms_highlighter.Add(item);
                        }
                    }
                    if ((num == 0) && (this.currentConf.wSpecialTip != 0))
                    {
                        NewbieGuideSpecialTipConf specialTipConfig = Singleton <NewbieGuideDataManager> .GetInstance().GetSpecialTipConfig(this.currentConf.wSpecialTip);

                        if ((specialTipConfig != null) && (specialTipConfig.bGuideTextPos > 0))
                        {
                            GameObject obj6 = InstantiateGuideText(specialTipConfig, widget, NewbieGuideScriptControl.FormGuideMask, inOriginalForm);
                            if (obj6 != null)
                            {
                                ms_guideTextList.Add(obj6);
                                obj6.CustomSetActive(false);
                            }
                        }
                    }
                    num++;
                }
            }
        }
    }
Ejemplo n.º 21
0
        public static void AddRedDot(GameObject target, enRedDotPos dotPos = enRedDotPos.enTopRight, int alertNum = 0)
        {
            if (target == null || target.transform == null)
            {
                return;
            }
            CUIRedDotSystem.DelRedDot(target);
            GameObject gameObject;

            if (alertNum == 0)
            {
                gameObject = (Object.Instantiate(CUIUtility.GetSpritePrefeb("UGUI/Form/Common/redDot", false, false)) as GameObject);
            }
            else
            {
                gameObject = (Object.Instantiate(CUIUtility.GetSpritePrefeb("UGUI/Form/Common/redDotBig", false, false)) as GameObject);
            }
            Transform transform = gameObject.transform;

            transform.gameObject.name = CUIRedDotSystem.s_redDotName;
            CUIMiniEventScript component = transform.GetComponent <CUIMiniEventScript>();

            component.m_onDownEventParams.tag = 0;
            if (alertNum != 0 && transform.Find("Text") != null)
            {
                Text component2 = transform.Find("Text").GetComponent <Text>();
                component2.text = alertNum.ToString();
            }
            transform.SetParent(target.transform, false);
            transform.SetAsLastSibling();
            RectTransform rectTransform = transform as RectTransform;
            Vector2       anchorMin     = default(Vector2);
            Vector2       anchorMax     = default(Vector2);
            Vector2       pivot         = default(Vector2);

            switch (dotPos)
            {
            case enRedDotPos.enTopLeft:
                anchorMin.x = 0f;
                anchorMin.y = 1f;
                anchorMax.x = 0f;
                anchorMax.y = 1f;
                pivot.x     = 0f;
                pivot.y     = 1f;
                break;

            case enRedDotPos.enTopCenter:
                anchorMin.x = 0.5f;
                anchorMin.y = 1f;
                anchorMax.x = 0.5f;
                anchorMax.y = 1f;
                pivot.x     = 0.5f;
                pivot.y     = 1f;
                break;

            case enRedDotPos.enTopRight:
                anchorMin.x = 1f;
                anchorMin.y = 1f;
                anchorMax.x = 1f;
                anchorMax.y = 1f;
                pivot.x     = 1f;
                pivot.y     = 1f;
                break;

            case enRedDotPos.enMiddleLeft:
                anchorMin.x = 0f;
                anchorMin.y = 0.5f;
                anchorMax.x = 0f;
                anchorMax.y = 0.5f;
                pivot.x     = 0f;
                pivot.y     = 0.5f;
                break;

            case enRedDotPos.enMiddleCenter:
                anchorMin.x = 0.5f;
                anchorMin.y = 0.5f;
                anchorMax.x = 0.5f;
                anchorMax.y = 0.5f;
                pivot.x     = 0.5f;
                pivot.y     = 0.5f;
                break;

            case enRedDotPos.enMiddleRight:
                anchorMin.x = 1f;
                anchorMin.y = 0.5f;
                anchorMax.x = 1f;
                anchorMax.y = 0.5f;
                pivot.x     = 1f;
                pivot.y     = 0.5f;
                break;

            case enRedDotPos.enBottomLeft:
                anchorMin.x = 0f;
                anchorMin.y = 0f;
                anchorMax.x = 0f;
                anchorMax.y = 0f;
                pivot.x     = 0f;
                pivot.y     = 0f;
                break;

            case enRedDotPos.enBottomCenter:
                anchorMin.x = 0.5f;
                anchorMin.y = 0f;
                anchorMax.x = 0.5f;
                anchorMax.y = 0f;
                pivot.x     = 0.5f;
                pivot.y     = 0f;
                break;

            case enRedDotPos.enBottomRight:
                anchorMin.x = 1f;
                anchorMin.y = 0f;
                anchorMax.x = 1f;
                anchorMax.y = 0f;
                pivot.x     = 1f;
                pivot.y     = 0f;
                break;
            }
            rectTransform.pivot            = pivot;
            rectTransform.anchorMin        = anchorMin;
            rectTransform.anchorMax        = anchorMax;
            rectTransform.anchoredPosition = default(Vector2);
        }