MovableChessboard
Library/Mod to move chessboard around. Provides useful hooks for mods depending on position of the chessboard.
模組介紹 作者原文
MovableChessboard
MovableChessboard is a simple mod that allows players and mods alike to move the chessboard around the airport.
Provides hooks to _BoardMovement™_ events to allow mods depending on this one to get instant updates on the new
position, rotation and scale of the board!
As stated before, players can move chessboard using controls as defined per config file.
For more information, see Configuration section.
Usage
As a dependency
To get updates on chessboard movement, your mod has to first call BoardManager.Init(), preferably in your plugin's Start() method.
After that, you can start hooking up your own event handlers. Here's an example:
private void Start()
{
// Initialize board manager
BoardManager.Init();
// Hook up to all interested events with your handlers
BoardManager.OnBoardLoaded += MyOnBoardLoaded;
BoardManager.OnBoardChangedPosition += MyOnBoardMoved;
BoardManager.OnBoardChangedRotation += MyOnBoardRotated;
BoardManager.OnBoardChangedScale += MyOnBoardScaled;
}
private void MyOnBoardLoaded()
{
Plugin.Log.LogDebug("Chessboard just got loaded into BoardManager!");
}
private void MyOnBoardMoved(Vector3 newPosition)
{
Plugin.Log.LogDebug($"Chessboard just got moved! New position: {newPosition}");
}
private void MyOnBoardRotated(Quaternion newRotation)
{
Plugin.Log.LogDebug($"Chessboard just got rotated! New rotation: {newRotation}");
}
private void MyOnBoardScaled(Vector3 newScale)
{
Plugin.Log.LogDebug($"Chessboard just got scaled! New scale: {newScale}");
}
To move, rotate or scale the chessboard from within your mod, you will have to call MoveChessboard(Vector3 newPosition),
RotateChessboard(Quaternion newRotation) and ScaleChessboard(Vector3 newScale) respectively.
For example usages of these methods, see src/MovableChessboard/Plugin.cs.
As a standalone mod
When you create a lobby and get assigned as a host, you have an ability to move, rotate and scale the chessboard using controls
as defined by Configuration file.
Note
Chessboard means _only_ chessboard. Pieces will stay at the same position unless moved by other mods, see BetterChess.
Also, as of right now, only you (the host) able to percieve the change in chessboard position.
(I plan to add more RPC calls to make it possible to also change position when host changes as well as percieving the chessboard movement as client with a mod)
Configuration
Configuration file can be found in your $PEAK_FOLDER/BepInEx/config/com.github.Kirshoo.MovableChessboard.cfg
Issues and Suggestions
If you running into any issues or have suggestions, you can contact me on discord in modding community server here or open an issue on github repository for this project.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。
下面這些內容需要先安裝,否則該模組不會生效: