//判断是否拥有改权限 public bool IsPowerEnough(string power) { GuildOfficial guildOfficial = GuildOfficialConfig.GetGuildOfficial(PlayerMediator.playerInfo.guildPower); if (guildOfficial == null || string.IsNullOrEmpty(guildOfficial.powerOpen)) { return(false); } string powerStr = guildOfficial.powerOpen; string[] powerStrArr = powerStr.Split(','); List <string> listPower = new List <string>(powerStrArr); int indexPower = listPower.IndexOf(power); if (indexPower == -1) { return(false); } return(true); }
//刷新职位权限 private void UpdatePostGrid(UIGridItem item) { if (item == null || item.mScripts == null || item.oData == null) { return; } GuildOfficial info = item.oData as GuildOfficial; UILabel post_label = item.mScripts[0] as UILabel; UILabel count_label = item.mScripts[1] as UILabel; UILabel powerinfo_label = item.mScripts[2] as UILabel; UIButton accuse_btn = item.mScripts[3] as UIButton; bool isImpeach = GetIsImpeach(); accuse_btn.isEnabled = isImpeach; accuse_btn.gameObject.SetActive(info.id == 5); post_label.text = TextManager.GetUIString("UIGuildPower" + info.id); int nowcount = GetGuildPowerNum(info.id); count_label.gameObject.SetActive(info.num > 0); count_label.text = nowcount + "/" + info.num; string content = string.Empty; string[] powerArr = info.powerOpen.Split(','); for (int i = 0; i < powerArr.Length; i++) { if (GameConvert.IntConvert(powerArr[i]) > 0) { content += TextManager.GetUIString("UI_GuildPower" + powerArr[i]); content += i < powerArr.Length - 1 ? "," : " "; } } UIEventListener.Get(accuse_btn.gameObject).onClick = OnImpeachClick; powerinfo_label.text = content; }
private void OnReadRow(GuildOfficial row) { m_data.Add(row.id, row); }