From 43d25b5026ddd439c021e3471608362bc52ae14a Mon Sep 17 00:00:00 2001
From: Boria138 <boriabloger@protonmail.com>
Date: Thu, 1 Feb 2024 18:08:40 +0600
Subject: [PATCH] Added show_fps_limit if there are more than two limit values

---
 data_from_portwine/scripts/zen_yad_gui | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/data_from_portwine/scripts/zen_yad_gui b/data_from_portwine/scripts/zen_yad_gui
index 34630ddc..e2c97c6e 100755
--- a/data_from_portwine/scripts/zen_yad_gui
+++ b/data_from_portwine/scripts/zen_yad_gui
@@ -522,8 +522,8 @@ gui_MangoHud () {
 
     if [ -n "$PW_FPS_LIMIT" ]; then
         PW_FPS_LIMIT_VAR=($(echo "$PW_FPS_LIMIT" | tr '' '\n' | grep -v '='))
-   elif [ -n "$FPS_LIMIT" ] ; then
-   	PW_FPS_LIMIT_VAR=($(echo "$FPS_LIMIT" | tr '' '\n' | grep -v '='))
+    elif [ -n "$FPS_LIMIT" ] ; then
+        PW_FPS_LIMIT_VAR=($(echo "$FPS_LIMIT" | tr '' '\n' | grep -v '='))
     fi
 
     for add_list_mh in "${LIST_MH[@]}"; do
@@ -603,9 +603,13 @@ gui_MangoHud () {
     done
 
     GUI_MH_FPS_RESULT="${GUI_MH_FPS_RESULT}"
-    if [ "$(echo "${GUI_MH_FPS_RESULT}" | awk -F'+' '{print $2}')" ]
-    then export PW_FPS_LIMIT="0+${GUI_MH_FPS_RESULT%+}"
-    else export PW_FPS_LIMIT="${GUI_MH_FPS_RESULT%+}"
+    if [ "$(echo "${GUI_MH_FPS_RESULT}" | awk -F'+' '{print $2}')" ] ; then
+        export PW_FPS_LIMIT="0+${GUI_MH_FPS_RESULT%+}"
+        if [[ ! "${GUI_MH_RESULT}" =~ "show_fps_limit" ]] ; then
+            GUI_MH_RESULT="${GUI_MH_RESULT}show_fps_limit,"
+        fi
+    else
+        export PW_FPS_LIMIT="${GUI_MH_FPS_RESULT%+}"
     fi
 
     if [[ -n "$MH_FONT_SIZE" ]]