Ejemplo n.º 1
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            CRoomView.SetStartBtnStatus(root, data);
            CRoomView.UpdateBtnStatus(root, data);
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = (int)(pvpMapCommonInfo.bMaxAcntNum / 2);

            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().text = pvpMapCommonInfo.szName;
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().text    = Singleton <CTextManager> .get_instance().GetText(string.Format("Common_Team_Player_Type_{0}", num));

            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            for (int i = 1; i <= 5; i++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/LeftPlayers/Left_Player{0}", i)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(1, i - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, 1, i - 1, num >= i);
            }
            for (int j = 1; j <= 5; j++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/RightPlayers/Right_Player{0}", j)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(2, j - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, 2, j - 1, num >= j);
            }
            ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);

            CRoomView.SetComEnable(pvpMapCommonInfo2.stPickRuleInfo.bPickType != 3);
        }
Ejemplo n.º 2
0
        public static void SetRoomData(GameObject root, RoomInfo data)
        {
            ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);
            int num = (int)(pvpMapCommonInfo.bMaxAcntNum / 2);

            CRoomView.SetStartBtnStatus(root, data, (int)pvpMapCommonInfo.bMaxAcntNum);
            CRoomView.UpdateBtnStatus(root, data);
            if (data.fromType == COM_ROOM_FROMTYPE.COM_ROOM_FROM_QQSPROT)
            {
                Transform transform = root.transform.Find("Btn_Back");
                if (transform)
                {
                    transform.gameObject.CustomSetActive(false);
                }
            }
            root.transform.Find("Panel_Main/MapInfo/txtMapName").gameObject.GetComponent <Text>().set_text(pvpMapCommonInfo.szName);
            root.transform.Find("Panel_Main/MapInfo/txtTeam").gameObject.GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText(string.Format("Common_Team_Player_Type_{0}", num)));
            MemberInfo masterMemberInfo = data.GetMasterMemberInfo();

            DebugHelper.Assert(masterMemberInfo != null);
            COM_ROOM_FROMTYPE fromType = data.fromType;

            for (int i = 1; i <= 5; i++)
            {
                GameObject gameObject = root.transform.Find(string.Format("Panel_Main/LeftPlayers/Left_Player{0}", i)).gameObject;
                MemberInfo memberInfo = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1);
                CRoomView.SetPlayerSlotData(gameObject, memberInfo, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_1, i - 1, num >= i, fromType);
            }
            for (int j = 1; j <= 5; j++)
            {
                GameObject gameObject2 = root.transform.Find(string.Format("Panel_Main/RightPlayers/Right_Player{0}", j)).gameObject;
                MemberInfo memberInfo2 = data.GetMemberInfo(COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1);
                CRoomView.SetPlayerSlotData(gameObject2, memberInfo2, masterMemberInfo, COM_PLAYERCAMP.COM_PLAYERCAMP_2, j - 1, num >= j, fromType);
            }
            ResDT_LevelCommonInfo pvpMapCommonInfo2 = CLevelCfgLogicManager.GetPvpMapCommonInfo(data.roomAttrib.bMapType, data.roomAttrib.dwMapId);

            CRoomView.SetComEnable(pvpMapCommonInfo2.stPickRuleInfo.bPickType != 3);
            if (fromType == COM_ROOM_FROMTYPE.COM_ROOM_FROM_QQSPROT)
            {
                CRoomView.DontShowComEnable(false);
            }
        }