Skip to content

Conversation

@bingtangxh
Copy link

Some features for Windows platform.

  • The archive path, save dir, font path, will be converted into ANSI/CP_ACP before trying to find, so non-UTF-8 path is now supported on Windows.
  • If only the root path is specified in the prompt parameter, the program will now try looking for the default.ttf font file in the archive path/root directory.
  • If run on Windows and could not find any of the script file, then a MessageBox will appear, instead of only stderr output.
    The program will automaticially add a shortcut into the Start Menu on Windows while USE_TOAST macro is 1.
  • If the window is larger than or equal to 1280x720, then a balloon notification or toast notification will appear, mentioning user to switch to fullscreen or scratch mode. If the shortcut was just put into Start Menu now, or toast failed to appear, or macro USE_TOAST is 0, then it will fallback to balloon. [This requires WinRT DLLs on Windows, or disable it by modifying ONScripter_command.cpp(61) USE_TOAST macro from 1 to 0.]
  • All of the code written by me can be removed by editing all the USE_BTXH_CODE macros from 1 to 0 in several source files.
  • The file coding2utf16.cpp uses GBK now, if it is wrong then notice me i will convert it back.
  • archive path, save dir, font path 会先转换成 ANSI/CP_ACP,再试着去查找,这样 Windows 上的非 UTF-8 路径就支持了,不会找不到。
  • 如果命令行参数里只有 -r 路径,没有指定字体文件,那么程序不仅会查找当前目录,还会在 root path 下试着找 default.ttf 文-件,这样一般坊间的资源就可以只指定一个 -r 参数了。
  • 要是在 Windows 上运行且找不到任何脚本文件,那么会有一个 MessageBox 表示找不到文件,不只是在 stderr 里输出错误信息。
  • 在 Windows 上运行的时候自动搁“开始”菜单里放一个能打开资源的快捷方式,但是得 USE_TOAST 宏定义是 1
    要是窗口大小大于等于 1280x720 (长、宽有一个大于等于就算),那么会弹出一个 Toast 通知,提示用户切换到全屏或者适应模式。要是 Toast 弹出失败或者宏定义 USE_TOAST 是 0 ,再或者开始菜单的快捷方式是刚放上去的,那么就回退到 Balloon。(这个会要求系统有 WinRT 相关的 DLL 文件,要是要兼容低版本 Windows 的话,就将 ONScripter_command.cpp 的第 61 行的 USE_TOAST 宏定义改成 0)
  • 所有我写的代码都可以将我改过的文件开头的 USE_BTXH_CODE 宏定义从 1 改成 0 ,就剔除掉了
  • 原计划给 Actions 还是 Workflow 加上 MSVC Windows ARM32 支持,但是死活都配不好(WIndows 11 SDK 10.0.26100.x 不带 ARM32 玩了,所以 vcpkg 装包的时候会导致 LINK 报错无法打开输入文件 'kernel32.lib',我还试了重配一套 overlay-triplets ,但是那样的话,又就啥变量都得自己设置,非常的难弄,尤其是 MSVC 生成工具版本啥的),还有 MinGW 的生成任务也不好弄,我还试了改成 MSYS ,但是 SDL2-image 包又死活找不到,先改回原来的样子了(原谅我),所以 Windows ARM32 的可执行文件还是我用我的本地旧版工具链生成编译链接,单独上传exe文件作为Release算了。
  • coding2utf16.cpp 现在用的是 GBK 编码,因为原先的 UTF-8 会在 GBK 的 MSVC 上用不了,要是不行的话就让我改回 UTF-8。

Add non-UTF-8 path support , a notification about switching into fullscreen while window is larger or equal, automatically put a shortcut to Start Menu, and error message box while run in a incorrect directory
This reverts commit cd18765.
This reverts commit adf2b59, reversing
changes made to 0f7bafc.
@YuriSizuku
Copy link
Owner

This pull request might be too larger and hard to review.
At first, could you please show proper changes of "build_xxx.yml" ?
It seems that all the contents are changed such as change the \r\n in every line.

@bingtangxh
Copy link
Author

bingtangxh commented Sep 5, 2025

OK, build_win_msvc.yml contains these

  1. windows-2019 changed to windows-2022
  2. Visual Studio 16 2019 changed to Visual Studio 17 2022
  3. add "--allow-unsupported" to the command line of vcpkg in ARM64 triplet
  4. A non-functional triplet for ARM32 (Windows SDK 10.0.26100.x does not support ARM32), already commented in order to pass the GitHub Actions check
    Other .yml files were not modified at all, my changes are all Windows-specific
    build_win_msvc.yml 改了这些
  5. windows-2019 改成 windows-2022
  6. Visual Studio 16 2019 改成 Visual Studio 17 2022
  7. 给ARM64平台的vcpkg命令行加了个"--allow-unsupported"参数
  8. 写了个ARM32的生成配置,但是死活配不好,所以为了通过 GitHub Actions 的检查看着好看就注释掉了
    别的 .yml 文件我应该都没改,我这加的都是 Windows-specific 功能,所以提交代码之后那些生成任务能是对号就是成功就没管

还有那啥,现在感觉代码里有点太搅乱了,要是要的话我就先再整洁一下
i am willing to clean up my code if needed

@yigekuyou
Copy link
Contributor

yigekuyou commented Jan 13, 2026

请不要用Windows编辑器随便编辑非Windows的文档,Windows结尾可能导致Linux/mac系统出车祸,之前在其他项目就遇到过有人用Windows打开bash.sh把sh弄坏的情况

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.

3 participants