Move pair clothing wording policy
This commit is contained in:
+84
-4
@@ -147,6 +147,89 @@ INSTA_OF_HARDCORE_MEN_CLOTHING_VISIBLE = [
|
||||
]
|
||||
|
||||
|
||||
def _clean_pair_punctuation(text: Any) -> str:
|
||||
text = re.sub(r"\s+", " ", str(text or "")).strip()
|
||||
text = re.sub(r"\s+([,.;:])", r"\1", text)
|
||||
text = re.sub(r"(?:,\s*){2,}", ", ", text)
|
||||
text = re.sub(r"\.\s*\.", ".", text)
|
||||
text = re.sub(r":\s*\.", ".", text)
|
||||
return text.strip()
|
||||
|
||||
|
||||
def body_exposure_scene_text(scene: Any) -> str:
|
||||
text = str(scene or "").strip()
|
||||
if not text:
|
||||
return ""
|
||||
replacements = (
|
||||
(r",?\s*\bscattered (?:clothes|clothing)\b", ""),
|
||||
(r",?\s*\bfloor clothes\b", ""),
|
||||
(r"\bclothes scattered\b", "soft floor shadows"),
|
||||
(r",?\s*\bscattered lingerie\b", ""),
|
||||
(r",?\s*\blingerie visible nearby\b", ""),
|
||||
(r"\boutfit racks\b", "mirror shelves"),
|
||||
(r"\bcostume racks\b", "mirror shelves"),
|
||||
(r"\bhanging outfits\b", "hanging fabric"),
|
||||
(r"\bclothing hooks\b", "wall hooks"),
|
||||
(r"\boutfit-check\b", "creator-shot"),
|
||||
(r"\boutfit framing\b", "body framing"),
|
||||
(r"\bfull outfits\b", "full bodies"),
|
||||
(r"\bcoordinated outfits\b", "coordinated posing"),
|
||||
)
|
||||
for pattern, replacement in replacements:
|
||||
text = re.sub(pattern, replacement, text, flags=re.IGNORECASE)
|
||||
text = re.sub(r"\bwith,\s*", "with ", text, flags=re.IGNORECASE)
|
||||
text = re.sub(r",\s*,", ",", text)
|
||||
return _clean_pair_punctuation(text)
|
||||
|
||||
|
||||
def softcore_outfit_sentence(label: str, outfit: str) -> str:
|
||||
outfit = str(outfit or "").strip()
|
||||
if not outfit:
|
||||
return ""
|
||||
lower = outfit.lower()
|
||||
if lower.startswith(("wears ", "wearing ", "in ")):
|
||||
return f"{label} {outfit}"
|
||||
return f"{label} wears {outfit}"
|
||||
|
||||
|
||||
def hardcore_clothing_sentence(label: str, clothing: str) -> str:
|
||||
clothing = str(clothing or "").strip().rstrip(".")
|
||||
if not clothing:
|
||||
return ""
|
||||
lower = clothing.lower()
|
||||
if lower.startswith(("fully nude", "nude")):
|
||||
return f"{label}'s body is fully exposed, bare skin unobstructed"
|
||||
if lower.startswith("partly nude"):
|
||||
return f"{label}'s body is partly exposed"
|
||||
if lower.startswith(("is ", "wears ", "wearing ", "keeps ", "has ", "with ")):
|
||||
return f"{label} {clothing}"
|
||||
return f"{label}'s clothing: {clothing}"
|
||||
|
||||
|
||||
def character_hardcore_clothing_entries(
|
||||
label_map: dict[str, dict[str, Any]],
|
||||
women_count: int,
|
||||
men_count: int,
|
||||
pov_labels: list[str] | None,
|
||||
rng: Any,
|
||||
slot_hardcore_clothing: Callable[[dict[str, Any] | None, Any], str],
|
||||
) -> list[str]:
|
||||
pov_set = set(pov_labels or [])
|
||||
labels = [
|
||||
*[f"Woman {chr(ord('A') + index)}" for index in range(max(0, women_count))],
|
||||
*[f"Man {chr(ord('A') + index)}" for index in range(max(0, men_count))],
|
||||
]
|
||||
entries: list[str] = []
|
||||
for label in labels:
|
||||
if label in pov_set:
|
||||
continue
|
||||
clothing = slot_hardcore_clothing(label_map.get(label), rng)
|
||||
sentence = hardcore_clothing_sentence(label, clothing)
|
||||
if sentence:
|
||||
entries.append(sentence)
|
||||
return entries
|
||||
|
||||
|
||||
def hardcore_row_access_flags(row: dict[str, Any]) -> dict[str, bool]:
|
||||
axis_values = row.get("item_axis_values")
|
||||
axis_text = " ".join(str(value) for value in axis_values.values()) if isinstance(axis_values, dict) else ""
|
||||
@@ -272,7 +355,6 @@ def default_man_hardcore_clothing_entries(
|
||||
rng: Any,
|
||||
needs_lower_access: bool,
|
||||
choose: Callable[[Any, list[str]], str],
|
||||
sentence_builder: Callable[[str, str], str],
|
||||
) -> list[str]:
|
||||
pov_set = set(pov_labels or [])
|
||||
configured_labels = {
|
||||
@@ -287,7 +369,7 @@ def default_man_hardcore_clothing_entries(
|
||||
label = f"Man {chr(ord('A') + index)}"
|
||||
if label in pov_set or label in configured_labels:
|
||||
continue
|
||||
entries.append(sentence_builder(label, choose(rng, pool)))
|
||||
entries.append(hardcore_clothing_sentence(label, choose(rng, pool)))
|
||||
return entries
|
||||
|
||||
|
||||
@@ -302,7 +384,6 @@ def resolve_hardcore_pair_clothing(
|
||||
rng: Any,
|
||||
continuity_map: dict[str, str],
|
||||
choose: Callable[[Any, list[str]], str],
|
||||
sentence_builder: Callable[[str, str], str],
|
||||
) -> dict[str, Any]:
|
||||
access_flags = hardcore_row_access_flags(hard_row)
|
||||
woman_access = "lower" if access_flags["woman_lower"] else "upper" if access_flags["woman_upper"] else ""
|
||||
@@ -313,7 +394,6 @@ def resolve_hardcore_pair_clothing(
|
||||
rng,
|
||||
access_flags["man_lower"],
|
||||
choose,
|
||||
sentence_builder,
|
||||
)
|
||||
has_primary_hardcore_clothing = any(entry.startswith("Woman A") for entry in character_hardcore_clothing_entries)
|
||||
fallback_state = "" if has_primary_hardcore_clothing else hardcore_clothing_state(
|
||||
|
||||
Reference in New Issue
Block a user