Commit 07175825 authored by Mikhail Tergoev's avatar Mikhail Tergoev

minor update hardmode-2

parent 64b70f01
......@@ -868,7 +868,7 @@ search_desktop_file () {
if [[ ${line2[1]} == "$ENTRY_POINT" ]] ; then
break
fi
done < "$PW_DATABASE_PATH/database"
done < "$PORT_WINE_TMP_PATH/statistics"
if [[ $portwine_exe == "${EXEC_DESKTOP//\"/}" ]] ; then
DESKTOP_CORRECT_FILE="$desktop_file"
fi
......@@ -884,9 +884,9 @@ search_desktop_file () {
# Проверка новых десктоп файлов, чтобы их можно было сортировать первыми при первом создании в главном меню
if [[ $PW_NEW_DESKTOP == 1 ]] && [[ ${line2[3]} != NEW_DESKTOP ]] ; then
if [[ -n ${line2[1]} ]] ; then
sed -i "s|$ENTRY_POINT $TIME_CURRENT OLD_DESKTOP|$ENTRY_POINT $TIME_CURRENT NEW_DESKTOP|" "$PW_DATABASE_PATH/database"
sed -i "s|$ENTRY_POINT $TIME_CURRENT OLD_DESKTOP|$ENTRY_POINT $TIME_CURRENT NEW_DESKTOP|" "$PORT_WINE_TMP_PATH/statistics"
else
echo "${portwine_exe// /#@_@#} $ENTRY_POINT $TIME_CURRENT NEW_DESKTOP" >> "$PW_DATABASE_PATH/database"
echo "${portwine_exe// /#@_@#} $ENTRY_POINT $TIME_CURRENT NEW_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi
fi
unset PW_NEW_DESKTOP
......@@ -895,26 +895,26 @@ search_desktop_file () {
TIME_TOTAL=$(( TIME_CURRENT + PW_TIME_IN_GAME ))
if [[ -n ${line2[1]} ]] ; then
# Когда есть предыдущее время
sed -i "s|$ENTRY_POINT $TIME_CURRENT|$ENTRY_POINT $TIME_TOTAL|" "$PW_DATABASE_PATH/database"
sed -i "s|$ENTRY_POINT $TIME_CURRENT|$ENTRY_POINT $TIME_TOTAL|" "$PORT_WINE_TMP_PATH/statistics"
else
# Когда только запустили приложение первый раз
echo "${portwine_exe// /#@_@#} $ENTRY_POINT $TIME_TOTAL OLD_DESKTOP" >> "$PW_DATABASE_PATH/database"
echo "${portwine_exe// /#@_@#} $ENTRY_POINT $TIME_TOTAL OLD_DESKTOP" >> "$PORT_WINE_TMP_PATH/statistics"
fi
# Здесь добавляются новые линии для статистики по аналогии, к примеру ${line2[4]}
# L4 важен, чтобы не было путаницы из-за sed, то что используется \(.*\), для ${line2[5]} это будет L5 и т.д.
if [[ -z ${line2[4]} ]] ; then
line2[4]=1
sed -i "s|$ENTRY_POINT \(.*\)|$ENTRY_POINT \1 L4-${line2[4]}|" "$PW_DATABASE_PATH/database"
sed -i "s|$ENTRY_POINT \(.*\)|$ENTRY_POINT \1 L4-${line2[4]}|" "$PORT_WINE_TMP_PATH/statistics"
else
line2[4]=${line2[4]//L4-/}
NUMBER_OF_STARTS=$(( line2[4] + 1 ))
sed -i "s|$ENTRY_POINT \(.*\) L4-${line2[4]}|$ENTRY_POINT \1 L4-$NUMBER_OF_STARTS|" "$PW_DATABASE_PATH/database"
sed -i "s|$ENTRY_POINT \(.*\) L4-${line2[4]}|$ENTRY_POINT \1 L4-$NUMBER_OF_STARTS|" "$PORT_WINE_TMP_PATH/statistics"
fi
fi
# Ремонтирует путь на новый, если вдруг путь до .exe файла битый или изменился, но .exe файл он опознал
if [[ -n ${line2[1]} ]] && [[ ${line2[0]} != "${portwine_exe// /#@_@#}" ]] ; then
[[ -z $TIME_TOTAL ]] && TIME_TOTAL=$TIME_CURRENT
sed -i "s|${line2[0]} $ENTRY_POINT $TIME_CURRENT|${portwine_exe// /#@_@#} $ENTRY_POINT $TIME_TOTAL|" "$PW_DATABASE_PATH/database"
sed -i "s|${line2[0]} $ENTRY_POINT $TIME_CURRENT|${portwine_exe// /#@_@#} $ENTRY_POINT $TIME_TOTAL|" "$PORT_WINE_TMP_PATH/statistics"
fi
}
......
#!/usr/bin/env bash
#Author: fidel
#warframe_launcher_pp.exe
#launcher.exe|Warframe Launcher
#Rating=1-5
#####################examples###########################
export PW_WINDOWS_VER="10"
......
......@@ -3,6 +3,10 @@
# Development assistants: Cefeiko; Dezert1r; Taz_mania; Anton_Famillianov; gavr; RidBowt; chal55rus; UserDiscord; Boria138; Vano; Akai; Htylol
# shellcheck disable=SC2140,SC2119,SC2206,SC2068
########################################################################
export url_site="https://linux-gaming.ru/portproton/"
export url_cloud="https://cloud.linux-gaming.ru/portproton"
export url_git="https://git.linux-gaming.ru/CastroFidel/PortWINE"
########################################################################
echo '
█░░ █ █▄░█ █░█ ▀▄▀ ▄▄ █▀▀ ▄▀█ █▀▄▀█ █ █▄░█ █▀▀ ░ █▀█ █░█
█▄▄ █ █░▀█ █▄█ █░█ ░░ █▄█ █▀█ █░▀░█ █ █░▀█ █▄█ ▄ █▀▄ █▄█
......@@ -151,16 +155,12 @@ source "${PORT_SCRIPTS_PATH}/var"
export STEAM_SCRIPTS="${PORT_WINE_PATH}/steam_scripts"
export PW_PLUGINS_PATH="${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}"
export PW_CACHE_LANG_PATH="${PORT_WINE_TMP_PATH}/cache_lang/"
export PW_DATABASE_PATH="${PORT_WINE_TMP_PATH}/pw_database/"
export PW_GUI_ICON_PATH="${PORT_WINE_PATH}/data/img/gui"
export PW_GUI_THEMES_PATH="${PORT_WINE_PATH}/data/themes"
export pw_yad="${PW_GUI_THEMES_PATH}/gui/yad_gui_pp"
change_locale
export urlg="https://linux-gaming.ru/portproton/"
export url_cloud="https://cloud.linux-gaming.ru/portproton"
export url_git="https://git.linux-gaming.ru/CastroFidel/PortWINE"
export PW_WINELIB="${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}"
try_remove_dir "${PW_WINELIB}/var"
install_ver="$(<"${PORT_WINE_TMP_PATH}/PortProton_ver")"
......@@ -177,23 +177,20 @@ check_variables PW_LOG "0"
try_remove_file "${PW_TMPFS_PATH}/update_pfx_log"
# shellcheck source=/dev/null
source "${USER_CONF}"
source "$USER_CONF"
if [[ ! -f $PW_DATABASE_PATH/database ]] ; then
create_new_dir "$PW_DATABASE_PATH"
touch "$PW_DATABASE_PATH/database"
fi
[[ ! -f "${PW_CACHE_LANG_PATH}/$LANGUAGE" ]] && create_translations
[[ ! -f "$PORT_WINE_TMP_PATH/statistics" ]] && touch "$PORT_WINE_TMP_PATH/statistics"
[[ ! -f "$PW_CACHE_LANG_PATH/$LANGUAGE" ]] && create_translations
unset translations
# shellcheck source=/dev/null
source "${PW_CACHE_LANG_PATH}/$LANGUAGE"
source "$PW_CACHE_LANG_PATH/$LANGUAGE"
if [[ $TRANSLATIONS_VER != "$scripts_install_ver" ]] ; then
try_remove_dir "${PW_CACHE_LANG_PATH}"
try_remove_dir "$PW_CACHE_LANG_PATH"
create_translations
# shellcheck source=/dev/null
source "${PW_CACHE_LANG_PATH}/$LANGUAGE"
source "$PW_CACHE_LANG_PATH/$LANGUAGE"
fi
# check PortProton theme
......@@ -645,9 +642,9 @@ else
else
PW_GAME_TIME["$AMOUNT_GENERATE_BUTTONS"]=0
fi
done < "$PW_DATABASE_PATH/database"
done < "$PORT_WINE_TMP_PATH/statistics"
if [[ $SORT_WITH_TIME == enabled ]] && [[ ${line2[3]} == NEW_DESKTOP ]] ; then
sed -i "s/${line2[1]} ${line2[2]} NEW_DESKTOP/${line2[1]} ${line2[2]} OLD_DESKTOP/" "$PW_DATABASE_PATH/database"
sed -i "s/${line2[1]} ${line2[2]} NEW_DESKTOP/${line2[1]} ${line2[2]} OLD_DESKTOP/" "$PORT_WINE_TMP_PATH/statistics"
PW_AMOUNT_NEW_DESKTOP+=($AMOUNT_GENERATE_BUTTONS)
else
PW_AMOUNT_OLD_DESKTOP+=($AMOUNT_GENERATE_BUTTONS)
......
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