PeakChatOps
A chat system for PEAK. Basic messaging functionality with UI enhancements. Includes AI assistant support via OpenAI API.
About this mod Machine translation
PeakChatOps
Welcome to PeakChatOps
This mod is a chat enhancement mod with the following features:
- Multiple extensible chat commands
- Scrollable message history without lag, with text copying support
- LLM integration for translation and other AI features
- Localization support (commands not fully localized yet)
Usage Tips
- Default key: Press Y to open chat
- Commands: Start with /
- Help: /help to view available commands
- AI Chat: /ai HI - Chat with AI (local display only)
- Translation: /ai translate Hello - Translate to English, then @send to broadcast the AI response
- Command Learning: /ai how to use this cmd: whisper @whisper - Learn how to use commands (useful for foreign language commands)
- Position: /pos T / R / C - Change chat window position (Top/Right/Center)
Note: While typing, you can freely click on text to copy content
What
'
s New in 1.2.0 (vs 1.1.5)
I completely abandoned the old UI system and switched to Unity
'
s latest UXML/USS system, solving these issues:
- No more lag when sending long texts - significantly improved experience
- Smoother scrolling throughout the interface
- Better extensibility for future features
Customizing Chat Styles
Here
'
s how to customize the chat appearance:
- Open the Unity Project
- Navigate to the unity folder in this project
- Open with Unity (same version as the project)
- Locate the UI Files
- In the Mod folder, you
'
ll find prefab files
- Use UI Toolkit to open the.uxml files
- Customize Styles
- Edit the UXML/USS files to change appearance
- Important: Don
'
t change component names, or you
'
ll need to update the source code bindings
- Build the Bundle
- Enable Unity Addressable System
- Go to Window → Asset Management → Addressables → Groups → Build
- Click Build to generate the bundle
- Deploy the Bundle
- Find the largest bundle file in: unity project / Libraries / com.unity.addressables / aa / standalonewindows64 /
- Rename it to: PeakChatOpsUI.peakbundle
- Place it in the mod folder
Developing Custom Commands
Here
'
s how to create your own commands. Example: Echo.cs
using System;
using PeakChatOps.API;
using Cysharp.Threading.Tasks;
using PeakChatOps.Core;
nullable enable
namespace PeakChatOps.Commands;
[PCOCommand("echo", "Echo input content", "Usage: /echo \nReturns your input as-is.")]
public class EchoCommand
{
// New message-driven handler signature. Plugins/commands register handlers
// on EventBusRegistry.CmdMessageBus with channel "cmd://echo".
public EchoCommand()
{
EventBusRegistry.CmdMessageBus.Subscribe("cmd://echo", Handle);
DevLog.UI("[Cmd] EchoCommand subscribed to cmd://echo");
}
public static async UniTask Handle(CmdMessageEvent evt)
{
try
{
var args = evt.Args?? Array.Empty();
var res = args.Length == 0? "Please enter content to echo.": string.Join(" ", args);
var resultEvt = new CmdExecResultEvent(evt.Command, evt.Args?? Array.Empty(), evt.UserId, stdout: res, stderr: null, success: true);
await EventBusRegistry.CmdExecResultBus.Publish("cmd://", resultEvt);
}
catch (Exception ex)
{
var errEvt = new CmdExecResultEvent(evt.Command, evt.Args?? Array.Empty(), evt.UserId, stdout: null, stderr: ex.Message, success: false);
await EventBusRegistry.CmdExecResultBus.Publish("cmd://", errEvt);
}
await UniTask.CompletedTask;
}
}
API Key Security Tips
- The API Key has been safely stored locally, please feel free to use it.
- If you are unsure, it is recommended to use the cloud model provided by ollama.
API Key is securely stored locally. You can use it with confidence.
If you have concerns, it is recommended to use the cloud model provided by ollama.
Build
dotnet build -c Release -target:PackTS -v d
Credits (in no particular order)
- PeakTextChat (Inspiration)
- BepInEx (Framework)
- PeakLib (Utility library)
For questions or suggestions, feel free to open an issue or PR!
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.
Install these first, or the mod will not work: