Repository navigation
modoptions: string 设置项直接给文本框 + 游戏内文本输入层(并修复键位配置界面被盖住) - #5
Open
std-external wants to merge 2 commits into
Open
std-external wants to merge 2 commits into
std-external wants to merge 2 commits into
Conversation
std-external
force-pushed
the
feat/string-text-input
branch
from
October 22, 2026 10:10
a151e73 to
800d977
Compare
… fields String settings in the material mod options page are now edited like a regular text box: - keyboard mouse users edit inline through SDL text input (IME included); the self-drawn QWERTY prompt is kept for gamepad input - both editors keep a caret, so left/right, Home/End and Delete work, and backspace removes the character before the caret - mouse/touch clicks place the caret at the nearest character boundary; widths come from the TTF font, so CJK/full-width glyphs count twice - spaces are drawn as a middle dot so leading/trailing spaces and the caret position stay visible The old key/button config layering fix has moved to its own PR.
std-external
force-pushed
the
feat/string-text-input
branch
from
October 26, 2026 15:24
800d977 to
b2b7cea
Compare
Contributor
Author
|
已 rebase 到最新 master( 冲突与解决7 处冲突全在
没有重叠的依据:master 这几次改的是 option 分类、滑条/下拉渲染、配置覆盖层和结构体类型;string 输入走的是 验证
顺带清理了 fork
|
Contributor
Author
|
CI 在这个 head 上全绿:Tests 47s、Windows x64 3m10s、macOS x64 3m55s、Linux x64 8m10s、Android ARM64 2m1s。 |
The inline string editor and both mod options search boxes now behave like a regular text box: - spaces are drawn as spaces; the middle-dot placeholder is gone - Ctrl+A selects everything, Ctrl+C/X/V copy, cut and paste through Everest's clipboard wrapper (SDL), so all platforms share the same path - Shift+Left/Right/Home/End extend a selection; typing, backspace, delete and paste replace it - holding Left/Right repeats after a short delay, matching keyboard repeat - clicking inside a search box focuses it and drops the caret at the nearest character, same as the inline editor - the search boxes now keep a real caret instead of appending at the end The editing logic moved into the game-independent TextEditBuffer so the ModOptions test project can cover selection, cut/paste semantics, max length and the repeat timing. Width measurement and windowing stay in TextEditGeometry. IME handling is untouched: TextInputEXT is never started/stopped here, the existing TextInput.OnInput / TextEditing subscriptions still own character input, and composition previews are still drawn at the caret.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
动机
群友反馈:模组设置页里的字符串项(MiaoNet 的名称 / 头衔 / 颜色 / 头像链接等)只显示成一个通用「打开」按钮,值被塞在标题里,既不直观也没法像常规文本框那样编辑。
改动
1. 字符串项变成常规文本框
TextInput.OnInput+TextInputEXT.TextEditing),和 vanilla 改名框同一条路径,支持系统输入法 / 非 ASCIITouchKind: "text"触控目标拉起系统软键盘MInput.ControllerHasFocus为 true 或 EverestUseKeyboardForTextInput关闭时,进入自绘 QWERTY(方向键导航 + 确认)Func<string>/Action<string>闭包)、以及兜底拦截Overworld.Goto<OuiModOptionString>()2. 光标、选词与剪贴板
·占位,值按原样显示;光标宽度仍按SystemTtfFont.MeasureVisible实测,中文/全角字符算 2 格TextInput.Get/SetClipboardText()(SDL),Windows / Linux / Android 同一条路;粘贴进来的换行/制表符按单行字段过滤3. 搜索模组 / 搜索当前设置共用同一套交互
两个搜索框原来只是「末尾追加 + 退格」,现在换成同一个
TextEditBuffer:TextEditShortcuts/TextKeyRepeat)TouchKind: "text")不变,提交后整体写回并把光标放到末尾4. 可复用输入层
Source/TextEntryOverlay.cs:手机式 QWERTY(qwertyuiop / asdfghjkl / zxcvbnm,shift 切大写,123/#+=/ABC明确切页,底部 取消/空格/退格/接受,长按空格连打,角标只是提示)。Source/TextEditBuffer.cs只保留与游戏无关的文本/光标/选区状态,宽度窗口拆到Source/TextEditGeometry.cs,剪贴板快捷键在Source/TextEditShortcuts.cs,长按重复在Source/TextKeyRepeat.cs。测试工程可以直接链接TextEditBuffer/TextKeyRepeat做纯逻辑测试。改了哪些文件
Source/TextEditBuffer.csSource/TextEditGeometry.csSource/TextEditShortcuts.csSource/TextKeyRepeat.csSource/TextEntryOverlay.csSource/MaterialModOptions.csTests/ModOptions/Program.cs验证
dotnet build Source/MicroblocksQolUtils.csproj:0 error / 0 warning(Everest stable lib-stripped)dotnet run --project Tests/ModOptions/ModOptions.csproj -c Release:OptionRules 36 + 文本编辑 60 assertions 通过dotnet run --project Tests/Capture/Capture.csproj -c Release:PASS手工验证步骤
a(前后各两个空格),显示就是空格本身,不再出现·;提交后重新打开值仍保留这些空格。本轮没做
鼠标/触屏拖动选择文本留到下一轮(需要处理按住拖动、跨窗口滚动和触屏手势冲突),本次先做真空格 + Ctrl+A/C/X/V + Shift 选词 + 长按移动这几项。