diff --git a/src/js/DefaultRules.tw b/src/js/DefaultRules.tw index 466b15382eebefa5d5f9caa67b29b7fc3761d3f2..27a1b54220d92fe50d08a404426ef6c342e227ec 100644 --- a/src/js/DefaultRules.tw +++ b/src/js/DefaultRules.tw @@ -2191,9 +2191,14 @@ window.DefaultRules = (function() { } function ProcessLabel(slave, rule) { - if (rule.label !== "no default setting" && slave.customLabel !== rule.label) { - slave.customLabel = rule.label; - r += `<br>${slave.slaveName}'s label has been set to ${rule.label}`; + if (rule.label !== "no default setting" && !slave.customLabel.includes("["+rule.label+"]")) { + slave.customLabel = slave.customLabel + "[" + rule.label + "]"; + r += `<br>${slave.slaveName} has been tagged as ${rule.label}`; + } + + if (rule.removeLabel !== "no default setting" && slave.customLabel.includes("["+rule.removeLabel+"]")) { + slave.customLabel = slave.customLabel.replace("["+rule.removeLabel+"]", ""); + r += `<br>${slave.slaveName}'s tag [${rule.removeLabel}] is removed.`; } } diff --git a/src/js/rulesAssistant.tw b/src/js/rulesAssistant.tw index 8783498ad7f72a20b6ae509a50c37cb7ce116ff6..d7c116286504c7916fc744a742aa7ca0979633cd 100644 --- a/src/js/rulesAssistant.tw +++ b/src/js/rulesAssistant.tw @@ -290,6 +290,7 @@ window.emptyDefaultRule = function emptyDefaultRule() { bellyImplantVol: -1, teeth: "no default setting", label: "no default setting", + removeLabel: "no default setting", skinColor: "no default setting", } }; diff --git a/src/js/rulesAssistantOptions.tw b/src/js/rulesAssistantOptions.tw index 1c9de4d52442792414abaddc07068078605937e4..e947f7b77f38ed1181fd5bc6b5ba8a1905f03aa3 100644 --- a/src/js/rulesAssistantOptions.tw +++ b/src/js/rulesAssistantOptions.tw @@ -966,6 +966,7 @@ window.rulesAssistantOptions = (function() { constructor() { super("Other Settings"); this.appendChild(new LabelList()); + this.appendChild(new LabelRemoveList()); } } @@ -3152,6 +3153,17 @@ window.rulesAssistantOptions = (function() { this.onchange = (value) => current_rule.set.label = value; } } + + class LabelRemoveList extends List { + constructor() { + const items = [ + ["no default setting"], + ]; + super("Remove custom label", items, true); + this.setValue(current_rule.set.removeLabel); + this.onchange = (value) => current_rule.set.removeLabel = value; + } + } class SkinColourList extends List { constructor() { diff --git a/src/uncategorized/BackwardsCompatibility.tw b/src/uncategorized/BackwardsCompatibility.tw index fe5beda585e280ba1fcbefe6579eb30207f4ac3a..7ffae04654cecda4c83852dfd071fa1d21902603 100644 --- a/src/uncategorized/BackwardsCompatibility.tw +++ b/src/uncategorized/BackwardsCompatibility.tw @@ -2950,4 +2950,6 @@ Done! <<run $defaultRules.filter(x => x.set.label === undefined).forEach(x => { x.set.label = "no default setting"; })>> +<<run $defaultRules.filter(x => x.set.removeLabel === undefined).forEach(x => { x.set.removeLabel = "no default setting"; })>> + <<run $defaultRules.filter(x => x.set.skinColour === undefined).forEach(x => { x.set.skinColor = "no default setting"; })>>