mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Reload now shows confirmation modal again. Added some stuff missing from the last commit.
This commit is contained in:
parent
f3dfcdc81d
commit
a8700f5113
7 changed files with 27 additions and 7 deletions
BIN
app/assets/images/level/hud_background.png
Normal file
BIN
app/assets/images/level/hud_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.2 KiB |
BIN
app/assets/images/level/hud_wood_background.png
Normal file
BIN
app/assets/images/level/hud_wood_background.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 25 KiB |
|
@ -46,13 +46,13 @@
|
||||||
|
|
||||||
.thang-avatar-view
|
.thang-avatar-view
|
||||||
width: $childSize - 10px
|
width: $childSize - 10px
|
||||||
margin: 5px
|
margin: 5px 0.4vw
|
||||||
display: inline-block
|
display: inline-block
|
||||||
float: left
|
float: left
|
||||||
|
|
||||||
.btn.btn-small
|
.btn.btn-small
|
||||||
margin-top: 15px
|
margin-top: 15px
|
||||||
margin-right: 15px
|
margin-right: 1.3vw
|
||||||
font-size: 18px
|
font-size: 18px
|
||||||
|
|
||||||
.glyphicon
|
.glyphicon
|
||||||
|
|
11
app/templates/play/level/modal/reload-level-modal.jade
Normal file
11
app/templates/play/level/modal/reload-level-modal.jade
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
extends /templates/modal/modal_base
|
||||||
|
|
||||||
|
block modal-header-content
|
||||||
|
h3(data-i18n="play_level.reload_title") Reload All Code?
|
||||||
|
|
||||||
|
block modal-body-content
|
||||||
|
p(data-i18n="play_level.reload_really") Are you sure you want to reload this level back to the beginning?
|
||||||
|
|
||||||
|
block modal-footer-content
|
||||||
|
a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="modal.close").btn Close
|
||||||
|
a(href='#', data-dismiss="modal", aria-hidden="true", data-i18n="play_level.reload_confirm").btn.btn-primary#restart-level-confirm-button Reload All
|
|
@ -31,7 +31,7 @@ module.exports = class LevelLoadingView extends CocoView
|
||||||
eventualCanvasWidth = $('#canvas-wrapper').outerWidth()
|
eventualCanvasWidth = $('#canvas-wrapper').outerWidth()
|
||||||
eventualCanvasHeight = Math.max(eventualCanvasWidth / canvasAspectRatio)
|
eventualCanvasHeight = Math.max(eventualCanvasWidth / canvasAspectRatio)
|
||||||
currentCanvasHeight = 589
|
currentCanvasHeight = 589
|
||||||
extraHeight # From control bar (I think)
|
extraHeight = 50 # From control bar (I think)
|
||||||
@$el.addClass('manually-sized').css('height', @$el.outerHeight() + eventualCanvasHeight - currentCanvasHeight + 2 + extraHeight)
|
@$el.addClass('manually-sized').css('height', @$el.outerHeight() + eventualCanvasHeight - currentCanvasHeight + 2 + extraHeight)
|
||||||
|
|
||||||
onLevelLoaded: (e) ->
|
onLevelLoaded: (e) ->
|
||||||
|
|
9
app/views/play/level/modal/ReloadLevelModal.coffee
Normal file
9
app/views/play/level/modal/ReloadLevelModal.coffee
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
ModalView = require 'views/kinds/ModalView'
|
||||||
|
template = require 'templates/play/level/modal/reload-level-modal'
|
||||||
|
|
||||||
|
module.exports = class ReloadLevelModal extends ModalView
|
||||||
|
id: '#reload-level-modal'
|
||||||
|
template: template
|
||||||
|
|
||||||
|
events:
|
||||||
|
'click #restart-level-confirm-button': -> Backbone.Mediator.publish 'level:restart', {}
|
|
@ -3,7 +3,7 @@ ThangAvatarView = require 'views/play/level/ThangAvatarView'
|
||||||
template = require 'templates/play/level/tome/spell_list_tab_entry'
|
template = require 'templates/play/level/tome/spell_list_tab_entry'
|
||||||
LevelComponent = require 'models/LevelComponent'
|
LevelComponent = require 'models/LevelComponent'
|
||||||
DocFormatter = require './DocFormatter'
|
DocFormatter = require './DocFormatter'
|
||||||
filters = require 'lib/image_filter'
|
ReloadLevelModal = require 'views/play/level/modal/ReloadLevelModal'
|
||||||
|
|
||||||
module.exports = class SpellListTabEntryView extends SpellListEntryView
|
module.exports = class SpellListTabEntryView extends SpellListEntryView
|
||||||
template: template
|
template: template
|
||||||
|
@ -97,10 +97,10 @@ module.exports = class SpellListTabEntryView extends SpellListEntryView
|
||||||
Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'spell-list-open', volume: 1
|
Backbone.Mediator.publish 'audio-player:play-sound', trigger: 'spell-list-open', volume: 1
|
||||||
|
|
||||||
onCodeReload: (e) ->
|
onCodeReload: (e) ->
|
||||||
return unless @controlsEnabled
|
#return unless @controlsEnabled
|
||||||
#Backbone.Mediator.publish 'tome:reload-code', spell: @spell # Old: just reload the current code
|
#Backbone.Mediator.publish 'tome:reload-code', spell: @spell # Old: just reload the current code
|
||||||
Backbone.Mediator.publish 'level:restart', {} # New: prompt them to restart the level
|
@openModalView new ReloadLevelModal() # New: prompt them to restart the level
|
||||||
# TODO: actually prompt them to restart rather than just doing it
|
|
||||||
|
|
||||||
onBeautifyClick: (e) ->
|
onBeautifyClick: (e) ->
|
||||||
return unless @controlsEnabled
|
return unless @controlsEnabled
|
||||||
|
|
Loading…
Reference in a new issue