From d7f1855fbddb817bbaf1acf4dffcd94c526debd3 Mon Sep 17 00:00:00 2001 From: dazedanon Date: Fri, 20 Mar 2026 17:44:23 -0500 Subject: [PATCH] Better prompt for speaker format --- gui/workflow_tab.py | 114 ++++++++++++++++++++++++-------------------- 1 file changed, 62 insertions(+), 52 deletions(-) diff --git a/gui/workflow_tab.py b/gui/workflow_tab.py index 650f531..3dc9e9e 100644 --- a/gui/workflow_tab.py +++ b/gui/workflow_tab.py @@ -789,63 +789,73 @@ class WorkflowTab(QWidget): "Code 101 opens the text window. Code 401 is a dialogue line. " "Multiple 401s in a row form one message box.\n" "\n" - "## The formats to identify\n" + "## IMPORTANT — Always-on formats (NO FLAG NEEDED, never enable any flag for these)\n" "\n" - "### Format A — 101 name in param[4] (NO FLAG NEEDED, handled automatically)\n" - "The 101 code has a non-empty string at parameters[4].\n" - "Example:\n" - " { \"code\": 101, \"parameters\": [\"\", 0, 2, 2, \"るな\"] }\n" - " { \"code\": 401, \"parameters\": [\"「おはよう!\"] }\n" - "→ No flag needed. Do not set anything.\n" + "The following formats are detected and translated automatically. " + "If the game uses ANY of these, do NOT enable any flag — output SKIP for every flag.\n" "\n" - "### Format B — INLINE401SPEAKERS\n" - "The speaker name is embedded at the start of the 401 text directly before 「.\n" - "Example:\n" - " { \"code\": 401, \"parameters\": [\"エレナ「今日は晴れですね。\"] }\n" - "→ Set INLINE401SPEAKERS = True\n" - "\n" - "### Format C — FIRSTLINESPEAKERS\n" - "The first 401 in a group is a short name (<40 chars), and the next 401 " - "starts with 「 \" ( ( * [.\n" - "Example:\n" - " { \"code\": 401, \"parameters\": [\"アリス\"] }\n" - " { \"code\": 401, \"parameters\": [\"「こんにちは。\"] }\n" - "→ Set FIRSTLINESPEAKERS = True\n" - "\n" - "### Format D — FACENAME101\n" - "The 101 code has a face image filename in parameters[0] and parameters[4] is empty " - "or missing. The speaker name must be inferred from the face filename.\n" - "Example:\n" - " { \"code\": 101, \"parameters\": [\"face_alice\", 0, 0, 2, \"\"] }\n" - "→ Set FACENAME101 = True\n" - "\n" - "### Format E — Color-wrapped speaker (NO FLAG NEEDED, handled automatically)\n" - "A 401 line consists solely of a color-code-wrapped name: \\\\c[N]Name\\\\c[0].\n" - "Example:\n" - " { \"code\": 401, \"parameters\": [\"\\\\c[2]アリス\\\\c[0]\"] }\n" - " { \"code\": 401, \"parameters\": [\"「こんにちは。\"] }\n" - "→ No flag needed. Do not set anything.\n" - "\n" - "### Format F — Full-width colon (NO FLAG NEEDED, handled automatically)\n" - "A 401 line ends with a full-width colon : marking it as a speaker line.\n" - "Example:\n" - " { \"code\": 401, \"parameters\": [\"アリス:\"] }\n" - " { \"code\": 401, \"parameters\": [\"「こんにちは。\"] }\n" - "→ No flag needed. Do not set anything.\n" - "\n" - "### Always-on (NO FLAG NEEDED, handled automatically)\n" - " - \\\\n or \\\\k codes embedded in 401 text\n" - " - 【Name】 alone on a line or 【Name】dialogue on the same line\n" - " - \\\\c[N]Name\\\\c[0] color-wrapped name on its own 401 line\n" - " - Name: line ending with a full-width colon\n" + " • 101 param[4] name — { \"code\": 101, \"parameters\": [\"\", 0, 2, 2, \"るな\"] }\n" + " • \\\\n or \\\\k escape code anywhere in a 401 line\n" + " • 【Name】 alone on a line, or 【Name】dialogue on the same line\n" + " • [Name] alone on a line (square brackets), or [Name]dialogue on the same line\n" + " • \\\\c[N]Name\\\\c[0] color-wrapped name on its own 401 line\n" + " • Name: line ending with a full-width colon\n" "\n" "---\n" "\n" - "Please examine a sample of the event commands in the game files attached and tell me:\n" - " 1. Which format(s) are present\n" - " 2. Exactly which flags to set True (only list flags that should be True):\n" - " INLINE401SPEAKERS, FIRSTLINESPEAKERS, FACENAME101\n" - " 3. A short concrete example from the files confirming the pattern\n" + "## Flags that MAY need to be enabled\n" + "\n" + "Only set these if the game does NOT already use an always-on format above.\n" + "\n" + "### INLINE401SPEAKERS\n" + "The speaker name is embedded at the start of the 401 text directly before 「 " + "with NO intervening markup or brackets.\n" + "Example:\n" + " { \"code\": 401, \"parameters\": [\"エレナ「今日は晴れですね。\"] }\n" + "→ ENABLE only if the game has no always-on format. " + "Do NOT enable if names come via 101 param[4], \\\\n<>, 【】, or [] — those are already handled.\n" + "\n" + "### FIRSTLINESPEAKERS\n" + "The very first 401 in a message group is a short standalone name (<40 chars), " + "and the following 401 starts with 「 \" ( ( * [.\n" + "Example:\n" + " { \"code\": 401, \"parameters\": [\"アリス\"] }\n" + " { \"code\": 401, \"parameters\": [\"「こんにちは。\"] }\n" + "→ ENABLE only if the game has no always-on format and names appear this way.\n" + "\n" + "### FACENAME101 ⚠ LAST RESORT ONLY\n" + "Enable this ONLY when:\n" + " (a) the game has NO always-on speaker format, AND\n" + " (b) neither INLINE401SPEAKERS nor FIRSTLINESPEAKERS applies, AND\n" + " (c) the 101 code has a face image filename in parameters[0] while parameters[4] is empty.\n" + "Example:\n" + " { \"code\": 101, \"parameters\": [\"face_alice\", 0, 0, 2, \"\"] }\n" + "→ ENABLE only as a last resort. If you recommend this, you MUST also list every " + "unique face filename found in parameters[0] of code 101 across the attached files, " + "so the user knows which names to map.\n" + "\n" + "---\n" + "\n" + "## Decision process\n" + "\n" + "Step 1 — Check for always-on formats in the 401/101 blocks.\n" + " If found → output SKIP for all three flags and stop.\n" + "Step 2 — Check for INLINE401SPEAKERS or FIRSTLINESPEAKERS.\n" + " If found → ENABLE the matching flag(s). Stop — do not also enable FACENAME101.\n" + "Step 3 — Only if steps 1 and 2 both found nothing → consider FACENAME101.\n" + "\n" + "---\n" + "\n" + "Please examine a sample of the event commands in the attached files and output:\n" + "\n" + " 1. Which format(s) were detected and which step of the decision process applied\n" + " 2. For each flag — ENABLE or SKIP, with a one-line reason:\n" + " INLINE401SPEAKERS : ENABLE / SKIP — \n" + " FIRSTLINESPEAKERS : ENABLE / SKIP — \n" + " FACENAME101 : ENABLE / SKIP — \n" + " 3. A short concrete example from the files confirming the dominant pattern\n" + " 4. If FACENAME101 is ENABLE: list every unique face filename found in " + "code 101 parameters[0] so the user can build the name mapping\n" ) _PROMPT_GLOSSARY = (