From 7f55f1c8684beb610e2cfa93345cabdc1dd8d8b6 Mon Sep 17 00:00:00 2001 From: Marco Cawthorne Date: Tue, 18 Apr 2023 14:46:51 -0700 Subject: [PATCH] Client - Titles: add new function Titles_GetTextBody() to grab the body portion of a titles.txt entry --- src/client/titles.qc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/client/titles.qc b/src/client/titles.qc index 3295e6b0..058b0569 100644 --- a/src/client/titles.qc +++ b/src/client/titles.qc @@ -82,6 +82,25 @@ Titles_Shutdown(void) g_titles_count = 0; } +string +Titles_GetTextBody(string shortName) +{ + int foundID = -1i; + string compare = strtoupper(shortName); + + for (int i = 0; i < g_titles_count; i++) { + if (g_titles[i].m_strName == compare) { + foundID = i; + break; + } + } + + if (foundID >= 0) + return g_titles[foundID].m_strMessage; + + return compare; +} + void Titles_Init(void) {