diff --git a/docs/controls.md b/docs/controls.md index 9c14b771..7c70b0e6 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -70,7 +70,7 @@ The Switch prompts stay, with a note under *Button prompts* and a `RomFS overlay | Left stick, its press | W A S D (or the keys of the directions meant), Ctrl | | Right stick, its press | the mouse, with an arrow for each direction meant, C | -- The glyphs keep the width of the game's own, so the right-aligned guides do not run into their text. A key is a rounded square with its label cut out in the game's own text fonts; a mouse button is a mouse with that button filled and the others hollow. +- The glyphs keep the width of the game's own, so the right-aligned guides do not run into their text. A key is a rounded square with its label cut out in the game's own text fonts (Shift: an arrow over its name); a mouse button is a mouse with that button filled and the others hollow. - The button guide in play draws every button from images of the Common archive (`Nt_KeyTexA/B/X/Y/L/ZL_00`, `Nt_KeyTexLSt_00` and `_01`, the stick tilted and pressed): all of them are painted with the same icons. The letters of the action prompt's diamond are one character of the Normal font each: E, an arrow for Shift, a bar for Space, L and R for the mouse buttons. - Like the Xbox prompts they follow the defaults and not the bindings. `--binds ` draws the first key of each `bind_` line of that file instead, for a folder made by hand. - At a game resolution of another shape than 16:9 the game loads `romfs-patches-pc-x` in place of `romfs-patches-x` when it is there: the same prompts with that shape's UI layout, `make_romfs_patches.py --prompts pc --aspect x --out \romfs-patches-pc-x`. The setup does not write those, so without one the Switch prompts stay (*off at a game resolution not 16:9*). diff --git a/tests/romfs_prompts_test.py b/tests/romfs_prompts_test.py index a21cdd50..fe170c92 100644 --- a/tests/romfs_prompts_test.py +++ b/tests/romfs_prompts_test.py @@ -299,7 +299,7 @@ LETTERS_2 = {ord('T'): (560, polygon((230, 0), (330, 0), (330, 600), (520, 600), # The other characters the PC prompts' keys show (button_icons.PC_LABELS of the defaults): a block with a counter, each # its own size. LETTERS_2.update({ord(ch): (560, lambda pen, i=i: [rect(pen, 60, 0, 300 + 10 * i, 700), rect(pen, 120, 100, 240, 600, True)]) - for i, ch in enumerate('ACDEFMQSW1234⇧G')}) + for i, ch in enumerate('ACDEFGHIMQSW1234')}) PC_PANES = {'A': 'E', 'B': '↑', 'X': '▬', 'Y': 'L'} # the diamond's letters with the default keys diff --git a/tools/button_icons.py b/tools/button_icons.py index 813a174c..05b4dba0 100644 --- a/tools/button_icons.py +++ b/tools/button_icons.py @@ -195,7 +195,7 @@ PC_BINDS = { } # What a key shows: its letter, a symbol or a short name (key names as in totk.ini; the rest show their name). PC_LABELS = { - 'lshift': '⇧', 'rshift': '⇧', 'lctrl': 'CTRL', 'rctrl': 'CTRL', 'lalt': 'ALT', 'tab': 'TAB', + 'lshift': 'SHIFT', 'rshift': 'SHIFT', 'lctrl': 'CTRL', 'rctrl': 'CTRL', 'lalt': 'ALT', 'tab': 'TAB', 'enter': 'ENT', 'backspace': 'BKSP', 'capslock': 'CAPS', 'insert': 'INS', 'delete': 'DEL', 'home': 'HOME', 'end': 'END', 'pageup': 'PGUP', 'pagedown': 'PGDN', 'up': '↑', 'down': '↓', 'left': '←', 'right': '→', 'num_add': '+', 'num_sub': '-', 'num_mul': '*', 'num_div': '/', 'num_decimal': '.', @@ -284,6 +284,13 @@ def pc_icons(g, adv, binds=PC_BINDS): polygon(ReverseContourPen(pen), [(bx0, by0), (bx1, by0), (bx1, by1), (bx1 - t, by1), (bx1 - t, by0 + t), (bx0 + t, by0 + t), (bx0 + t, by1), (bx0, by1)]) return + if key in ('lshift', 'rshift'): # a solid arrow and the name under it: the arrow alone read as a direction + cx, ab, at, hw, sw = (x0 + x1) / 2, y0 + h * 0.46, y0 + h * 0.86, w * 0.20, w * 0.09 + neck = ab + h * 0.18 + polygon(ReverseContourPen(pen), [(cx - sw, ab), (cx + sw, ab), (cx + sw, neck), (cx + hw, neck), (cx, at), + (cx - hw, neck), (cx - sw, neck)]) + g.hole(pen, 'SHIFT', cx, y0 + h * 0.25, h * 0.21, w * 0.84) + return label = PC_LABELS.get(key, key.upper()) cap = h * (0.52 if len(label) == 1 else 0.36 if len(label) == 2 else 0.26) g.hole(pen, label, (x0 + x1) / 2, (y0 + y1) / 2, cap, w * 0.74)