Skip to content

Instantly share code, notes, and snippets.

@alef
Created December 11, 2022 15:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alef/7060b898bce6fb5f2936c7c5e927533e to your computer and use it in GitHub Desktop.
Save alef/7060b898bce6fb5f2936c7c5e927533e to your computer and use it in GitHub Desktop.
#SingleInstance Force
Persistent True
WindowedFullScreen(Monitor) {
; In-game settings:
; /Video\
; [ Windowed ]
; [ Resolution: Detect ]
; [ Window is resizable (takes effect on restart) Yes ]
Title := "Dwarf Fortress"
StrStyle := "-0xC00000"
SetTitleMatchMode 3
if ! WinWait(Title, , 2)
return
MonitorGetWorkArea(Monitor, &Left, &Top, &Right, &Bottom)
Width := Right - Left
Height := Bottom - Top
WinSetStyle StrStyle
WinMove Left, Top, Width, Height
}
tray := A_TrayMenu
tray.Add("")
loop MonitorGetCount() {
Name := (MonitorGetPrimary() == A_Index ? "P" : Chr(Ord("A") + A_Index - 1))
MonitorGetWorkArea(A_Index, &Left, &Top, &Right, &Bottom)
Title := Name " " Format("{1:d}:{2:d}", Left, Top)
tray.Add(Title, ((i, *) => WindowedFullScreen(i)).Bind(A_Index))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment