mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-05 18:34:45 +00:00
Fixed #2175 Removing DefineButtonSound, warning about incorrect sound character type in FLA export
This commit is contained in:
@@ -162,4 +162,66 @@ public class DefineButtonSoundTag extends Tag implements CharacterIdTag {
|
||||
public String toString() {
|
||||
return super.toString() + " (" + buttonId + ")";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean removeCharacter(int characterId) {
|
||||
boolean modified = false;
|
||||
|
||||
if (buttonSoundChar0 == characterId) {
|
||||
buttonSoundChar0 = 0;
|
||||
buttonSoundInfo0 = null;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar1 == characterId) {
|
||||
buttonSoundChar1 = 0;
|
||||
buttonSoundInfo1 = null;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar2 == characterId) {
|
||||
buttonSoundChar2 = 0;
|
||||
buttonSoundInfo2 = null;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar3 == characterId) {
|
||||
buttonSoundChar3 = 0;
|
||||
buttonSoundInfo3 = null;
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (modified) {
|
||||
setModified(true);
|
||||
}
|
||||
return modified;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceCharacter(int oldCharacterId, int newCharacterId) {
|
||||
boolean modified = false;
|
||||
|
||||
if (buttonId == oldCharacterId) {
|
||||
buttonId = newCharacterId;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar0 == oldCharacterId) {
|
||||
buttonSoundChar0 = newCharacterId;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar1 == oldCharacterId) {
|
||||
buttonSoundChar1 = newCharacterId;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar2 == oldCharacterId) {
|
||||
buttonSoundChar2 = newCharacterId;
|
||||
modified = true;
|
||||
}
|
||||
if (buttonSoundChar3 == oldCharacterId) {
|
||||
buttonSoundChar3 = newCharacterId;
|
||||
modified = true;
|
||||
}
|
||||
|
||||
if (modified) {
|
||||
setModified(true);
|
||||
}
|
||||
return modified;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1811,8 +1811,15 @@ public class XFLConverter {
|
||||
"index", Integer.toString(frame - 1),
|
||||
"keyMode", Integer.toString(KEY_MODE_NORMAL)});
|
||||
if (soundChar > 0) {
|
||||
DefineSoundTag sound = (DefineSoundTag) swf.getCharacter(soundChar);
|
||||
convertSoundUsage(symbolStr, sound, soundInfo);
|
||||
CharacterTag soundCharTag = swf.getCharacter(soundChar);
|
||||
if (soundCharTag == null) {
|
||||
logger.log(Level.WARNING, "Sound tag (ID={0}) was not found", soundChar);
|
||||
} else if (soundCharTag instanceof DefineSoundTag) {
|
||||
DefineSoundTag sound = (DefineSoundTag) soundCharTag;
|
||||
convertSoundUsage(symbolStr, sound, soundInfo);
|
||||
} else {
|
||||
logger.log(Level.WARNING, "Tag (ID={0}) expected to be DefineSound, {1} found. It is referenced from DefineButtonSound({2}).", new Object[] {soundChar, soundCharTag.getClass().getSimpleName(), defineButtonSound.buttonId});
|
||||
}
|
||||
}
|
||||
symbolStr.writeStartElement("elements");
|
||||
symbolStr.writeEndElement(); //elements
|
||||
|
||||
Reference in New Issue
Block a user