mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 23:58:02 -05:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
417ff1e48d
33 changed files with 318 additions and 141 deletions
BIN
app/assets/images/level/loading_left_wing.png
Normal file
BIN
app/assets/images/level/loading_left_wing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 410 KiB |
BIN
app/assets/images/level/loading_right_wing.png
Normal file
BIN
app/assets/images/level/loading_right_wing.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 411 KiB |
|
@ -2,6 +2,5 @@ LevelComponent = require 'models/LevelComponent'
|
|||
CocoCollection = require 'models/CocoCollection'
|
||||
|
||||
module.exports = class ComponentsCollection extends CocoCollection
|
||||
url: '/db/level_component/search'
|
||||
url: '/db/level.component/search'
|
||||
model: LevelComponent
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ CocoClass = require 'lib/CocoClass'
|
|||
|
||||
module.exports = class LoadingScreen extends CocoClass
|
||||
progress: 0
|
||||
|
||||
|
||||
constructor: (canvas) ->
|
||||
super()
|
||||
@width = canvas.width
|
||||
|
@ -93,12 +93,12 @@ module.exports = class LoadingScreen extends CocoClass
|
|||
@text.text = "BUILDING" if @progress is 1
|
||||
@progressBar.scaleX = @progress
|
||||
@stage.update()
|
||||
|
||||
|
||||
showReady: ->
|
||||
@text.text = 'READY'
|
||||
@text.regX = @text.getMeasuredWidth() / 2
|
||||
@stage.update()
|
||||
|
||||
|
||||
destroy: ->
|
||||
@stage.canvas = null
|
||||
super()
|
||||
super()
|
||||
|
|
|
@ -165,7 +165,8 @@ module.exports = class Camera extends CocoClass
|
|||
target = {x: newTargetX, y:newTargetY}
|
||||
else
|
||||
target = @target
|
||||
@zoomTo target, newZoom, 0
|
||||
if not(newZoom >= MAX_ZOOM or newZoom <= Math.max(@minZoom, MIN_ZOOM))
|
||||
@zoomTo target, newZoom, 0
|
||||
|
||||
onMouseDown: (e) ->
|
||||
return if @dragDisabled
|
||||
|
|
|
@ -205,6 +205,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
.to({alpha: 0.6, scaleY: @options.camera.y2x, scaleX: 1}, 100, createjs.Ease.circOut)
|
||||
.to({alpha: 0, scaleY: 0, scaleX: 0}, 700, createjs.Ease.circIn)
|
||||
.call =>
|
||||
return if @destroyed
|
||||
@options.groundLayer.removeChild circle
|
||||
delete @handledAoEs[event]
|
||||
|
||||
|
@ -284,7 +285,7 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
##################################################
|
||||
updateAction: ->
|
||||
action = @determineAction()
|
||||
isDifferent = action isnt @currentRootAction
|
||||
isDifferent = action isnt @currentRootAction or action is null
|
||||
if not action and @thang?.actionActivated and not @stopLogging
|
||||
console.error "action is", action, "for", @thang?.id, "from", @currentRootAction, @thang.action, @thang.getActionName?()
|
||||
@stopLogging = true
|
||||
|
|
|
@ -23,7 +23,7 @@ module.exports = class CoordinateDisplay extends createjs.Container
|
|||
|
||||
build: ->
|
||||
@mouseEnabled = @mouseChildren = false
|
||||
@addChild @label = new createjs.Text("", "20px Arial", "#003300")
|
||||
@addChild @label = new createjs.Text("", "40px Arial", "#003300")
|
||||
@label.name = 'position text'
|
||||
@label.shadow = new createjs.Shadow("#FFFFFF", 1, 1, 0)
|
||||
|
||||
|
|
|
@ -25,10 +25,10 @@ module.exports = class DebugDisplay extends createjs.Container
|
|||
|
||||
build: ->
|
||||
@mouseEnabled = @mouseChildren = false
|
||||
@addChild @frameText = new createjs.Text "...", "20px Arial", "#FFF"
|
||||
@addChild @frameText = new createjs.Text "...", "40px Arial", "#FFF"
|
||||
@frameText.name = 'frame text'
|
||||
@frameText.x = @canvasWidth - 50
|
||||
@frameText.y = @canvasHeight - 25
|
||||
@frameText.x = @canvasWidth - 100
|
||||
@frameText.y = @canvasHeight - 50
|
||||
@frameText.alpha = 0.5
|
||||
|
||||
updateFrame: (currentFrame) ->
|
||||
|
@ -42,4 +42,4 @@ module.exports = class DebugDisplay extends createjs.Container
|
|||
@framesRenderedThisSecond = 0
|
||||
|
||||
@frameText.text = Math.round(currentFrame) + (if @fps? then " - " + @fps + ' fps' else '')
|
||||
@frameText.x = @canvasWidth - @frameText.getMeasuredWidth() - 10
|
||||
@frameText.x = @canvasWidth - @frameText.getMeasuredWidth() - 20
|
||||
|
|
|
@ -59,7 +59,7 @@ module.exports = class Label extends CocoClass
|
|||
o.fontWeight = {D: "bold", S: "bold", N: "bold"}[st]
|
||||
o.shadow = {D: false, S: true, N: true}[st]
|
||||
o.shadowColor = {D: "#FFF", S: "#000", N: "#FFF"}[st]
|
||||
o.fontSize = {D: 25, S: 12, N: 12}[st]
|
||||
o.fontSize = {D: 50, S: 24, N: 24}[st]
|
||||
fontFamily = {D: "Arial", S: "Arial", N: "Arial"}[st]
|
||||
o.fontDescriptor = "#{o.fontWeight} #{o.fontSize}px #{fontFamily}"
|
||||
o.fontColor = {D: "#000", S: "#FFF", N: "#00a"}[st]
|
||||
|
|
|
@ -81,7 +81,7 @@ module.exports = class Mark extends CocoClass
|
|||
shape.graphics.endStroke()
|
||||
shape.graphics.endFill()
|
||||
|
||||
text = new createjs.Text "" + index, "20px Arial", color.replace('0.5', '1')
|
||||
text = new createjs.Text "" + index, "40px Arial", color.replace('0.5', '1')
|
||||
text.regX = text.getMeasuredWidth() / 2
|
||||
text.regY = text.getMeasuredHeight() / 2
|
||||
text.shadow = new createjs.Shadow("#000000", 1, 1, 0)
|
||||
|
|
|
@ -7,7 +7,6 @@ module.exports = class RegionChooser extends CocoClass
|
|||
@options.stage.addEventListener 'stagemousedown', @onMouseDown
|
||||
@options.stage.addEventListener 'stagemousemove', @onMouseMove
|
||||
@options.stage.addEventListener 'stagemouseup', @onMouseUp
|
||||
@options.camera.dragDisabled = true
|
||||
|
||||
destroy: ->
|
||||
@options.stage.removeEventListener 'stagemousedown', @onMouseDown
|
||||
|
@ -18,6 +17,7 @@ module.exports = class RegionChooser extends CocoClass
|
|||
onMouseDown: (e) =>
|
||||
return unless key.shift
|
||||
@firstPoint = @options.camera.canvasToWorld {x: e.stageX, y: e.stageY}
|
||||
@options.camera.dragDisabled = true
|
||||
|
||||
onMouseMove: (e) =>
|
||||
return unless @firstPoint
|
||||
|
@ -30,6 +30,7 @@ module.exports = class RegionChooser extends CocoClass
|
|||
Backbone.Mediator.publish 'choose-region', points: [@firstPoint, @secondPoint]
|
||||
@firstPoint = null
|
||||
@secondPoint = null
|
||||
@options.camera.dragDisabled = false
|
||||
|
||||
restrictRegion: ->
|
||||
RATIO = 1.56876 # 924 / 589
|
||||
|
|
|
@ -110,7 +110,13 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
createOpponentWizard: (opponent) ->
|
||||
# TODO: colorize name and cloud by team, colorize wizard by user's color config, level-specific wizard spawn points
|
||||
sprite = @createWizardSprite thangID: opponent.id, name: opponent.name
|
||||
sprite.targetPos = if opponent.team is 'ogres' then {x: 52, y: 52} else {x: 28, y: 28}
|
||||
if not opponent.levelSlug or opponent.levelSlug is "brawlwood"
|
||||
sprite.targetPos = if opponent.team is 'ogres' then {x: 52, y: 52} else {x: 28, y: 28}
|
||||
else if opponent.levelSlug is "dungeon-arena"
|
||||
sprite.targetPos = if opponent.team is 'ogres' then {x:72, y: 39} else {x: 9, y:39}
|
||||
else
|
||||
sprite.targetPos = if opponent.team is 'ogres' then {x:52, y: 28} else {x: 20, y:28}
|
||||
|
||||
|
||||
createWizardSprite: (options) ->
|
||||
sprite = new WizardSprite @thangTypeFor("Wizard"), @createSpriteOptions(options)
|
||||
|
@ -294,7 +300,7 @@ module.exports = class SpriteBoss extends CocoClass
|
|||
@willSelectThang = [thangID, null]
|
||||
@updateTarget()
|
||||
return unless @selectionMark
|
||||
@selectedSprite = null unless @selectedSprite?.thang
|
||||
@selectedSprite = null if @selectedSprite and (@selectedSprite.destroyed or not @selectedSprite.thang)
|
||||
@selectionMark.toggle @selectedSprite?
|
||||
@selectionMark.setSprite @selectedSprite
|
||||
@selectionMark.update()
|
||||
|
|
|
@ -81,7 +81,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
campaign_player_created: "Stworzone przez graczy"
|
||||
campaign_player_created_description: "... w których walczysz przeciwko dziełom <a href=\"/contribute#artisan\">Czarodziejów Rękodzielnictwa</a>"
|
||||
level_difficulty: "Poziom trudności: "
|
||||
# play_as: "Play As "
|
||||
play_as: "Graj jako "
|
||||
|
||||
contact:
|
||||
contact_us: "Kontakt z CodeCombat"
|
||||
|
@ -123,7 +123,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
wizard_tab: "Czarodziej"
|
||||
password_tab: "Hasło"
|
||||
emails_tab: "Powiadomienia"
|
||||
# admin: "Admin"
|
||||
admin: "Administrator"
|
||||
gravatar_select: "Wybierz fotografię z Gravatar"
|
||||
gravatar_add_photos: "Dodaj zdjęcia i miniatury do swojego konta Gravatar, by móc wybrać zdjęcie."
|
||||
gravatar_add_more_photos: "Dodaj więcej zdjęć do swojego konta Gravatar, by móc ich użyć."
|
||||
|
@ -132,7 +132,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
new_password_verify: "Zweryfikuj"
|
||||
email_subscriptions: "Powiadomienia email"
|
||||
email_announcements: "Ogłoszenia"
|
||||
# email_notifications: "Notifications"
|
||||
email_notifications: "Powiadomienia"
|
||||
email_notifications_description: "Otrzymuj okresowe powiadomienia dotyczące twojego konta."
|
||||
email_announcements_description: "Otrzymuj powiadomienia o najnowszych wiadomościach i zmianach w CodeCombat."
|
||||
contributor_emails: "Powiadomienia asystentów"
|
||||
|
@ -180,9 +180,9 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
victory_sign_up: "Zapisz się, by zapisać postępy"
|
||||
victory_sign_up_poke: "Chcesz zapisać swój kod? Utwórz bezpłatne konto!"
|
||||
victory_rate_the_level: "Oceń poziom: "
|
||||
# victory_rank_my_game: "Rank My Game"
|
||||
# victory_ranking_game: "Submitting..."
|
||||
# victory_return_to_ladder: "Return to Ladder"
|
||||
victory_rank_my_game: "Oceń moją grę"
|
||||
victory_ranking_game: "Wprowadzanie..."
|
||||
victory_return_to_ladder: "Powrót do drabinki"
|
||||
victory_play_next_level: "Przejdź na następny poziom"
|
||||
victory_go_home: "Powrót do strony głównej"
|
||||
victory_review: "Powiedz nam coś więcej!"
|
||||
|
@ -207,17 +207,17 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
hud_continue: "Kontynuuj (Shift + spacja)"
|
||||
spell_saved: "Czar zapisany"
|
||||
skip_tutorial: "Pomiń (esc)"
|
||||
# editor_config: "Editor Config"
|
||||
# editor_config_title: "Editor Configuration"
|
||||
# editor_config_keybindings_label: "Key Bindings"
|
||||
# editor_config_keybindings_default: "Default (Ace)"
|
||||
# editor_config_keybindings_description: "Adds additional shortcuts known from the common editors."
|
||||
# editor_config_invisibles_label: "Show Invisibles"
|
||||
# editor_config_invisibles_description: "Displays invisibles such as spaces or tabs."
|
||||
# editor_config_indentguides_label: "Show Indent Guides"
|
||||
# editor_config_indentguides_description: "Displays vertical lines to see indentation better."
|
||||
# editor_config_behaviors_label: "Smart Behaviors"
|
||||
# editor_config_behaviors_description: "Autocompletes brackets, braces, and quotes."
|
||||
editor_config: "Konfiguracja edytora"
|
||||
editor_config_title: "Konfiguracja edytora"
|
||||
editor_config_keybindings_label: "Przypisania klawiszy"
|
||||
editor_config_keybindings_default: "Domyślny (Ace)"
|
||||
editor_config_keybindings_description: "Dodaje skróty znane z popularnych edytorów."
|
||||
editor_config_invisibles_label: "Pokaż białe znaki"
|
||||
editor_config_invisibles_description: "Wyświetla białe znaki takie jak spacja czy tabulator."
|
||||
editor_config_indentguides_label: "Pokaż linijki wcięć"
|
||||
editor_config_indentguides_description: "Wyświetla pionowe linie, by lepiej zaznaczyć wcięcia."
|
||||
editor_config_behaviors_label: "Inteligentne zachowania"
|
||||
editor_config_behaviors_description: "Autouzupełnianie nawiasów, klamer i cudzysłowów."
|
||||
|
||||
admin:
|
||||
av_title: "Panel administracyjny"
|
||||
|
@ -242,8 +242,8 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
contact_us: "skontaktuj się z nami!"
|
||||
hipchat_prefix: "Możesz nas też spotkać w naszym"
|
||||
hipchat_url: "pokoju HipChat."
|
||||
# revert: "Revert"
|
||||
# revert_models: "Revert Models"
|
||||
revert: "Przywróć"
|
||||
revert_models: "Przywróć wersję"
|
||||
level_some_options: "Trochę opcji?"
|
||||
level_tab_thangs: "Obiekty"
|
||||
level_tab_scripts: "Skrypty"
|
||||
|
@ -262,18 +262,18 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
level_components_title: "Powrót do listy obiektów"
|
||||
level_components_type: "Typ"
|
||||
level_component_edit_title: "Edytuj komponent"
|
||||
# level_component_config_schema: "Config Schema"
|
||||
# level_component_settings: "Settings"
|
||||
level_component_config_schema: "Schemat konfiguracji"
|
||||
level_component_settings: "Ustawienia"
|
||||
level_system_edit_title: "Edytuj system"
|
||||
create_system_title: "Stwórz nowy system"
|
||||
new_component_title: "Stwórz nowy komponent"
|
||||
new_component_field_system: "System"
|
||||
# new_article_title: "Create a New Article"
|
||||
# new_thang_title: "Create a New Thang Type"
|
||||
# new_level_title: "Create a New Level"
|
||||
# article_search_title: "Search Articles Here"
|
||||
# thang_search_title: "Search Thang Types Here"
|
||||
# level_search_title: "Search Levels Here"
|
||||
new_article_title: "Stwórz nowy artykuł"
|
||||
new_thang_title: "Stwórz nowy typ obiektu"
|
||||
new_level_title: "Stwórz nowy poziom"
|
||||
article_search_title: "Przeszukaj artykuły"
|
||||
thang_search_title: "Przeszukaj typy obiektów"
|
||||
level_search_title: "Przeszukaj poziomy"
|
||||
|
||||
article:
|
||||
edit_btn_preview: "Podgląd"
|
||||
|
@ -285,27 +285,27 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
body: "Zawartość"
|
||||
version: "Wersja"
|
||||
commit_msg: "Wiadomość do commitu"
|
||||
# history: "History"
|
||||
history: "Historia"
|
||||
version_history_for: "Historia wersji dla: "
|
||||
# result: "Result"
|
||||
results: "Wynik"
|
||||
result: "Wynik"
|
||||
results: "Wyniki"
|
||||
description: "Opis"
|
||||
or: "lub"
|
||||
email: "Email"
|
||||
# password: "Password"
|
||||
password: "Hasło"
|
||||
message: "Wiadomość"
|
||||
# code: "Code"
|
||||
# ladder: "Ladder"
|
||||
# when: "When"
|
||||
# opponent: "Opponent"
|
||||
# rank: "Rank"
|
||||
# score: "Score"
|
||||
# win: "Win"
|
||||
# loss: "Loss"
|
||||
# tie: "Tie"
|
||||
# easy: "Easy"
|
||||
# medium: "Medium"
|
||||
# hard: "Hard"
|
||||
code: "Kod"
|
||||
ladder: "Drabinka"
|
||||
when: "kiedy"
|
||||
opponent: "Przeciwnik"
|
||||
rank: "Ranking"
|
||||
score: "Wynik"
|
||||
win: "Wygrana"
|
||||
loss: "Przegrana"
|
||||
tie: "Remis"
|
||||
easy: "Łatwy"
|
||||
medium: "Średni"
|
||||
hard: "Trudny"
|
||||
|
||||
about:
|
||||
who_is_codecombat: "Czym jest CodeCombat?"
|
||||
|
@ -416,7 +416,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
join_desc_4: ", a dowiesz się wszystkiego!"
|
||||
join_url_email: "Napisz do nas"
|
||||
join_url_hipchat: "publicznego pokoju HipChat"
|
||||
more_about_archmage: "Dowiedz się więcej na temat stawania się Arcymagiem"
|
||||
more_about_archmage: "Dowiedz się więcej o stawaniu się Arcymagiem"
|
||||
archmage_subscribe_desc: "Otrzymuj e-maile dotyczące nowych okazji programistycznych oraz ogłoszeń."
|
||||
artisan_summary_pref: "Chcesz projektować poziomy i rozwijać arsenał CodeCombat? Ludzie grają w dostarczane przez nas zasoby szybciej, niż potrafimy je tworzyć! Obecnie, nasz edytor jest dosyć niemrawy więc czuj się ostrzeżony - tworzenie poziomów przy jego pomocy może być trochę wymagające i zbugowane. Jeśli masz wizję nowych kampanii, od pętli typu for do"
|
||||
artisan_summary_suf: ", ta klasa jest dla ciebie."
|
||||
|
@ -441,15 +441,15 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
adventurer_join_suf: "więc jeśli wolałbyś być informowany w ten sposób, zarejestruj się na nich!"
|
||||
more_about_adventurer: "Dowiedz się więcej o stawaniu się Podróżnikiem"
|
||||
adventurer_subscribe_desc: "Otrzymuj e-maile, gdy pojawią się nowe poziomy do tesotwania."
|
||||
scribe_summary_pref: "Codecombat nie będzie tylko zbieraniną poziomów. Będzie też źródłem wiedzy programistycznej, na której gracze będą mogli sie opierać. Dzięki temu, każdy z Rzemieślników będzie mógł podać link do szczegółowego artykułu, który pomoże graczowi: dokumentacji w stylu zbudowanej przez "
|
||||
# scribe_summary_suf: " has built. If you enjoy explaining programming concepts, then this class is for you."
|
||||
scribe_summary_pref: "Codecombat nie będzie tylko zbieraniną poziomów. Będzie też źródłem wiedzy programistycznej, na której gracze będą mogli sie opierać. Dzięki temu, każdy z Rzemieślników będzie mógł podać link do szczegółowego artykułu, który pomoże graczowi: dokumentacji w stylu "
|
||||
scribe_summary_suf: ". Jeśli lubisz wyjaśniać idee programistyczne, ta klasa jest dla ciebie."
|
||||
scribe_introduction_pref: "CodeCombat nie będzie tylko zbieraniną poziomów. Będzie też zawierać źródło wiedzy, wiki programistycznych idei, na której będzie można oprzeć poziomy. Dzięki temu, każdy z Rzemieślników zamiast opisywać ze szczegółami, czym jest operator porónania, będzie mógł po prostu podać graczowi w swoim poziomie link do artykułu opisującego go. Mamy na myśli coś podobnego do "
|
||||
scribe_introduction_url_mozilla: "Mozilla Developer Network"
|
||||
scribe_introduction_suf: " . Jeśli twoją definicją zabawy jest artykułowanie idei programistycznych przy pomocy składni Markdown, ta klasa może być dla ciebie."
|
||||
scribe_introduction_suf: ". Jeśli twoją definicją zabawy jest artykułowanie idei programistycznych przy pomocy składni Markdown, ta klasa może być dla ciebie."
|
||||
scribe_attribute_1: "Umiejętne posługiwanie się słowem to właściwie wszystko, czego potrzebujesz. Nie tylko gramatyka i ortografia, ale również umiejętnośc tłumaczenia trudnego materiału innym."
|
||||
contact_us_url: "Skontaktuj się z nami"
|
||||
scribe_join_description: "powiedz nam coś o sobie, swoim doświadczeniu w programowaniu i rzeczach, o których chciałbyś pisać, a chętnie to z tobą uzgodnimy!"
|
||||
more_about_scribe: "Dowiedz się więcej na temat stawania się Skrybą"
|
||||
more_about_scribe: "Dowiedz się więcej o stawaniu się Skrybą"
|
||||
scribe_subscribe_desc: "Otrzymuj e-maile na temat ogłoszeń dotyczących pisania artykułów."
|
||||
diplomat_summary: "W krajach nieanglojęzycznych istnieje wielkie zainteresowanie CodeCombat! Szukamy tłumaczy chętnych do poświęcenia swojego czasu na tłumaczenie treści strony, aby CodeCombat było dostępne dla całego świata tak szybko, jak to tylko możliwe. Jeśli chcesz pomóc w sprawieniu, by CodeCombat było prawdziwie międzynarodowe, ta klasa jest dla ciebie."
|
||||
diplomat_introduction_pref: "Jeśli dowiedzieliśmy jednej rzeczy z naszego "
|
||||
|
@ -459,7 +459,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
diplomat_join_pref_github: "Znajdź plik lokalizacyjny dla wybranego języka "
|
||||
diplomat_github_url: "na GitHubie"
|
||||
diplomat_join_suf_github: ", edytuj go online i wyślij pull request. Do tego, zaznacz kratkę poniżej, aby być na bieżąco z naszym międzynarodowym rozwojem!"
|
||||
more_about_diplomat: "Dowiedz się więcej na temat stawania się Dyplomatą"
|
||||
more_about_diplomat: "Dowiedz się więcej o stawaniu się Dyplomatą"
|
||||
diplomat_subscribe_desc: "Otrzymuj e-maile na temat postępów i18n i poziomów do tłumaczenia."
|
||||
ambassador_summary: "Staramy się zbudować społeczność, a każda społeczność potrzebuje zespołu wsparcia, kiedy pojawią się kłopoty. Mamy czaty, e-maile i strony w sieciach społecznościowych, aby nasi użytkownicy mogli zapoznać się z grą. Jeśli chcesz pomóc ludziom w tym, jak do nas dołączyć, dobrze się bawić, a do tego poznać tajniki programowania, ta klasa jest dla ciebie."
|
||||
ambassador_introduction: "Oto społeczność, którą budujemy, a ty jesteś jej łącznikiem. Mamy czaty, e-maile i strony w sieciach społecznościowych oraz wielu ludzi potrzebujących pomocy w zapoznaniu się z grą oraz uczeniu się za jej pomocą. Jeśli chcesz pomóc ludziom, by do nas dołączyli i dobrze się bawili oraz mieć pełne poczucie tętna CodeCombat oraz kierunku, w którym zmierzamy, ta klasa może być dla ciebie."
|
||||
|
@ -475,7 +475,7 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
counselor_attribute_1: "Doświadczenie, w którymkolwiek z powyższych obszarów lub czymś, co uważasz za pomocne."
|
||||
counselor_attribute_2: "Trochę wolnego czasu"
|
||||
counselor_join_desc: "powiedz nam coś o sobie, o tym, czego dokonałeś i jak chciałbyś nam pomóc. Dodamy cię do naszej listy kontaktów i damy ci znać, kiedy będziemy potrzebować twojej pomocy (nie za często)."
|
||||
more_about_counselor: "Dowiedz się więcej na temat stawania się Opiekunem"
|
||||
more_about_counselor: "Dowiedz się więcej o stawaniu się Opiekunem"
|
||||
changes_auto_save: "Zmiany zapisują się automatycznie po kliknięci kratki."
|
||||
diligent_scribes: "Nasi pilni Skrybowie:"
|
||||
powerful_archmages: "Nasi potężni Arcymagowie:"
|
||||
|
@ -500,34 +500,34 @@ module.exports = nativeDescription: "język polski", englishDescription: "Polish
|
|||
counselor_title: "Opiekun"
|
||||
counselor_title_description: "(ekspert/nauczyciel)"
|
||||
|
||||
# ladder:
|
||||
# please_login: "Please log in first before playing a ladder game."
|
||||
# my_matches: "My Matches"
|
||||
# simulate: "Simulate"
|
||||
# simulation_explanation: "By simulating games you can get your game ranked faster!"
|
||||
# simulate_games: "Simulate Games!"
|
||||
# simulate_all: "RESET AND SIMULATE GAMES"
|
||||
# leaderboard: "Leaderboard"
|
||||
# battle_as: "Battle as "
|
||||
# summary_your: "Your "
|
||||
# summary_matches: "Matches - "
|
||||
# summary_wins: " Wins, "
|
||||
# summary_losses: " Losses"
|
||||
# rank_no_code: "No New Code to Rank"
|
||||
# rank_my_game: "Rank My Game!"
|
||||
# rank_submitting: "Submitting..."
|
||||
# rank_submitted: "Submitted for Ranking"
|
||||
# rank_failed: "Failed to Rank"
|
||||
# rank_being_ranked: "Game Being Ranked"
|
||||
# code_being_simulated: "Your new code is being simulated by other players for ranking. This will refresh as new matches come in."
|
||||
# no_ranked_matches_pre: "No ranked matches for the "
|
||||
# no_ranked_matches_post: " team! Play against some competitors and then come back here to get your game ranked."
|
||||
# choose_opponent: "Choose an Opponent"
|
||||
# tutorial_play: "Play Tutorial"
|
||||
# tutorial_recommended: "Recommended if you've never played before"
|
||||
# tutorial_skip: "Skip Tutorial"
|
||||
# tutorial_not_sure: "Not sure what's going on?"
|
||||
# tutorial_play_first: "Play the Tutorial first."
|
||||
# simple_ai: "Simple AI"
|
||||
# warmup: "Warmup"
|
||||
ladder:
|
||||
please_login: "Przed rozpoczęciem gry rankingowej musisz się zalogować."
|
||||
my_matches: "Moje pojedynki"
|
||||
simulate: "Symuluj"
|
||||
simulation_explanation: "Symulując gry możesz szybciej uzyskać ocenę swojej gry!"
|
||||
simulate_games: "Symuluj gry!"
|
||||
simulate_all: "RESETUJ I SYMULUJ GRY"
|
||||
leaderboard: "Tabela rankingowa"
|
||||
battle_as: "Walcz jako "
|
||||
summary_your: "Twój "
|
||||
summary_matches: "Pojedynki - "
|
||||
summary_wins: " Wygrane, "
|
||||
summary_losses: " Przegrane"
|
||||
rank_no_code: "Brak nowego kodu do oceny"
|
||||
rank_my_game: "Oceń moją grę!"
|
||||
rank_submitting: "Wysyłanie..."
|
||||
rank_submitted: "Wysłano do oceny"
|
||||
rank_failed: "Błąd oceniania"
|
||||
rank_being_ranked: "Aktualnie oceniane gry"
|
||||
code_being_simulated: "Twój nowy kod jest aktualnie symulowany przez innych graczy w celu oceny. W miarę pojawiania sie nowych pojedynków, nastąpi odświeżenie."
|
||||
no_ranked_matches_pre: "Brak ocenionych pojedynków dla drużyny "
|
||||
no_ranked_matches_post: " ! Zagraj przeciwko kilku oponentom i wróc tutaj, aby uzyskać ocenę gry."
|
||||
choose_opponent: "Wybierz przeciwnika"
|
||||
tutorial_play: "Rozegraj samouczek"
|
||||
tutorial_recommended: "Zalecane, jeśli wcześniej nie grałeś"
|
||||
tutorial_skip: "Pomiń samouczek"
|
||||
tutorial_not_sure: "Nie wiesz, co się dzieje?"
|
||||
tutorial_play_first: "Rozegraj najpierw samouczek."
|
||||
simple_ai: "Proste AI"
|
||||
warmup: "Rozgrzewka"
|
||||
# vs: "VS"
|
||||
|
|
|
@ -4,6 +4,10 @@
|
|||
html
|
||||
background-color: #2f261d
|
||||
|
||||
html, body
|
||||
// For level loading view wings
|
||||
overflow-x: hidden
|
||||
|
||||
// https://github.com/twbs/bootstrap/issues/9237 -- need a version that's not !important
|
||||
.secret
|
||||
display: none
|
||||
|
|
|
@ -18,8 +18,6 @@
|
|||
display: block
|
||||
z-index: 1
|
||||
|
||||
|
||||
//max-width: 1680px // guideline, but for now let's let it stretch out
|
||||
min-width: 1024px
|
||||
position: relative
|
||||
|
||||
|
|
65
app/styles/play/level/loading.sass
Normal file
65
app/styles/play/level/loading.sass
Normal file
|
@ -0,0 +1,65 @@
|
|||
@import "app/styles/bootstrap/mixins"
|
||||
@import "app/styles/mixins"
|
||||
|
||||
@mixin sky-background($url: '', $backgroundPosition: left)
|
||||
$top: #95D9EF
|
||||
$mid: #FFFFFF
|
||||
$bot: #8EC643
|
||||
$stop: 99.6%
|
||||
background: $mid
|
||||
background-image: url($url) // fallback
|
||||
background-image: url($url), -webkit-linear-gradient(top, $top, $mid $stop, $bot)
|
||||
background-image: url($url), -ms-linear-gradient(top, $top, $mid $stop, $bot)
|
||||
background-image: url($url), linear-gradient(to bottom, $top, $mid $stop, $bot)
|
||||
background-repeat: no-repeat
|
||||
background-position: top $backgroundPosition
|
||||
|
||||
#level-loading-view
|
||||
color: blue
|
||||
width: 100%
|
||||
height: 100%
|
||||
position: absolute
|
||||
z-index: 20
|
||||
$UNVEIL_TIME: 1.2s
|
||||
pointer-events: none
|
||||
|
||||
.loading-details
|
||||
position: absolute
|
||||
top: 20px
|
||||
left: 50%
|
||||
$WIDTH: 1000px
|
||||
width: $WIDTH
|
||||
margin-left: (-$WIDTH / 2)
|
||||
z-index: 100
|
||||
background-color: rgba(220, 255, 230, 0.5)
|
||||
border-radius: 30px
|
||||
padding: 10px
|
||||
text-align: center
|
||||
// http://matthewlein.com/ceaser/ Bounce down a bit, then snap up.
|
||||
-webkit-transition: top $UNVEIL_TIME cubic-bezier(0.285, 0, 0.670, 0)
|
||||
-webkit-transition: top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600)
|
||||
-moz-transition: top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600)
|
||||
-o-transition: top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600)
|
||||
transition: top $UNVEIL_TIME cubic-bezier(0.285, -0.595, 0.670, -0.600)
|
||||
|
||||
.load-progress
|
||||
width: 100%
|
||||
|
||||
.progress-bar
|
||||
width: 1%
|
||||
transition-duration: 1.2s
|
||||
|
||||
.left-wing, .right-wing
|
||||
width: 100%
|
||||
height: 100%
|
||||
position: absolute
|
||||
|
||||
.left-wing
|
||||
@include sky-background('/images/level/loading_left_wing.png', right)
|
||||
left: -50%
|
||||
transition: all $UNVEIL_TIME ease
|
||||
|
||||
.right-wing
|
||||
@include sky-background('/images/level/loading_right_wing.png', left)
|
||||
right: -50%
|
||||
transition: all $UNVEIL_TIME ease
|
|
@ -1,7 +1,6 @@
|
|||
@import "app/styles/bootstrap/mixins"
|
||||
@import "app/styles/mixins"
|
||||
|
||||
|
||||
#spectate-level-view
|
||||
#playback-view
|
||||
width: 100%
|
||||
|
@ -24,12 +23,16 @@
|
|||
line-height: 15px
|
||||
left: 0
|
||||
|
||||
|
||||
max-width: 1920px
|
||||
margin: 0 auto
|
||||
@include user-select(none)
|
||||
|
||||
#level-loading-view
|
||||
max-height: 1284px
|
||||
|
||||
.level-content
|
||||
position: relative
|
||||
margin: 0px auto
|
||||
|
||||
#canvas-wrapper
|
||||
height: 100%
|
||||
|
@ -38,6 +41,8 @@
|
|||
|
||||
canvas#surface
|
||||
background-color: #ddd
|
||||
max-height: 93%
|
||||
max-height: -webkit-calc(100% - 60px)
|
||||
max-height: calc(100% - 60px)
|
||||
height: auto
|
||||
max-width: 100%
|
||||
|
@ -46,7 +51,6 @@
|
|||
margin: 0 auto
|
||||
|
||||
|
||||
//max-width: 1680px // guideline, but for now let's let it stretch out
|
||||
min-width: 1024px
|
||||
position: relative
|
||||
#thang-hud
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
div.alert.alert-info
|
||||
strong Enter
|
||||
| to confirm
|
||||
canvas(width=924, height=590)
|
||||
canvas(width=1920, height=1224)
|
||||
.modal-footer
|
||||
a.btn.btn-primary#done-button Done
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
.world-container.thangs-column
|
||||
h3(data-i18n="editor.level_tab_thangs_conditions") Starting Conditions
|
||||
#canvas-wrapper
|
||||
canvas(width=924, height=589)#surface
|
||||
canvas(width=1920, height=1224)#surface
|
||||
#canvas-left-gradient.gradient
|
||||
#canvas-top-gradient.gradient
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#level-loading-view
|
||||
|
||||
.level-content
|
||||
|
||||
#control-bar-view
|
||||
|
@ -7,7 +9,7 @@
|
|||
#tome-view
|
||||
|
||||
#canvas-wrapper
|
||||
canvas(width=924, height=589)#surface
|
||||
canvas(width=1920, height=1224)#surface
|
||||
#canvas-left-gradient.gradient
|
||||
#canvas-top-gradient.gradient
|
||||
|
||||
|
|
13
app/templates/play/level/level_loading.jade
Normal file
13
app/templates/play/level/level_loading.jade
Normal file
|
@ -0,0 +1,13 @@
|
|||
.left-wing
|
||||
|
||||
.right-wing
|
||||
|
||||
.loading-details
|
||||
|
||||
h2(data-i18n='play_level.loading_level') Loading Level
|
||||
|
||||
.load-progress
|
||||
.progress.progress-striped.active
|
||||
.progress-bar.progress-bar-success
|
||||
|
||||
h4 Tip: you can shift+click a position on the map to insert it into the spell editor.
|
|
@ -1,7 +1,9 @@
|
|||
#level-loading-view
|
||||
|
||||
.level-content
|
||||
#control-bar-view
|
||||
#canvas-wrapper
|
||||
canvas(width=1848, height=1178)#surface
|
||||
canvas(width=1920, height=1224)#surface
|
||||
#canvas-left-gradient.gradient
|
||||
#canvas-top-gradient.gradient
|
||||
#gold-view.secret.expanded
|
||||
|
|
|
@ -29,7 +29,8 @@ module.exports = class AdminView extends View
|
|||
espionageSuccess: (model) ->
|
||||
storage.save('whoami',model)
|
||||
window.location.reload()
|
||||
|
||||
espionageFailure: (jqxhr, status,error)->
|
||||
console.log "There was an error entering espionage mode: #{error}"
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ CocoCollection = require 'models/CocoCollection'
|
|||
Surface = require 'lib/surface/Surface'
|
||||
Thang = require 'lib/world/thang'
|
||||
LevelThangEditView = require './thang/edit'
|
||||
ComponentsCollection = require 'collections/ComponentsCollection'
|
||||
|
||||
# Moving the screen while dragging thangs constants
|
||||
MOVE_MARGIN = 0.15
|
||||
|
@ -60,12 +61,25 @@ module.exports = class ThangsTabView extends View
|
|||
@thangTypes.once 'sync', @onThangTypesLoaded
|
||||
@thangTypes.fetch()
|
||||
|
||||
# just loading all Components for now: https://github.com/codecombat/codecombat/issues/405
|
||||
@componentCollection = @supermodel.getCollection new ComponentsCollection()
|
||||
@componentCollection.once 'sync', @onComponentsLoaded
|
||||
@componentCollection.fetch()
|
||||
|
||||
onThangTypesLoaded: =>
|
||||
return if @destroyed
|
||||
@supermodel.addCollection @thangTypes
|
||||
@supermodel.populateModel model for model in @thangTypes.models
|
||||
@startsLoading = false
|
||||
@startsLoading = not @componentCollection.loaded
|
||||
@render() # do it again but without the loading screen
|
||||
@onLevelLoaded level: @level if @level
|
||||
@onLevelLoaded level: @level if @level and not @startsLoading
|
||||
|
||||
onComponentsLoaded: =>
|
||||
return if @destroyed
|
||||
@supermodel.addCollection @componentCollection
|
||||
@startsLoading = not @thangTypes.loaded
|
||||
@render() # do it again but without the loading screen
|
||||
@onLevelLoaded level: @level if @level and not @startsLoading
|
||||
|
||||
getRenderData: (context={}) ->
|
||||
context = super(context)
|
||||
|
@ -146,7 +160,6 @@ module.exports = class ThangsTabView extends View
|
|||
@surface.playing = false
|
||||
@surface.setWorld @world
|
||||
@surface.camera.zoomTo({x:262, y:-164}, 1.66, 0)
|
||||
@surface.camera.dragDisabled = true
|
||||
|
||||
destroy: ->
|
||||
@selectAddThangType null
|
||||
|
@ -168,6 +181,7 @@ module.exports = class ThangsTabView extends View
|
|||
|
||||
onSpriteDragged: (e) ->
|
||||
return unless @selectedExtantThang and e.thang?.id is @selectedExtantThang?.id
|
||||
@surface.camera.dragDisabled = true
|
||||
{stageX, stageY} = e.originalEvent
|
||||
wop = @surface.camera.canvasToWorld x: stageX, y: stageY
|
||||
wop.z = @selectedExtantThang.depth / 2
|
||||
|
@ -178,6 +192,7 @@ module.exports = class ThangsTabView extends View
|
|||
onSpriteMouseUp: (e) ->
|
||||
clearInterval(@movementInterval) if @movementInterval?
|
||||
@movementInterval = null
|
||||
@surface.camera.dragDisabled = false
|
||||
return unless @selectedExtantThang and e.thang?.id is @selectedExtantThang?.id
|
||||
pos = @selectedExtantThang.pos
|
||||
physicalOriginal = componentOriginals["physics.Physical"]
|
||||
|
|
|
@ -102,7 +102,7 @@ module.exports = class MyMatchesTabView extends CocoView
|
|||
@$el.find('.rank-button').each (i, el) =>
|
||||
button = $(el)
|
||||
sessionID = button.data('session-id')
|
||||
session = _.find @sessions.models, { id: sessionID }
|
||||
session = _.find @sessions.models, {id: sessionID}
|
||||
rankingState = 'unavailable'
|
||||
if @readyToRank session
|
||||
rankingState = 'rank'
|
||||
|
@ -119,14 +119,14 @@ module.exports = class MyMatchesTabView extends CocoView
|
|||
rankSession: (e) ->
|
||||
button = $(e.target).closest('.rank-button')
|
||||
sessionID = button.data('session-id')
|
||||
session = _.find @sessions.models, { id: sessionID }
|
||||
session = _.find @sessions.models, {id: sessionID}
|
||||
return unless @readyToRank(session)
|
||||
|
||||
@setRankingButtonText(button, 'submitting')
|
||||
success = => @setRankingButtonText(button, 'submitted')
|
||||
failure = => @setRankingButtonText(button, 'failed')
|
||||
|
||||
ajaxData = { session: sessionID, levelID: @level.id, originalLevelID: @level.attributes.original, levelMajorVersion: @level.attributes.version.major }
|
||||
ajaxData = {session: sessionID, levelID: @level.id, originalLevelID: @level.attributes.original, levelMajorVersion: @level.attributes.version.major}
|
||||
console.log "Posting game for ranking from My Matches view."
|
||||
$.ajax '/queue/scoring', {
|
||||
type: 'POST'
|
||||
|
|
40
app/views/play/level/level_loading_view.coffee
Normal file
40
app/views/play/level/level_loading_view.coffee
Normal file
|
@ -0,0 +1,40 @@
|
|||
View = require 'views/kinds/CocoView'
|
||||
template = require 'templates/play/level/level_loading'
|
||||
|
||||
module.exports = class LevelLoadingView extends View
|
||||
id: "level-loading-view"
|
||||
template: template
|
||||
|
||||
subscriptions:
|
||||
'level-loader:progress-changed': 'onLevelLoaderProgressChanged'
|
||||
|
||||
onLevelLoaderProgressChanged: (e) ->
|
||||
@progress = e.progress
|
||||
@updateProgressBar()
|
||||
|
||||
updateProgressBar: ->
|
||||
#@text.text = "BUILDING" if @progress is 1
|
||||
@$el.find('.progress-bar').css('width', (100 * @progress) + '%')
|
||||
|
||||
showReady: ->
|
||||
return
|
||||
|
||||
unveil: ->
|
||||
_.delay @reallyUnveil, 1000
|
||||
|
||||
reallyUnveil: =>
|
||||
return if @destroyed
|
||||
loadingDetails = @$el.find('.loading-details')
|
||||
duration = parseFloat loadingDetails.css 'transition-duration'
|
||||
loadingDetails.css 'top', -loadingDetails.outerHeight(true)
|
||||
@$el.find('.left-wing').css left: '-100%', backgroundPosition: 'right -400px top 0'
|
||||
@$el.find('.right-wing').css right: '-100%', backgroundPosition: 'left -400px top 0'
|
||||
_.delay @onUnveilEnded, duration * 1000
|
||||
|
||||
onUnveilEnded: =>
|
||||
return if @destroyed
|
||||
Backbone.Mediator.publish 'onLoadingViewUnveiled', view: @
|
||||
|
||||
getRenderData: (c={}) ->
|
||||
super c
|
||||
c
|
|
@ -22,6 +22,7 @@ Camera = require 'lib/surface/Camera'
|
|||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
|
||||
# subviews
|
||||
LoadingView = require './level/level_loading_view'
|
||||
TomeView = require './level/tome/tome_view'
|
||||
ChatView = require './level/level_chat_view'
|
||||
HUDView = require './level/hud_view'
|
||||
|
@ -32,8 +33,6 @@ GoldView = require './level/gold_view'
|
|||
VictoryModal = require './level/modal/victory_modal'
|
||||
InfiniteLoopModal = require './level/modal/infinite_loop_modal'
|
||||
|
||||
LoadingScreen = require 'lib/LoadingScreen'
|
||||
|
||||
PROFILE_ME = false
|
||||
|
||||
module.exports = class PlayLevelView extends View
|
||||
|
@ -62,6 +61,8 @@ module.exports = class PlayLevelView extends View
|
|||
'level:session-will-save': 'onSessionWillSave'
|
||||
'level:set-team': 'setTeam'
|
||||
'god:new-world-created': 'loadSoundsForWorld'
|
||||
'level:started': 'onLevelStarted'
|
||||
'level:loading-view-unveiled': 'onLoadingViewUnveiled'
|
||||
|
||||
events:
|
||||
'click #level-done-button': 'onDonePressed'
|
||||
|
@ -122,8 +123,7 @@ module.exports = class PlayLevelView extends View
|
|||
|
||||
afterRender: ->
|
||||
window.onPlayLevelViewLoaded? @ # still a hack
|
||||
@loadingScreen = new LoadingScreen(@$el.find('canvas')[0])
|
||||
@loadingScreen.show()
|
||||
@insertSubView @loadingView = new LoadingView {}
|
||||
@$el.find('#level-done-button').hide()
|
||||
super()
|
||||
|
||||
|
@ -149,23 +149,22 @@ module.exports = class PlayLevelView extends View
|
|||
|
||||
onLevelLoaderLoaded: ->
|
||||
return unless @levelLoader.progress() is 1 # double check, since closing the guide may trigger this early
|
||||
# Save latest level played in local storage
|
||||
if window.currentModal and not window.currentModal.destroyed
|
||||
@loadingScreen.showReady()
|
||||
@loadingView.showReady()
|
||||
return Backbone.Mediator.subscribeOnce 'modal-closed', @onLevelLoaderLoaded, @
|
||||
|
||||
# Save latest level played in local storage
|
||||
localStorage["lastLevel"] = @levelID if localStorage?
|
||||
@grabLevelLoaderData()
|
||||
team = @getQueryVariable("team") ? @world.teamForPlayer(0)
|
||||
@loadOpponentTeam(team)
|
||||
@loadingScreen.destroy()
|
||||
@god.level = @level.serialize @supermodel
|
||||
@god.worldClassMap = @world.classMap
|
||||
@setTeam team
|
||||
@initSurface()
|
||||
@initGoalManager()
|
||||
@initScriptManager()
|
||||
@insertSubviews ladderGame: @otherSession?
|
||||
@insertSubviews ladderGame: (@level.get('type') is "ladder")
|
||||
@initVolume()
|
||||
@session.on 'change:multiplayer', @onMultiplayerChanged, @
|
||||
@originalSessionState = _.cloneDeep(@session.get('state'))
|
||||
|
@ -202,6 +201,12 @@ module.exports = class PlayLevelView extends View
|
|||
# For now, ladderGame will disallow multiplayer, because session code combining doesn't play nice yet.
|
||||
@session.set 'multiplayer', false
|
||||
|
||||
onLevelStarted: (e) ->
|
||||
@loadingView?.unveil()
|
||||
|
||||
onLoadingViewUnveiled: (e) ->
|
||||
@removeSubView @loadingView
|
||||
@loadingView = null
|
||||
|
||||
onSupermodelLoadedOne: =>
|
||||
@modelsLoaded ?= 0
|
||||
|
|
|
@ -20,6 +20,7 @@ Camera = require 'lib/surface/Camera'
|
|||
AudioPlayer = require 'lib/AudioPlayer'
|
||||
|
||||
# subviews
|
||||
LoadingView = require './level/level_loading_view'
|
||||
TomeView = require './level/tome/tome_view'
|
||||
ChatView = require './level/level_chat_view'
|
||||
HUDView = require './level/hud_view'
|
||||
|
@ -30,8 +31,6 @@ GoldView = require './level/gold_view'
|
|||
VictoryModal = require './level/modal/victory_modal'
|
||||
InfiniteLoopModal = require './level/modal/infinite_loop_modal'
|
||||
|
||||
LoadingScreen = require 'lib/LoadingScreen'
|
||||
|
||||
PROFILE_ME = false
|
||||
|
||||
module.exports = class SpectateLevelView extends View
|
||||
|
@ -57,6 +56,8 @@ module.exports = class SpectateLevelView extends View
|
|||
'level:set-team': 'setTeam'
|
||||
'god:new-world-created': 'loadSoundsForWorld'
|
||||
'next-game-pressed': 'onNextGamePressed'
|
||||
'level:started': 'onLevelStarted'
|
||||
'level:loading-view-unveiled': 'onLoadingViewUnveiled'
|
||||
|
||||
events:
|
||||
'click #level-done-button': 'onDonePressed'
|
||||
|
@ -70,9 +71,13 @@ module.exports = class SpectateLevelView extends View
|
|||
super options
|
||||
$(window).on('resize', @onWindowResize)
|
||||
@supermodel.once 'error', @onLevelLoadError
|
||||
|
||||
|
||||
@sessionOne = @getQueryVariable 'session-one'
|
||||
@sessionTwo = @getQueryVariable 'session-two'
|
||||
if options.spectateSessions
|
||||
@sessionOne = options.spectateSessions.sessionOne
|
||||
@sessionTwo = options.spectateSessions.sessionTwo
|
||||
|
||||
if not @sessionOne or not @sessionTwo
|
||||
@fetchRandomSessionPair (err, data) =>
|
||||
if err? then return console.log "There was an error fetching the random session pair: #{data}"
|
||||
|
@ -112,8 +117,7 @@ module.exports = class SpectateLevelView extends View
|
|||
|
||||
afterRender: ->
|
||||
window.onPlayLevelViewLoaded? @ # still a hack
|
||||
@loadingScreen = new LoadingScreen(@$el.find('canvas')[0])
|
||||
@loadingScreen.show()
|
||||
@insertSubView @loadingView = new LoadingView {}
|
||||
@$el.find('#level-done-button').hide()
|
||||
super()
|
||||
|
||||
|
@ -141,14 +145,13 @@ module.exports = class SpectateLevelView extends View
|
|||
return unless @levelLoader.progress() is 1 # double check, since closing the guide may trigger this early
|
||||
# Save latest level played in local storage
|
||||
if window.currentModal and not window.currentModal.destroyed
|
||||
@loadingScreen.showReady()
|
||||
@loadingView.showReady()
|
||||
return Backbone.Mediator.subscribeOnce 'modal-closed', @onLevelLoaderLoaded, @
|
||||
|
||||
@grabLevelLoaderData()
|
||||
#at this point, all requisite data is loaded, and sessions are not denormalized
|
||||
team = @world.teamForPlayer(0)
|
||||
@loadOpponentTeam(team)
|
||||
@loadingScreen.destroy()
|
||||
@god.level = @level.serialize @supermodel
|
||||
@god.worldClassMap = @world.classMap
|
||||
@setTeam team
|
||||
|
@ -157,7 +160,7 @@ module.exports = class SpectateLevelView extends View
|
|||
@initScriptManager()
|
||||
@insertSubviews ladderGame: @otherSession?
|
||||
@initVolume()
|
||||
|
||||
|
||||
@originalSessionState = _.cloneDeep(@session.get('state'))
|
||||
@register()
|
||||
@controlBar.setBus(@bus)
|
||||
|
@ -167,11 +170,13 @@ module.exports = class SpectateLevelView extends View
|
|||
id: @session.get('creator')
|
||||
name: @session.get('creatorName')
|
||||
team: @session.get('team')
|
||||
levelSlug: @level.get('slug')
|
||||
|
||||
@surface.createOpponentWizard
|
||||
id: @otherSession.get('creator')
|
||||
name: @otherSession.get('creatorName')
|
||||
team: @otherSession.get('team')
|
||||
levelSlug: @level.get('slug')
|
||||
|
||||
grabLevelLoaderData: ->
|
||||
@session = @levelLoader.session
|
||||
|
@ -199,6 +204,12 @@ module.exports = class SpectateLevelView extends View
|
|||
# For now, ladderGame will disallow multiplayer, because session code combining doesn't play nice yet.
|
||||
@session.set 'multiplayer', false
|
||||
|
||||
onLevelStarted: (e) ->
|
||||
@loadingView?.unveil()
|
||||
|
||||
onLoadingViewUnveiled: (e) ->
|
||||
@removeSubView @loadingView
|
||||
@loadingView = null
|
||||
|
||||
onSupermodelLoadedOne: =>
|
||||
@modelsLoaded ?= 0
|
||||
|
@ -429,12 +440,11 @@ module.exports = class SpectateLevelView extends View
|
|||
if err? then return console.log "There was an error fetching the random session pair: #{data}"
|
||||
@sessionOne = data[0]._id
|
||||
@sessionTwo = data[1]._id
|
||||
console.log "Playing session #{@sessionOne} against #{@sessionTwo}"
|
||||
url = "/play/spectate/dungeon-arena?session-one=#{@sessionOne}&session-two=#{@sessionTwo}"
|
||||
url = "/play/spectate/#{@levelID}?session-one=#{@sessionOne}&session-two=#{@sessionTwo}"
|
||||
Backbone.Mediator.publish 'router:navigate', {
|
||||
route: url,
|
||||
viewClass: SpectateLevelView,
|
||||
viewArgs: [{spectateSessions:{sessionOne: @sessionOne, sessionTwo: @sessionTwo}}, "dungeon-arena"]}
|
||||
viewArgs: [{spectateSessions:{sessionOne: @sessionOne, sessionTwo: @sessionTwo}}, @levelID ]}
|
||||
|
||||
fetchRandomSessionPair: (cb) ->
|
||||
console.log "Fetching random session pair!"
|
||||
|
@ -447,10 +457,6 @@ module.exports = class SpectateLevelView extends View
|
|||
cb("error", jqxhr.statusText)
|
||||
else
|
||||
cb(null, $.parseJSON(jqxhr.responseText))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
destroy: ()->
|
||||
@supermodel?.off 'error', @onLevelLoadError
|
||||
|
|
|
@ -185,7 +185,8 @@ class MongoQueue extends events.EventEmitter
|
|||
subscribe: (eventName, callback) -> @on eventName, callback
|
||||
unsubscribe: (eventName, callback) -> @removeListener eventName, callback
|
||||
|
||||
|
||||
totalMessagesInQueue: (callback) -> @Message.count {}, callback
|
||||
|
||||
receiveMessage: (callback) ->
|
||||
conditions =
|
||||
queue: @queueName
|
||||
|
|
|
@ -24,6 +24,14 @@ connectToScoringQueue = ->
|
|||
if error? then throw new Error "There was an error registering the scoring queue: #{error}"
|
||||
scoringTaskQueue = data
|
||||
log.info "Connected to scoring task queue!"
|
||||
|
||||
module.exports.messagesInQueueCount = (req, res) ->
|
||||
scoringTaskQueue.totalMessagesInQueue (err, count) ->
|
||||
if err? then return errors.serverError res, "There was an issue finding the Mongoose count:#{err}"
|
||||
response = String(count)
|
||||
res.send(response)
|
||||
res.end()
|
||||
|
||||
|
||||
module.exports.addPairwiseTaskToQueueFromRequest = (req, res) ->
|
||||
taskPair = req.body.sessions
|
||||
|
|
|
@ -100,8 +100,8 @@ sendLadderUpdateEmail = (session, daysAgo) ->
|
|||
context =
|
||||
email_id: sendwithus.templates.ladder_update_email
|
||||
recipient:
|
||||
#address: user.email
|
||||
address: 'nick@codecombat.com' # Debugging
|
||||
address: user.email
|
||||
#address: 'nick@codecombat.com' # Debugging
|
||||
name: name
|
||||
email_data:
|
||||
name: name
|
||||
|
|
|
@ -9,6 +9,11 @@ module.exports.setup = (app) ->
|
|||
#app.post '/queue/scoring/pairwise', (req, res) ->
|
||||
# handler = loadQueueHandler 'scoring'
|
||||
# handler.addPairwiseTaskToQueue req, res
|
||||
|
||||
app.get '/queue/messagesInQueueCount', (req, res) ->
|
||||
handler = loadQueueHandler 'scoring'
|
||||
handler.messagesInQueueCount req, res
|
||||
|
||||
|
||||
app.all '/queue/*', (req, res) ->
|
||||
setResponseHeaderToJSONContentType res
|
||||
|
|
|
@ -20,7 +20,7 @@ config = require './server_config'
|
|||
# self.emit('pass',message)
|
||||
# next()
|
||||
|
||||
productionLogging = (tokens, req, res)->
|
||||
productionLogging = (tokens, req, res) ->
|
||||
status = res.statusCode
|
||||
color = 32
|
||||
if status >= 500 then color = 31
|
||||
|
|
Loading…
Reference in a new issue