2019-12-03 23:28:28 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "zstring.h"
|
|
|
|
#include "gstrings.h"
|
|
|
|
// Reimplementation of the Duke quote string buffer.
|
|
|
|
// Needed because these strings need a level of abstraction from the engine to allow localization
|
|
|
|
// and because some of the quotes are really status messages that need to be shared between the different games.
|
|
|
|
// Also a good opportunity to consolidate the data buffers from Duke and Redneck frontends.
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
MAXQUOTES = 16384,
|
|
|
|
};
|
|
|
|
|
2020-02-23 13:03:03 +00:00
|
|
|
class FSerializer;
|
|
|
|
|
2019-12-03 23:28:28 +00:00
|
|
|
class Quotes
|
|
|
|
{
|
|
|
|
FString quotes[MAXQUOTES];
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2019-12-03 23:28:28 +00:00
|
|
|
void MakeStringLabel(FString "e);
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2019-12-03 23:28:28 +00:00
|
|
|
public:
|
|
|
|
|
|
|
|
void InitializeQuote(int num, const char *text, bool fromscript = false);
|
|
|
|
|
|
|
|
const char *GetQuote(int num)
|
|
|
|
{
|
|
|
|
return GStrings.localize(quotes[num]);
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2019-12-03 23:28:28 +00:00
|
|
|
const char *GetRawQuote(int num)
|
|
|
|
{
|
|
|
|
return quotes[num];
|
|
|
|
}
|
2021-12-30 09:30:21 +00:00
|
|
|
|
2019-12-03 23:28:28 +00:00
|
|
|
void CopyQuote(int dst, int src)
|
|
|
|
{
|
|
|
|
quotes[dst] = quotes[src];
|
|
|
|
}
|
|
|
|
|
|
|
|
void AppendQuote(int dst, int src, int len = -1);
|
|
|
|
void FormatQuote(int dst, const char* fmt, ...);
|
|
|
|
void Substitute(int num, const char* text, const char* replc);
|
2020-02-23 13:03:03 +00:00
|
|
|
void Serialize(FSerializer &arc);
|
2019-12-03 23:28:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern Quotes quoteMgr;
|