mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
use thang.labelStyle to configure Labels
This allows level creators to configure the type of dialogue box used when a thang says a message.
This commit is contained in:
parent
51408a94de
commit
efbd66a9b1
2 changed files with 5 additions and 2 deletions
app/lib/surface
|
@ -15,7 +15,7 @@ module.exports = class Label extends CocoClass
|
|||
@sprite = options.sprite
|
||||
@camera = options.camera
|
||||
@layer = options.layer
|
||||
@style = options.style ? Label.STYLE_SAY
|
||||
@style = options.style ? (@sprite?.thang?.labelStyle || Label.STYLE_SAY)
|
||||
console.error @toString(), 'needs a sprite.' unless @sprite
|
||||
console.error @toString(), 'needs a camera.' unless @camera
|
||||
console.error @toString(), 'needs a layer.' unless @layer
|
||||
|
|
|
@ -684,7 +684,10 @@ module.exports = Lank = class Lank extends CocoClass
|
|||
return unless @thang
|
||||
blurb = if @thang.health <= 0 then null else @thang.sayMessage # Dead men tell no tales
|
||||
blurb = null if blurb in ['For Thoktar!', 'Bones!', 'Behead!', 'Destroy!', 'Die, humans!'] # Let's just hear, not see, these ones.
|
||||
labelStyle = if /Hero Placeholder/.test(@thang.id) then Label.STYLE_DIALOGUE else Label.STYLE_SAY
|
||||
if /Hero Placeholder/.test(@thang.id)
|
||||
labelStyle = Label.STYLE_DIALOGUE
|
||||
else
|
||||
labelStyle = @thang.labelStyle ? Label.STYLE_SAY
|
||||
@addLabel 'say', labelStyle if blurb
|
||||
if @labels.say?.setText blurb
|
||||
@notifySpeechUpdated blurb: blurb
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue