Skip to content
Snippets Groups Projects
Commit 1269d562 authored by vas's avatar vas
Browse files

add custom label support to RA

parent c630af34
No related branches found
No related tags found
No related merge requests found
...@@ -53,6 +53,7 @@ window.DefaultRules = (function() { ...@@ -53,6 +53,7 @@ window.DefaultRules = (function() {
ProcessSmartPiercings(slave, rule); ProcessSmartPiercings(slave, rule);
ProcessTattoos(slave, rule); ProcessTattoos(slave, rule);
ProcessPorn(slave, rule); ProcessPorn(slave, rule);
ProcessLabel(slave, rule);
return r; return r;
} }
...@@ -2183,6 +2184,13 @@ window.DefaultRules = (function() { ...@@ -2183,6 +2184,13 @@ 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}`;
}
}
return DefaultRules; return DefaultRules;
})(); })();
...@@ -289,6 +289,7 @@ window.emptyDefaultRule = function emptyDefaultRule() { ...@@ -289,6 +289,7 @@ window.emptyDefaultRule = function emptyDefaultRule() {
pregSpeed: "no default setting", pregSpeed: "no default setting",
bellyImplantVol: -1, bellyImplantVol: -1,
teeth: "no default setting", teeth: "no default setting",
label: "no default setting",
} }
}; };
return rule; return rule;
......
...@@ -890,6 +890,7 @@ window.rulesAssistantOptions = (function() { ...@@ -890,6 +890,7 @@ window.rulesAssistantOptions = (function() {
this.appendChild(new AutosurgerySection()); this.appendChild(new AutosurgerySection());
this.appendChild(new RegimenSection()); this.appendChild(new RegimenSection());
this.appendChild(new BehaviourSection()); this.appendChild(new BehaviourSection());
this.appendChild(new OtherSection());
} }
render() { render() {
...@@ -960,6 +961,13 @@ window.rulesAssistantOptions = (function() { ...@@ -960,6 +961,13 @@ window.rulesAssistantOptions = (function() {
this.appendChild(new PornList()); this.appendChild(new PornList());
} }
} }
class OtherSection extends Section {
constructor() {
super("Other Settings");
this.appendChild(new LabelList());
}
}
class CosmeticSection extends Section { class CosmeticSection extends Section {
constructor() { constructor() {
...@@ -3132,5 +3140,16 @@ window.rulesAssistantOptions = (function() { ...@@ -3132,5 +3140,16 @@ window.rulesAssistantOptions = (function() {
} }
} }
class LabelList extends List {
constructor() {
const items = [
["no default setting"],
];
super("Custom label", items, true);
this.setValue(current_rule.set.label);
this.onchange = (value) => current_rule.set.label = value;
}
}
return rulesAssistantOptions; return rulesAssistantOptions;
})(); })();
...@@ -2946,6 +2946,6 @@ Done! ...@@ -2946,6 +2946,6 @@ Done!
else x.set.preg = false; else x.set.preg = false;
})>> })>>
<<run $defaultRules.filter(x => !([1, 0, "no default setting"].includes(x.set.haircuts))).forEach(x => { <<run $defaultRules.filter(x => x.set.haircuts === undefined).forEach(x => { x.set.haircuts = "no default setting"; })>>
x.set.haircuts = "no default setting";
})>> <<run $defaultRules.filter(x => x.set.label === undefined).forEach(x => { x.set.label = "no default setting"; }>>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment