From 1dcdb0f5d8fd350f7863842035e4c8842cd035ce Mon Sep 17 00:00:00 2001 From: Cerapter Date: Wed, 12 Dec 2018 18:54:50 +0100 Subject: [PATCH] Added defaults to the inline colouring system. --- text_file_functions.cpp | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/text_file_functions.cpp b/text_file_functions.cpp index ff40c9c..afe8fc3 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -268,12 +268,49 @@ QColor AOApplication::get_color(QString p_identifier, QString p_file) QColor AOApplication::get_chat_color(QString p_identifier, QString p_chat) { + QColor return_color(255, 255, 255); + + if (p_identifier == "_inline_grey") + { + return_color = QColor(187, 187, 187); + } + else + { + switch (p_identifier.toInt()) { + case 1: + return_color = QColor(0, 255, 0); + break; + case 2: + return_color = QColor(255, 0, 0); + break; + case 3: + return_color = QColor(255, 165, 0); + break; + case 4: + return_color = QColor(45, 150, 255); + break; + case 5: + return_color = QColor(255, 255, 0); + break; + case 7: + return_color = QColor(255, 192, 203); + break; + case 8: + return_color = QColor(0, 255, 255); + break; + case 0: + case 6: // 6 is rainbow. + default: + return_color = QColor(255, 255, 255); + break; + } + } + p_identifier = p_identifier.prepend("c"); QString design_ini_path = get_base_path() + "misc/" + p_chat + "/config.ini"; QString default_path = get_base_path() + "misc/default/config.ini"; QString f_result = read_design_ini(p_identifier, design_ini_path); - QColor return_color(255, 255, 255); if (f_result == "") { f_result = read_design_ini(p_identifier, default_path);