Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Zero-K.info/Views/Planetwars/PwMatchMaker.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
}
else
{
PwMatchCommand.VoteOption opt = pw.Options.First();
text = string.Format("{0} attacks planet {2}, {1} defends", pw.AttackerFaction, string.Join(",", pw.DefenderFactions), opt.PlanetName);
var planetNames = string.Join(", ", pw.Options.Select(o => o.PlanetName));
text = string.Format("{0} attacks {2}, {1} defends", pw.AttackerFaction, string.Join(",", pw.DefenderFactions), planetNames);
}

bool canClick = (pw.Mode == PwMatchCommand.ModeType.Attack && pw.AttackerFaction == Global.Account.Faction.Shortcut) || (pw.Mode == PwMatchCommand.ModeType.Defend && pw.DefenderFactions.Contains(Global.Account.Faction.Shortcut));
Expand Down
25 changes: 14 additions & 11 deletions ZeroKLobby/Notifications/PwBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,23 +82,26 @@ void UpdateGui()
}
else if (pw.Mode == PwMatchCommand.ModeType.Defend)
{
PwMatchCommand.VoteOption opt = pw.Options.First();
headerLabel.Text = string.Format("{0} attacks planet {2}, {1} defends",
headerLabel.Text = string.Format("{0} attacks, {1} defends",
pw.AttackerFaction,
string.Join(",", pw.DefenderFactions),
opt.PlanetName);
string.Join(",", pw.DefenderFactions));

foreach (Button c in pnl.Controls.OfType<Button>().ToList()) pnl.Controls.Remove(c);

var but = new Button { Text = string.Format("{0} [{1}/{2}]", opt.PlanetName, opt.Count, opt.Needed), AutoSize = true };
Program.ToolTip.SetMap(but, opt.Map);

if (pw.DefenderFactions.Contains(tas.MyUser.Faction)) // NOTE this is for cases where nightwatch self faction info is delayed
foreach (PwMatchCommand.VoteOption opt in pw.Options)
{
AddButtonClick(opt, but);
Program.Downloader.GetResource(DownloadType.MAP, opt.Map);

var but = new Button { Text = string.Format("{0} [{1}/{2}]", opt.PlanetName, opt.Count, opt.Needed), AutoSize = true };
Program.ToolTip.SetMap(but, opt.Map);

if (pw.DefenderFactions.Contains(tas.MyUser.Faction))
{
AddButtonClick(opt, but);
}
else but.Enabled = false;
pnl.Controls.Add(but);
}
else but.Enabled = false;
pnl.Controls.Add(but);
}

Program.NotifySection.AddBar(this);
Expand Down
Loading