mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-24 11:50:58 -04:00
Separate isSelectable from inThangList. Mouse wheel all the way in/out. bountyGold shows up as gold. Moved say Labels to mouth offset from aboveHead offset and obey sprite rotation. Don't link projects to example.com.
This commit is contained in:
parent
b9173a5ea5
commit
2a2ddd068e
7 changed files with 16 additions and 8 deletions
app
lib/surface
styles/play/level
templates/account
views/play/level
|
@ -164,8 +164,9 @@ module.exports = class Camera extends CocoClass
|
|||
target = {x: newTargetX, y:newTargetY}
|
||||
else
|
||||
target = @target
|
||||
if not(newZoom >= MAX_ZOOM or newZoom <= Math.max(@minZoom, MIN_ZOOM))
|
||||
@zoomTo target, newZoom, 0
|
||||
newZoom = Math.min newZoom, MAX_ZOOM
|
||||
newZoom = Math.max newZoom, MIN_ZOOM, @minZoom
|
||||
@zoomTo target, newZoom, 0
|
||||
|
||||
onMouseDown: (e) ->
|
||||
return if @dragDisabled
|
||||
|
|
|
@ -447,6 +447,10 @@ module.exports = CocoSprite = class CocoSprite extends CocoClass
|
|||
scaleFactor = @thang.scaleFactor ? 1
|
||||
pos.x *= @thang.scaleFactorX ? scaleFactor
|
||||
pos.y *= @thang.scaleFactorY ? scaleFactor
|
||||
# We might need to do this, but I don't have a good test case yet. TODO: figure out.
|
||||
#if prop isnt @registration
|
||||
# pos.x *= if @getActionProp 'flipX' then -1 else 1
|
||||
# pos.y *= if @getActionProp 'flipY' then -1 else 1
|
||||
pos
|
||||
|
||||
createMarks: ->
|
||||
|
|
|
@ -45,8 +45,10 @@ module.exports = class Label extends CocoClass
|
|||
|
||||
update: ->
|
||||
return unless @text
|
||||
offset = @sprite.getOffset? (if @style is 'dialogue' then 'mouth' else 'aboveHead')
|
||||
offset = @sprite.getOffset? (if @style in ['dialogue', 'say'] then 'mouth' else 'aboveHead')
|
||||
offset ?= x: 0, y: 0 # temp (if not CocoSprite)
|
||||
rotation = @sprite.getRotation()
|
||||
offset.x *= -1 if rotation >= 135 or rotation <= -135
|
||||
@label.x = @background.x = @sprite.displayObject.x + offset.x
|
||||
@label.y = @background.y = @sprite.displayObject.y + offset.y
|
||||
null
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
background-position-x: -6 * $iconSize
|
||||
&.prop-label-icon-maxSpeed
|
||||
background-position-x: -7 * $iconSize
|
||||
&.prop-label-icon-gold
|
||||
&.prop-label-icon-gold, &.prop-label-icon-bountyGold
|
||||
background-position-x: -8 * $iconSize
|
||||
|
||||
.prop-value.bar-prop
|
||||
|
|
|
@ -62,7 +62,7 @@ block content
|
|||
div.long-description!= marked(profile.longDescription)
|
||||
|
||||
if profile.work.length
|
||||
h3.experience-header
|
||||
h3.experience-header
|
||||
img.header-icon(src="/images/pages/account/profile/work.png", alt="")
|
||||
span(data-i18n="account_profile.work_experience") Work Experience
|
||||
each job in profile.work
|
||||
|
@ -103,7 +103,8 @@ block content
|
|||
each project in profile.projects
|
||||
if project.name
|
||||
li
|
||||
a(href=project.link)
|
||||
if project.link && project.link.length && project.link != 'http://example.com'
|
||||
a(href=project.link)
|
||||
if project.picture
|
||||
.project-image(style="background-image: url('/file/" + project.picture + "')")
|
||||
p= project.name
|
||||
|
|
|
@ -249,7 +249,7 @@ module.exports = class HUDView extends View
|
|||
return null # included in the bar
|
||||
context =
|
||||
prop: prop
|
||||
hasIcon: prop in ["health", "pos", "target", "inventory", "gold", "visualRange", "attackDamage", "attackRange", "maxSpeed"]
|
||||
hasIcon: prop in ["health", "pos", "target", "inventory", "gold", "bountyGold", "visualRange", "attackDamage", "attackRange", "maxSpeed"]
|
||||
hasBar: prop in ["health"]
|
||||
$(prop_template(context))
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ module.exports = class TomeView extends View
|
|||
delete @options.thangs
|
||||
|
||||
onNewWorld: (e) ->
|
||||
thangs = _.filter e.world.thangs, 'isSelectable'
|
||||
thangs = _.filter e.world.thangs, 'inThangList'
|
||||
programmableThangs = _.filter thangs, 'isProgrammable'
|
||||
@createSpells programmableThangs, e.world
|
||||
@thangList.adjustThangs @spells, thangs
|
||||
|
|
Loading…
Add table
Reference in a new issue