Skip to content

feat(wx): support native dark mode - #4317

Open
baphomello wants to merge 13 commits into
OpenKore:masterfrom
baphomello:feat/wx-native-dark
Open

baphomello wants to merge 13 commits into
OpenKore:masterfrom
baphomello:feat/wx-native-dark

Conversation

@baphomello

@baphomello baphomello commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Enable native dark mode in wxstart.exe with 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/1 and 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 #start lines independently leave a command tab open; rem start avoids 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.

@baphomello
baphomello marked this pull request as ready for review November 14, 2026 14:12
@dcyxxt

dcyxxt commented Nov 14, 2026

Copy link
Copy Markdown

I downloaded this branch, but when I use WX, it's still in light mode. How do I enable dark mode?

@baphomello

baphomello commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor Author

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.

@dcyxxt

dcyxxt commented Nov 14, 2026

Copy link
Copy Markdown

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.

1 2

@baphomello
baphomello marked this pull request as draft November 14, 2026 16:41
@baphomello

Copy link
Copy Markdown
Contributor Author

@dcyxxt Thanks for testing! I’ll investigate the Chinese path and encoding issues and work on a fix.

@dcyxxt

dcyxxt commented Nov 14, 2026

Copy link
Copy Markdown

@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.
It would be great if the font color scheme could be more harmonious in dark mode~

@baphomello

Copy link
Copy Markdown
Contributor Author

@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. It would be great if the font color scheme could be more harmonious in dark mode~

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.

@baphomello

Copy link
Copy Markdown
Contributor Author

@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.

@baphomello
baphomello marked this pull request as ready for review November 14, 2026 17:24
@dcyxxt

dcyxxt commented Nov 15, 2026 •

Copy link
Copy Markdown

@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.

QQ_2026-11-15_12-24-20 QQ_2026-11-15_12-24-26

12:23:57: can't open file 'C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src\Interface\Wx\window.png' (error 3: 系统找不到指定的路径。)
12:23:57: Failed to load image from file "C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src\Interface\Wx\window.png".
12:23:57: can't open file 'C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src\Interface\Wx\close.png' (error 3: 系统找不到指定的路径。)
12:23:57: Failed to load image from file "C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src\Interface\Wx\close.png".
12:23:57: can't open file 'C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src/build/openkore.ico' (error 3: 系统找不到指定的路径。)
12:23:57: Failed to load image from file "C:\Users\Administrator\Downloads\Compressed\openkore-feat-wx-native-dark_ÖÐÎÄ\src/build/openkore.ico".

sys.txt
i set

Localization settings

locale zh_CN

log.txt

@baphomello

Copy link
Copy Markdown
Contributor Author

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

dcyxxt commented Nov 15, 2026

Copy link
Copy Markdown

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.

Hi, thanks for the fix — this vision"6d2193f5642e5fed1e8fff956df09d8225500d34" resolves the popup issue with Chinese folder paths. However, the in-game text (server messages like broadcasts and chat) is now showing as garbled characters. My previous workaround was to set the folder name to Chinese and add locale zh_CN under the Localization settings in sys.txt, which made those messages display correctly. But even with that setup now, the text still shows as garbled.

ScreenShot_2026-11-15_224342_385

@baphomello

Copy link
Copy Markdown
Contributor Author

I reproduced garbled colored NPC messages in the existing version, independently of dark mode. I opened #4330 to track it and #4331 to fix it.

@alisonrag

Copy link
Copy Markdown
Contributor

@dcyxxt merged master on this branch, test again

@dcyxxt

dcyxxt commented Nov 16, 2026

Copy link
Copy Markdown

@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:
start wxstart.exe --control=test3 --logs=logs/test3

QQ_2026-11-16_12-37-21

@baphomello

Copy link
Copy Markdown
Contributor Author

I changed how the launcher handles the console and isolated its temporary files when starting multiple instances.
@dcyxxt Could you please test the latest wxstart.exe from this PR with your batch file and let me know if the console still stays open?

@dcyxxt

dcyxxt commented Nov 16, 2026

Copy link
Copy Markdown

I changed how the launcher handles the console and isolated its temporary files when starting multiple instances. @dcyxxt Could you please test the latest wxstart.exe from this PR with your batch file and let me know if the console still stays open?

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.

QQ_2026-11-16_22-46-47 QQ_2026-11-16_22-49-14

@baphomello

Copy link
Copy Markdown
Contributor Author

Thanks for testing @dcyxxt! Could you please share the full contents of your .bat file?

@dcyxxt

dcyxxt commented Nov 16, 2026

Copy link
Copy Markdown

Thanks for testing @dcyxxt! Could you please share the full contents of your .bat file?

start wxstart.exe --control=test1 --logs=logs/test1

test1.zip

i saved this as a .bat file

@baphomello

Copy link
Copy Markdown
Contributor Author

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.
@baphomello

Copy link
Copy Markdown
Contributor Author

@dcyxxt I've updated wxstart.exe in d425762 to fix console handling while preserving wxHideConsole 0/1.
It passed repeated three-instance launches with Windows Terminal set as the default.
Could you download the latest wxstart.exe from this branch and try your batch file again?

Please set wxHideConsole 1 in the sys.txt of each control folder used by your batch file. Setting it to 0 intentionally keeps the console open.

@dcyxxt

dcyxxt commented Nov 17, 2026 •

Copy link
Copy Markdown

I simulated the color scheme using AI, which may offer some reference ideas.
Subject: Color suggestions for the dark UI (Windows 11 26H2)​

I'm testing the latest build on Windows 11 (version 26H2) with the dark theme. The right-side panel background is #191919, while the Console area is pure black #000000.

There are two lists in the right-side panel, and I'd like to suggest clearer colors for them.

  1. Town / NPC list

NPC names are currently shown in light blue #B5D4F4. This reads well, so I'd like to keep it.
2. Hunting / monster & drop lists

Player names (e.g. [AUTO]...) use #DCDCDC. Please keep this unchanged.
Monster IDs are currently a very dark red around #6A1010. On the #191919 background the contrast ratio is only about 1.4:1, which makes them barely readable. I suggest a softer but brighter red #F09595 (7.9:1).
Dropped item IDs are currently a very dark blue around #0101B7, also about 1.4:1 contrast. I suggest #38BDF8 (8.2:1) — a brighter sky blue that is also clearly distinguishable from the NPC light blue #B5D4F4.
The HP / SP / Exp / Weight bars are white by default. I suggest mint green #5DCAA5 for a look more consistent with the dark theme.
Summary of suggested colors:​

Player: #DCDCDC (unchanged)
Monster: #F09595 (was #6A1010)
Drop: #38BDF8 (was #0101B7)
NPC: #B5D4F4 (unchanged)
Status bars: #5DCAA5 (was white)
The goal is to improve readability under the dark background while keeping the "red = monster, blue = drop" convention consistent.

openkore-town.html

openkore-hunt.html

openkore-hunt openkore-town

@dcyxxt

dcyxxt commented Nov 17, 2026

Copy link
Copy Markdown

@dcyxxt I've updated wxstart.exe in d425762 to fix console handling while preserving wxHideConsole 0/1. It passed repeated three-instance launches with Windows Terminal set as the default. Could you download the latest wxstart.exe from this branch and try your batch file again?

Please set wxHideConsole 1 在 sys.txt of each control folder used by your batch file. Setting it to 0 intentionally keeps the console open.

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.

@dcyxxt

dcyxxt commented Nov 17, 2026

Copy link
Copy Markdown

@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.

QQ_2026-11-17_16-16-38

@dcyxxt

dcyxxt commented Nov 17, 2026

Copy link
Copy Markdown

@baphomello I also used AI to design a set of font colors for the console interface, tailored for dark mode.

openkore-console-colors

openkore-console-colors.html

@baphomello

Copy link
Copy Markdown
Contributor Author

@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!

@dcyxxt

dcyxxt commented Nov 18, 2026

Copy link
Copy Markdown

@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.

ScreenShot_2026-11-18_124207_891

Recent Windows 11 builds use a white selected-row background with
wxWidgets 3.3.0. Backport the native list theme from wxWidgets 441157ae0429.
@baphomello

Copy link
Copy Markdown
Contributor Author

@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?

@dcyxxt

dcyxxt commented Nov 18, 2026

Copy link
Copy Markdown

@baphomello Just to clarify: I've always tested by downloading the full ZIP archive each time, not individual commits.

I tested 22c886a.
1,In the upper half of the dialogue window, the text can't be selected at all — the same text is selectable in the master build.
2,The options in the lower half are actually selectable (clicking works), but there's no visible highlight or contrast to show which one is selected.

ScreenShot_2026-11-18_130751_710

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.
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.

Will WX's interface get a dark mode?

3 participants