Fixed MangoHud

This commit is contained in:
Boria138 2024-02-22 20:31:52 +06:00
parent 9bc78beae0
commit 3388c2479c
3 changed files with 18 additions and 18 deletions

@ -239,7 +239,6 @@ if [[ "${update_loc}" == "RUS" ]] ; then
export PW_MH_exec_name_INFO='Отображать текущее имя исполняемого файла'
export PW_MH_fcat_INFO='Позволяет анализировать захват кадра'
export PW_MH_fps_metrics_INFO='Принимает список десятичных значений или значение avg, например avg,0,001'
export PW_MH_fps_only_INFO='Показывать только FPS. <b>Не предназначен для использования с другими параметрами</b>'
export PW_MH_frame_count_INFO='Показывать FPS'
export PW_MH_full_INFO='Включите большинство переключаемых параметров (в настоящее время исключается гистограмма)'
export PW_MH_gamemode_INFO='Отображает активность gamemode'
@ -648,7 +647,6 @@ elif [[ "${update_loc}" == "ENG" ]] ; then
export PW_MH_exec_name_INFO='Display current exec name'
export PW_MH_fcat_INFO='Enables frame capture analysis'
export PW_MH_fps_metrics_INFO='Takes a list of decimal values or the value avg, e.g avg,0.001'
export PW_MH_fps_only_INFO='Show FPS only. <b>Not meant to be used with other display params</b>'
export PW_MH_frame_count_INFO='Display frame count'
export PW_MH_full_INFO='Enable most of the toggleable parameters (currently excludes histogram)'
export PW_MH_gamemode_INFO='Show if GameMode is on'

@ -793,8 +793,14 @@ export LSPCI_VGA="$(lspci -k | grep -E 'VGA|3D' | tr -d '\n')"
if command -v xrandr &>/dev/null ; then
try_remove_file "${PORT_WINE_TMP_PATH}/tmp_screen_configuration"
export PW_SCREEN_RESOLUTION="$(xrandr | sed -rn 's/^.*primary.* ([0-9]+x[0-9]+).*$/\1/p')"
export PW_SCREEN_PRIMARY="$(xrandr | grep "primary" | awk '{print $1}')"
if [[ $(xrandr | grep " connected" | wc -l) == "1" ]]; then
export PW_SCREEN_RESOLUTION="$(xrandr | sed -rn 's/^.* connected.* ([0-9]+x[0-9]+).*$/\1/p')"
export PW_SCREEN_PRIMARY="$(xrandr | grep " connected" | awk '{print $1}')"
else
export PW_SCREEN_RESOLUTION="$(xrandr | sed -rn 's/^.*primary.* ([0-9]+x[0-9]+).*$/\1/p')"
export PW_SCREEN_PRIMARY="$(xrandr | grep "primary" | awk '{print $1}')"
fi
print_var PW_SCREEN_RESOLUTION PW_SCREEN_PRIMARY
else
print_error "xrandr - not found!"

@ -570,7 +570,6 @@ gui_MangoHud () {
show_fps_limit swap temp_fahrenheit throttling_status throttling_status_graph
time version vkbasalt vram vulkan_driver wine
)
# fps_only
unset ADD_GUI_MH GUI_MH_RESULT
@ -582,10 +581,9 @@ gui_MangoHud () {
FPS_LIMIT_VAR="${FPS_LIMIT}"
fi
if [ -n "$MANGOHUD_CONFIG" ]; then
PW_MANGOHUD_CONFIG=($(echo "$MANGOHUD_CONFIG" | tr ',' '\n' | grep -v '='))
else
PW_MANGOHUD_CONFIG=($(echo "$DEFAULT_MANGOHUD_CONFIG" | tr ',' '\n' | grep -v '='))
if [ ! -z "${MANGOHUD_CONFIG}" ]
then PW_MANGOHUD_CONFIG=($(echo "$MANGOHUD_CONFIG" | tr ',' '\n' | grep -v '='))
else PW_MANGOHUD_CONFIG=($(echo "$DEFAULT_MANGOHUD_CONFIG" | tr ',' '\n' | grep -v '='))
fi
for add_list_mh in "${LIST_MH[@]}"; do
@ -636,10 +634,13 @@ gui_MangoHud () {
YAD_MH_SET=$(<"${PORT_WINE_TMP_PATH}/tmp_yad_mh_set")
FPS_LIMIT=$(cat "${PORT_WINE_TMP_PATH}/tmp_yad_mh_fps_limit" | awk '{print $1}')
if [[ ! -z "${PW_SCREEN_RESOLUTION}" ]]
then MONITOR_HEIGHT="$(echo $PW_SCREEN_RESOLUTION | awk -F'x' '{print $2}')"
fi
MONITOR_HEIGHT="$(echo $PW_SCREEN_RESOLUTION | awk -F'x' '{print $2}')"
MH_FONT_SIZE="font_size=$(( MONITOR_HEIGHT / 45 ))"
if [[ ! -z "${MONITOR_HEIGHT}" ]]
then MH_FONT_SIZE="font_size=$(( MONITOR_HEIGHT / 45 ))"
fi
export INT_COUNT_MH=0
for read_list_mh in ${YAD_MH_SET} ; do
@ -649,7 +650,7 @@ gui_MangoHud () {
((INT_COUNT_MH++))
done
if [[ -n "$MH_FONT_SIZE" ]]
if [[ ! -z "$MH_FONT_SIZE" ]]
then GUI_MH_RESULT="${GUI_MH_RESULT}${MH_FONT_SIZE}"
else GUI_MH_RESULT="${GUI_MH_RESULT%,}"
fi
@ -661,11 +662,6 @@ gui_MangoHud () {
then export GUI_MH_RESULT="$(echo ${GUI_MH_RESULT} | sed "s/,fps_limit=${FPS_LIMIT_VAR}//" | sed "s/,fps_limit=disabled//")"
fi
if [[ "${GUI_MH_RESULT}" =~ "fps_only" ]]; then
export GUI_MH_RESULT="fps_only"
print_info "In the MangoHud config fps_only is detected all settings are reseted"
fi
export MANGOHUD_CONFIG="${GUI_MH_RESULT}"
edit_db_from_gui MANGOHUD_CONFIG PW_MANGOHUD FPS_LIMIT