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

Closed
JordanFableFur wants to merge 1 commit from upstream-pr/323 into main
JordanFableFur commented 2026-11-24 23:34:32 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-24T23:34:32Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6593594686 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/323). Originally posted by [JordanFableFur](https://github.com/JordanFableFur) on 2026-11-24T23:34:32Z. --- ## 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.
chatgpt-codex-connector[bot commented 2026-11-25 00:10:08 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T23:34:51Z.


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.

<!-- greyfinch-sync:fxceless/victory-fork:comment:7147561363 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/323#issuecomment-7147561363). Originally posted by [chatgpt-codex-connector[bot]](https://github.com/chatgpt-codex-connector%5Bbot%5D) on 2026-11-24T23:34:51Z. --- <!-- 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>
upstream-sync closed this pull request 2026-11-25 02:09:24 +00:00
kaayzouee commented 2026-11-25 02:10:05 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by kaayzouee on 2026-11-25T01:13:12Z.


Duplicate of #291?

<!-- greyfinch-sync:fxceless/victory-fork:comment:7149326225 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/323#issuecomment-7149326225). Originally posted by [kaayzouee](https://github.com/kaayzouee) on 2026-11-25T01:13:12Z. --- Duplicate of #291?
JordanFableFur commented 2026-11-25 02:10:10 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by JordanFableFur on 2026-11-25T01:46:10Z.


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

<!-- greyfinch-sync:fxceless/victory-fork:comment:7149934598 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/323#issuecomment-7149934598). Originally posted by [JordanFableFur](https://github.com/JordanFableFur) on 2026-11-25T01:46:10Z. --- 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

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!323
No description provided.