From 53ea38d5d2db4105800f91f027a1e621f2993ae7 Mon Sep 17 00:00:00 2001
From: lowercasedonkey <lowercasedonkey@gmail.com>
Date: Sun, 17 Jan 2021 18:36:53 -0500
Subject: [PATCH] add editting and sync for counter tats

---
 .../bodyModification/bodyModification.js      | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/src/facilities/bodyModification/bodyModification.js b/src/facilities/bodyModification/bodyModification.js
index 8f6de0ee316..ede74b49640 100644
--- a/src/facilities/bodyModification/bodyModification.js
+++ b/src/facilities/bodyModification/bodyModification.js
@@ -638,11 +638,33 @@ App.UI.bodyModification = function(slave, cheat = false) {
 						);
 					}
 				}
+				if (slave.birthsTat !== slave.counter.births ) {
+					linkArray.push(
+						App.UI.DOM.link(
+							`Update tattoo to match birth counter (${slave.counter.births})`,
+							() => {
+								slave.birthsTat = slave.counter.births;
+								billMod();
+								refresh();
+							}
+						)
+					);
+				}
+				linkArray.push(
+					App.UI.DOM.makeTextBox(
+						slave.birthsTat,
+						v => {
+							slave.birthsTat = v;
+							refresh();
+						}
+					)
+				);
 			}
 			r.push(App.UI.DOM.generateLinksStrip(linkArray));
 			App.Events.addNode(el, r, "div");
 
 			r = [];
+			linkArray = [];
 			if (slave.abortionTat === -1) {
 				r.push(`Have ${him} receive a tattoo for each abortion or miscarriage ${he} has.`);
 				linkArray.push(
@@ -699,6 +721,27 @@ App.UI.bodyModification = function(slave, cheat = false) {
 						);
 					}
 				}
+				if (slave.abortionTat !== slave.counter.abortions ) {
+					linkArray.push(
+						App.UI.DOM.link(
+							`Update tattoo to match abortion/miscarriage counter (${slave.counter.abortions})`,
+							() => {
+								slave.abortionTat = slave.counter.abortions;
+								billMod();
+								refresh();
+							}
+						)
+					);
+				}
+				linkArray.push(
+					App.UI.DOM.makeTextBox(
+						slave.abortionTat,
+						v => {
+							slave.abortionTat = v;
+							refresh();
+						}
+					)
+				);
 			}
 
 			r.push(App.UI.DOM.generateLinksStrip(linkArray));
-- 
GitLab