mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
Dialogue update (code side)
- Use menu font for speaker's name - Make the Z input in the top left of the box animate if the dialogue can be closed/go to the next page - Exempt certain sigils from punctuation delay that look awkward ( + and " )
This commit is contained in:
parent
2b515fa847
commit
969611753e
1 changed files with 14 additions and 4 deletions
|
|
@ -106,7 +106,8 @@ void Dialogue::Typewriter::WriteText(void)
|
|||
{
|
||||
textTimer += textSpeed;
|
||||
}
|
||||
else if (std::ispunct(c)
|
||||
else if (c != '+' && c != '"' // tutorial hack
|
||||
&& std::ispunct(c)
|
||||
&& std::isspace(nextc))
|
||||
{
|
||||
// slow down for punctuation
|
||||
|
|
@ -374,7 +375,7 @@ void Dialogue::Draw(void)
|
|||
|
||||
if (speakername && speaker[0])
|
||||
{
|
||||
INT32 speakernamewidth = V_StringWidth(speakername, 0);
|
||||
INT32 speakernamewidth = V_MenuStringWidth(speakername, 0);
|
||||
INT32 existingborder = (portrait == nullptr ? -4 : 3);
|
||||
|
||||
INT32 speakernamewidthoffset = (speakernamewidth + (arrowstep - existingborder) - 1) % arrowstep;
|
||||
|
|
@ -417,7 +418,7 @@ void Dialogue::Draw(void)
|
|||
|
||||
drawer
|
||||
.xy(speakernamewidthoffset + speakernameedge, -39-9)
|
||||
.font(srb2::Draw::Font::kConsole)
|
||||
.font(srb2::Draw::Font::kMenu)
|
||||
.text(speakername);
|
||||
|
||||
speakernameedge -= 5;
|
||||
|
|
@ -468,9 +469,18 @@ void Dialogue::Draw(void)
|
|||
.patch("TUTDIAG2");
|
||||
}
|
||||
|
||||
auto bt_translate_press = [this]() -> std::optional<bool>
|
||||
{
|
||||
if (Held())
|
||||
return true;
|
||||
if (TextDone())
|
||||
return {};
|
||||
return false;
|
||||
};
|
||||
|
||||
drawer
|
||||
.xy(17-14 - BASEVIDWIDTH, -39-16)
|
||||
.button(srb2::Draw::Button::z, Held());
|
||||
.button(srb2::Draw::Button::z, bt_translate_press());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue