You are viewing a potentially older version of this package. View all versions.
maeT-HalfGridSnap-1.1.0 icon

HalfGridSnap

Allows you to snap coordinates to half-grid points. 允许你进行对半格点的坐标进行吸附。

Date uploaded 5 months ago
Version 1.1.0
Download link maeT-HalfGridSnap-1.1.0.zip
Downloads 372
Dependency string maeT-HalfGridSnap-1.1.0

This mod requires the following mods to function

xiaoye97-BepInEx-5.4.17 icon
xiaoye97-BepInEx

BepInEx5.4.17 mod plugin framework, Mod框架

Preferred version: 5.4.17
CommonAPI-CommonAPI-1.6.7 icon
CommonAPI-CommonAPI

A modding library for Dyson Sphere Program. Currently is under development.

Preferred version: 1.6.7

README

HalfGridSnap | English Description

允许将坐标吸附到“半格点”。本插件通过 Harmony Transpiler 替换游戏中 PlanetGrid 的硬编码常量,从而改变网格吸附间距,实现半格点吸附效果。

主要功能

  • PlanetGrid 中的硬编码常量 5.0f 替换为 10.0f,改变吸附间距以实现半格点行为。
  • 在运行时通过按默认快捷键 ~ 切换半格点吸附(默认已启用),快捷键可通过游戏内自定义。

安装

  1. 直接拷贝输出的 DLL 到 BepInEx/plugins 或者通过模组管理器导入 Output 目录下的 zip 压缩包进行安装。

从源码构建

  1. 使用支持 .NET Standard 2.1 的 SDK / Visual Studio(例如 Visual Studio 2026)。
  2. 恢复 NuGet 包或手动引用 BepInEx 与 HarmonyLib 的程序集(项目中应已有引用)。
  3. 编辑项目 .csproj 里面的 GameDir 为你的实际游戏目录。
  4. 在解决方案中选择 Release/Debug,生成项目:
    • Visual Studio:打开解决方案 -> 右键项目 -> 生成

实现说明(开发者)

  • 关键实现位于 PlanetGridPatch.cs
    • 使用 HarmonyTranspiler 遍历 IL 指令,查找 ldc.r4 5.0,并将其替换为 ldc.r4 10.0
  • 这样修改后,PlanetGrid 的吸附行为会以新的常量进行计算,从而实现期望的吸附效果。

CHANGELOG

English

Changelog

All notable changes will be documented here. Follows common Semantic Versioning and release note format.

[1.1.0] - February 28, 2026

Added

  • Added runtime toggle switch: Registered default hotkey ~ via CustomKeyBindSystem, supports in-game customization and is localizable.

[1.0.0] - February 26, 2026

Added

  • Initial release: Implemented "Half-Grid" grid snapping functionality (HalfGridSnap).
中文

更改日志

所有重大更新将记录在此。遵循常见的语义化版本和发布说明格式。

[1.1.0] - 二月 28, 2026

已添加

  • 在运行时添加切换开关:通过 CustomKeyBindSystem 注册默认快捷键 ~,支持在游戏内自定义并可本地化。

[1.0.0] - 二月 26, 2026

已添加

  • 初始发布:实现“半格点”网格吸附功能(HalfGridSnap)。