BorderlessFullScreen

版本 v2.0.1·更新於 2024-04-21

Quicker alt tabbing

模組介紹 作者原文

Borderless Full Screen

  • Game must be set to windowed mode for this to work properly.

-1.0.1: The mod will do this for you.

+2.0.0: Mod doesn't do this anymore to maintain compatibility with other games that can also utilize BepInEx, you can use the command below to ensure the game starts in windowed mode.

Launch Unity games in windowed mode with this command:

-screen-fullscreen 0

+2.0.0

No longer use Autohotkey.Interop dependency, instead just do what the ahk script did:

public class BorderlessFullScreenPlugin: BaseUnityPlugin

{

[DllImport("user32.dll")]

private static extern IntPtr FindWindow(string className, string windowName);

[DllImport("user32.dll")]

private static extern int GetWindowLong(IntPtr hWnd, int index);

[DllImport("user32.dll")]

private static extern int SetWindowLong(IntPtr hWnd, int index, int value);

[DllImport("user32.dll")]

private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int width, int height, uint flags);

private const int GWL_STYLE = -16;

private const uint SWP_FRAMECHANGED = 0x0020;

private const uint SWP_SHOWWINDOW = 0x0040;

private void Start()

{

IntPtr hWnd = FindWindow("UnityWndClass", null);

if (hWnd!= IntPtr.Zero)

{

int style = GetWindowLong(hWnd, GWL_STYLE);

style &= ~0xC40000; // Remove WS_BORDER and WS_CAPTION

SetWindowLong(hWnd, GWL_STYLE, style);

SetWindowPos(hWnd, IntPtr.Zero, 0, 0, Screen.width, Screen.height, SWP_FRAMECHANGED | SWP_SHOWWINDOW);

}

else

{

Debug.LogError("Unity window not found.");

}

Debug.Log($"Plugin {"BorderlessFullscreen"} is loaded!");

}

}

Old Description for version 1.0.1

Uses AutoHotkey.Interop to execute the following AutoHotkey script into the game through BepInEx.

procName:= "UnityWndClass"

WinGet Style, Style, % "ahk_class " procName

If (Style & 0xC40000)

{

WinSet, Style, -0xC40000, % "ahk_class " procName

WinMove, % "ahk_class " procName,, 0, 0, A_ScreenWidth + 1, A_ScreenHeight + 1

}

Return

The benefit of using this is so DXVK can run... as it seems to crash the game for anything other than windowed mode.\.ahk script modified from:

-

-

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

BepInEx-BepInExPack

檔案與校驗

檔案名稱
BorderlessFullScreen-2.0.1.zip
檔案大小
100.8 KiB