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

more RAO work

parent 5a7cb1ae
No related branches found
No related tags found
No related merge requests found
......@@ -21,12 +21,134 @@ window.rulesAssistantOptions = (function() {
let tmp = document.createElement("div")
tmp.classList.add("passage")
tmp.classList.add("rules-assistant-options")
document.getElementById("passages").appendChild(tmp)
const root = new Element(tmp)
tmp = document.createElement("p")
tmp.innerHTML = `<em>${properTitle()}, I will review your slaves and make changes that will have a beneficial effect. Apologies, ${properTitle()}, but this function is... not fully complete. It may have some serious limitations. Please use the 'no default setting' option to identify areas I should not address.</em>`
root.appendChild(new Element(tmp))
const root = new Root(tmp)
}
function newRule(root) {
const id = V.defaultRules.length === 0? 1: V.defaultRules[V.defaultRules.length-1].ID + 1
v.defaultRules.push({
ID: id,
name: `Rule ${id}`,
condition: {
function: false,
data: {},
excludeSpecialSlaves: false,
assignment: [],
excludeAssignment: [],
selectedSlaves: [],
excludedSlaves: [],
facility: [],
excludeFacility: [],
},
set: {
releaseRules: "no default setting",
clitSetting: "no default setting",
clitSettingXY: "no default setting",
clitSettingXX: "no default setting",
clitSettingEnergy: "no default setting",
speechRules: "no default setting",
clothes: "no default setting",
collar: "no default setting",
shoes: "no default setting",
virginAccessory: "no default setting",
aVirginAccessory: "no default setting",
vaginalAccessory: "no default setting",
aVirginDickAccessory: "no default setting",
dickAccessory: "no default setting",
bellyAccessory: "no default setting",
aVirginButtplug: "no default setting",
buttplug: "no default setting",
eyeColor: "no default setting",
makeup: "no default setting",
nails: "no default setting",
hColor: "no default setting",
hLength: "no default setting",
hStyle: "no default setting",
pubicHColor: "no default setting",
pubicHStyle: "no default setting",
nipplesPiercing: "no default setting",
areolaePiercing: "no default setting",
clitPiercing: "no default setting",
vaginaLube: "no default setting",
vaginaPiercing: "no default setting",
dickPiercing: "no default setting",
anusPiercing: "no default setting",
lipsPiercing: "no default setting",
tonguePiercing: "no default setting",
earPiercing: "no default setting",
nosePiercing: "no default setting",
eyebrowPiercing: "no default setting",
navelPiercing: "no default setting",
corsetPiercing: "no default setting",
boobsTat: "no default setting",
buttTat: "no default setting",
vaginaTat: "no default setting",
dickTat: "no default setting",
lipsTat: "no default setting",
anusTat: "no default setting",
shouldersTat: "no default setting",
armsTat: "no default setting",
legsTat: "no default setting",
backTat: "no default setting",
stampTat: "no default setting",
curatives: "no default setting",
livingRules: "no default setting",
relationshipRules: "no default setting",
standardPunishment: "no default setting",
standardReward: "no default setting",
diet: "no default setting",
dietCum: "no default setting",
dietMilk: "no default setting",
muscles: "no default setting",
XY: "no default setting",
XX: "no default setting",
gelding: "no default setting",
preg: "no default setting",
growth_boobs: "no default setting",
growth_butt: "no default setting",
growth_lips: "no default setting",
growth_dick: "no default setting",
growth_balls: "no default setting",
aphrodisiacs: "no default setting",
autoSurgery: 0,
autoBrand: 0,
pornFameSpending: "no default setting",
dietGrowthSupport: 0,
eyewear: "no default setting",
setAssignment: "no default setting",
facilityRemove: false,
removalAssignment: "rest",
surgery_eyes: "no default setting",
surgery_lactation: "no default setting",
surgery_prostate: "no default setting",
surgery_cosmetic: "no default setting",
surgery_accent: "no default setting",
surgery_shoulders: "no default setting",
surgery_shouldersImplant: "no default setting",
surgery_boobs: "no default setting",
surgery_hips: "no default setting",
surgery_hipsImplant: "no default setting",
surgery_butt: "no default setting",
surgery_faceShape: "no default setting",
surgery_lips: "no default setting",
surgery_holes: "not default setting",
underArmHColor: "no default setting",
underArmHStyle: "no default setting",
drug: "no default setting",
eyes: "no default setting",
pregSpeed: "no default setting",
bellyImplantVol: -1,
}
})
reload(root)
}
function reload(root) {
root.element.remove()
rulesAssistantOptions()
}
// the Element class wraps around a DOM element and adds extra functionality
......@@ -108,7 +230,6 @@ window.rulesAssistantOptions = (function() {
if (this.onchange instanceof Function)
this.onchange(this.getValue())
}
}
// a clickable item of a list
......@@ -132,6 +253,7 @@ window.rulesAssistantOptions = (function() {
this.parent.selectItem(this)
this.elem.classList.add("selected")
this.selected = true
return true
}
deselect() {
......@@ -155,5 +277,89 @@ window.rulesAssistantOptions = (function() {
}
}
class Options extends Element {
constructor(elements=[]) {
elements.forEach(element => { this.appendChild(element) })
}
render() {
const elem = document.createElement("div")
elem.classList.add("rajs-list")
return elem
}
}
class OptionsItem extends Element {
constructor(label, onclick) {
super(label)
this.onclick = onclick
}
render(label, onclick) {
const elem = document.createElement("span")
elem.classList.add("rajs-listitem")
elem.innerHTML = label
elem.onclick = () => { return this.onclick() }
return elem
}
}
class NewRuleField extends Element {
constructor(root) {
super()
this.root = root
}
render() {
const container = document.createElement("div")
const textarea = document.createElmenet("textarea")
textarea.placeholder = "Paste your rule here"
container.appendChild(textarea)
this.textarea = textarea
const button = document.createElement("button")
button.name = "Load"
button.onclick = () => { this.loadNewRule() }
container.appendChild(button)
return container
}
loadNewRule() {
const text = this.textarea.value
try {
const rule = JSON.parse(text)
rule.ID = V.defaultRules.length === 0? rule.ID: V.defaultRules[V.defaultRules.length-1].ID + 1
reload(this.root)
} catch (e) {
alert(e)
}
}
}
class Root extends Element {
render(element) {
const greeting = document.createElement("p")
greeting.innerHTML = `<em>${properTitle()}, I will review your slaves and make changes that will have a beneficial effect. Apologies, ${properTitle()}, but this function is... not fully complete. It may have some serious limitations. Please use the 'no default setting' option to identify areas I should not address.</em>`
element.appendChild(greeting)
if(V.defaultRules.length === 0) {
const paragraph = document.createElement("p")
paragraph.innerHTML = "<strong>No rules</strong>"
element.appendChild(paragraph)
element.appendChild(new NoRules(root))
return element
}
}
}
class NoRules extends Options {
constructor(root) {
super()
this.root = root
const newrule = new OptionsItem("Add a new rule", () => { newRule(this.root) })
this.appendChild(newrule)
const importrule = new OptionsItem("Import a rule", () => { this.root.appendChild(new NewRuleField()) })
this.appendChild(importrule)
}
}
return rulesAssistantOptions
})()
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