a lot of stuff

This commit is contained in:
Vysyr committed 2026-10-27 19:57:03 +01:00
1 parent 86f54deb01
commit a3a80dfa16
35 files changed
+407

No files matched your search

+69
View File
@@ -0,0 +1,69 @@
#!/usr/bin/env bash
# Open ExampleProject.uproject in Unreal Editor on Linux.
set -Eeuo pipefail
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
PROJECT_PATH="$SCRIPT_DIR/ExampleProject.uproject"
show_error() {
local message="$1"
if command -v zenity >/dev/null 2>&1 && [[ -n "${DISPLAY:-}${WAYLAND_DISPLAY:-}" ]]; then
zenity --error --title="ExampleProject - Unreal Editor" --width=520 --text="$message"
else
printf 'ERROR: %s\n' "$message" >&2
if [[ -t 0 ]]; then
read -r -p "Press Enter to close..." _
fi
fi
}
if [[ ! -f "$PROJECT_PATH" ]]; then
show_error "Project file was not found:\n$PROJECT_PATH"
exit 1
fi
find_editor() {
local candidate
# An explicit path takes priority. It may point to the UE root or the binary.
if [[ -n "${UE_ROOT:-}" ]]; then
for candidate in \
"$UE_ROOT" \
"$UE_ROOT/Engine/Binaries/Linux/UnrealEditor"; do
if [[ -x "$candidate" && ! -d "$candidate" ]]; then
printf '%s\n' "$candidate"
return 0
fi
done
fi
if command -v UnrealEditor >/dev/null 2>&1; then
command -v UnrealEditor
return 0
fi
for candidate in \
"$HOME/Unreal/UE_5.8/Engine/Binaries/Linux/UnrealEditor" \
"$HOME/Unreal/UE_5.7/Engine/Binaries/Linux/UnrealEditor" \
"$HOME/UnrealEngine/Engine/Binaries/Linux/UnrealEditor" \
/opt/UnrealEngine/Engine/Binaries/Linux/UnrealEditor \
/mnt/UnrealEngine/Engine/Binaries/Linux/UnrealEditor; do
if [[ -x "$candidate" ]]; then
printf '%s\n' "$candidate"
return 0
fi
done
return 1
}
if ! UNREAL_EDITOR="$(find_editor)"; then
show_error "Unreal Editor was not found.\n\nSet UE_ROOT to the Unreal Engine directory, for example:\nexport UE_ROOT=/home/vysyr/Unreal/UE_5.7"
exit 1
fi
printf 'Opening project:\n %s\nwith:\n %s\n' "$PROJECT_PATH" "$UNREAL_EDITOR"
SDL_VIDEODRIVER=x11 exec "$UNREAL_EDITOR" "$PROJECT_PATH" "$@"