fix: center tutorial introduction paragraphs
This commit is contained in:
@@ -172,3 +172,10 @@ so centred labels (the "Start New Game" button) were flushed right. Fixed to
|
|||||||
- Built and deployed after process and source-hash checks. SHA256: `15a7a24a236d01af4f5f3bcc89901dac5ab0211ed51357dfda5ef78d0026c423`. Backup of previous trial: `E:/DragonHD/backup_game/tutorial-intro-layout-20260920/Tutorial.dsc`. Rollback executed on separate copy and restored previous hash.
|
- Built and deployed after process and source-hash checks. SHA256: `15a7a24a236d01af4f5f3bcc89901dac5ab0211ed51357dfda5ef78d0026c423`. Backup of previous trial: `E:/DragonHD/backup_game/tutorial-intro-layout-20260920/Tutorial.dsc`. Rollback executed on separate copy and restored previous hash.
|
||||||
- Rebuild: `python tools/script_text.py --source E:/DragonHD/backup_game/tutorial-step1-20260920/Tutorial.dsc --mapping tools/tutorial_cn.json --out E:/DragonHD/build/tutorial-intro-layout/Tutorial.dsc --allow-alignment-changes`.
|
- Rebuild: `python tools/script_text.py --source E:/DragonHD/backup_game/tutorial-step1-20260920/Tutorial.dsc --mapping tools/tutorial_cn.json --out E:/DragonHD/build/tutorial-intro-layout/Tutorial.dsc --allow-alignment-changes`.
|
||||||
- Opening page visual recheck pending. Later pages retained exactly as user-tested.
|
- Opening page visual recheck pending. Later pages retained exactly as user-tested.
|
||||||
|
|
||||||
|
## 2026-09-20 — Correct opening page to centered alignment
|
||||||
|
|
||||||
|
- User rejected left alignment. The prior fix interpreted the visual preference incorrectly. Changed all four intro paragraphs to centered alignment, preserving the concise text and all later pages.
|
||||||
|
- Exactly eight escape bytes changed (`\b` to `\a`) across the intro message and repeated mission description.
|
||||||
|
- Center-coordinate test first failed on prior left-aligned mapping (0 != 66). New mapping passes at widths 360/400/480 using engine font metrics including 5px spaces. All 32 tests pass; rollback restores the previous copy exactly.
|
||||||
|
- User exited game; deployed centered file and reread/verified it. SHA256: `941fb4899d37304a304a985743c18cfd4b7dfed7613d831f8359c4d6b6972d6d`. Visual acceptance pending.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from test_cjk_layout import layout
|
|||||||
|
|
||||||
|
|
||||||
class IntroTests(unittest.TestCase):
|
class IntroTests(unittest.TestCase):
|
||||||
def test_intro_paragraphs_are_left_aligned_without_orphan_punctuation(self):
|
def test_intro_paragraphs_are_centered_without_orphan_punctuation(self):
|
||||||
mapping = json.loads(Path(__file__).with_name('tutorial_cn.json').read_text(encoding='utf-8'))
|
mapping = json.loads(Path(__file__).with_name('tutorial_cn.json').read_text(encoding='utf-8'))
|
||||||
intros = [v for k, v in mapping.items() if k.startswith('\fNow')]
|
intros = [v for k, v in mapping.items() if k.startswith('\fNow')]
|
||||||
self.assertEqual(len(intros), 2)
|
self.assertEqual(len(intros), 2)
|
||||||
@@ -15,7 +15,9 @@ class IntroTests(unittest.TestCase):
|
|||||||
for width in (360, 400, 480):
|
for width in (360, 400, 480):
|
||||||
lines, _ = layout(intro, width=width, alignment=0)
|
lines, _ = layout(intro, width=width, alignment=0)
|
||||||
for raw, x, y in lines:
|
for raw, x, y in lines:
|
||||||
self.assertEqual(x, 0)
|
text = raw.decode("gb2312")
|
||||||
|
pixels = sum(5 if c == " " else 8 if ord(c) < 128 else 12 for c in text)
|
||||||
|
self.assertEqual(x, (width - pixels) // 2)
|
||||||
self.assertNotIn(raw.decode('gb2312')[0], ',。!?、;:”)')
|
self.assertNotIn(raw.decode('gb2312')[0], ',。!?、;:”)')
|
||||||
self.assertEqual(len(lines), 4)
|
self.assertEqual(len(lines), 4)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"Tutorial": "操作教程",
|
"Tutorial": "操作教程",
|
||||||
"\fNow you have the chance to learn the game controls. Note the \"Next\" button at the top of the screen - click on it after completing each task to move to the next.\n\fYou can get help with the game interface by pressing the \"H\" button.\n\fYou don't have to finish this tutorial (although we recommend doing it once - there are some useful things to learn), you can exit it at any time by pressing the \"Esc\" button.\n\u0007(Note two buttons marked by red arrows: \"Next\" and a button that shows this text)": "\b每完成一项练习,点击上方“继续教程”。\n\b按 H 键查看界面帮助。\n\b建议首次游玩时完成教程;按 Esc 可退出。\n\b红箭头指向“继续教程”和“当前任务”按钮。",
|
"\fNow you have the chance to learn the game controls. Note the \"Next\" button at the top of the screen - click on it after completing each task to move to the next.\n\fYou can get help with the game interface by pressing the \"H\" button.\n\fYou don't have to finish this tutorial (although we recommend doing it once - there are some useful things to learn), you can exit it at any time by pressing the \"Esc\" button.\n\u0007(Note two buttons marked by red arrows: \"Next\" and a button that shows this text)": "\u0007每完成一项练习,点击上方“继续教程”。\n\u0007按 H 键查看界面帮助。\n\u0007建议首次游玩时完成教程;按 Esc 可退出。\n\u0007红箭头指向“继续教程”和“当前任务”按钮。",
|
||||||
"\fNow you have the chance to learn the game controls. Note the \"Next\" button at the top of the screen - click on it after completing each task to move to the next.\n\fYou can get help on the game interface by pressing the \"H\" button.\n\fYou don't have to finish this tutorial (although we recommend doing it once - there are some useful things to learn), you can exit it at any time by pressing \"Esc\" button.\n\u0007(Note two buttons marked by red arrows: \"Next\" and a button that shows this text)": "\b每完成一项练习,点击上方“继续教程”。\n\b按 H 键查看界面帮助。\n\b建议首次游玩时完成教程;按 Esc 可退出。\n\b红箭头指向“继续教程”和“当前任务”按钮。",
|
"\fNow you have the chance to learn the game controls. Note the \"Next\" button at the top of the screen - click on it after completing each task to move to the next.\n\fYou can get help on the game interface by pressing the \"H\" button.\n\fYou don't have to finish this tutorial (although we recommend doing it once - there are some useful things to learn), you can exit it at any time by pressing \"Esc\" button.\n\u0007(Note two buttons marked by red arrows: \"Next\" and a button that shows this text)": "\u0007每完成一项练习,点击上方“继续教程”。\n\u0007按 H 键查看界面帮助。\n\u0007建议首次游玩时完成教程;按 Esc 可退出。\n\u0007红箭头指向“继续教程”和“当前任务”按钮。",
|
||||||
"Camera rotation": "旋转镜头",
|
"Camera rotation": "旋转镜头",
|
||||||
"\fMove the mouse cursor to the left or right edge of the screen to rotate the view. Alternatively, use the numeric keypad or hold the center mouse button (wheel) and the Shift key and move the mouse.": "\f将鼠标移到屏幕左、右边缘可旋转视角。也可以使用数字小键盘,或按住 Shift 和鼠标中键(滚轮)并移动鼠标。",
|
"\fMove the mouse cursor to the left or right edge of the screen to rotate the view. Alternatively, use the numeric keypad or hold the center mouse button (wheel) and the Shift key and move the mouse.": "\f将鼠标移到屏幕左、右边缘可旋转视角。也可以使用数字小键盘,或按住 Shift 和鼠标中键(滚轮)并移动鼠标。",
|
||||||
"Center the camera": "镜头回正",
|
"Center the camera": "镜头回正",
|
||||||
|
|||||||
Reference in New Issue
Block a user