mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-03 17:33:31 -04:00
Added a clear storage button to the campaign editor.
This commit is contained in:
parent
075f7630ed
commit
1ab8274c43
5 changed files with 25 additions and 16 deletions
app
lib/surface
locale
styles/play
templates/play
views/play
|
@ -103,6 +103,7 @@ module.exports = Lank = class Lank extends CocoClass
|
||||||
|
|
||||||
setSprite: (newSprite) ->
|
setSprite: (newSprite) ->
|
||||||
if @sprite
|
if @sprite
|
||||||
|
@sprite.off 'animationend', @playNextAction
|
||||||
@sprite.destroy?()
|
@sprite.destroy?()
|
||||||
if parent = @sprite.parent
|
if parent = @sprite.parent
|
||||||
parent.removeChild @sprite
|
parent.removeChild @sprite
|
||||||
|
|
|
@ -780,6 +780,7 @@
|
||||||
level_completion: "Level Completion"
|
level_completion: "Level Completion"
|
||||||
pop_i18n: "Populate I18N"
|
pop_i18n: "Populate I18N"
|
||||||
tasks: "Tasks"
|
tasks: "Tasks"
|
||||||
|
clear_storage: "Clear your local changes"
|
||||||
|
|
||||||
article:
|
article:
|
||||||
edit_btn_preview: "Preview"
|
edit_btn_preview: "Preview"
|
||||||
|
|
|
@ -427,8 +427,7 @@ $gameControlMargin: 30px
|
||||||
&.sorcerer
|
&.sorcerer
|
||||||
background-position: (-12 * $spriteSheetSize) 0
|
background-position: (-12 * $spriteSheetSize) 0
|
||||||
|
|
||||||
|
.campaign-control-button
|
||||||
#volume-button
|
|
||||||
position: absolute
|
position: absolute
|
||||||
right: 1%
|
right: 1%
|
||||||
top: 1%
|
top: 1%
|
||||||
|
@ -439,9 +438,12 @@ $gameControlMargin: 30px
|
||||||
@include opacity(1.0)
|
@include opacity(1.0)
|
||||||
|
|
||||||
.glyphicon
|
.glyphicon
|
||||||
display: none
|
|
||||||
font-size: 32px
|
font-size: 32px
|
||||||
|
|
||||||
|
#volume-button
|
||||||
|
.glyphicon
|
||||||
|
display: none
|
||||||
|
|
||||||
&.vol-up .glyphicon.glyphicon-volume-up
|
&.vol-up .glyphicon.glyphicon-volume-up
|
||||||
display: inline-block
|
display: inline-block
|
||||||
|
|
||||||
|
@ -454,20 +456,11 @@ $gameControlMargin: 30px
|
||||||
&.vol-down .glyphicon.glyphicon-volume-down
|
&.vol-down .glyphicon.glyphicon-volume-down
|
||||||
display: inline-block
|
display: inline-block
|
||||||
|
|
||||||
#back-button
|
#back-button, #clear-storage-button
|
||||||
position: absolute
|
position: absolute
|
||||||
right: 70px
|
right: 70px
|
||||||
right: -webkit-calc(1% + 55px)
|
right: -webkit-calc(1% + 55px)
|
||||||
right: calc(1% + 55px)
|
right: calc(1% + 55px)
|
||||||
top: 1%
|
|
||||||
padding: 3px 8px
|
|
||||||
@include opacity(0.75)
|
|
||||||
|
|
||||||
&:hover
|
|
||||||
@include opacity(1.0)
|
|
||||||
|
|
||||||
.glyphicon
|
|
||||||
font-size: 32px
|
|
||||||
|
|
||||||
#campaign-status
|
#campaign-status
|
||||||
position: absolute
|
position: absolute
|
||||||
|
|
|
@ -107,15 +107,19 @@ else
|
||||||
button.btn.btn-illustrated.btn-primary(data-i18n="nav.contact", data-toggle="coco-modal", data-target="core/ContactModal") Contact
|
button.btn.btn-illustrated.btn-primary(data-i18n="nav.contact", data-toggle="coco-modal", data-target="core/ContactModal") Contact
|
||||||
|
|
||||||
|
|
||||||
button.btn.btn-lg.btn-inverse#volume-button(data-i18n="[title]play.adjust_volume", title="Adjust volume")
|
button.btn.btn-lg.btn-inverse.campaign-control-button#volume-button(data-i18n="[title]play.adjust_volume", title="Adjust volume")
|
||||||
.glyphicon.glyphicon-volume-off
|
.glyphicon.glyphicon-volume-off
|
||||||
.glyphicon.glyphicon-volume-down
|
.glyphicon.glyphicon-volume-down
|
||||||
.glyphicon.glyphicon-volume-up
|
.glyphicon.glyphicon-volume-up
|
||||||
|
|
||||||
if campaign
|
if campaign && !editorMode
|
||||||
button.btn.btn-lg.btn-inverse#back-button(data-i18n="[title]resources.campaigns", title="Campaigns")
|
button.btn.btn-lg.btn-inverse.campaign-control-button#back-button(data-i18n="[title]resources.campaigns", title="Campaigns")
|
||||||
.glyphicon.glyphicon-globe
|
.glyphicon.glyphicon-globe
|
||||||
|
|
||||||
|
if editorMode
|
||||||
|
button.btn.btn-lg.btn-inverse.campaign-control-button#clear-storage-button(data-i18n="[title]editor.clear_storage", title="Clear your local changes")
|
||||||
|
.glyphicon.glyphicon-refresh
|
||||||
|
|
||||||
if campaign && campaign.loaded
|
if campaign && campaign.loaded
|
||||||
h1#campaign-status
|
h1#campaign-status
|
||||||
.campaign-status-background
|
.campaign-status-background
|
||||||
|
|
|
@ -48,6 +48,7 @@ module.exports = class CampaignView extends RootView
|
||||||
'click .level-info-container .view-solutions': 'onClickViewSolutions'
|
'click .level-info-container .view-solutions': 'onClickViewSolutions'
|
||||||
'click #volume-button': 'onToggleVolume'
|
'click #volume-button': 'onToggleVolume'
|
||||||
'click #back-button': 'onClickBack'
|
'click #back-button': 'onClickBack'
|
||||||
|
'click #clear-storage-button': 'onClickClearStorage'
|
||||||
'click .portal .campaign': 'onClickPortalCampaign'
|
'click .portal .campaign': 'onClickPortalCampaign'
|
||||||
'mouseenter .portals': 'onMouseEnterPortals'
|
'mouseenter .portals': 'onMouseEnterPortals'
|
||||||
'mouseleave .portals': 'onMouseLeavePortals'
|
'mouseleave .portals': 'onMouseLeavePortals'
|
||||||
|
@ -531,6 +532,15 @@ module.exports = class CampaignView extends RootView
|
||||||
viewClass: CampaignView
|
viewClass: CampaignView
|
||||||
viewArgs: [{supermodel: @supermodel}]
|
viewArgs: [{supermodel: @supermodel}]
|
||||||
|
|
||||||
|
onClickClearStorage: (e) ->
|
||||||
|
localStorage.clear()
|
||||||
|
noty {
|
||||||
|
text: 'Local storage cleared. Reload to view the original campaign.'
|
||||||
|
layout: 'topCenter'
|
||||||
|
timeout: 5000
|
||||||
|
type: 'information'
|
||||||
|
}
|
||||||
|
|
||||||
updateHero: ->
|
updateHero: ->
|
||||||
return unless hero = me.get('heroConfig')?.thangType
|
return unless hero = me.get('heroConfig')?.thangType
|
||||||
for slug, original of ThangType.heroes when original is hero
|
for slug, original of ThangType.heroes when original is hero
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue