From db8dcd356b6d5534a73aa1197ccc50a485a490c0 Mon Sep 17 00:00:00 2001
From: XargonWan <xargonwan@gmail.com>
Date: Fri, 3 Nov 2023 16:31:56 +0100
Subject: [PATCH] Updated ES-DE to 2.2.0 (tentative)

---
 net.retrodeck.retrodeck.yml                   |  2 +-
 .../es-de/GuiThemeDownloader.cpp.patch        | 10 ++++++++
 rd-submodules/es-de/patch_helper.sh           | 24 +++++++++++--------
 3 files changed, 25 insertions(+), 11 deletions(-)
 create mode 100644 rd-submodules/es-de/GuiThemeDownloader.cpp.patch

diff --git a/net.retrodeck.retrodeck.yml b/net.retrodeck.retrodeck.yml
index 1657d62a..261a5535 100644
--- a/net.retrodeck.retrodeck.yml
+++ b/net.retrodeck.retrodeck.yml
@@ -376,7 +376,7 @@ modules:
     sources:
       - type: git
         url: https://gitlab.com/es-de/emulationstation-de
-        branch: 2055b30836476f7cbdde9d94e43e451487537962
+        branch: dfaf8ef8cf9a2dd9350bf8bc0bbc94366c9fd168
       - type: shell
         commands:
           - sed -i 's#"EMULATIONSTATION-DE  V" + Utils::String::toUpper(PROGRAM_VERSION_STRING)#"RetroDECK
diff --git a/rd-submodules/es-de/GuiThemeDownloader.cpp.patch b/rd-submodules/es-de/GuiThemeDownloader.cpp.patch
new file mode 100644
index 00000000..8dd35293
--- /dev/null
+++ b/rd-submodules/es-de/GuiThemeDownloader.cpp.patch
@@ -0,0 +1,10 @@
+diff -au1r emulationstation-de/es-app/src/guis/GuiThemeDownloader.cpp emulationstation-de/es-app/src/guis/GuiThemeDownloader.cpp
+--- emulationstation-de/es-app/src/guis/GuiThemeDownloader.cpp	2023-11-03 16:25:01.115126901 +0100
++++ emulationstation-de/es-app/src/guis/GuiThemeDownloader.cpp	2023-11-03 16:26:18.882607724 +0100
+@@ -602,4 +602,4 @@
+                 getHelpStyle(),
+-                "IT SEEMS AS IF YOU'RE NOT RUNNING THE LATEST ES-DE RELEASE, PLEASE UPGRADE BEFORE "
+-                "PROCEEDING AS THESE THEMES MAY NOT BE COMPATIBLE WITH YOUR VERSION",
++                "ES-DE THEME ENGINE WAS UPDATED UPSTREAM. THESE THEMES MAY NOT BE COMPATIBLE WITH THE CURRENT RETRODECK VERSION."
++                "CHECK IF A NEW RETRODECK UPDATE IS AVAILABLE, ELSE PLEASE WAIT FOR IT OR PROCEED AT YOUR OWN RISK.",
+                 "OK", [] { return; }, "", nullptr, "", nullptr, nullptr, true));
diff --git a/rd-submodules/es-de/patch_helper.sh b/rd-submodules/es-de/patch_helper.sh
index abdc2189..27923b97 100755
--- a/rd-submodules/es-de/patch_helper.sh
+++ b/rd-submodules/es-de/patch_helper.sh
@@ -2,7 +2,7 @@
 
 mkdir /tmp
 
-branch="2de8282f6a5feaf86424b1175154c5fc2585f70a"
+branch="00a226062fff37209d98e0ab048ac89af50ecacc"
 git clone "https://gitlab.com/es-de/emulationstation-de.git" /tmp/emulationstation-de
 
 pushd .
@@ -12,16 +12,20 @@ popd
 
 mkdir patches-tmp
 
-cp /tmp/emulationstation-de/es-app/src/guis/GuiMenu.cpp         ./patches-tmp
-cp /tmp/emulationstation-de/es-app/src/guis/GuiMenu.h           ./patches-tmp
-cp /tmp/emulationstation-de/es-app/src/views/ViewController.cpp ./patches-tmp
-cp /tmp/emulationstation-de/es-core/src/Window.cpp              ./patches-tmp
+cp /tmp/emulationstation-de/es-app/src/guis/GuiMenu.cpp             ./patches-tmp
+cp /tmp/emulationstation-de/es-app/src/guis/GuiMenu.h               ./patches-tmp
+cp /tmp/emulationstation-de/es-app/src/views/ViewController.cpp     ./patches-tmp
+cp /tmp/emulationstation-de/es-core/src/Window.cpp                  ./patches-tmp
+cp /tmp/emulationstation-de/es-app/src/guis/GuiThemeDownloader.cpp  ./patches-tmp
 
 read -p "Please edit the files in \"patches-tmp\" and press enter to continue."
 
-diff -au1r /tmp/emulationstation-de/es-app/src/guis/GuiMenu.cpp         ./patches-tmp/GuiMenu.cpp           > GuiMenu.cpp.patch
-diff -au1r /tmp/emulationstation-de/es-app/src/guis/GuiMenu.h           ./patches-tmp/GuiMenu.h             > GuiMenu.h.patch 
-diff -au1r /tmp/emulationstation-de/es-app/src/views/ViewController.cpp ./patches-tmp/ViewController.cpp    > ViewController.cpp.patch            
-diff -au1r /tmp/emulationstation-de/es-core/src/Window.cpp              ./patches-tmp/Window.cpp            > Window.cpp.patch
+diff -au1r /tmp/emulationstation-de/es-app/src/guis/GuiMenu.cpp             ./patches-tmp/GuiMenu.cpp               > GuiMenu.cpp.patch
+diff -au1r /tmp/emulationstation-de/es-app/src/guis/GuiMenu.h               ./patches-tmp/GuiMenu.h                 > GuiMenu.h.patch 
+diff -au1r /tmp/emulationstation-de/es-app/src/views/ViewController.cpp     ./patches-tmp/ViewController.cpp        > ViewController.cpp.patch            
+diff -au1r /tmp/emulationstation-de/es-core/src/Window.cpp                  ./patches-tmp/Window.cpp                > Window.cpp.patch
+diff -au1r /tmp/emulationstation-de/es-app/src/guis/GuiThemeDownloader.cpp  ./patches-tmp/GuiThemeDownloader.cpp    > GuiThemeDownloader.cpp.patch
 
-rm -rf patches-tmp
\ No newline at end of file
+rm -rf patches-tmp
+
+echo "Done, now please remeber to edit the headers of the patch files with the correct paths."
\ No newline at end of file