Repository navigation
feat(wx): support native dark mode - #4317
baphomello wants to merge 13 commits into
Conversation
|
I downloaded this branch, but when I use WX, it's still in light mode. How do I enable dark mode? |
@dcyxxt Updated the PR to follow the Windows app theme automatically. Please download the latest wxstart.exe from this branch and launch it directly. To use dark mode, set your Windows app theme to Dark under Settings → Personalization → Colors. |
I downloaded the branch you just updated, and dark mode works now. However, when my folder path contains Chinese characters, a popup window appears. The reason I set the folder name to include Chinese is that only this way can the messages in my OpenKore display in Chinese (not system messages, but in-game messages like broadcasts). But even with this setup, the text still shows up as garbled characters.
|
|
@dcyxxt Thanks for testing! I’ll investigate the Chinese path and encoding issues and work on a fix. |
Thank you very much for your hard work on the foreign language support. |
I’ll leave color changes out of this PR to keep it easier to review and test. Once this is merged, we can gather feedback on dark mode and, if it’s positive, add a theme switch and improve the colors in a separate PR. |
|
@dcyxxt Fixed the Chinese encoding aliases and argument handling for paths with spaces. Please download the updated wxstart.exe from this branch and test again. If the popup still appears, please share its exact error text. |
12:23:57: can't open file 'C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src\Interface\Wx\window.png' (error 3: 系统找不到指定的路径。) sys.txt Localization settingslocale zh_CN |
|
I don’t have a Windows system using code page 936, so I simulated the reported issue and updated the resource path handling. The simulated tests passed, but I couldn’t verify the full startup in a Chinese Windows environment. |
|
@dcyxxt merged master on this branch, test again |
Thanks for the update — all Chinese characters now display correctly in this version (commit 2aa9b99). But there's still a small issue: when I use a .bat file to run multiple instances, a black console window pops up. This doesn't happen with the Master version. Here's the format I use in my bat file:
|
|
I changed how the launcher handles the console and isolated its temporary files when starting multiple instances. |
I tested this build (205543c). When starting multiple instances from a .bat file, the windows for the subsequent instances still appear (the issue persists). I'm on Windows 11, version 26H2.
|
|
Thanks for testing @dcyxxt! Could you please share the full contents of your .bat file? |
|
Thanks for sharing the batch file @dcyxxt! I reproduced a Windows Terminal regression when launching wxstart directly with wxHideConsole 1, and I’m still validating a fix. |
Set the theme before the packed interpreter loads Wx and wait for its console detachment in the native loader. Avoid a Perl restart that retained console clients and changed native exit statuses.
|
@dcyxxt I've updated Please set |
I tested d425762 — everything is OK now, the Windows black console window no longer pops up. I had also set wxHideConsole 1 in sys.txt before, which is a default option. |
|
@baphomello A new bug: with both "Use Wx NPC Talk" and "Use Wx Captcha" enabled, the text in the dialogs is cut off (partially unreadable) and scrolling doesn't work, so the full content cannot be viewed. In addition, the NPC TALK panel remains in light mode instead of following the dark theme.
|
|
@baphomello I also used AI to design a set of font colors for the console interface, tailored for dark mode.
|
|
@dcyxxt Thanks for reporting the hard-to-read text. I’m already working on a fix and hope to have it ready soon. As mentioned before, I’ll work on the colors after this PR is approved, to keep the changes separate and make the review easier. Thanks for taking the time to generate the colors with AI. They look great, and I’ll use them as inspiration! |
|
@baphomello thx for update,I tested build 39750e1. When an NPC dialogue appears, the option list is shown but none of the options can be selected — clicking an option does nothing.
|
Recent Windows 11 builds use a white selected-row background with wxWidgets 3.3.0. Backport the native list theme from wxWidgets 441157ae0429.
|
@dcyxxt Thanks for catching this, and sorry I missed it. I tested the NPC dialogue layout and scrolling, but I forgot to check whether clicking an option visibly highlighted it in dark mode. I fixed the highlight in 22c886a and verified that clicking an option and pressing OK sends the right response. Could you try the full PR and let me know if it works on your setup? |
|
@baphomello Just to clarify: I've always tested by downloading the full ZIP archive each time, not individual commits. I tested 22c886a.
|
DarkMode_DarkTheme paints selected rows almost the same as the list. Match wxWidgets 5bd892f7ac21 and theme only the scrollbars so Windows paints the row with its standard selection colors.














Enable native dark mode in
wxstart.exewith wxWidgets 3.3.0 and WxPerl 3.009, following the Windows app theme. Preserve launcher arguments, resource paths and encoding aliases.Initialize the theme in the native PAR loader before Perl loads Wx. Release the waiting loader from the console after its interpreter detaches, without restarting Perl. This preserves
wxHideConsole 0/1and restores master's full native exit statuses.Tested on Windows 11 with packaged Windows Terminal 1.25 as the default: 23 rounds of three simultaneous starts, with all 69 instances retained. Also checked direct launches, the supplied batch, shared consoles, input, shutdown, theme values, arguments, cleanup, 24 native-exit comparisons against master, and all 1,187 Windows unit checks. The integrated executable connected to the real local client and isolated rAthena through XKore 3 and completed combat.
The supplied batch's
#startlines independently leave a command tab open;rem startavoids those cmd errors. A rebuild from distribution-listed inputs passed the three-instance console tests with both 0 and 1. It used the existing toolchain; clean-machine and byte-identical builds were not verified. Chinese Windows remains untested.Closes #4316
NPC Talk now uses readable colors against the system background, preserves the scroll position when the dialog state changes, and keeps the transcript and response list visible in narrow panels. Docked headers follow the system dark theme. NPC illustrations and oversized Captcha images scroll independently, and the Captcha field keeps initial focus.
Verified light and dark themes with the packaged launcher on Windows, including narrow panels, long responses, Unicode text, and compact and oversized images. Also verified a real NPC conversation through XKore 3 and local rAthena with both options enabled. A synthetic Captcha was scrolled and dismissed without sending an answer.