예제 #1
0
 public void SetAllItemUnSelectByCharacter(int iCharacter)
 {
     foreach (DictionaryEntry info in petItemList)
     {
         sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon;
         UInt64           uuID = icon.GetId();
         if (uuID != UInt64.MaxValue)
         {
             sdGamePetItem petItem = sdNewPetMgr.Instance.getPetItem(uuID);
             if (petItem != null && petItem.iCharacter == iCharacter)
             {
                 icon.bSelect = false;
                 icon.ReflashSelectUI();
             }
         }
     }
 }
예제 #2
0
    void OnClickSale()
    {
        GameObject wnd = GameObject.Find("NGUIRoot");

        if (wnd)
        {
            sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
            if (petPnl)
            {
                foreach (DictionaryEntry info in petPnl.petItemList)
                {
                    sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon;
                    if (icon != null)
                    {
                        UInt64 uuID = icon.GetId();
                        if (uuID != UInt64.MaxValue && icon.bSelect == true)
                        {
                            sdPetMsg.Send_CS_PET_EVENT_REQ((byte)HeaderProto.EPetEvent.PET_ITEM_EVENT_SELL, uuID);
                        }
                    }
                }
            }
        }
    }
예제 #3
0
 void OnClick()
 {
     if (gameObject.name == "BT_petClose")
     {
         if (sdUIPetControl.m_UIPetEquipPnl != null)
         {
             sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetEquipPnl);
             if (!sdUIPetControl.Instance.IsReturnLevelPrepare())
             {
                 sdUIPetEquipPnl obj = sdUIPetControl.m_UIPetEquipPnl.GetComponent <sdUIPetEquipPnl>();
                 if (obj != null && obj.m_preWnd != null)
                 {
                     obj.m_preWnd.SetActive(true);
                 }
             }
         }
     }
     else if (gameObject.name == "tab2_all")
     {
         GameObject wnd = GameObject.Find("NGUIRoot");
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 petPnl.m_Type = PetEquipType.Pet_EquipType_all;
                 petPnl.RefreshPetItemListPage();
             }
         }
     }
     else if (gameObject.name == "tab2_armor")
     {
         GameObject wnd = GameObject.Find("NGUIRoot");
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 petPnl.m_Type = PetEquipType.Pet_EquipType_fj;
                 petPnl.RefreshPetItemListPage();
             }
         }
     }
     else if (gameObject.name == "tab2_shipin")
     {
         GameObject wnd = GameObject.Find("NGUIRoot");
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 petPnl.m_Type = PetEquipType.Pet_EquipType_sp;
                 petPnl.RefreshPetItemListPage();
             }
         }
     }
     else if (gameObject.name == "tab2_weapon")
     {
         GameObject wnd = GameObject.Find("NGUIRoot");
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 petPnl.m_Type = PetEquipType.Pet_EquipType_wq;
                 petPnl.RefreshPetItemListPage();
             }
         }
     }
     else if (gameObject.name == "btnSale")
     {
         GameObject wnd = GameObject.Find("NGUIRoot");
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 foreach (DictionaryEntry info in petPnl.petItemList)
                 {
                     sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon;
                     if (icon != null)
                     {
                         UInt64 uuID = icon.GetId();
                         if (uuID != UInt64.MaxValue && icon.bSelect == true)
                         {
                             sdMsgBox.OnConfirm btn_sale = new sdMsgBox.OnConfirm(OnClickSale);
                             sdUICharacter.Instance.ShowOkCanelMsg("您确定要将已选择的宠物装备出售么?", btn_sale, null);
                             break;
                         }
                     }
                 }
             }
         }
     }
     else if (gameObject.name == "sort_value")
     {
         GameObject wnd = sdGameLevel.instance.NGUIRoot;
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 if (petPnl.m_iSortType != (int)PetItemSortType.PetItem_SortBy_Value)
                 {
                     petPnl.m_iSortType = (int)PetItemSortType.PetItem_SortBy_Value;
                     petPnl.RefreshPetItemListPage();
                 }
             }
         }
     }
     else if (gameObject.name == "sort_color")
     {
         GameObject wnd = sdGameLevel.instance.NGUIRoot;
         if (wnd)
         {
             sdUIPetEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetEquipPnl>();
             if (petPnl)
             {
                 if (petPnl.m_iSortType != (int)PetItemSortType.PetItem_SortBy_Color)
                 {
                     petPnl.m_iSortType = (int)PetItemSortType.PetItem_SortBy_Color;
                     petPnl.RefreshPetItemListPage();
                 }
             }
         }
     }
 }
예제 #4
0
    void OnClick()
    {
        if (gameObject.name == "BT_petClose")
        {
            if (sdUIPetControl.m_UIPetChangeEquipPnl != null)
            {
                sdUIPetControl.Instance.ClosePetPnl(sdUIPetControl.m_UIPetChangeEquipPnl);
            }

            if (m_preWnd)
            {
                m_preWnd.SetActive(true);
            }

            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetPropPnl petPnl = wnd.GetComponentInChildren <sdUIPetPropPnl>();
                if (petPnl)
                {
                    petPnl.SetPetModelVisible(true);
                }
            }
        }
        else if (gameObject.name == "btnEquip")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                if (petPnl)
                {
                    foreach (DictionaryEntry info in petPnl.petItemList)
                    {
                        sdUIPetEquipIcon icon = info.Value as sdUIPetEquipIcon;
                        if (icon != null)
                        {
                            UInt64 uuID = icon.GetId();
                            if (uuID != UInt64.MaxValue && icon.bSelect == true)
                            {
                                sdPetMsg.Send_CS_PET_EQUIP_REQ(uuID, petPnl.m_uuSelectDBID, 1);
                            }
                        }
                    }
                }
            }
        }
        else if (gameObject.name == "btnUnEquip")
        {
            GameObject wnd = GameObject.Find("NGUIRoot");
            if (wnd)
            {
                sdUIPetChangeEquipPnl petPnl = wnd.GetComponentInChildren <sdUIPetChangeEquipPnl>();
                if (petPnl)
                {
                    SClientPetInfo Info = null;
                    if (petPnl.m_uuSelectDBID != UInt64.MaxValue)
                    {
                        Info = sdNewPetMgr.Instance.GetPetInfo(petPnl.m_uuSelectDBID);
                        if (Info == null)
                        {
                            return;
                        }
                    }
                    else
                    {
                        return;
                    }

                    foreach (DictionaryEntry equipInfo in Info.m_EquipedDB)
                    {
                        sdGamePetItem petItem = (sdGamePetItem)equipInfo.Value;
                        UInt64        uuID    = petItem.instanceID;
                        if (uuID != UInt64.MaxValue)
                        {
                            sdPetMsg.Send_CS_PET_EQUIP_REQ(uuID, petPnl.m_uuSelectDBID, 0);
                        }
                    }
                }
            }
        }
    }