/** 显示战斗中的界面 */ private void showFightingUI() { if (!isAwakeformHide && data.areas.Count == 1 && !GuildFightSampleManager.Instance().isGuildFightOver()) { MessageWindow.ShowAlert(Language("GuildArea_46")); } //buttonRevive.gameObject.SetActive (data.isDead); //buttonRevive.disableButton (!data.isDead); // if (!data.isDead) { // buttonRevive.textLabel.effectColor = new Color (0.22f, 0.22f, 0.22f); // } else { // buttonRevive.textLabel.effectColor = new Color (0.67f, 0.05f, 0.075f); // } buttonRank.gameObject.SetActive(true); buttonGetPower.disableButton(!data.get_power); buttonRule.gameObject.SetActive(true); notOpenGroup.SetActive(false); areaGroup.SetActive(true); GuildAreaPreInfo [] preArray = new GuildAreaPreInfo[data.areas.Count]; data.areas.CopyTo(preArray); SetKit.sort(preArray, new GuildAreaPreCompareWithWarNum()); List <GuildAreaPreInfo> list = new List <GuildAreaPreInfo> (); list.AddRange(preArray); for (int i = 0; i < data.areas.Count; i++) { data.areas [i].rank = list.IndexOf(data.areas [i]) + 1; areaItems [i].initUI(data.areas [i], data.curBlood, data.maxBlood); } initSmallMan(); showTips(); }
public void initUI(GuildAreaPreInfo data, float curBolld, float maxBolld) { this.data = data; if (data.uid != GuildManagerment.Instance.getGuild().uid) { name.color = Color.red; } selfCurBol = curBolld; selfMaxBol = maxBolld; name.text = data.name + "." + data.server; warNum.text = LanguageConfigManager.Instance.getLanguage("GuildArea_16") + data.warNum.ToString(); rank.text = LanguageConfigManager.Instance.getLanguage("GuildArea_18", data.rank.ToString()); judge.text = LanguageConfigManager.Instance.getLanguage("GuildArea_19") + data.getJudeString(); /** 被击破 */ if (data.state == 3) { build.spriteName = "broke"; startTimer(); } else { timeLabel.gameObject.SetActive(false); build.spriteName = "hall_fight_" + StringKit.toInt(this.gameObject.name); } }
public int compare(object a, object b) { GuildAreaPreInfo itemA = a as GuildAreaPreInfo; GuildAreaPreInfo itemB = b as GuildAreaPreInfo; if (itemA.warNum > itemB.warNum) { return(-1); } else if (itemA.warNum < itemB.warNum) { return(1); } else { if (itemA.judgeScore < itemB.judgeScore) { return(-1); } else if (itemA.judgeScore > itemB.judgeScore) { return(1); } else { long uidA = long.Parse(itemA.uid); long uidB = long.Parse(itemB.uid); if (uidA > uidB) { return(1); } else if (uidA < uidB) { return(-1); } else { return(0); } } } }
public override void read(ErlKVMessage message) { base.read(message); if ((message.getValue("msg") as ErlType) != null && (message.getValue("msg") as ErlType).getValueString() == "error") { UiManager.Instance.createMessageLintWindow(LanguageConfigManager.Instance.getLanguage("GuildArea_54")); UiManager.Instance.BackToWindow <GuildMainWindow>(); callBack = null; return; } if (message.getValue("state").ToString() != null) { List <string> messageList = new List <string>(); ErlType stateType = message.getValue("state") as ErlType; ErlArray powerType = message.getValue("power") as ErlArray; int guildPowerNow = StringKit.toInt(powerType.Value[0].getValueString()); int guildPowerMax = StringKit.toInt(powerType.Value[1].getValueString()); int openTime = 0; int weekActivi = 0; int selfWarNum = 0; int selfCurBlood = 0; int selfMaxBlood = 0; bool get_power = false; bool isDead = false; int guildFightState = StringKit.toInt(stateType.getValueString()); List <GuildAreaPreInfo> areaList = new List <GuildAreaPreInfo> (); /** 公会战未开启 */ if (guildFightState == GuildFightMainWindow.NOTOPEN) { /** 公会战开启时间 */ ErlType openTimeType = message.getValue("open_time") as ErlType; openTime = StringKit.toInt(openTimeType.getValueString()); /** 公会本周活跃度 */ ErlType weekActiviType = message.getValue("week_active") as ErlType; weekActivi = StringKit.toInt(weekActiviType.getValueString()); } else if (guildFightState == GuildFightMainWindow.NOTJOIN) { /** 公会本周活跃度 */ ErlType weekActiviType = message.getValue("week_active") as ErlType; weekActivi = StringKit.toInt(weekActiviType.getValueString()); } /** 公会战分组中 */ else if (guildFightState == GuildFightMainWindow.GROUPING) { //DO NOTHING } /** 公会战期间 */ else if (guildFightState == GuildFightMainWindow.FIGHTING) { get_power = (message.getValue("get_power") as ErlType).getValueString() != "1"; isDead = (message.getValue("revive") as ErlType).getValueString() == "0"; ErlType type = message.getValue("msg") as ErlType; if (type is ErlArray) { ErlArray areas = type as ErlArray; for (int i = 0; i < areas.Value.Length; ++i) { ErlArray areaArray = areas.Value [i] as ErlArray; int offset = 0; /** 服务器名 */ string server = areaArray.Value [offset++].getValueString(); /** uid */ string uid = areaArray.Value [offset++].getValueString(); /** 名称 */ string name = areaArray.Value [offset++].getValueString(); /** 战争点 */ int warNum = StringKit.toInt(areaArray.Value [offset++].getValueString()); /** 评分 */ int judge = StringKit.toInt(areaArray.Value[offset++].getValueString()); /** 状态 */ int state = StringKit.toInt(areaArray.Value[offset++].getValueString()); int time = StringKit.toInt(areaArray.Value[offset++].getValueString()); int defense = StringKit.toInt(areaArray.Value[offset++].getValueString()); int attack = StringKit.toInt(areaArray.Value[offset++].getValueString()); /** 自己公会,就去接收消息 */ if (uid == GuildManagerment.Instance.getGuild().uid) { ErlArray messageArrays = areaArray.Value[offset++] as ErlArray; for (int j = 0; j < messageArrays.Value.Length; ++j) { messageList.Add(messageArrays.Value[j].getValueString()); } selfWarNum = StringKit.toInt(areaArray.Value[offset++].getValueString()); selfCurBlood = StringKit.toInt(areaArray.Value[offset++].getValueString()); selfMaxBlood = StringKit.toInt(areaArray.Value[offset++].getValueString()); } GuildAreaPreInfo info = new GuildAreaPreInfo(uid, server, name, warNum, judge, state, time, defense, attack); areaList.Add(info); } } } GuildManagerment.Instance.guildFightInfo = new GuildFightInfo(guildFightState, areaList, get_power, messageList, openTime, weekActivi, selfWarNum, isDead, selfCurBlood, selfMaxBlood); if (callBack != null) { callBack(); } } }