更好的手电筒——更亮、更宽的光束
Wood Studios 制作的手电筒模组:提高光束亮度、照射距离和宽度,同时保留夜间逐渐变暗的效果。支持玩家及联机队友,NPC 手电筒不受影响。需要 MelonLoader 0.7,适用于常规 IL2CPP 分支。
为游戏控制台提供解锁、快捷键修改与命令绑定功能,并避免重新载入存档时重复创建命令列表。未在 Alternate Beta Release 上测试。需要 MelonLoader;其他模组若使用此框架,应将其列为必需模组,而不是随模组打包 DLL。
尚未在 Alternate Beta Release 上测试。
~ 打开控制台命令窗口。consolekey [f2] 并按 Enter。将 [f2] 替换为所需按键。例如,输入 consolekey f2。~ 打开控制台命令窗口。bind [L] 并按 Enter。将 [L] 替换为要使用的按键,并将 [command] 替换为命令。例如,输入 bind L changecash 500。~ 打开控制台命令窗口。unbind [L] 并按 Enter。将 [L] 替换为对应按键,例如 unbind L。~ 打开控制台命令窗口。logcustomcommands 并按 Enter。如果绑定出现问题,请从以下目录删除这两个文件:
C:\Program Files (x86)\Steam\steamapps\common\Schedule I\UserData
CustomCommandFrameworkBinds.json
CustomCommandsFramework.cfg
将文件解压到:
C:\Program Files (x86)\Steam\steamapps\common\Schedule I\Mods
必须在你的模组中引用 CustomCommandsFramework.dll。不要将此 DLL 打包进自己的模组;应将本框架列为必需模组。
新用户建议使用 [CustomCommand] 特性。手动注册仍然可用,但主要用于旧版兼容。以下为可用方法:
// 向游戏控制台界面添加自定义命令提示。
Command.Registry.AddCustomCommandHint(string commandName, string CommandExample = null, string CommandDescription = null, bool log = false)
// 向游戏控制台添加自定义命令。
CommandRegistry.AddCustomCommand(string commandName, Action action, bool log = false)
// 仅在游戏内显示屏幕右侧的自定义通知。delay 为延迟时间;duration 为 0f 时持续显示,或等待按 Enter 关闭。
CustomNotification.ShowNotification(string message, float delay = 0f, duration = 5f);
// 仅在游戏内显示屏幕左侧的自定义文本通知。duration 为 0f 时立即关闭。
CustomNotification.ShowTextNotification(string header, string message, Sprite sprite = null, float delay = 0f, float duration = 5f, bool sound = true)
using System;
using System.IO;
using CustomCommandsFramework; // 不使用特性时必需
using MelonLoader;
using MelonLoader.Utils;
[assembly: MelonInfo(typeof(QuitGameCommand.QuitGameCommand), "Quit Game Command", "1.0.0", "Cubandsweety")]
[assembly: MelonGame("TVGS", "Schedule I")]
namespace QuitGameCommand
{
internal class QuitGameCommand : MelonMod
{
// 模组初始化时调用
public override void OnInitializeMelon()
{
// 可选:若使用 [CustomCommand],请勿调用此方法;只使用一种方式,以避免警告。
CheckAndRegisterCommands();
}
// 检查并注册自定义命令
private static void CheckAndRegisterCommands()
{
try
{
// 添加自定义命令提示(可选,用于帮助说明)
CommandRegistry.AddCustomCommandHint("quit", "quit false", "Quits and saves (Default is true) the game.");
// 注册命令及其处理程序
CommandRegistry.AddCustomCommand("quit", Command.SaveCommand);
}
catch (Exception ex)
{
MelonLogger.Error($"Failed to register console commands: {ex}");
}
}
}
}
using System;
using System.Collections;
using CustomCommandsFramework; // 使用特性时必需
using Il2CppScheduleOne.DevUtilities;
using Il2CppScheduleOne.Persistence;
using MelonLoader;
using UnityEngine;
namespace QuitGameCommand
{
internal static class Command
{
// 'quit' 命令的主要逻辑
// 若使用特性,请取消下面一行的注释,并停用 CheckAndRegisterCommands()。
//[CustomCommand("quit", "quit false", "Quits and saves (Default is true) the game.")]
internal static void SaveCommand(string args)
{
bool shouldSave = false;
var parts = args.Split(' ');
// 简单用法
//if (args == "quit")
//{
// Application.Quit();
//}
// 高级用法:无参数或参数为 'true' 时保存
if (parts.Length == 1 || (parts.Length == 2 && parts[1].Equals("true", StringComparison.OrdinalIgnoreCase)))
{
shouldSave = true;
}
// 获取 SaveManager 实例
var instance = Singleton.Instance;
if (!instance)
{
Logs.LogWarning("Failed to find SaveManager instance.");
return;
}
// 调用成功处理方法,保存并退出
SuccessMethod(instance, shouldSave);
}
private static void SuccessMethod(SaveManager instance, bool shouldSave)
{
// shouldSave 为 true 时保存
if (shouldSave)
{
instance.Save();
}
// 退出游戏
Application.Quit();
}
}
}
如果觉得模组有用,作者欢迎玩家为其点赞支持。如需联系或寻求帮助,可加入 Cubandsweety Modding Hub Discord。
前往 N 网打开所选文件。安装与下载要求以原作者及平台说明为准。
<!-- aoe-mods-source:nexusmods:schedule1:589 -->