Commit adca2dc8 authored by Mikhail Tergoev's avatar Mikhail Tergoev

update CEMU and change_loc func

parent 1de4ead8
......@@ -2,7 +2,10 @@
-----------------------------------------
История изменений:
удалена автоустановка эмулятора CITRA
* удалена автоустановка эмулятора "CITRA"
* обновлена автоустановка эмулятора "CEMU"
* возвращена установка игры "Secret World Legends (ENG)"
###Scripts version 2352### / Дата: 26.09.2024 / Размер скачиваемого обновления: 4 мегабайт
* добавлена автоустановка игры "Farlight 84" (спасибо Chal55rus)
......
......@@ -60,6 +60,7 @@ fatal () {
change_locale () {
if [[ -f "${PORT_WINE_TMP_PATH}/PortProton_loc" ]] ; then
LANGUAGE=$(<"${PORT_WINE_TMP_PATH}/PortProton_loc")
# TODO: drop legacy check language after 01.01.2025
if [[ "$LANGUAGE" == "RUS" ]] ; then
LANGUAGE="ru"
......@@ -68,8 +69,12 @@ change_locale () {
LANGUAGE="en"
echo "en" > "${PORT_WINE_TMP_PATH}/PortProton_loc"
fi
else
[[ ! -f "${pw_yad}" ]] && pw_yad="yad"
fi
[[ ! -f "${pw_yad}" ]] && pw_yad="yad"
if [[ -z "$LANGUAGE" ]] \
|| [[ "${PW_FORCE_CHANGE_LOC}" == "1" ]] ; then
SET_LANG=(
"${pw_yad}" --list
--window-icon="$PW_GUI_ICON_PATH/portproton.svg"
......@@ -83,13 +88,17 @@ change_locale () {
)
out=$("${SET_LANG[@]}")
if [[ -z $out ]] ; then
fatal "Language is not set!"
if [[ -z $out ]] \
&& [[ -n "$LANGUAGE" ]] ; then
echo "${LANGUAGE}" > "${PORT_WINE_TMP_PATH}/PortProton_loc"
elif [[ -z $out ]] ; then
echo "en" > "${PORT_WINE_TMP_PATH}/PortProton_loc"
else
LANGUAGE=$(echo "$out" | cut -d '|' -f2)
echo "${LANGUAGE}" > "${PORT_WINE_TMP_PATH}/PortProton_loc"
create_translations
fi
unset PW_FORCE_CHANGE_LOC
restart_pp
fi
export LANGUAGE
......@@ -108,6 +117,7 @@ change_locale () {
*)
export FULL_LN="english"
export LANGUAGE_GIF="en"
export LANGUAGE="en"
;;
esac
......@@ -1901,7 +1911,7 @@ pw_check_command () {
local F_CMD="$1"
[[ -z "$TIMEOUT_CMD" ]] && TIMEOUT_CMD="3"
if command -v "$S_CMD" &>/dev/null ; then
if ! timeout "$TIMEOUT_CMD" $F_CMD &> "${PW_TMPFS_PATH}/$S_CMD.tmp" ; then
print_error "$S_CMD - broken!"
......@@ -5855,7 +5865,7 @@ gui_pw_update () {
export -f gui_pw_update
change_loc () {
try_remove_file "${PORT_WINE_TMP_PATH}/PortProton_loc"
export PW_FORCE_CHANGE_LOC="1"
print_info "Restarting PP for change language..."
restart_pp
}
......
#!/usr/bin/env bash
# Author: linux-gaming.ru
########################################################################
export PW_URL_CEMU=($(curl -s "https://cemu.info" | grep "zip" | cut -d \" -f 2))
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/`echo ${PW_URL_CEMU} | awk -F/ '{print $5}'`"
export PW_URL_CEMU=$(curl -s "https://api.github.com/repos/cemu-project/Cemu/releases" | grep -iEo 'https.*download.*' | grep "windows" | head -n1)
export PW_CEMU_NAME=Cemu_$(echo "$PW_URL_CEMU" | awk -F"-" '{print $3}')
export PW_AUTOINSTALL_EXE="${PW_USER_TEMP}/${PW_CEMU_NAME}.zip"
start_portwine
if try_download "${PW_URL_CEMU}" "${PW_AUTOINSTALL_EXE}" no_mirror
if try_download "${PW_URL_CEMU//\"/}" "${PW_AUTOINSTALL_EXE}" no_mirror
then
pw_start_progress_bar_install_game "Cemu."
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"$WINEPREFIX/drive_c/Program Files (x86)"
portwine_exe="$WINEPREFIX/drive_c/Program Files (x86)/`echo ${PW_URL_CEMU} | awk -F/ '{print $5}' | sed 's/.zip//'`/Cemu.exe"
"$pw_7z" x -y "${PW_AUTOINSTALL_EXE}" -o"${WINEPREFIX}/drive_c/Program Files (x86)/"
portwine_exe="${WINEPREFIX}/drive_c/Program Files (x86)/${PW_CEMU_NAME}/Cemu.exe"
try_remove_file "${PW_AUTOINSTALL_EXE}"
try_remove_file "${portwine_exe}.ppdb"
kill_portwine
pw_stop_progress_bar
export PORTWINE_CREATE_SHORTCUT_NAME="Cemu"
export PORTWINE_CREATE_SHORTCUT_NAME="${PW_CEMU_NAME}"
portwine_create_shortcut
fi
stop_portwine
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment