Skip to content

Commit 2f02e0a

Browse files
authored
Merge pull request #149 from battlecode/minor-tournament-client-fixes
Minor client tournament mode fixes
2 parents 5d142a8 + 3be7d89 commit 2f02e0a

File tree

3 files changed

+26
-18
lines changed

3 files changed

+26
-18
lines changed

client/visualizer/src/gamearea/renderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ export default class Renderer {
194194
if (effect.type == 'destabilize') {
195195
color = effect.turns_remaining == 0 ? "#D53E432F" : "#573f5e2F"
196196
}
197-
if (effect.type == 'boost' || true) {
197+
if (effect.type == 'boost') {
198198
color = "#00F0000F"
199199
}
200200
this.drawCircle(effect.x, height - effect.y - 1, 25, color, cst.TEAM_COLORS[effect.team])

client/visualizer/src/runner.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ export default class Runner {
441441
infoString += `<br>`
442442
infoString += `Score: <b class="red">${wins[this.tournament.current().team1]}</b> - <b class="blue">${wins[this.tournament.current().team2]}</b>`
443443
}
444+
if (this.conf.tournamentMode) {
445+
const team1 = this.games[this.currentGame].meta.teams[1].name
446+
const team2 = this.games[this.currentGame].meta.teams[2].name
447+
const wins = this.getCurrentWins(team1, team2, this.currentMatch - 1)
448+
infoString += `Map: <b>${this.games[this.currentGame].getMatch(this.currentMatch).current.mapStats.name}</b>`
449+
infoString += `<br>`
450+
infoString += `Score: <b class="red">${wins[team1]}</b> - <b class="blue">${wins[team2]}</b>`
451+
}
444452

445453
this.looper = new Looper(match, meta, this.conf, this.imgs,
446454
this.controls, this.stats, this.gamearea, this.console, this.matchqueue, this.profiler, infoString,

client/visualizer/src/sidebar/stats.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -457,24 +457,24 @@ export default class Stats {
457457
this.maxVotes = 750;
458458

459459
this.div.appendChild(document.createElement("br"));
460-
if (this.conf.tournamentMode) {
461-
// FOR TOURNAMENT
462-
this.tourneyUpload = document.createElement('div');
460+
// if (this.conf.tournamentMode) {
461+
// // FOR TOURNAMENT
462+
// this.tourneyUpload = document.createElement('div');
463463

464-
let uploadButton = this.runner.getUploadButton();
465-
let tempdiv = document.createElement("div");
466-
tempdiv.className = "upload-button-div";
467-
tempdiv.appendChild(uploadButton);
468-
this.tourneyUpload.appendChild(tempdiv);
469-
470-
// add text input field
471-
this.tourIndexJump.type = "text";
472-
this.tourIndexJump.onkeyup = (e) => { this.tourIndexJumpFun(e) };
473-
this.tourIndexJump.onchange = (e) => { this.tourIndexJumpFun(e) };
474-
this.tourneyUpload.appendChild(this.tourIndexJump);
475-
476-
this.div.appendChild(this.tourneyUpload);
477-
}
464+
// let uploadButton = this.runner.getUploadButton();
465+
// let tempdiv = document.createElement("div");
466+
// tempdiv.className = "upload-button-div";
467+
// tempdiv.appendChild(uploadButton);
468+
// this.tourneyUpload.appendChild(tempdiv);
469+
470+
// // add text input field
471+
// this.tourIndexJump.type = "text";
472+
// this.tourIndexJump.onkeyup = (e) => { this.tourIndexJumpFun(e) };
473+
// this.tourIndexJump.onchange = (e) => { this.tourIndexJumpFun(e) };
474+
// this.tourneyUpload.appendChild(this.tourIndexJump);
475+
476+
// this.div.appendChild(this.tourneyUpload);
477+
// }
478478

479479
this.extraInfo = document.createElement('div');
480480
this.extraInfo.className = "extra-info";

0 commit comments

Comments
 (0)