XGameUI: maxTextLength=0 is the GDK's 1024 default #323

Closed
github-bot wants to merge 1 commit from gh-pr/323/head into gh-pr/323/base
Owner

@⁠JordanFableFur on GitHub · 2026-11-24 23:34 UTC · original
JordanFableFur:fix/xgameui-text-limit-default → main · +26 −5 · 1 files · 1 commits · closed without merging

What

The GDK defines a zero maxTextLength as a limit of 1024 characters, not no limit. The text-entry dialog passed the zero straight through: the edit control's EM_LIMITTEXT with 0 disables the limit, and the result trimming kept everything, so a 1025-character input came back whole.

The limit is now normalized at the entry (text_limit), and both the dialog's edit control and the result trimming use the effective value.

Fixes #248.

Testing

The existing test opens the entry through the vtable; a new case calls it with maxTextLength=0 and a 1030-character default, then reads the result: 1024 characters come back. An explicit positive limit still cuts (kept the old limit assertion, plus one through text_limit(0)).

  • Cross-checked clippy -D warnings for the Windows target (clean); victory-hle is Windows-only at run time, so the test run itself needs CI.

AI use: written with Codex and Claude Code (GPT-5.2 Codex); reviewed and posted with my approval. No game files were used.

**@⁠JordanFableFur** on GitHub · 2026-11-24 23:34 UTC · [original](https://github.com/fxceless/victory-fork/pull/323) `JordanFableFur:fix/xgameui-text-limit-default` → `main` · +26 −5 · 1 files · 1 commits · closed without merging ## What The GDK defines a zero `maxTextLength` as a limit of 1024 characters, not no limit. The text-entry dialog passed the zero straight through: the edit control's `EM_LIMITTEXT` with 0 disables the limit, and the result trimming kept everything, so a 1025-character input came back whole. The limit is now normalized at the entry (`text_limit`), and both the dialog's edit control and the result trimming use the effective value. Fixes #248. ## Testing The existing test opens the entry through the vtable; a new case calls it with `maxTextLength=0` and a 1030-character default, then reads the result: 1024 characters come back. An explicit positive limit still cuts (kept the old `limit` assertion, plus one through `text_limit(0)`). - Cross-checked clippy `-D warnings` for the Windows target (clean); `victory-hle` is Windows-only at run time, so the test run itself needs CI. **AI use:** written with Codex and Claude Code (GPT-5.2 Codex); reviewed and posted with my approval. No game files were used.
The GDK defines a zero maxTextLength as a limit of 1024 characters, not
no limit: the text-entry dialog's edit control got the zero
(EM_LIMITTEXT 0 disables the limit) and the result kept everything the
user typed, so a 1025-character input came back whole.

The limit is normalized at the entry, and the dialog and the result
trimming both use the effective value. A test opens the entry with zero
and a 1030-character default and reads 1024 characters back.

AI use: written with Codex and Claude Code (GPT-5.2 Codex); reviewed and
posted with my approval. No game files were used.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:40:42 +00:00
github-bot closed this pull request 2026-11-26 03:40:42 +00:00
Author
Owner

@⁠chatgpt-codex-connector[bot] on GitHub · 2026-11-24 23:34 UTC · original · edited 2026-11-24 23:36 UTC

Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T23:36:20.845897Z e289bb9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@⁠codex review" or "@⁠codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

**@⁠chatgpt-codex-connector[bot]** on GitHub · 2026-11-24 23:34 UTC · [original](https://github.com/fxceless/victory-fork/pull/323#issuecomment-7147561363) · edited 2026-11-24 23:36 UTC <!-- codex-pull-request-review-summary --> <!-- codex-review-state:v1 {"code_review":{"commit_sha":"e289bb9ddbcc53a3dc6fa8e17656802214ec4c51","has_any_findings":false,"has_unresolved_findings":false,"status":"completed"},"security_review":{"commit_sha":null,"has_any_findings":null,"has_unresolved_findings":null,"status":null}} --> <details> <summary><strong>Codex Review Summary</strong>: ✅ Completed</summary> This comment shows the latest Codex review activity on this pull request. | Review | Status | Commit | Review trigger | | --- | --- | --- | --- | | 📝 **Code Review** | ✅ **Completed** <relative-time datetime="2026-11-24T23:36:20.845897Z">2026-11-24T23:36:20.845897Z</relative-time> | `e289bb9` | PR opened | <details> <summary>ℹ️ About Codex in GitHub</summary> <br/> [Your team has set up Codex to review pull requests in this repo](https://chatgpt.com/codex/cloud/settings/general). Reviews are triggered when you - Open a pull request for review - Mark a draft as ready - Comment "@⁠codex review" or "@⁠codex security review". Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. </details> </details>
Author
Owner

@⁠kaayzouee on GitHub · 2026-11-25 01:13 UTC · original

Duplicate of #291?

**@⁠kaayzouee** on GitHub · 2026-11-25 01:13 UTC · [original](https://github.com/fxceless/victory-fork/pull/323#issuecomment-7149326225) Duplicate of #291?
Author
Owner

@⁠JordanFableFur on GitHub · 2026-11-25 01:46 UTC · original

Closing — #291 fixes the same issue (#248) and was opened first. Answered the duplicate question rather than leaving it hanging; thanks for the sweep.

**@⁠JordanFableFur** on GitHub · 2026-11-25 01:46 UTC · [original](https://github.com/fxceless/victory-fork/pull/323#issuecomment-7149934598) Closing — #291 fixes the same issue (#248) and was opened first. Answered the duplicate question rather than leaving it hanging; thanks for the sweep.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.