8536 【前端】协助伤害增加菜单 组队
未处理对方无队伍申请入队显示问题
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // B9 11 请求加入队伍 #tagCGRequestJoinTeam
|
| | |
|
| | | public class CB911_tagCGRequestJoinTeam : GameNetPackBasic {
|
| | | public uint TeamID; // 目标队伍ID
|
| | |
|
| | | public CB911_tagCGRequestJoinTeam () {
|
| | | combineCmd = (ushort)0x1801;
|
| | | _cmd = (ushort)0xB911;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (TeamID, NetDataType.DWORD);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 83b61950137ffd847aaa445325a7abf7 |
| | | timeCreated: 1602245091 |
| | | licenseType: Free |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | { |
| | | [SerializeField] List<Text> playerNameTexts; |
| | | [SerializeField] List<Text> valueTexts; |
| | | [SerializeField] List<Button> helpBtns; |
| | | [SerializeField] Text mineValueText; |
| | | |
| | | |
| | |
| | | private object RegexPlayerDatas; |
| | | |
| | | DungeonModel model { get { return ModelCenter.Instance.GetModel<DungeonModel>(); } } |
| | | TeamModel m_TeamModel { get { return ModelCenter.Instance.GetModel<TeamModel>(); } } |
| | | |
| | | public void Init(int mapID) |
| | | { |
| | |
| | | (model.BossHurtRank.bossHurtInfo[i].HurtType == 2 ? Language.Get("ChatType_Team") : ""); |
| | | valueTexts[i].text = UIHelper.ReplaceLargeNum(model.BossHurtRank.bossHurtInfo[i].totalHurt); |
| | | |
| | | //自己,自己队伍,协助对象(队伍) 不显示; |
| | | bool isShowHelp = true; |
| | | if (model.BossHurtRank.bossHurtInfo[i].HurtID == 0) |
| | | { |
| | | isShowHelp = false; |
| | | } |
| | | else if (CrossServerUtility.IsCrossServer()) |
| | | { |
| | | isShowHelp = false; |
| | | } |
| | | else if (model.BossHurtRank.bossHurtInfo[i].HurtType == 1 |
| | | && PlayerDatas.Instance.baseData.PlayerID == model.BossHurtRank.bossHurtInfo[i].HurtID) |
| | | { |
| | | isShowHelp = false; |
| | | } |
| | | else if (model.BossHurtRank.bossHurtInfo[i].HurtType == 2 |
| | | && m_TeamModel.myTeam.teamId == model.BossHurtRank.bossHurtInfo[i].HurtID) |
| | | { |
| | | isShowHelp = false; |
| | | } |
| | | else if (PlayerDatas.Instance.baseData.ExAttr1 != 0 && model.BossHurtRank.bossHurtInfo[i].HurtType == 2) |
| | | { |
| | | var assistActor = GAMgr.Instance.GetBySID(PlayerDatas.Instance.baseData.ExAttr1) as GA_Player; |
| | | if (assistActor != null && assistActor.ActorInfo.teamID == model.BossHurtRank.bossHurtInfo[i].HurtID) |
| | | { |
| | | isShowHelp = false; |
| | | } |
| | | else if (assistActor == null) |
| | | { |
| | | //无法确认队伍关系的不显示 |
| | | isShowHelp = false; |
| | | } |
| | | } |
| | | else if (PlayerDatas.Instance.baseData.ExAttr1 == model.BossHurtRank.bossHurtInfo[i].HurtID) |
| | | { |
| | | isShowHelp = false; |
| | | } |
| | | |
| | | |
| | | helpBtns[i].gameObject.SetActive(isShowHelp); |
| | | var id = (int)model.BossHurtRank.bossHurtInfo[i].HurtID; |
| | | var name = playerNameTexts[i].text; |
| | | var inTeam = model.BossHurtRank.bossHurtInfo[i].HurtType == 2 ? 1:0; |
| | | helpBtns[i].SetListener(()=>{ |
| | | PlayerDetails.ShowBossHurtPlayer(id, name, inTeam); |
| | | }); |
| | | |
| | | } |
| | | } |
| | | } |
| | | else if (model.selectHurtModel == 2) |
| | |
| | | { |
| | | playerNameTexts[i].text = model.BossHurtRank.assistBossHurtInfo[i].playerName; |
| | | valueTexts[i].text = UIHelper.ReplaceLargeNum(model.BossHurtRank.assistBossHurtInfo[i].totalHurt); |
| | | |
| | | helpBtns[i].gameObject.SetActive(false); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | playerNameTexts[i].text = string.Empty; |
| | | valueTexts[i].text = string.Empty; |
| | | helpBtns[i].gameObject.SetActive(false); |
| | | i++; |
| | | } |
| | | |
| | |
| | | |
| | | private void ShowButton() |
| | | { |
| | | ShowAssistTips.gameObject.SetActive(!CrossServerUtility.IsCrossServer()); |
| | | SendAssist.gameObject.SetActive(!CrossServerUtility.IsCrossServer()); |
| | | |
| | | if (PlayerDatas.Instance.baseData.ExAttr1 > 0) |
| | | { |
| | | SendAssist.SetColorful(null, false); |
| | |
| | | GameNetSystem.Instance.SendInfo(apply);
|
| | | }
|
| | |
|
| | | public void RequestApplyForJoinByTeam(int _teamID)
|
| | | {
|
| | | var apply = new CB911_tagCGRequestJoinTeam();
|
| | | apply.TeamID = (uint)_teamID;
|
| | | GameNetSystem.Instance.SendInfo(apply);
|
| | | }
|
| | |
|
| | | public void RequestCreateTeam(int _mapId, int _lineId, int _levelMin = 1, int _levelMax = 1)
|
| | | {
|
| | | var mapId = _mapId == NONE_MISSION ? 0 : _mapId == CURRENTMAP_MISSION ? PlayerDatas.Instance.baseData.MapID : _mapId;
|
| | |
| | | m_ContainerDetail.localPosition = PlayerDetails.targetPos; |
| | | m_PlayerTxt.text = UIHelper.ServerStringTrim(PlayerDetails.PlayerName);
|
| | | m_LevelSign.gameObject.SetActive(false);
|
| | | m_PlayerLevelTxt.gameObject.SetActive(PlayerDetails.LV!=0); |
| | | m_PlayerLevelTxt.text = Language.Get("PlayerDetail_Level", PlayerDetails.LV); |
| | | if (PlayerDetails.openType == PlayerDetails.OpenType.Assist) |
| | | { |
| | | CheckAssisType(); |
| | | } |
| | | else |
| | | { |
| | | CheckDetailType(); |
| | | } |
| | | OnPlayerDetailRefresh(); |
| | | |
| | | var _rt = m_ContainerDetail as RectTransform; |
| | |
| | | m_ContainerDetail.localPosition = pos; |
| | | } |
| | | |
| | | private void CheckAssisType() |
| | | { |
| | | funcTypes.Clear(); |
| | | funcTypes.Add(PlayerDetails.DetailType.Kill); |
| | | if (PlayerDetails.IsInTeam == 1) |
| | | { |
| | | funcTypes.Add(PlayerDetails.DetailType.ApplyTeam); |
| | | } |
| | | else |
| | | { |
| | | funcTypes.Add(PlayerDetails.DetailType.ApplyTeam); |
| | | funcTypes.Add(PlayerDetails.DetailType.InviteTeam); |
| | | } |
| | | } |
| | | public void CheckDetailType() |
| | | { |
| | | funcTypes.Clear(); |
| | |
| | | if (_ok) |
| | | { |
| | | m_TeamModel.RequestExitTeam(); |
| | | if (PlayerDetails.openType == PlayerDetails.OpenType.Assist && |
| | | PlayerDetails.IsInTeam == 1) |
| | | { |
| | | //此处代表队伍ID |
| | | m_TeamModel.RequestApplyForJoinByTeam(PlayerDetails.PlayerID); |
| | | } |
| | | else |
| | | { |
| | | m_TeamModel.RequestApplyForJoin(PlayerDetails.PlayerID); |
| | | } |
| | | } |
| | | } |
| | | ); |
| | |
| | | case PlayerDetails.DetailType.InviteFairy: |
| | | m_FairyModel.SendInviteFairy(PlayerDetails.PlayerID, PlayerDetails.PlayerName); |
| | | break; |
| | | case PlayerDetails.DetailType.Kill: |
| | | uint tagetID = 0; |
| | | //队伍中的攻击目标 |
| | | if (PlayerDetails.IsInTeam == 1) |
| | | { |
| | | List<GActor> _list = GAMgr.Instance.GetTypeList(E_ActorClassType.Player); |
| | | if (_list == null || _list.Count == 0) |
| | | { |
| | | break; |
| | | } |
| | | foreach(var actor in _list) |
| | | { |
| | | var tagetPlayer = actor as GA_Player; |
| | | if (tagetPlayer.ActorInfo.teamID == PlayerDetails.PlayerID) |
| | | { |
| | | tagetID = tagetPlayer.ActorInfo.sid; |
| | | break; |
| | | } |
| | | } |
| | | if (tagetID == 0) |
| | | { |
| | | break; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | tagetID = (uint)PlayerDetails.PlayerID; |
| | | } |
| | | |
| | | var _hero = PlayerDatas.Instance.hero; |
| | | var taget = GAMgr.Instance.GetBySID(tagetID); |
| | | if (taget != null) |
| | | { |
| | | _hero.SelectTarget = _hero.LockTarget = taget; |
| | | GA_Hero.CallLockTargetChanged(_hero.LockTarget.ServerInstID); |
| | | |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | |
| | |
| | | }
|
| | | } |
| | | |
| | | public static void ShowBossHurtPlayer(int playerId, string name, int inTeam) |
| | | { |
| | | openType = OpenType.Assist; |
| | | PlayerID = playerId; |
| | | LV = 0; |
| | | Job = 1; |
| | | RealmLV = 0; |
| | | PlayerName = name; |
| | | OnlineType = 0; |
| | | IsInTeam = inTeam; |
| | | ServerGroupId = 0; |
| | | |
| | | RectTransformUtility.ScreenPointToLocalPointInRectangle(WindowCenter.Instance.uiRoot.tipsCanvas, Input.mousePosition, WindowCenter.Instance.uiRoot.uicamera, out targetPos); |
| | | |
| | | if (!WindowCenter.Instance.IsOpen<PlayerDetailWin>()) |
| | | { |
| | | WindowCenter.Instance.Open<PlayerDetailWin>(); |
| | | } |
| | | } |
| | | |
| | | public static void ShowAreaPlayer(int _playerId)
|
| | | {
|
| | | openType = OpenType.Default; |
| | |
| | | public enum DetailType |
| | | { |
| | | PrivateChat = 0,//私聊 |
| | | ViewEquip = 1,//查看装备 |
| | | AddFriend = 2,//加为好友 |
| | | DeleteFriend = 3,//删除好友 |
| | | AddBlack = 4,//加入黑名单 |
| | | AddTeam = 5,//加入队伍 |
| | | FairyLv = 6,//更改仙盟职权 |
| | | KickFairy = 7,//提出仙盟 |
| | | ApplyTeam = 8, //申请入队 |
| | | InviteTeam = 9, //邀请入队 |
| | | RemoveBlack = 10, //移出黑名单 |
| | | LookFight = 11,//查看战力 |
| | | InviteFairy = 12,//邀请入盟 |
| | | ViewEquip,//查看装备 |
| | | AddFriend,//加为好友 |
| | | DeleteFriend,//删除好友 |
| | | AddBlack,//加入黑名单 |
| | | AddTeam,//加入队伍 |
| | | FairyLv,//更改仙盟职权 |
| | | KickFairy,//提出仙盟 |
| | | Kill, //击杀 |
| | | ApplyTeam, //申请入队 |
| | | InviteTeam, //邀请入队 |
| | | RemoveBlack, //移出黑名单 |
| | | LookFight,//查看战力 |
| | | InviteFairy,//邀请入盟 |
| | | } |
| | | |
| | | public enum OpenType |
| | |
| | | Fairy, |
| | | Friend, |
| | | CrossPlayer, |
| | | Assist, |
| | | } |
| | | |
| | | public static int PlayerID = 0; |