Skip to main content

MetaHorror

Kindclass
Packagebackend
Full namebackend.MetaHorror
Sourcesource/backend/MetaHorror.hx

Public fields​

NameTypeStaticDefaultNotes
programListArray<String>yes[Process-name fragments treated as "recording/streaming software" by isRecording. Matched as lowercase substrings against the host process list; extend freely.
wallpaperAppListArray<String>yes[Wallpaper-engine processes killed by killWallpaperApps so a wallpaper swap is actually visible over live-wallpaper apps.
oldWallpaperNull<String>yesnullproperty (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.

View source

killWallpaperApps​

static function killWallpaperApps():Void

Forcefully closes the live-wallpaper apps in wallpaperAppList so a setWallpaper swap is visible. Windows only; no-op elsewhere.

View source

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: &lt;temp&gt;/phoenix_horror. @return The written file path, or null on failure / unsupported target.

ParameterTypeDefault
imageFileString—
finalFileNameString—
fileType (optional)String'png'
location (optional)String—

View source

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.

ParameterTypeDefault
pathString—

View source

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.

ParameterTypeDefault
percentageInt—

View source

setSysAudioMute​

static function setSysAudioMute(mute:Bool):Bool

Mutes (or unmutes) the default audio output device. @return true on success; false on failure / unsupported target.

ParameterTypeDefault
muteBool—

View source

getSysAudioVolume​

static function getSysAudioVolume():Int

@return Current master volume percentage (0-100), or -1 when unavailable.

View source

getSysAudioMute​

static function getSysAudioMute():Bool

@return Master-mute state, or false when unavailable.

View source

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.

ParameterTypeDefault
xFloat—
yFloat—

View source

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.

ParameterTypeDefault
textString—
delay (optional)Float0.05

View source

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/&lt;name&gt;.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.

ParameterTypeDefault
pathString—
absolute (optional)Boolfalse

View source

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).

View source

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.

View source

restoreTaskbar​

static function restoreTaskbar():Void

Restores the taskbar to the visibility it had before hideTaskbar.

View source

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.

View source

restoreAllWindows​

static function restoreAllWindows():Int

Re-shows the windows hidden by hideAllWindows (without stealing focus). @return How many windows were restored. Windows only.

View source

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.

View source

setWindowAlpha​

static function setWindowAlpha(alpha:Float):Bool

Whole-window opacity, 0.0 (invisible) - 1.0 (opaque). Values are clamped. Windows only.

ParameterTypeDefault
alphaFloat—

View source

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.

ParameterTypeDefault
colorInt—

View source

resetWindowEffects​

static function resetWindowEffects():Bool

Restores the game window's original extended style, undoing setWindowAlpha / setWindowColorKey / layered effects.

View source

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.

View source

Internals​

Private / internal members
FieldTypeStatic
hiddenWindowTitlesArray<String>yes
taskbarWasVisibleBoolyes
typeTokenIntyes
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