Skip to content

fix: mswin gui 界面物品列表被提前截断 - #22

Merged
Francium-223 merged 2 commits into
StackC00ki3:Nethack-CN-5.0.0from
0xb1aded:fix/mswin-listview
Sep 29, 2026
Merged

Francium-223 merged 2 commits into
StackC00ki3:Nethack-CN-5.0.0from
0xb1aded:fix/mswin-listview

Conversation

@0xb1aded

Copy link
Copy Markdown
Contributor

具体效果见下图中右侧物品栏

修复前

屏幕截图 2026-09-29 164737

修复后

屏幕截图 2026-09-29 164107

由于未知原因,此处使用 SetWindowText 会导致截断问题,而 SendMessage 就不会,总之非常玄学。

87bd11b#diff-6b30ac7074b00077203d7bc3b7da2e6f7bd83298b468d781771f8cc62bab0159R589-R590

@0xb1aded

Copy link
Copy Markdown
Contributor Author

额外修复:此处的外部函数声明移动到了文件作用域,原本的写法属于编译器扩展,修改后更 pedantic 并规避编译器警告

#ifdef _WIN32
extern void stdout_write_utf8(const char *);
stdout_write_utf8(str);
stdout_write_utf8("\n");
#else

@Francium-223
Francium-223 merged commit bcef90c into StackC00ki3:Nethack-CN-5.0.0 Sep 29, 2026
30 checks passed
@0xb1aded
0xb1aded deleted the fix/mswin-listview branch September 30, 2026 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants