public static void JoinSlot(MissionSlot slot) { if (ChangeDesiredSpectatorState(false)) { Program.TasClient.ChangeMyBattleStatus(false, null, slot.AllyID, slot.TeamID); } }
public static void JoinSlot(MissionSlot slot) { if (ChangeDesiredSpectatorState(false)) { var newStatus = Program.TasClient.MyBattleStatus.Clone(); newStatus.AllyNumber = slot.AllyID; newStatus.TeamNumber = slot.TeamID; newStatus.IsSpectator = false; newStatus.TeamColor = slot.Color; Program.TasClient.SendMyBattleStatus(newStatus); } }
public void SelectMission(MissionSlot m) { //Unhighlihght region; if (selectedMission != null) { selectedMission.icon.SetTooltip(false); } selectedMission = m; selectedMission.icon.SetTooltip(true); //TODO: ENEMIES PREDICTION (XCOM) //TODO: HIGHLIGHT Map regions }
void Awake() { //TODO: Create icons on the map foreach (Mission m in availableMissions) { MissionIcon mi = Instantiate <MissionIcon>(iconPrefab, mapParent.transform); mi.Init(m); MissionSlot mb = Instantiate <MissionSlot>(slotPrefab, missionParent.transform); mb.manager = this; mb.icon = mi; mb.SetMission(m); } selectedMission = null; }
public List <MissionSlot> GetSlots() { var alliances = Players.Select(p => p.Alliance).Distinct().ToList(); var slots = new List <MissionSlot>(); foreach (var player in Players) { var missionSlot = new MissionSlot { AiShortName = player.AIDll, AiVersion = player.AIVersion, AllyID = alliances.IndexOf(player.Alliance), AllyName = player.Alliance, IsHuman = player.IsHuman, IsRequired = player.IsRequired, TeamID = Players.IndexOf(player), TeamName = player.Name, Color = (int)(MyCol)player.Color }; slots.Add(missionSlot); } return(slots); }
public List<MissionSlot> GetSlots() { var alliances = Players.Select(p => p.Alliance).Distinct().ToList(); var slots = new List<MissionSlot>(); foreach (var player in Players) { var missionSlot = new MissionSlot { AiShortName = player.AIDll, AiVersion = player.AIVersion, AllyID = alliances.IndexOf(player.Alliance), AllyName = player.Alliance, IsHuman = player.IsHuman, IsRequired = player.IsRequired, TeamID = Players.IndexOf(player), TeamName = player.Name, Color = (int)(MyCol)player.Color }; slots.Add(missionSlot); } return slots; }
/// <summary> /// Read mission.lua file. /// </summary> public static void ReadMissionSlot(string filePath, ref Mod modInfo) { if (!File.Exists(filePath)) { return; } using (FileStream fileStream = File.OpenRead(filePath)) using (var stream = new StreamReader(fileStream)) { var allText = stream.ReadToEnd(); int offset =0; var config = new TableReaderConfig(); var table = TableReader.ParseTable(config,0,allText,filePath,out offset); var allSlots = new List<MissionSlot>(); foreach (var kvp in table) { var slot = new MissionSlot(); int numbers = 0; foreach (var kvp2 in (kvp.Value as Dictionary<String,Object>)) { var value = (kvp2.Value as String); switch(kvp2.Key) { case "AllyID": int.TryParse(value,NumberStyles.Integer,CultureInfo.InvariantCulture,out numbers); slot.AllyID = numbers; break; case "AllyName": slot.AllyName = value; break; case "IsHuman": slot.IsHuman = (value=="true"); break; case "IsRequired": slot.IsRequired = (value =="true"); break; case "TeamID": int.TryParse(value,NumberStyles.Integer,CultureInfo.InvariantCulture,out numbers); slot.TeamID = numbers; break; case "TeamName": slot.TeamName = value; break; case "Color": int.TryParse(value,NumberStyles.Integer,CultureInfo.InvariantCulture,out numbers); slot.Color = numbers; //var springColor = (MyCol)numbers; //slot.ColorR = springColor.R; //slot.ColorG = springColor.G; //slot.ColorB = springColor.B; break; //case "ColorR": // break; //case "ColorG": // break; //case "ColorB": // break; case "AiShortName": slot.AiShortName = value; break; case "AiVersion": slot.AiVersion = value; break; } } if (slot.AiShortName!=null) { allSlots.Add(slot); } } modInfo.MissionSlots = allSlots; } }
/// <summary> /// Read mission.lua file. /// </summary> public static void ReadMissionSlot(string filePath, ref Mod modInfo) { if (!File.Exists(filePath)) { return; } using (FileStream fileStream = File.OpenRead(filePath)) using (var stream = new StreamReader(fileStream)) { var allText = stream.ReadToEnd(); int offset = 0; var config = new TableReaderConfig(); var table = TableReader.ParseTable(config, 0, allText, filePath, out offset); var allSlots = new List <MissionSlot>(); foreach (var kvp in table) { var slot = new MissionSlot(); int numbers = 0; foreach (var kvp2 in (kvp.Value as Dictionary <String, Object>)) { var value = (kvp2.Value as String); switch (kvp2.Key) { case "AllyID": int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out numbers); slot.AllyID = numbers; break; case "AllyName": slot.AllyName = value; break; case "IsHuman": slot.IsHuman = (value == "true"); break; case "IsRequired": slot.IsRequired = (value == "true"); break; case "TeamID": int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out numbers); slot.TeamID = numbers; break; case "TeamName": slot.TeamName = value; break; case "Color": int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out numbers); slot.Color = numbers; //var springColor = (MyCol)numbers; //slot.ColorR = springColor.R; //slot.ColorG = springColor.G; //slot.ColorB = springColor.B; break; //case "ColorR": // break; //case "ColorG": // break; //case "ColorB": // break; case "AiShortName": slot.AiShortName = value; break; case "AiVersion": slot.AiVersion = value; break; } } if (slot.AiShortName != null) { allSlots.Add(slot); } } modInfo.MissionSlots = allSlots; } }
public static void JoinSlot(MissionSlot slot) { if (ChangeDesiredSpectatorState(false)) { Program.TasClient.ChangeMyBattleStatus(false,null,slot.AllyID,slot.TeamID); } }