Visual updates
This commit is contained in:
parent
0f2ee249a1
commit
3357084d4e
@ -70,14 +70,18 @@ class CompleteLevel(CSRFexemptTemplateView):
|
||||
return HttpResponse(content="GG", status=200)
|
||||
|
||||
bloonsa_util.tag_player(request=request)
|
||||
|
||||
level_id = int(request.POST.get("level_id"))
|
||||
darts_left = int(request.POST.get("darts_left"))
|
||||
dart_glitch = bool(request.POST.get("dart_glitch"))
|
||||
dart_glitch = bool(request.POST.get("dart_glitch") == "true")
|
||||
pops = int(request.POST.get("pops"))
|
||||
|
||||
level: Level = Level.objects.get(level_id=level_id)
|
||||
player: Player = Player.objects.get(user=request.user)
|
||||
|
||||
print(f"{darts_left=} {dart_glitch=}")
|
||||
|
||||
|
||||
prevScore = LevelScore.objects.filter(player=player,
|
||||
level=level).first()
|
||||
if prevScore is None \
|
||||
|
||||
@ -68,5 +68,6 @@ class LevelScore(models.Model):
|
||||
|
||||
def __str__(self):
|
||||
clearState = "✅" if self.clear else "❌"
|
||||
return (f"{self.player.user.username if self.player else ''}'s {clearState} @ {self.level.title}: "
|
||||
f"🎈{self.pops} | 🎯{self.darts_left}")
|
||||
scoreView = f"🎈{self.pops} | 🎯{self.darts_left} {'✏' if self.dart_glitch else ''}"
|
||||
return (f"{self.player.user.username if self.player else ''}'s "
|
||||
f"{clearState} @ {self.level.title}: {scoreView}")
|
||||
@ -63,4 +63,8 @@
|
||||
|
||||
#level_clear_state {
|
||||
|
||||
}
|
||||
|
||||
#level_info_row1 #level_info_row2 {
|
||||
display: block;
|
||||
}
|
||||
@ -1,9 +1,10 @@
|
||||
function bloonsa_new_level_started(level_id) {
|
||||
console.log("call to new_level_started");
|
||||
console.log("call to bloonsa_new_level_started");
|
||||
bloonsa_update_data(level_id);
|
||||
}
|
||||
|
||||
function bloonsa_level_completed(level_id) {
|
||||
console.log("call to bloonsa_level_completed");
|
||||
bloonsa_update_data(level_id)
|
||||
}
|
||||
|
||||
|
||||
@ -69,24 +69,28 @@
|
||||
{% block content %}{% endblock content %}
|
||||
|
||||
<div id="current_level_container" class="wide left">
|
||||
<p>
|
||||
<h1 id="level_title"></h1><h1 id="level_id"></h1><h1 id="level_clear_state"></h1><h1></h1>
|
||||
<h3 id="level_author"></h3><h3 id="level_author_id"></h3><br>
|
||||
</p>
|
||||
<div id="level_info_row1">
|
||||
<h1 id="level_title">test</h1>
|
||||
<h1 id="level_id">123</h1>
|
||||
<h1 id="level_clear_state">a</h1>
|
||||
</div>
|
||||
<div id="level_info_row2">
|
||||
<h3 id="level_author">amog</h3>
|
||||
<h3 id="level_author_id">424</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="skyscraper rhs">
|
||||
<ul id="menu" class="light">
|
||||
|
||||
<li><a href="{% url 'bloonsa_game:index' %}"><img src="{% static 'bloonsa_game/img/nav_home.gif' %}" alt="Nav_home"/></a></li>
|
||||
<li><a href="{% url 'bloonsa_game:game' %}"><img src="{% static 'bloonsa_game/img/nav_play.gif' %}" alt="Nav_play"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_build.gif' %}" alt="Nav_build"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_levels.gif' %}" alt="Nav_levels"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_users.gif' %}" alt="Nav_users"/></a></li>
|
||||
<!--<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_nk.gif' %}" alt="Nav_nk"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_buy.gif' %}" alt="Nav_buy"/></a></li>-->
|
||||
</ul>
|
||||
<li><a href="{% url 'bloonsa_game:index' %}"><img src="{% static 'bloonsa_game/img/nav_home.gif' %}" alt="Nav_home"/></a></li>
|
||||
<li><a href="{% url 'bloonsa_game:game' %}"><img src="{% static 'bloonsa_game/img/nav_play.gif' %}" alt="Nav_play"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_build.gif' %}" alt="Nav_build"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_levels.gif' %}" alt="Nav_levels"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_users.gif' %}" alt="Nav_users"/></a></li>
|
||||
<!--<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_nk.gif' %}" alt="Nav_nk"/></a></li>
|
||||
<li><a href="#"><img src="{% static 'bloonsa_game/img/nav_buy.gif' %}" alt="Nav_buy"/></a></li>-->
|
||||
</ul>
|
||||
<div id="searchbox">
|
||||
<form method="post" action="/level/list">
|
||||
<input type="text" name="search" id="search" value="Search levels" onclick="this.value="""/>
|
||||
@ -101,10 +105,8 @@
|
||||
<div id="adslot3"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div> </div>
|
||||
</body>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div id="adholder1">
|
||||
<script type="text/javascript"><!--
|
||||
e9 = new Object();
|
||||
@ -123,4 +125,5 @@
|
||||
document.getElementById('adslot1').appendChild(document.getElementById('adholder1'));
|
||||
document.getElementById('adslot2').appendChild(document.getElementById('adholder3'));
|
||||
document.getElementById('adslot3').appendChild(document.getElementById('adholder2'));
|
||||
</script>
|
||||
</script>
|
||||
</body>
|
||||
Loading…
Reference in New Issue
Block a user