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 已包含所需运行环境。

⚠️ 兼容性说明

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

    注:HacknetFontReplace默认不支持打出UTF-16的字符或emoji,在候选框中会显示为空白,暂不清楚是否为默认无对应字体导致,请避免打出此类字符以防游戏出现故障

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

  • 需要 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

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

    Note: HacknetFontReplace may not render UTF‑16 surrogate characters or emoji correctly; they will appear blank in the candidate list. Avoid typing such characters to prevent potential game issues.

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

  • 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