feature/MAPG-235-basic-challenge-mode #48

Merged
balazs merged 43 commits from feature/MAPG-235-basic-challenge-mode into develop 2021-05-28 20:41:09 +02:00
3 changed files with 14 additions and 9 deletions
Showing only changes of commit ae7fd98256 - Show all commits

View File

@ -112,6 +112,7 @@
document.getElementById('playMode').style.visibility = 'hidden'; document.getElementById('playMode').style.visibility = 'hidden';
} }
if (document.getElementById('challengeButton')) {
document.getElementById('challengeButton').onclick = function () { document.getElementById('challengeButton').onclick = function () {
MapGuesser.showModal('challenge'); MapGuesser.showModal('challenge');
document.getElementById('createNewChallengeButton').href = '/challenge/new/' + this.dataset.mapId; document.getElementById('createNewChallengeButton').href = '/challenge/new/' + this.dataset.mapId;
@ -119,6 +120,7 @@
var timeLimit = document.getElementById('timeLimit').value; var timeLimit = document.getElementById('timeLimit').value;
document.getElementById('timeLimitLabel').innerText = 'Time limit of ' + timeLimit + ' seconds per round'; document.getElementById('timeLimitLabel').innerText = 'Time limit of ' + timeLimit + ' seconds per round';
};
} }
document.getElementById('closePlayModeButton').onclick = function () { document.getElementById('closePlayModeButton').onclick = function () {

View File

@ -48,6 +48,7 @@ class MapsController
$user = $this->request->user(); $user = $this->request->user();
return new HtmlContent('maps', [ return new HtmlContent('maps', [
'maps' => $maps, 'maps' => $maps,
'isLoggedIn' => $user !== null,
'isAdmin' => $user !== null && $user->hasPermission(IUser::PERMISSION_ADMIN) 'isAdmin' => $user !== null && $user->hasPermission(IUser::PERMISSION_ADMIN)
]); ]);
} }

View File

@ -11,8 +11,10 @@ TODO: condition!
<a id="singleButton" class="button fullWidth marginTop" href="" title="Single player">Single player</a> <a id="singleButton" class="button fullWidth marginTop" href="" title="Single player">Single player</a>
<p class="bold center marginTop marginBottom">OR</p> <p class="bold center marginTop marginBottom">OR</p>
<button id="multiButton" class="fullWidth green" data-map-id="">Multiplayer (beta)</button> <button id="multiButton" class="fullWidth green" data-map-id="">Multiplayer (beta)</button>
<?php if ($isLoggedIn): ?>
<p class="bold center marginTop marginBottom">OR</p> <p class="bold center marginTop marginBottom">OR</p>
<button id="challengeButton" class="fullWidth yellow" data-map-id="" data-timer="">Challenge (gamma)</button> <button id="challengeButton" class="fullWidth yellow" data-map-id="" data-timer="">Challenge (gamma)</button>
Review

Gamma :D

Gamma :D
<?php endif; ?>
<div class="right"> <div class="right">
<button id="closePlayModeButton" class="gray marginTop" type="button">Close</button> <button id="closePlayModeButton" class="gray marginTop" type="button">Close</button>
</div> </div>