Skip to content

Commit

Permalink
Merge branch 'master' of github.com:PyPlanet/PyPlanet
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvlk committed Nov 4, 2023
2 parents ff6f062 + f8c5ee4 commit d0e5505
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 44 deletions.
40 changes: 0 additions & 40 deletions pyplanet/apps/contrib/live_rankings/templates/widget.Script.txt

This file was deleted.

4 changes: 0 additions & 4 deletions pyplanet/apps/contrib/live_rankings/templates/widget.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,3 @@
{% endfor %}
{% endif %}
{% endblock %}

{% block maniascript %}
<script><!-- {% include 'live_rankings/widget.Script.txt' %} --></script>
{% endblock %}
9 changes: 9 additions & 0 deletions pyplanet/views/templates/generics/widget.Script.Txt
Original file line number Diff line number Diff line change
Expand Up @@ -136,5 +136,14 @@ while(True) {
override_enable = True;
}

foreach (Event in PendingEvents) {
if (Event.Type == CMlScriptEvent::Type::MouseClick && Event.Control.HasClass("toggleSpec")) {
if (InputPlayer.RequestsSpectate) {
declare frame <=> Event.Control.Parent;
SetSpectateTarget(frame.DataAttributeGet("login"));
}
}
}

yield;
}
9 changes: 9 additions & 0 deletions pyplanet/views/templates/generics/widget_next.Script.Txt
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,14 @@ while(True) {
override_enable = True;
}

foreach (Event in PendingEvents) {
if (Event.Type == CMlScriptEvent::Type::MouseClick && Event.Control.HasClass("toggleSpec")) {
if (InputPlayer.RequestsSpectate) {
declare frame <=> Event.Control.Parent;
SetSpectateTarget(frame.DataAttributeGet("login"));
}
}
}

yield;
}

0 comments on commit d0e5505

Please sign in to comment.