mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-05-02 17:03:42 -04:00
Adds randomize button in case of level with no thangs
This commit is contained in:
parent
df554360fe
commit
69713f5603
3 changed files with 21 additions and 0 deletions
app
styles/editor/level
templates/editor/level
views/editor/level/thangs
|
@ -210,6 +210,21 @@ $mobile: 1050px
|
||||||
#canvas-wrapper
|
#canvas-wrapper
|
||||||
width: 100%
|
width: 100%
|
||||||
position: relative
|
position: relative
|
||||||
|
|
||||||
|
#canvas-overlay
|
||||||
|
position: absolute
|
||||||
|
width: 100%
|
||||||
|
height: 100%
|
||||||
|
background: white
|
||||||
|
opacity: 0.5
|
||||||
|
text-align: center
|
||||||
|
|
||||||
|
#randomize-button
|
||||||
|
position: absolute
|
||||||
|
top: 45%
|
||||||
|
height: 40px
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Below snatched from play/level.sass; should refactor?
|
// Below snatched from play/level.sass; should refactor?
|
||||||
|
|
||||||
|
|
|
@ -23,6 +23,8 @@ button.navbar-toggle.toggle.btn-primary#thangs-palette-toggle(type="button", dat
|
||||||
.world-container.thangs-column
|
.world-container.thangs-column
|
||||||
h3(data-i18n="editor.level_tab_thangs_conditions") Starting Conditions
|
h3(data-i18n="editor.level_tab_thangs_conditions") Starting Conditions
|
||||||
#canvas-wrapper
|
#canvas-wrapper
|
||||||
|
#canvas-overlay
|
||||||
|
button.btn.btn-primary(id="randomize-button", data-toggle="coco-modal", data-target="editor/level/modals/TerrainRandomizeModal", data-i18n="editor.randomize", title="Randomize Terrain") Randomize
|
||||||
ul.dropdown-menu#contextmenu
|
ul.dropdown-menu#contextmenu
|
||||||
li#delete
|
li#delete
|
||||||
a(data-i18n="editor.delete") Delete
|
a(data-i18n="editor.delete") Delete
|
||||||
|
|
|
@ -116,6 +116,8 @@ module.exports = class ThangsTabView extends CocoView
|
||||||
$(window).resize @onWindowResize
|
$(window).resize @onWindowResize
|
||||||
@addThangsView = @insertSubView new AddThangsView world: @world, supermodel: @supermodel
|
@addThangsView = @insertSubView new AddThangsView world: @world, supermodel: @supermodel
|
||||||
@buildInterface() # refactor to not have this trigger when this view re-renders?
|
@buildInterface() # refactor to not have this trigger when this view re-renders?
|
||||||
|
if @thangsTreema.data.length
|
||||||
|
@$el.find('#canvas-overlay').css('display', 'none')
|
||||||
|
|
||||||
onFilterExtantThangs: (e) ->
|
onFilterExtantThangs: (e) ->
|
||||||
@$el.find('#extant-thangs-filter button.active').button('toggle')
|
@$el.find('#extant-thangs-filter button.active').button('toggle')
|
||||||
|
@ -233,6 +235,8 @@ module.exports = class ThangsTabView extends CocoView
|
||||||
@addThang @addThangType, thang.pos, true
|
@addThang @addThangType, thang.pos, true
|
||||||
@batchInsert()
|
@batchInsert()
|
||||||
@selectAddThangType null
|
@selectAddThangType null
|
||||||
|
@$el.find('#canvas-overlay').css('display', 'none')
|
||||||
|
|
||||||
|
|
||||||
# TODO: figure out a good way to have all Surface clicks and Treema clicks just proxy in one direction, so we can maintain only one way of handling selection and deletion
|
# TODO: figure out a good way to have all Surface clicks and Treema clicks just proxy in one direction, so we can maintain only one way of handling selection and deletion
|
||||||
onExtantThangSelected: (e) ->
|
onExtantThangSelected: (e) ->
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue