#!/bin/bash
#
# SPDX-License-Identifier: MIT
#

## Modular - MUOS
# 
# A modular file that is sourced for specific script lines required by ports running on MUOS.
#
# usage `[ -f "${controlfolder}/mod_${CFW_NAME}.txt" ] && source "${controlfolder}/mod_${CFW_NAME}.txt"`

# Set the virtual screen
CUR_TTY="/dev/null"

# Use for Godot 2
GODOT2_OPTS="-r ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} -f"

# Use for Godot 3+
GODOT_OPTS="--resolution ${DISPLAY_WIDTH}x${DISPLAY_HEIGHT} -f"

pm_platform_helper() {
    pm_message_close

    if [ -e "$PM_PIPE" ]; then
        PortMasterDialogExit
    fi

    # Help keep XongleBongles sanity below
    [ -e /run/muos/system/foreground_process ] && printf "%s" "$(basename "$1")" > /run/muos/system/foreground_process
    [ -e /opt/muos/config/system/foreground_process ] && printf "%s" "$(basename "$1")" > /opt/muos/config/system/foreground_process
}
