Centralize item axis value flattening
This commit is contained in:
+6
-28
@@ -3,6 +3,11 @@ from __future__ import annotations
|
||||
import re
|
||||
from typing import Any
|
||||
|
||||
try:
|
||||
from . import item_axis_policy
|
||||
except ImportError: # Allows local smoke tests with top-level imports.
|
||||
import item_axis_policy
|
||||
|
||||
|
||||
HARDCORE_DETAIL_DENSITY_CHOICES = {"compact", "balanced", "dense"}
|
||||
|
||||
@@ -21,34 +26,7 @@ def normalize_hardcore_detail_density(value: Any) -> str:
|
||||
|
||||
|
||||
def axis_values_text(axis_values: Any) -> str:
|
||||
if not isinstance(axis_values, dict):
|
||||
return ""
|
||||
priority = (
|
||||
"position",
|
||||
"body_position",
|
||||
"body_arrangement",
|
||||
"arrangement",
|
||||
"angle",
|
||||
"surface",
|
||||
"body_contact",
|
||||
"leg_detail",
|
||||
"outer_act",
|
||||
"contact_detail",
|
||||
"texture_detail",
|
||||
"hand_detail",
|
||||
"visibility",
|
||||
"expression_detail",
|
||||
"oral_act",
|
||||
"oral_detail",
|
||||
"penetration_act",
|
||||
"penetration_detail",
|
||||
"anal_act",
|
||||
"double_act",
|
||||
"threesome_act",
|
||||
"group_act",
|
||||
)
|
||||
parts = [_clean(axis_values.get(key)) for key in priority if _clean(axis_values.get(key))]
|
||||
return " ".join(parts)
|
||||
return item_axis_policy.action_context_text(axis_values)
|
||||
|
||||
|
||||
def position_context_text(role_graph: str, hard_item: str, composition: str = "", axis_values: Any = None) -> str:
|
||||
|
||||
Reference in New Issue
Block a user