private void On_Guild_Recruit_Apply_Join(CUIEvent uiEvent) { ulong commonUInt64Param = uiEvent.m_eventParams.commonUInt64Param1; stGuildBriefInfo stBriefInfo = this.m_Model.GetAppliedGuildInfoByUid(commonUInt64Param).stBriefInfo; if (stBriefInfo.uulUid != 0uL) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Current_Guild_Has_Invited_Tip", true, 1.5f, null, new object[0]); return; } if (CGuildHelper.IsInLastQuitGuildCd()) { return; } if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum > 0) { uint dwConfValue = GameDataMgr.guildMiscDatabin.GetDataByKey(8u).dwConfValue; if ((long)(Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_extGuildInfo.bApplyJoinGuildNum + 1) > (long)((ulong)dwConfValue)) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_Today_Apply_Reach_Limit_Tip", true, 1.5f, null, new object[0]); return; } } Singleton <CGuildListController> .GetInstance().RequestApplyJoinGuild(commonUInt64Param, true); }
private void On_Guild_Guild_Select(CUIEvent uiEvent) { int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex(); GuildInfo guildInfoByIndex = this.m_Model.GetGuildInfoByIndex(selectedIndex); if (guildInfoByIndex != null) { CUIHttpImageScript component = this.m_form.GetWidget(34).GetComponent <CUIHttpImageScript>(); component.SetImageUrl(CGuildHelper.GetHeadUrl(guildInfoByIndex.chairman.stBriefInfo.szHeadUrl)); MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(this.m_form.GetWidget(41).GetComponent <Image>(), CGuildHelper.GetNobeLevel(guildInfoByIndex.chairman.stBriefInfo.uulUid, guildInfoByIndex.chairman.stBriefInfo.stVip.level), false); MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(this.m_form.GetWidget(40).GetComponent <Image>(), CGuildHelper.GetNobeHeadIconId(guildInfoByIndex.chairman.stBriefInfo.uulUid, guildInfoByIndex.chairman.stBriefInfo.stVip.headIconId)); this.m_form.GetWidget(10).GetComponent <Text>().text = guildInfoByIndex.briefInfo.sBulletin; this.m_form.GetWidget(11).GetComponent <Text>().text = guildInfoByIndex.chairman.stBriefInfo.sName; this.m_form.GetWidget(39).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Common_Level_Format", new string[] { guildInfoByIndex.chairman.stBriefInfo.dwLevel.ToString() }); Image component2 = this.m_form.GetWidget(46).GetComponent <Image>(); Text component3 = this.m_form.GetWidget(47).GetComponent <Text>(); Text component4 = this.m_form.GetWidget(48).GetComponent <Text>(); component2.SetSprite(CGuildHelper.GetGradeIconPathByRankpointScore(guildInfoByIndex.RankInfo.totalRankPoint), this.m_form, true, false, false, false); component3.text = CGuildHelper.GetGradeName(guildInfoByIndex.RankInfo.totalRankPoint); component4.text = Singleton <CTextManager> .GetInstance().GetText("Guild_Profit_Desc", new string[] { CGuildHelper.GetCoinProfitPercentage((int)guildInfoByIndex.briefInfo.bLevel).ToString() }); } }
public static string GetFriendSourceDesc(ulong friendUid, COMDT_FRIEND_SOURCE friendSource) { if (friendSource != null) { COM_ADD_FRIEND_TYPE bAddFriendType = friendSource.bAddFriendType; if (bAddFriendType == 1) { string heroName = CHeroInfo.GetHeroName(friendSource.stAddFriendInfo.get_stPvp().dwHeroID); if (!string.IsNullOrEmpty(heroName)) { return(Singleton <CTextManager> .GetInstance().GetText("Friend_Apply_Play_With_You_Tip", new string[] { heroName })); } DebugHelper.Assert(false, "好友来源是PVP,但却获取不了英雄名,heroId={0}", new object[] { friendSource.stAddFriendInfo.get_stPvp().dwHeroID }); } else { if (CGuildHelper.IsInSameGuild(friendUid)) { return(Singleton <CTextManager> .GetInstance().GetText("Friend_Apply_Same_Guild_Tip")); } if (bAddFriendType == 2) { return(Singleton <CTextManager> .GetInstance().GetText("Friend_Apply_Nearby_You_Tip")); } } } return(string.Empty); }
public void OnGuildRankpointRequestRankList(enGuildRankpointRankListType rankListType) { if (CGuildHelper.IsNeedRequestNewRankpoinRank(rankListType)) { switch (rankListType) { case enGuildRankpointRankListType.CurrentWeek: this.RequestGetRankpointWeekRank(0); break; case enGuildRankpointRankListType.LastWeek: this.RequestGetRankpointWeekRank(1); break; case enGuildRankpointRankListType.SeasonSelf: this.RequestGetRankpointSeasonRankBySpecialScore(); this.RequestGetPlayerGuildRankInfo(); break; case enGuildRankpointRankListType.SeasonBest: this.RequestGetRankpointSeasonRank(); this.RequestGetPlayerGuildRankInfo(); break; } } }
private void SetGuildListItem(CUIListElementScript listElementScript, GuildInfo info) { Transform transform = listElementScript.transform; Image component = transform.Find("imgIcon").GetComponent <Image>(); Text component2 = transform.Find("txtName").GetComponent <Text>(); Text component3 = transform.Find("txtMemCnt").GetComponent <Text>(); GameObject gameObject = transform.Find("imgApplied").gameObject; Text component4 = transform.Find("txtChairmanName").GetComponent <Text>(); Text component5 = transform.Find("txtSeasonRankpoint").GetComponent <Text>(); Text component6 = transform.Find("txtJoinLimit").GetComponent <Text>(); string prefabPath = CUIUtility.s_Sprite_Dynamic_GuildHead_Dir + info.briefInfo.dwHeadId; component.SetSprite(prefabPath, this.m_form, true, false, false, false); component2.text = info.briefInfo.sName; component3.text = info.briefInfo.bMemberNum + "/" + CGuildHelper.GetMaxGuildMemberCountByLevel((int)info.briefInfo.bLevel); component4.text = info.chairman.stBriefInfo.sName; component5.text = info.chairman.RankInfo.totalRankPoint.ToString(); component6.text = CGuildHelper.GetGuildJoinLimitText((int)info.briefInfo.LevelLimit, (int)info.briefInfo.GradeLimit, info.briefInfo.dwSettingMask); stGuildBriefInfo stBriefInfo = this.m_Model.GetAppliedGuildInfoByUid(info.briefInfo.uulUid).stBriefInfo; if (stBriefInfo.uulUid != 0uL) { gameObject.CustomSetActive(true); } else { gameObject.CustomSetActive(false); } }
public void OnGuildRankpointRequestRankList(enGuildRankpointRankListType rankListType, bool isNeedOpenRankpointFormWhenNotRequest) { if (CGuildHelper.IsNeedRequestNewRankpoinRank(rankListType)) { switch (rankListType) { case enGuildRankpointRankListType.CurrentWeek: this.RequestGetRankpointWeekRank(0); break; case enGuildRankpointRankListType.LastWeek: this.RequestGetRankpointWeekRank(1); break; case enGuildRankpointRankListType.SeasonSelf: this.RequestGetRankpointSeasonRankBySpecialScore(); this.RequestGetPlayerGuildRankInfo(); break; case enGuildRankpointRankListType.SeasonBest: this.RequestGetRankpointSeasonRank(); this.RequestGetPlayerGuildRankInfo(); break; } } else if (isNeedOpenRankpointFormWhenNotRequest) { this.m_View.OpenRankpointForm(); } }
public void ChangeGuildSignState(bool isSigned) { CGuildHelper.SetPlayerSigned(isSigned); if (this.m_View != null) { this.m_View.RefreshInfoPanelSignBtn(); } }
public static uint GetGuildGrade() { if (Singleton <CGuildSystem> .GetInstance().IsInNormalGuild()) { return(CGuildHelper.GetGradeByRankpointScore(Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.RankInfo.totalRankPoint)); } return(0u); }
public void PrepareSettle() { GuildMemInfo playerGuildMemberInfo = CGuildHelper.GetPlayerGuildMemberInfo(); if (playerGuildMemberInfo != null) { this.maxRankPoint = playerGuildMemberInfo.RankInfo.maxRankPoint; } }
public static void SetPlayerSigned(bool isSigned) { GuildMemInfo playerGuildMemberInfo = CGuildHelper.GetPlayerGuildMemberInfo(); if (playerGuildMemberInfo != null) { playerGuildMemberInfo.RankInfo.isSigned = isSigned; } }
public static int GetMemberLogicWorldId(ulong memberUid) { GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(memberUid); if (guildMemberInfoByUid != null) { return(guildMemberInfoByUid.stBriefInfo.dwLogicWorldId); } return(0); }
public static bool IsGuildMatchFormInviteTabShowRedDot() { if (!Singleton <CGuildSystem> .GetInstance().IsInNormalGuild()) { return(false); } bool flag = Singleton <CGuildMatchSystem> .GetInstance().IsSelfBelongedTeamLeader(); return(flag && CGuildHelper.IsCanShowRedDotForTeamNotFullReason()); }
public static int GetViceChairmanMaxCount() { int guildLevel = CGuildHelper.GetGuildLevel(); if (guildLevel > 0) { return((int)GameDataMgr.guildLevelDatabin.GetDataByKey((uint)((byte)guildLevel)).bViceChairManCnt); } return(-1); }
public static byte GetFixedGuildLevelLimit(byte originalLevelLimit) { uint guildMemberMinPvpLevel = CGuildHelper.GetGuildMemberMinPvpLevel(); if ((uint)originalLevelLimit < guildMemberMinPvpLevel) { return((byte)guildMemberMinPvpLevel); } return(originalLevelLimit); }
private void OnGlobalRefreshTime() { if (this.m_View != null) { this.m_View.RefreshInfoPanelSignBtn(); } Singleton <EventRouter> .GetInstance().BroadCastEvent <bool>("Guild_Sign_State_Changed", false); CGuildHelper.SetSendGuildMailCnt(0); }
public void OnAcceptInvite() { if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_baseGuildInfo.guildState != COM_PLAYER_GUILD_STATE.COM_PLAYER_GUILD_STATE_NULL) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_No_Guild_Can_Accept_Invite_Tip", true, 1.5f, null, new object[0]); } else if (!CGuildHelper.IsInLastQuitGuildCd() && (this.m_Model.m_InviteGuildUuid != 0)) { this.RequestDealInviteReq(1); } }
private static int GuildMemberComparison(GuildMemInfo a, GuildMemInfo b) { if (CGuildHelper.IsMemberOnline(a) && !CGuildHelper.IsMemberOnline(b)) { return(-1); } if (!CGuildHelper.IsMemberOnline(a) && CGuildHelper.IsMemberOnline(b)) { return(1); } return((a.stBriefInfo.uulUid >= b.stBriefInfo.uulUid) ? 1 : -1); }
public static void UpdateGuildMemberListElement(GameObject element, GuildMemInfo guildMember) { GameObject gameObject = element.transform.FindChild("HeadBg").gameObject; GameObject obj3 = element.transform.FindChild("InviteButton").gameObject; Text component = element.transform.FindChild("PlayerName").GetComponent <Text>(); Text text2 = element.transform.FindChild("Online").GetComponent <Text>(); Image image = element.transform.FindChild("NobeIcon").GetComponent <Image>(); Image image2 = element.transform.FindChild("HeadBg/NobeImag").GetComponent <Image>(); if (image != null) { MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(image, (int)guildMember.stBriefInfo.stVip.level, false); } if (image2 != null) { MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(image2, (int)guildMember.stBriefInfo.stVip.headIconId); } component.text = Utility.UTF8Convert(guildMember.stBriefInfo.sName); if (CGuildHelper.IsMemberOnline(guildMember)) { if (guildMember.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE) { text2.text = string.Format("<color=#00ff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Online")); CUIEventScript script = obj3.GetComponent <CUIEventScript>(); script.m_onClickEventParams.tag = (int)Singleton <CInviteSystem> .instance.InviteType; script.m_onClickEventParams.commonUInt64Param1 = guildMember.stBriefInfo.uulUid; } else if ((guildMember.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_SINGLEGAME) || (guildMember.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_MULTIGAME)) { text2.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Gaming")); } else if (guildMember.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_TEAM) { text2.text = string.Format("<color=#ffff00>{0}</color>", Singleton <CTextManager> .instance.GetText("Common_Teaming")); } component.color = CUIUtility.s_Color_White; CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_White; } else { text2.text = string.Format(Singleton <CTextManager> .instance.GetText("Common_Offline"), new object[0]); component.color = CUIUtility.s_Color_Grey; CUIUtility.GetComponentInChildren <Image>(gameObject).color = CUIUtility.s_Color_GrayShader; } obj3.CustomSetActive(CGuildHelper.IsMemberOnline(guildMember) && (guildMember.GameState == COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE)); string szHeadUrl = guildMember.stBriefInfo.szHeadUrl; if (!string.IsNullOrEmpty(szHeadUrl)) { CUIUtility.GetComponentInChildren <CUIHttpImageScript>(gameObject).SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(szHeadUrl)); } }
public static RankpointRankInfo GetPlayerGuildRankpointRankInfo(enGuildRankpointRankListType rankListType) { ListView <RankpointRankInfo> listView = Singleton <CGuildModel> .GetInstance().RankpointRankInfoLists[(int)rankListType]; for (int i = 0; i < listView.Count; i++) { if (Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.briefInfo.uulUid == listView[i].guildId) { return(listView[i]); } } return(CGuildHelper.CreatePlayerGuildRankpointRankInfo(rankListType)); }
public static RankpointRankInfo CreatePlayerGuildRankpointRankInfo(enGuildRankpointRankListType rankListType) { return(new RankpointRankInfo { guildId = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.briefInfo.uulUid, rankScore = (CGuildHelper.IsWeekRankListType(rankListType) ? Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.RankInfo.weekRankPoint : Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.RankInfo.totalRankPoint), guildHeadId = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.briefInfo.dwHeadId, guildName = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.briefInfo.sName, guildLevel = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.briefInfo.bLevel, memberNum = (byte)CGuildHelper.GetGuildMemberCount(), star = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.star }); }
public static bool IsGuildHighestMatchScore() { ResGuildMisc dataByKey = GameDataMgr.guildMiscDatabin.GetDataByKey(50u); if (dataByKey != null) { uint guildMatchLastWeekRankNo = CGuildHelper.GetGuildMatchLastWeekRankNo(); if (guildMatchLastWeekRankNo != 0u) { return(guildMatchLastWeekRankNo <= dataByKey.dwConfValue); } } return(false); }
public static uint GetGuildHeadImageShopOpenSlotCount() { uint guildGrade = CGuildHelper.GetGuildGrade(); if (guildGrade > 0u) { return(GameDataMgr.guildGradeDatabin.GetDataByKey(guildGrade).dwGuildHeadImageShopOpenSlotCnt); } DebugHelper.Assert(false, "error guild grade: {0}!!!", new object[] { guildGrade }); return(0u); }
public void SetChatTab(CChatChannelMgr.EChatTab type) { this.CurActiveChannels.Clear(); if (type == CChatChannelMgr.EChatTab.Normal) { this.CurActiveChannels.Add(2u); this.CurActiveChannels.Add(4u); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null && masterRoleInfo.PvpLevel >= CGuildHelper.GetGuildMemberMinPvpLevel() && Singleton <CGuildSystem> .GetInstance() != null) { if (Singleton <CGuildSystem> .GetInstance().IsInNormalGuild()) { this.CurActiveChannels.Add(5u); } else { this.CurActiveChannels.Add(6u); } } this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.Room) { this.CurActiveChannels.Add(1u); this.CurActiveChannels.Add(4u); this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.Team) { this.CurActiveChannels.Add(0u); this.CurActiveChannels.Add(4u); this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.Settle) { this.CurActiveChannels.Add(10u); this.ChatTab = type; } else if (type == CChatChannelMgr.EChatTab.GuildMatch) { if (Singleton <CGuildMatchSystem> .GetInstance().IsSelfInAnyTeam()) { this.CurActiveChannels.Add(3u); } this.CurActiveChannels.Add(5u); this.CurActiveChannels.Add(4u); this.ChatTab = type; } }
private void InitAllGuildMemberList() { ListView <GuildMemInfo> guildMemberInfos = CGuildHelper.GetGuildMemberInfos(); this.m_allGuildMemberList = new ListView <GuildMemInfo>(); this.m_allGuildMemberList.AddRange(guildMemberInfos); for (int i = this.m_allGuildMemberList.Count - 1; i >= 0; i--) { if (CGuildHelper.IsSelf(this.m_allGuildMemberList[i].stBriefInfo.uulUid)) { this.m_allGuildMemberList.RemoveAt(i); break; } } }
public static void SetStarLevelPanel(uint starLevel, Transform panelTransform, CUIFormScript form) { if (panelTransform == null) { return; } int num = (int)(starLevel / 216u); int num2 = (int)(starLevel % 216u / 36u); int num3 = (int)(starLevel % 216u % 36u / 6u); int num4 = (int)(starLevel % 216u % 36u % 6u); int childCount = panelTransform.childCount; for (int i = 0; i < childCount; i++) { Transform child = panelTransform.GetChild(i); if (child == null) { return; } Image component = child.GetComponent <Image>(); if (component == null) { return; } child.gameObject.CustomSetActive(true); if (i < num) { component.SetSprite(CGuildHelper.DynamicPrefabPathCrown, form, true, false, false, false); } else if (i < num + num2) { component.SetSprite(CGuildHelper.DynamicPrefabPathSun, form, true, false, false, false); } else if (i < num + num2 + num3) { component.SetSprite(CGuildHelper.DynamicPrefabPathMoon, form, true, false, false, false); } else if (i < num + num2 + num3 + num4) { component.SetSprite(CGuildHelper.DynamicPrefabPathStar, form, true, false, false, false); } else { child.gameObject.CustomSetActive(false); } } CUICommonSystem.SetCommonTipsEvent(form, panelTransform.gameObject, CGuildHelper.GetStarLevelTipString(starLevel), enUseableTipsPos.enTop); }
private void OnReceivePrepareGuildList(ListView <PrepareGuildInfo> guildList, uint totalCnt, byte pageId, byte thisCnt) { if (pageId == 0) { this.m_Model.ClearPrepareGuildInfoList(); } this.m_Model.AddPrepareGuildInfoList(guildList); if (CGuildHelper.IsLastPage((int)pageId, totalCnt, 10)) { this.m_View.RefreshPrepareGuildPanel(false, pageId, true); } else { this.m_View.RefreshPrepareGuildPanel(false, pageId, false); } }
public static bool IsViceChairmanFull() { ListView <GuildMemInfo> listMemInfo = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.listMemInfo; int num = 0; for (int i = 0; i < listMemInfo.get_Count(); i++) { if (listMemInfo.get_Item(i).enPosition == 4) { num++; } } int viceChairmanMaxCount = CGuildHelper.GetViceChairmanMaxCount(); return(viceChairmanMaxCount > 0 && num >= viceChairmanMaxCount); }
public void OnAcceptInvite() { if (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_baseGuildInfo.guildState != null) { Singleton <CUIManager> .GetInstance().OpenTips("Guild_No_Guild_Can_Accept_Invite_Tip", true, 1.5f, null, new object[0]); return; } if (CGuildHelper.IsInLastQuitGuildCd()) { return; } if (this.m_Model.m_InviteGuildUuid != 0uL) { this.RequestDealInviteReq(1); } }
public static bool IsViceChairmanFull() { ListView <GuildMemInfo> listMemInfo = Singleton <CGuildModel> .GetInstance().CurrentGuildInfo.listMemInfo; int num = 0; for (int i = 0; i < listMemInfo.Count; i++) { if (listMemInfo[i].enPosition == COM_PLAYER_GUILD_STATE.COM_PLAYER_GUILD_STATE_VICE_CHAIRMAN) { num++; } } int viceChairmanMaxCount = CGuildHelper.GetViceChairmanMaxCount(); return(viceChairmanMaxCount > 0 && num >= viceChairmanMaxCount); }
public static void SetInviteGuildMemberData(CUIFormScript form, COM_INVITE_JOIN_TYPE joinType) { ListView <GuildMemInfo> allGuildMemberList = Singleton <CInviteSystem> .GetInstance().GetAllGuildMemberList(); int count = allGuildMemberList.Count; int num2 = 0; RefreshInviteGuildMemberList(form, count); for (int i = 0; i < count; i++) { if (CGuildHelper.IsMemberOnline(allGuildMemberList[i])) { num2++; } } string[] args = new string[] { num2.ToString(), count.ToString() }; form.GetWidget(6).GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Common_Online_Member", args); }