PeakChatOps

版本 v1.2.3·更新於 2025-10-04

A chat system for PEAK. Basic messaging functionality with UI enhancements. Includes AI assistant support via OpenAI API.

模組介紹 作者原文

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 你好 - 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 安全提示

  • API Key 已安全儲存在本地,請放心使用。
  • 如果不放心,建議使用 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!

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack_PEAKSnosz-PhotonCustomPropsUtilsPEAKModding-PEAKLib_CoreCysharp-UniTask

檔案與校驗

檔案名稱
PeakChatOps-1.2.3.zip
檔案大小
657.1 KiB