Skip to content

LDTchara/KernelFix

Repository files navigation

KernelFix

快速导航中文版本 | English Version

中文版本

KernelFix 是一款 HacknetPathfinder / BepInEx 全局插件,提供两大核心功能:

  1. 高 DPI 显示修复 – 解决近代高分屏下分辨率错误放大的问题。
  2. 原生中文输入法支持 – 在游戏终端内完美使用 Windows 自带输入法,并自绘候选词窗口。

✨ 功能简介

🖥️ 高 DPI 修复

  • 在游戏窗口创建前调用 SetProcessDPIAware()
  • 避免 Windows 的 DPI 虚拟化,使游戏分辨率列表与实际屏幕一致。
  • 消除全屏/窗口模式下的模糊和错误缩放。

⌨️ 中文输入法

  • 通过 ImeSharp 接入 Windows TSF (Text Services Framework)
  • 组合文本(拼音/字母)直接显示在终端光标处,并带有下划线。
  • 候选词列表以半透明面板绘制在终端左下角,支持长词自动适应宽度。

  • 使用 数字键 1‑9空格键 选词上屏,使用 [ ] 来切换候选页数。
  • 兼容微软拼音、微软五笔以及绝大多数基于 TSF 的输入法。
  • 提供 调试开关KernelFix.cs 中的 KernelFix.Debug),设为 true 可在控制台输出详细的输入法状态。

📦 安装方法

  1. 确保已安装 Pathfinder 框架(它自带了 BepInEx)。
  2. 下载 KernelFix.dll
  3. 将文件放入游戏目录下的 BepInEx/plugins/ 文件夹内。
  4. 启动游戏,插件即自动生效。

无需额外安装 BepInEx – Pathfinder 已包含所需运行环境。

⚠️ 兼容性说明

  • 本模组仅支持 Windows 系统。如果你使用的是 macOS 或 Linux,且原版游戏已经能正常输入中文,则无需额外安装任何输入法模组;否则请使用 TAXCoreCNfix 来获得基本的中文输入支持。

  • TAXCoreCNfix 不兼容,两者同时加载会导致输入冲突。请在使用 KernelFix 前移除 TAXCoreCNfix

  • 建议与 HacknetFontReplace 同时使用,以解决部分汉字显示为 ? 的问题。

    注:原版 HacknetFontReplace 可能无法正确渲染 UTF‑16 代理对字符(如 emoji),导致候选框中显示为空白或引发游戏异常。推荐使用修复版本 HacknetFontReplace_UTF16Fix,或避免在终端中打出此类字符。

  • 需要 Pathfinder 框架,否则插件不会加载。

  • 支持 Steam非 Steam 版本的 Hacknet + Labyrinths。

🛠️ 自行编译

  1. 克隆仓库:
    git clone https://github.com/LDTchara/KernelFix.git
  2. 使用 Visual Studio 打开 KernelFix.sln(或通过 dotnet 命令行构建):
    dotnet build KernelFix.sln -c Release
  3. 项目引用(Harmony、BepInEx、FNA 等)指向游戏安装目录下的 libs 文件夹,可按需调整。
  4. 采用 Costura.FodyImeSharp 及其依赖嵌入 DLL,生成的 KernelFix.dll 即为独立文件,无需其他附加库。

English Version

KernelFix is a Pathfinder / BepInEx global plugin for Hacknet that delivers two major quality‑of‑life improvements:

  1. High‑DPI display fix – resolves incorrect upscaling on modern high‑DPI screens.
  2. Native Chinese IME support – fully integrates Windows IME into the terminal, with an on‑screen composition preview and a self‑drawn candidate list.

✨ Features

🖥️ High‑DPI Fix

  • Calls SetProcessDPIAware() before the game window is created.
  • Prevents Windows DPI virtualization, matching the in‑game resolution list to the actual display.
  • Eliminates blurry text and improper scaling in both fullscreen and windowed modes.

⌨️ Chinese Input Method

  • Leverages Windows TSF (Text Services Framework) via ImeSharp.
  • Composition text (pinyin / letters) is displayed directly at the cursor with an underline.
  • Candidate list is drawn as a semi‑transparent panel in the lower‑left corner of the terminal, with automatic width adjustment for long phrases.

  • Select candidates with number keys 1‑9 or Space, and use [ ] to flip pages.
  • Compatible with Microsoft Pinyin, Microsoft Wubi, and most other TSF‑based IMEs.
  • Includes a debug switch (KernelFix.Debug in KernelFix.cs); set it to true to log detailed IME status to the console.

📦 Installation

  1. Make sure Pathfinder is installed (it bundles BepInEx).
  2. Download KernelFix.dll.
  3. Place it into BepInEx/plugins/ inside your Hacknet directory.
  4. Launch the game – the plugin loads automatically.

No separate BepInEx installation is required – Pathfinder already provides it.

⚠️ Compatibility

  • This mod only supports Windows systems. For players on other systems, please use TAXCoreCNfix to get basic Chinese input support. (If the macOS or Linux version of Hacknet already supports native Chinese input, you may not need it.)

  • KernelFix is incompatible with TAXCoreCNfix. Using both simultaneously will cause input conflicts. Please remove TAXCoreCNfix before using KernelFix.

  • It is recommended to use KernelFix together with HacknetFontReplace (modified version) to fix missing glyphs (displayed as ?).

    Note: The original HacknetFontReplace may not render UTF‑16 surrogate characters or emoji correctly; they will appear blank in the candidate list. The modified version linked above addresses this. If you choose not to use it, avoid typing such characters to prevent potential game issues.

  • Requires Pathfinder; the plugin will not load without it.

  • Works with both Steam and non‑Steam versions of Hacknet + Labyrinths.

🛠️ Building from Source

  1. Clone the repository:
    git clone https://github.com/LDTchara/KernelFix.git
  2. Open KernelFix.sln in Visual Studio (or build with dotnet):
    dotnet build KernelFix.sln -c Release
  3. The project references (Harmony, BepInEx, FNA, etc.) point to the libs folder inside your Hacknet installation; adjust them if necessary.
  4. Costura.Fody embeds ImeSharp and its dependencies into the DLL – the output KernelFix.dll is self‑contained and requires no extra libraries.

About

Hacknet Pathfinder分辨率修复和输入法调用模组

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages