MetaHorror
| Kind | class |
| Package | backend |
| Full name | backend.MetaHorror |
| Source | source/backend/MetaHorror.hx |
Public fields
| Name | Type | Static | Default | Notes |
|---|---|---|---|---|
programList | Array<String> | yes | [ | Process-name fragments treated as "recording/streaming software" by isRecording. Matched as lowercase substrings against the host process list; extend freely. |
wallpaperAppList | Array<String> | yes | [ | Wallpaper-engine processes killed by killWallpaperApps so a wallpaper swap is actually visible over live-wallpaper apps. |
oldWallpaper | Null<String> | yes | null | property (default, null) · Desktop wallpaper captured before the first setWallpaper call on this session; restoreWallpaper puts it back. null until then. |
Public methods
isRecording
static function isRecording():Bool
True when recording/streaming software from programList seems to be
running. Intended for "streamer-safe" swaps, but horror mods also use it
to change behaviour when the player is live.
Fails OPEN (returns true) when the process list cannot be read, so an
unknown error never leaks content to a live stream. Always false
without META_HORROR.
killWallpaperApps
static function killWallpaperApps():Void
Forcefully closes the live-wallpaper apps in wallpaperAppList so a
setWallpaper swap is visible. Windows only; no-op elsewhere.
duplicateImage
static function duplicateImage(imageFile:String, finalFileName:String, fileType:String = 'png', ?location:String):Null<String>
Writes a copy of an image asset to the real filesystem ("leaking" art out of the game). Accepts an absolute/relative file path or an embedded asset path.
@param imageFile Asset path or on-disk path of the source image.
@param finalFileName File name without extension for the copy.
@param fileType Extension to write (png recommended; PNG preserves alpha).
@param location Target directory. Default: <temp>/phoenix_horror.
@return The written file path, or null on failure / unsupported target.
| Parameter | Type | Default |
|---|---|---|
imageFile | String | — |
finalFileName | String | — |
fileType (optional) | String | 'png' |
location (optional) | String | — |
openFile
static function openFile(path:String):Bool
Opens path with the OS default application (ShellExecute on Windows,
xdg-open on Linux, open on macOS).
@return true when the open request was dispatched.
| Parameter | Type | Default |
|---|---|---|
path | String | — |
setSysAudioVolume
static function setSysAudioVolume(percentage:Int):Bool
Sets the default audio output device's master volume.
@param percentage 0-100.
@return true on success; false on failure / unsupported target.
| Parameter | Type | Default |
|---|---|---|
percentage | Int | — |
setSysAudioMute
static function setSysAudioMute(mute:Bool):Bool
Mutes (or unmutes) the default audio output device.
@return true on success; false on failure / unsupported target.
| Parameter | Type | Default |
|---|---|---|
mute | Bool | — |
getSysAudioVolume
static function getSysAudioVolume():Int
@return Current master volume percentage (0-100), or -1 when unavailable.
getSysAudioMute
static function getSysAudioMute():Bool
@return Master-mute state, or false when unavailable.
moveMousePos
static function moveMousePos(x:Float, y:Float):Bool
Moves the mouse cursor by x/y pixels relative to its current
position (matches the upstream nircmd sendmouse move behaviour).
Windows only.
| Parameter | Type | Default |
|---|---|---|
x | Float | — |
y | Float | — |
typeText
static function typeText(text:String, delay:Float = 0.05):Void
Types text into whatever window has focus, delay seconds per
character (SendInput with Unicode scan codes, so any layout works).
Special keys inside text: \n = Enter, \t = Tab, \b = Backspace.
A new call cancels a previous unfinished one. Windows only.
| Parameter | Type | Default |
|---|---|---|
text | String | — |
delay (optional) | Float | 0.05 |
setWallpaper
static function setWallpaper(path:String, absolute:Bool = false):Bool
Changes the desktop wallpaper. path is either an on-disk image path
(absolute) or an image name resolved like the upstream helper:
mods/images/<name>.png first, then any embedded asset (dumped to a
temp file automatically, since the OS needs a real file).
The pre-change wallpaper is captured once per session for
restoreWallpaper. Windows only.
@return true when the wallpaper changed.
| Parameter | Type | Default |
|---|---|---|
path | String | — |
absolute (optional) | Bool | false |
restoreWallpaper
static function restoreWallpaper():Bool
Restores the wallpaper captured by the first setWallpaper call of
this session.
@return true when restored (also true when there was nothing to restore).
hideTaskbar
static function hideTaskbar():Bool
Hides the Windows taskbar. Remember the result state and call
restoreTaskbar when the effect ends.
@return true when the taskbar is now hidden.
restoreTaskbar
static function restoreTaskbar():Void
Restores the taskbar to the visibility it had before hideTaskbar.
hideAllWindows
static function hideAllWindows():Int
Hides every visible top-level window except the game (and the shell).
Titles of the hidden windows are kept for restoreAllWindows.
@return How many windows were hidden. Windows only.
restoreAllWindows
static function restoreAllWindows():Int
Re-shows the windows hidden by hideAllWindows (without stealing focus).
@return How many windows were restored. Windows only.
removeWindowIcon
static function removeWindowIcon():Bool
Removes the window icon AND the whole system menu (close/minimize/
maximize buttons) by stripping WS_SYSMENU, like the upstream
removeWindowIcon. Windows only.
setWindowAlpha
static function setWindowAlpha(alpha:Float):Bool
Whole-window opacity, 0.0 (invisible) - 1.0 (opaque). Values are clamped. Windows only.
| Parameter | Type | Default |
|---|---|---|
alpha | Float | — |
setWindowColorKey
static function setWindowColorKey(color:Int):Bool
Color-key window transparency: every pixel of the game whose color
equals color (0xRRGGBB) becomes see-through to the desktop.
Windows only.
| Parameter | Type | Default |
|---|---|---|
color | Int | — |
resetWindowEffects
static function resetWindowEffects():Bool
Restores the game window's original extended style, undoing
setWindowAlpha / setWindowColorKey / layered effects.
getSystemRAM
static function getSystemRAM():Int
Physically installed system RAM in megabytes (upstream obtainRAM),
served by the engine's debug.system.SystemInfo query.
@return RAM in MB, or 0 when unavailable.
Internals
Private / internal members
| Field | Type | Static |
|---|---|---|
hiddenWindowTitles | Array<String> | yes |
taskbarWasVisible | Bool | yes |
typeToken | Int | yes |
| Method |
|---|
static inline function clamp01(value:Float):Float |
static inline function rgbToColorRef(color:Int):Int |
static function dumpImageToFile(imageFile:String, outPath:String):Bool |
static function resolveWallpaperFile(path:String, absolute:Bool):Null<String> |
static function setMasterVolumeNative(volume:Float):Bool |
static function setMasterMuteNative(mute:Bool):Bool |
static function getMasterVolumeNative():Float |
static function getMasterMuteNative():Bool |
static function moveMouseNative(dx:Int, dy:Int):Bool |
static function sendVirtualKeyNative(vk:Int, up:Bool = false):Bool |
static function sendUnicodeCharNative(charCode:Int):Bool |
static function openFileNative(path:String):Bool |
static function setWallpaperNative(path:String):Bool |
static function getWallpaperNative():String |
static function hideTaskbarNative():Bool |
static function restoreTaskbarNative(wasVisible:Bool):Void |
static function hideWindowsNative(ownTitle:String):Array<String> |
static function restoreWindowsNative(prevHidden:Array<String>):Int |
static function removeWindowIconNative():Bool |
static function setWindowAlphaNative(alpha:Float):Bool |
static function setWindowColorKeyNative(color:Int):Bool |
static function resetWindowStylesNative():Bool |