Skip to content
This repository has been archived by the owner on Aug 13, 2021. It is now read-only.

Commit

Permalink
Fixed issue where opening a new emote layer wouldn't work right in th…
Browse files Browse the repository at this point in the history
…e editor
  • Loading branch information
thepaperpilot committed May 9, 2017
1 parent 2e0522c commit a48a44f
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions src/renderer-process/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -764,7 +764,21 @@ function setLayer(e) {
document.getElementById('editor-layers-panel').style.display = 'none'
layer = e.target.id
if (layer.indexOf('-emote') > -1) {
puppet.changeEmote(layer.replace(/-emote/, ''))
var emote = layer.replace(/-emote/, '')
if (!(character.emotes[emote] && character.emotes[emote].enabled && emote !== 'default') && !character.emotes[emote]) {
character.emotes[emote] = {
"enabled": false,
"mouth": [],
"eyes": []
}
puppet.emotes[emote] = {
"mouth": new Container(),
"eyes": new Container()
}
puppet.mouthsContainer.addChild(puppet.emotes[emote].mouth)
puppet.eyesContainer.addChild(puppet.emotes[emote].eyes)
}
puppet.changeEmote(emote)
}
var selected = document.getElementById('editor-layers-panel').getElementsByClassName("selected")
while (selected.length)
Expand All @@ -782,12 +796,19 @@ function layerContextMenu(e) {
} else {
if (character.emotes[emote])
character.emotes[emote].enabled = true
else
else {
character.emotes[emote] = {
"enabled": true,
"mouth": [],
"eyes": []
}
puppet.emotes[emote] = {
"mouth": new Container(),
"eyes": new Container()
}
puppet.mouthsContainer.addChild(puppet.emotes[emote].mouth)
puppet.eyesContainer.addChild(puppet.emotes[emote].eyes)
}
e.target.className += " available"
}
}
Expand Down

0 comments on commit a48a44f

Please sign in to comment.