Skip to content
Snippets Groups Projects
Commit 0aaa1189 authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'SI-fix-indent' into 'pregmod-master'

SI: highlight rule selections

See merge request pregmodfan/fc-pregmod!8058
parents 910aee71 0f8fbfb2
No related branches found
No related tags found
No related merge requests found
......@@ -139,7 +139,6 @@ App.UI.SlaveInteract.rules = function(slave) {
if (["be a servant", "be a subordinate slave", "get milked", "please you", "serve in the club", "serve the public", "whore", "work as a farmhand", "work in the brothel", "work a glory hole"].includes(slave.assignment) || (V.dairyRestraintsSetting < 2 && slave.assignment === "work in the dairy")) {
div = document.createElement("div");
div.append("Sleep rules: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.rest, "bold");
choices = [
{value: "none"},
{value: "cruel"},
......@@ -157,7 +156,6 @@ App.UI.SlaveInteract.rules = function(slave) {
} else if (!canWalk(slave) && canMove(slave)) {
div = document.createElement("div");
div.append("Use of mobility aids: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.mobility, "bold");
choices = [
{value: "restrictive"},
{value: "permissive"},
......@@ -169,7 +167,6 @@ App.UI.SlaveInteract.rules = function(slave) {
// Punishment
div = document.createElement("div");
div.append("Typical punishment: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.punishment, "bold");
choices = [
{value: "confinement"},
{value: "whipping"},
......@@ -182,7 +179,6 @@ App.UI.SlaveInteract.rules = function(slave) {
// Reward
div = document.createElement("div");
div.append("Typical reward: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.reward, "bold");
choices = [
{value: "relaxation"},
{value: "drugs"},
......@@ -196,7 +192,6 @@ App.UI.SlaveInteract.rules = function(slave) {
if (slave.lactation !== 2) {
div = document.createElement("div");
div.append("Lactation maintenance: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.lactation, "bold");
choices = [
{
title: "Left alone",
......@@ -228,7 +223,6 @@ App.UI.SlaveInteract.rules = function(slave) {
if (slave.voice !== 0) {
div = document.createElement("div");
div.append("Speech rules: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.speech, "bold");
choices = [
{value: "restrictive"},
{value: "permissive"},
......@@ -248,7 +242,6 @@ App.UI.SlaveInteract.rules = function(slave) {
div = document.createElement("div");
div.append("Relationship rules: ");
App.UI.DOM.appendNewElement("span", div, slave.rules.relationship, "bold");
choices = [
{value: "restrictive"},
{value: "just friends"},
......@@ -271,6 +264,13 @@ App.UI.SlaveInteract.rules = function(slave) {
title, c.disabled
)
);
} else if (slave.rules[property] === c.value) {
links.push(
App.UI.DOM.disabledLink(
title,
["Current Setting"]
)
);
} else {
links.push(
App.UI.DOM.link(
......
......@@ -75,7 +75,16 @@ App.UI.SlaveInteract.generateRows = function(array, slave, category, accessCheck
}
if (accessCheck === false || unlocked) {
// is it just text?
if (array[i].disabled) {
let updateKeys;
let value;
if (!jQuery.isEmptyObject(array[i].updateSlave)) {
updateKeys = Object.keys(array[i].updateSlave); // ["clitsettings", ...]
value = array[i].updateSlave[updateKeys[0]];
}
if (updateKeys && slave[updateKeys[0]] === value) {
link = App.UI.DOM.disabledLink(array[i].text, ["Currently selected"]);
} else if (array[i].disabled) {
link = App.UI.DOM.disabledLink(array[i].text, [array[i].disabled]);
} else if (typeof unlocked === 'string') {
link = App.UI.DOM.disabledLink(array[i].text, [unlocked]);
......
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