Skip to content

Commit

Permalink
Added setting about tournament info
Browse files Browse the repository at this point in the history
  • Loading branch information
238SAMIxD committed Sep 27, 2023
1 parent b3dacb0 commit efced55
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontend/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ document.querySelector('#settings').addEventListener('submit', (e) => {
ppTimer: document.querySelector('#ppTimer').checked,
delay: parseInt(document.querySelector('#delay').value),
showNicknames: document.querySelector('#showNicknames').checked,
showTournament: document.querySelector('#showTournament').checked,
scoreboard: {
active: document.querySelector('#scoreboard-active').checked,
score: document.querySelector('#scoreboard-score').checked,
Expand Down Expand Up @@ -201,6 +202,7 @@ function initSettings(settings) {
document.querySelector('#ppTimer').checked = settings.ppTimer
document.querySelector('#delay').value = settings.delay
document.querySelector('#showNicknames').checked = settings.showNicknames
document.querySelector('#showTournament').checked = settings.showTournament

document.querySelector('#scoreboard-active').checked =
settings.scoreboard.active
Expand Down
5 changes: 5 additions & 0 deletions frontend/gfx/ingame.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const blueTeam = document.querySelector('#blue')
const redTeam = document.querySelector('#red')
let showNicknames,
showTournament,
showLeaderBoard,
showScoreBoard,
score,
Expand Down Expand Up @@ -636,6 +637,10 @@ function updateSettings(e) {
})
}
}
if (e.showTournament !== showTournament) {
showTournament = e.showTournament
document.querySelector('#tournament').style.display = e.showTournament ? 'block' : 'none'
}

if (showScoreBoard !== e.scoreboard.active) {
showScoreBoard = e.scoreboard.active
Expand Down
9 changes: 9 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,15 @@ <h2>Settings</h2>
/>
<label class="form-check-label" for="showNicknames"> Show Nicknames </label>
</div>
<div class="form-check mb-3">
<input
class="form-check-input"
type="checkbox"
value=""
id="showTournament"
/>
<label class="form-check-label" for="showTournament"> Show Tournnament Info </label>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Save Settings</button>
</div>
Expand Down
2 changes: 2 additions & 0 deletions plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ module.exports = async (ctx: PluginContext) => {
killfeed: false,
ppTimer: false,
showNicknames: false,
showTournament: true,
delay: 0,
scoreboard: {
active: true,
Expand All @@ -47,6 +48,7 @@ module.exports = async (ctx: PluginContext) => {
config.ppTimer = e.ppTimer
config.delay = e.delay
config.showNicknames = e.showNicknames
config.showTournament = e.showTournament
config.scoreboard = e.scoreboard

ctx.LPTE.emit({
Expand Down
1 change: 1 addition & 0 deletions types/Config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface Config {
ppTimer: boolean
delay: number
showNicknames: boolean
showTournament: boolean
scoreboard: {
active: boolean
score: boolean
Expand Down

0 comments on commit efced55

Please sign in to comment.