fix(rpgmaker): respect row limits and skip code 408 by default

This commit is contained in:
DazedAnon 2026-07-27 22:19:20 -05:00
parent 3d81c750fc
commit a7351d7d48
4 changed files with 29 additions and 14 deletions

View file

@ -161,11 +161,15 @@ geometry rather than generic RPG Maker defaults whenever project code is availab
4. Convert usable pixels to DazedTL's character-count wrap setting by measuring representative
English glyphs in the real font when possible. Otherwise use a conservative documented average
glyph width. Never copy a pixel width directly into `width`, `listWidth`, or `noteWidth`.
5. Test representative short, median, long, control-code-heavy, icon-heavy, and font-changed values.
Use the largest effective font when one shared setting must cover several variants.
6. For dialogue, verify the recommendation against the actual message-row limit, commonly four.
If a long message cannot fit without unreadable font reduction or horizontal overflow, flag it
for pagination/manual reflow instead of forcing an unsafe four-line wrap.
5. Simulate final wrapping for representative short, median, long, control-code-heavy, icon-heavy,
font-changed, and explicitly line-broken values. Use the largest effective font when one shared
setting must cover several variants. Accept a recommendation only when each rendered line fits
horizontally and the rendered line count stays within the actual visible-row limit.
6. Treat horizontal capacity and visible rows as simultaneous constraints. Distinguish fixed or
clipped windows from scrolling, paging, and auto-sizing windows. If no readable font and wrap
width satisfies both constraints, flag the value for pagination/manual reflow or a game-side
window change; do not reduce wrap width as a supposed fix for vertical overflow because that
usually creates more lines.
7. Detect standard message faces from non-empty code-101 parameter 0 values. Calculate both the
full dialogue width and the reduced `faceWidth`; DazedTL selects `faceWidth` automatically for
those message groups. For plugin portraits outside code 101, document the detection gap and use
@ -188,7 +192,7 @@ List/Help: listWidth=<DazedTL width> ; font=<px or keep current (measured px)> ;
Notes : noteWidth=<DazedTL width> ; font=<px or keep current (measured px)> ; rows=<count or varies>
Evidence:
- <resolution/window/font/plugin locator and calculation>
- <resolution/window/font/plugin locator, horizontal capacity, visible-row limit, and tested fit>
Exceptions / playtests:
- <variant windows, uncertain plugin behavior, or messages requiring pagination>

View file

@ -18,16 +18,23 @@ list/help text, and notes.
selects `faceWidth` automatically for those message groups. Identify plugin portraits that do
not use code 101 as exceptions requiring a conservative width or custom handling.
3. For Dialogue, List/Help, and Notes, calculate usable pixels from the actual window geometry:
subtract padding, text inset, faces/portraits, icons, columns, and plugin margins. Calculate row
capacity from usable height and line height.
subtract padding, text inset, faces/portraits, icons, columns, and plugin margins. Derive the
exact visible-row limit from usable height and the largest applicable line height. Distinguish
fixed/clipped windows from scrolling, paging, or auto-sizing windows.
4. Account for the real font face and base size plus `\\{`, `\\}`, `\\FS[n]`, custom font codes,
inline icons/images, and plugin scaling. Measure representative English glyphs in the real font
when possible; otherwise state the conservative average used. Never copy pixels directly into a
character-count setting.
5. Test representative short, long, icon-heavy, control-code-heavy, and font-changed values. Check
dialogue against its real row limit, commonly four. Recommend pagination/manual reflow when a
message cannot fit without unreadable font reduction or horizontal overflow.
6. Recommend a readable font for each category. Use `keep current (<N>px)` when no game-side font
5. Simulate the final wrapping of representative short, long, icon-heavy, control-code-heavy, and
font-changed values, including explicit line breaks. A recommendation is valid only when every
rendered line fits horizontally **and** the rendered line count does not exceed that window's
visible-row limit. Report both the widest rendered line and row count for the tested cases.
6. Treat horizontal and vertical fit as simultaneous constraints: horizontal capacity sets the
largest safe wrap width, while a fixed row limit may require enough text per line to avoid an
extra row. If no readable font and wrap width satisfies both, recommend
pagination/manual reflow or a game-side window change. Do not claim that reducing the wrap
width fixes vertical overflow; narrower wrapping usually creates more lines.
7. Recommend a readable font for each category. Use `keep current (<N>px)` when no game-side font
change is needed; otherwise cite the exact plugin parameter or function that would change it.
</instructions>
@ -40,7 +47,7 @@ List/Help: listWidth=<N> ; font=<Npx or keep current (Npx)> ; rows=<N or varies>
Notes : noteWidth=<N> ; font=<Npx or keep current (Npx)> ; rows=<N or varies>
Evidence:
- <window/font/plugin locator and calculation>
- <window/font/plugin locator, horizontal capacity, visible-row limit, and tested fit>
Exceptions / playtests:
- <plugin portraits, variant windows, or messages requiring pagination>

View file

@ -152,7 +152,7 @@ CODE405 = True
CODE102 = True
# Optional
CODE408 = True
CODE408 = False
# Variables
CODE122 = False

View file

@ -110,6 +110,10 @@ class WorkflowTranslationPromptTests(unittest.TestCase):
self.assertIn("non-empty parameter 0", prompt)
self.assertIn("plugin portraits", prompt)
self.assertIn("pagination/manual reflow", prompt)
self.assertIn("rendered line count", prompt)
self.assertIn("visible-row limit", prompt)
self.assertIn("simultaneous constraints", prompt)
self.assertIn("narrower wrapping usually creates more lines", prompt)
def test_image_translation_prompt_ends_skips_with_recovery_options(self):
prompt = load_clipboard_skill("image_translation.md")