Skip to content

Commit

Permalink
Merge pull request #1419 from sobkulir/ui_update_zergbot
Browse files Browse the repository at this point in the history
Add Tutorial button to ZergBot
  • Loading branch information
sammko authored Dec 10, 2022
2 parents a3e99db + 511351d commit 04fed74
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
Toto je port originál ZergBota z 2014, ktorého vtedy skódil Adam Dej, Syseľ (a možno niekto ďalší). Originál kód je na troch miestach:
* [Frontend na GDrive](https://drive.google.com/file/d/1FkCd3SrARQyyoSEE9EV90-EqlSeBD3Jv/view?usp=sharing)
* [Backend v tomto repe](https://github.com/trojsten/web/pull/1214)
* Skript, ktorý bežal interpreter na elementovi pri submte. Ten je asi stratený.
* Skript, ktorý bežal interpreter na elementovi pri submite. Ten je asi stratený.

Snažil som sa nechytať toho frontendového kódu moc. Hlavná zmena je, že backendový interpreter beží rovno na webovom serveri. Je to funkcia `run_interpreter()` vo `views.py`.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ angular.module('zerg.controllers', [])
.controller('GameCtrl', ['$scope', '$routeParams', '$location', '$timeout',
'Levels', 'Solutions', 'Submits', 'ngDialog',
function ($scope, $routeParams, $location, $timeout, Levels, Solutions, Submits, ngDialog) {

$scope.staticUrlPrefix = STATIC_URL_PREFIX;

var getCookie = function (name) {
var cookieValue = null;
if (document.cookie && document.cookie != '') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,18 @@ body {
background-image: url('../assets/graphics/buttons/btn_stop_disabled.png');
}

.level_body .program_view .program_controls .button.tutorial {
background-image: url('../assets/graphics/buttons/btn_tutorial.png');
}

.level_body .program_view .program_controls .button.tutorial:hover {
background-image: url('../assets/graphics/buttons/btn_tutorial_selected.png');
}

.level_body .program_view .program_controls .button.tutorial.disabled {
background-image: url('../assets/graphics/buttons/btn_tutorial_disabled.png');
}

.level_body .program_view .program_controls .button.warp {
background-image: url('../assets/graphics/buttons/btn_warp.png');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<div class="button" ng-class="running ? 'stop' : 'run'" ng-click="runClick()"></div>
<div class="button warp" ng-class="running ? (warping ? (warping_fast ? 'active_turbo' : 'active') : '') : 'disabled'" ng-click="timewarp()"></div>
<div class="button reset" ng-class="running ? 'disabled' : ''" ng-click="resetGame()"></div>
<div class="button clear" ng-class="running ? 'disabled' : ''" ng-click="clearEditor()"></div>
<div class="button tutorial"><a style="display: block; width: 100%;height: 100%" href="{{ staticUrlPrefix }}/assets/tutorial.pdf" target="_blank"></a></div>
<div class="button exit" ng-click="exitGame()"></div>
</div>
<div class="program_editor">
Expand Down

0 comments on commit 04fed74

Please sign in to comment.