mirror of
https://github.com/anticitizn/creamlinux.git
synced 2025-12-05 21:15:40 -05:00
Add code
This commit is contained in:
85
package/cream.sh
Executable file
85
package/cream.sh
Executable file
@@ -0,0 +1,85 @@
|
||||
#!/bin/bash
|
||||
result=$(zenity --title="Launch Options" --list "Start Game" "Edit Creamlinux settings" --column="Launch Options")
|
||||
# Supported games
|
||||
GAME_NAMES=("Hearts Of Iron IV" "Europa Universalis IV" "Cities: Skylines" "Paradox Launcher (Don't launch game here)")
|
||||
GAME_BINARIES=("./hoi4" "./eu4" "./Cities.x64" "./dowser")
|
||||
# stupid fix for stupid "backwards compatability" reasons
|
||||
# seriously i spent fucking 1h and 30mins figuring this shit out
|
||||
# really, backwards compatibility is stupid and breaks stuff most of the time (windows is a good example)
|
||||
# word splitting is one of those cases
|
||||
# who has any genuine use for word splitting????
|
||||
export IFS=""
|
||||
case $result in
|
||||
|
||||
"Start Game")
|
||||
# LD_PRELOAD doesn't support spaces, do this instead
|
||||
cp "$PWD/libCreamlinux.so" /tmp/libCreamlinux.so
|
||||
FOUND_BINS=()
|
||||
INDEX=0
|
||||
INDEX_ADDED=0
|
||||
MANGLED_OUTPUT=()
|
||||
|
||||
for GAMEBIN in "${GAME_BINARIES[@]}"
|
||||
do
|
||||
if [ -f "$GAMEBIN" ]; then
|
||||
echo "$GAMEBIN exists."
|
||||
FOUND_BINS+=("$GAMEBIN")
|
||||
MANGLED_OUTPUT+=("$INDEX_ADDED")
|
||||
MANGLED_OUTPUT+=("\"${GAME_NAMES[$INDEX]}\"")
|
||||
MANGLED_OUTPUT+=("\"${GAME_BINARIES[$INDEX]}\"")
|
||||
((INDEX_ADDED++))
|
||||
fi
|
||||
((INDEX++))
|
||||
# do whatever on "$bin" here
|
||||
|
||||
done
|
||||
if [ "${#FOUND_BINS[@]}" -eq "0" ]; then
|
||||
echo "No binaries found."
|
||||
zenity --error --text="No games were found in script directory."
|
||||
exit 1
|
||||
fi
|
||||
if [ "${#FOUND_BINS[@]}" -eq "1" ]; then
|
||||
echo "Found one binary, running"
|
||||
SELECTED_GAME="${FOUND_BINS[0]}"
|
||||
else
|
||||
echo "Found multiple binaries, triggering prompt"
|
||||
SELECTED_INDEX=$(zenity --list --column="I" --column="Game Name" --column="Binary Path" --title="Launch Options" --text="Multiple game binaries were found. Please pick the game you want to run." ${MANGLED_OUTPUT[@]} )
|
||||
SELECTED_GAME=${FOUND_BINS[$SELECTED_INDEX]}
|
||||
fi
|
||||
# is the game variable set
|
||||
if [ -z "$SELECTED_INDEX" ]; then
|
||||
zenity --error --text="Cancelled: No game selected"
|
||||
# unset ifs so we don't fuck up every other program
|
||||
unset IFS
|
||||
exit 1
|
||||
else
|
||||
# reset stupid backwards compatible stuff so games that DO use it don't break
|
||||
unset IFS
|
||||
# paradox launcher segfaults with creamlinux, if launching launcher, do it differently
|
||||
if [ "$SELECTED_GAME" -eq "./dowser" ]; then
|
||||
$SELECTED_GAME "$@"
|
||||
exit 0
|
||||
fi
|
||||
# actually launch the game
|
||||
LD_PRELOAD="$LD_PRELOAD /tmp/libCreamlinux.so" $SELECTED_GAME "$@"
|
||||
fi
|
||||
;;
|
||||
|
||||
"Edit Creamlinux settings")
|
||||
# is the cream_api.ini path set
|
||||
if [ -z "$CREAM_CONFIG_PATH" ]; then
|
||||
# no path was set
|
||||
xdg-open $PWD/cream_api.ini
|
||||
else
|
||||
# custom path was set
|
||||
xdg-open $CREAM_CONFIG_PATH
|
||||
fi
|
||||
# restart the script
|
||||
$PWD/cream.sh
|
||||
;;
|
||||
|
||||
*)
|
||||
|
||||
;;
|
||||
esac
|
||||
|
||||
40
package/cream_api.ini
Normal file
40
package/cream_api.ini
Normal file
@@ -0,0 +1,40 @@
|
||||
# add the dlc you want to fake here
|
||||
# APPID = DLC Name
|
||||
# copying a file from windows creamapi will not work, you need to fix line endings
|
||||
# the DLC id's below are for HOI4
|
||||
[dlc]
|
||||
445630 = Hearts of Iron IV: War Stories
|
||||
460550 = Hearts of Iron IV: German Tanks Pack
|
||||
460551 = Hearts of Iron IV: French Tanks Pack
|
||||
460553 = Hearts of Iron IV: Heavy Cruisers Unit Pack
|
||||
460554 = Hearts of Iron IV: Soviet Tanks Unit Pack
|
||||
460555 = Hearts of Iron IV: US Tanks Unit Pack
|
||||
460556 = Hearts of Iron IV: British Tanks Unit Pack
|
||||
460557 = Hearts of Iron IV: German March Order Music Pack
|
||||
460558 = Hearts of Iron IV: Allied Radio Music Pack
|
||||
460559 = Hearts of Iron IV: Rocket Launcher Unit Pack
|
||||
460600 = Hearts of Iron IV: Poland - United and Ready
|
||||
460610 = Hearts of Iron IV: German Historical Portraits
|
||||
461800 = Hearts of Iron IV: Sabaton Soundtrack (Music - Hearts of Iron IV: Sabaton Soundtrack)
|
||||
471560 = Hearts of Iron IV Preview Depot
|
||||
472410 = Hearts of Iron IV: Wallpaper
|
||||
473130 = Hearts of Iron IV: Artbook
|
||||
486950 = Hearts of Iron IV: Original Soundtrack
|
||||
530760 = Hearts of Iron IV: Together for Victory (Expansion - Hearts of Iron IV: Together for Victory)
|
||||
554840 = Hearts of Iron IV: Expansion Pass DLC
|
||||
584140 = Hearts of Iron IV: Death or Dishonor (Expansion - Hearts of Iron IV: Death or Dishonor)
|
||||
584141 = Hearts of Iron IV: Sabaton Soundtrack Vol. 2 (Music - Hearts of Iron IV: Sabaton Soundtrack Vol. 2)
|
||||
616200 = Hearts of Iron IV: Colonel Edition Upgrade Pack
|
||||
642010 = Hearts of Iron IV: Anniversary Pack
|
||||
702350 = Hearts of Iron IV: Waking the Tiger (Expansion - Hearts of Iron IV: Waking the Tiger)
|
||||
815460 = Hearts of Iron IV: Man the Guns (Expansion - Hearts of Iron IV: Man the Guns)
|
||||
1032150 = Hearts of Iron IV: Man the Guns Wallpaper (Pre-Order)
|
||||
1086480 = Hearts of Iron IV: Axis Armor Pack
|
||||
1086481 = Hearts of Iron IV: Radio Pack
|
||||
1158100 = Hearts of Iron IV: La Résistance
|
||||
1206030 = Hearts of Iron IV: La Résistance Pre-Order Bonus
|
||||
1317230 = Hearts of Iron IV: Allied Armor Pack
|
||||
1317250 = Hearts of Iron IV: Allied Speeches Music Pack
|
||||
1348660 = Hearts of Iron IV: Battle for the Bosporus (Expansion - Hearts of Iron IV: Battle for the Bosporus)
|
||||
1579991 = Hearts of Iron IV: Eastern Front Planes Pack
|
||||
1579992 = Hearts of Iron IV: Eastern Front Music Pack
|
||||
Reference in New Issue
Block a user