mirror of
https://github.com/loot/libloot.git
synced 2026-07-27 14:16:01 -07:00
Fixed Bash Tag types not being shown in editor.
They were getting converted incorrectly, I forgot about Javascript's object reference handling.
This commit is contained in:
@@ -49,22 +49,27 @@ function Plugin(obj) {
|
||||
/* Converts between the LOOT metadata object for tags, and their
|
||||
editor row representation. */
|
||||
Plugin.prototype.convTagObj = function(tag) {
|
||||
var newTag = {
|
||||
condition: tag.condition
|
||||
};
|
||||
if (tag.type) {
|
||||
/* Input is row data. */
|
||||
if (tag.type == 'remove') {
|
||||
tag.name = '-' + tag.name;
|
||||
newTag.name = '-' + tag.name;
|
||||
} else {
|
||||
newTag.name = tag.name;
|
||||
}
|
||||
delete tag.type;
|
||||
} else {
|
||||
/* Input is metadata object. */
|
||||
if (tag.name[0] == '-') {
|
||||
tag.type = 'remove';
|
||||
tag.name = tag.name.substr(1);
|
||||
newTag.type = 'remove';
|
||||
newTag.name = tag.name.substr(1);
|
||||
} else {
|
||||
tag.type = 'add';
|
||||
newTag.type = 'add';
|
||||
newTag.name = tag.name;
|
||||
}
|
||||
}
|
||||
return tag;
|
||||
return newTag;
|
||||
}
|
||||
|
||||
Plugin.prototype.getTagStrings = function() {
|
||||
|
||||
Reference in New Issue
Block a user