From 788a5dbcd5208fac3c69a1968048176975e3d57f Mon Sep 17 00:00:00 2001 From: M4RKUS28 Date: Tue, 3 Oct 2023 23:53:10 +0200 Subject: [PATCH] v6.3.3: new coloring for news mode --- src/parameterManager.h | 2 +- src/programManager.cpp | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/parameterManager.h b/src/parameterManager.h index b4927bd..e351931 100644 --- a/src/parameterManager.h +++ b/src/parameterManager.h @@ -24,7 +24,7 @@ #define UpdaterCloudUrlWithPath "https://cloud.obermui.de/s/tXz7SWdaPJ7TacZ/download?path=%2F&files=" #define SecondUpdaterCloudUrlWithPath "https://snew4.obermui.de/download?path=%2F&files=" -#define VERSION "6.3.1" +#define VERSION "6.3.3" #define DEFAULT_FILE_VERSION "2.5" diff --git a/src/programManager.cpp b/src/programManager.cpp index 67faa04..25b744a 100644 --- a/src/programManager.cpp +++ b/src/programManager.cpp @@ -1466,6 +1466,12 @@ int ProgramManager::newsModus(Settings *settings) std::string line; while (std::getline(strstream, line).good()) { + std::string lang; + if(settings->colorless) + lang= (line.find("German Flag") != std::string::npos) ? "GerDub" : (line.find("Deutsche Untertitel Flagge,") != std::string::npos) ? "GerSub" : "EngDub"; + else + lang= (line.find("German Flag") != std::string::npos) ? "\033[31mGerDub\033[0m" : (line.find("Deutsche Untertitel Flagge,") != std::string::npos) ? "\033[33mGerSub\033[0m" : "\033[96mEngDub\033[0m"; + size_t pos = line.find(""); size_t pos2 = line.find(""); if(pos == std::string::npos) { @@ -1496,9 +1502,13 @@ int ProgramManager::newsModus(Settings *settings) } std::string date = line.substr(pos + 7, pos2 - pos - 7); + + std::cout << " > " << ((settings->colorless) ? "" : "\033[97m") << date << ((settings->colorless) ? "" : "\033[0m") << ": " - << ((settings->colorless) ? "" : "\033[96m") << name << ((settings->colorless) ? "" : "\033[0m") << ": " - << ((settings->colorless) ? "" : "\033[92m") << id << ((settings->colorless) ? "" : "\033[0m") << std::endl; + << ((settings->colorless) ? "" : "\033[92m") << id << ((settings->colorless) ? "" : "\033[0m") << ":\t" + << ((settings->colorless) ? "" : "\033[34m") << lang << ((settings->colorless) ? "" : "\033[0m") << ":\t" + << ((settings->colorless) ? "" : "\033[1;34m") << name << ((settings->colorless) ? "" : "\033[0m") + << std::endl; } @@ -1877,7 +1887,7 @@ int ProgramManager::printPopularSeries(Settings *settings) std::cout << " > Serie: " << ((settings->colorless) ? "" : "\033[96m") << name << ((settings->colorless) ? "" : "\033[0m") << ": " - << ((settings->colorless) ? "" : "\033[92m") << "(" + replace(href,page.UrlDir, "") + ")" << ((settings->colorless) ? "" : "\033[0m") << std::endl; + << ((settings->colorless) ? "" : "\033[92m") << "(" + replace(href, page.UrlDir, "") + ")" << ((settings->colorless) ? "" : "\033[0m") << std::endl; }