mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 19:01:50 +00:00
srb2::Dialogue::NewText: use string parsing
This commit is contained in:
parent
cef3b6d841
commit
ae04a9be27
2 changed files with 4 additions and 3 deletions
|
|
@ -218,7 +218,7 @@ void Dialogue::SetSpeaker(std::string name, patch_t *patch, UINT8 *colormap, sfx
|
||||||
typewriter.voiceSfx = voice;
|
typewriter.voiceSfx = voice;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Dialogue::NewText(std::string rawText)
|
void Dialogue::NewText(std::string_view rawText)
|
||||||
{
|
{
|
||||||
Init();
|
Init();
|
||||||
|
|
||||||
|
|
@ -226,7 +226,7 @@ void Dialogue::NewText(std::string rawText)
|
||||||
290 << FRACBITS,
|
290 << FRACBITS,
|
||||||
FRACUNIT, FRACUNIT, FRACUNIT,
|
FRACUNIT, FRACUNIT, FRACUNIT,
|
||||||
0, HU_FONT,
|
0, HU_FONT,
|
||||||
rawText.c_str()
|
srb2::Draw::TextElement().parse(rawText).string().c_str() // parse special characters
|
||||||
);
|
);
|
||||||
|
|
||||||
typewriter.NewText(newText);
|
typewriter.NewText(newText);
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
#define __K_DIALOGUE_HPP__
|
#define __K_DIALOGUE_HPP__
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
|
|
@ -34,7 +35,7 @@ public:
|
||||||
void SetSpeaker(std::string skinName, int portraitID);
|
void SetSpeaker(std::string skinName, int portraitID);
|
||||||
void SetSpeaker(std::string name, patch_t *patch, UINT8 *colormap, sfxenum_t voice);
|
void SetSpeaker(std::string name, patch_t *patch, UINT8 *colormap, sfxenum_t voice);
|
||||||
|
|
||||||
void NewText(std::string newText);
|
void NewText(std::string_view newText);
|
||||||
|
|
||||||
bool Active(void);
|
bool Active(void);
|
||||||
bool TextDone(void);
|
bool TextDone(void);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue