mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Merge branch 'dialogue-pass' into 'master'
Dialogue pass (code side) See merge request KartKrew/Kart!2126
This commit is contained in:
commit
aff5cc05ac
3 changed files with 20 additions and 10 deletions
|
|
@ -106,7 +106,8 @@ void Dialogue::Typewriter::WriteText(void)
|
||||||
{
|
{
|
||||||
textTimer += textSpeed;
|
textTimer += textSpeed;
|
||||||
}
|
}
|
||||||
else if (std::ispunct(c)
|
else if (c != '+' && c != '"' // tutorial hack
|
||||||
|
&& std::ispunct(c)
|
||||||
&& std::isspace(nextc))
|
&& std::isspace(nextc))
|
||||||
{
|
{
|
||||||
// slow down for punctuation
|
// slow down for punctuation
|
||||||
|
|
@ -330,7 +331,7 @@ void Dialogue::Draw(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const UINT8 bgcol = 1, darkcol = 235;
|
const UINT8 bgcol = 235, speakerhilicol = 240;
|
||||||
|
|
||||||
const fixed_t height = 78 * FRACUNIT;
|
const fixed_t height = 78 * FRACUNIT;
|
||||||
|
|
||||||
|
|
@ -343,7 +344,7 @@ void Dialogue::Draw(void)
|
||||||
|
|
||||||
// TODO -- hack, change when dialogue is made per-player/netsynced
|
// TODO -- hack, change when dialogue is made per-player/netsynced
|
||||||
UINT32 speakerbgflags = (players[consoleplayer].nocontrol == 0 && P_LevelIsFrozen() == false)
|
UINT32 speakerbgflags = (players[consoleplayer].nocontrol == 0 && P_LevelIsFrozen() == false)
|
||||||
? (V_ADD|V_30TRANS)
|
? V_30TRANS
|
||||||
: 0;
|
: 0;
|
||||||
|
|
||||||
drawer
|
drawer
|
||||||
|
|
@ -374,10 +375,10 @@ void Dialogue::Draw(void)
|
||||||
|
|
||||||
if (speakername && speaker[0])
|
if (speakername && speaker[0])
|
||||||
{
|
{
|
||||||
INT32 speakernamewidth = V_StringWidth(speakername, 0);
|
INT32 speakernamewidth = V_MenuStringWidth(speakername, 0);
|
||||||
INT32 existingborder = (portrait == nullptr ? -4 : 3);
|
INT32 existingborder = (portrait == nullptr ? -4 : 3);
|
||||||
|
|
||||||
INT32 speakernamewidthoffset = (speakernamewidth + (arrowstep - existingborder) - 1) % arrowstep;
|
INT32 speakernamewidthoffset = (speakernamewidth + (arrowstep - existingborder) - 2) % arrowstep;
|
||||||
if (speakernamewidthoffset)
|
if (speakernamewidthoffset)
|
||||||
{
|
{
|
||||||
speakernamewidthoffset = (arrowstep - speakernamewidthoffset);
|
speakernamewidthoffset = (arrowstep - speakernamewidthoffset);
|
||||||
|
|
@ -410,14 +411,14 @@ void Dialogue::Draw(void)
|
||||||
.width(speakernamewidth - existingborder)
|
.width(speakernamewidth - existingborder)
|
||||||
.y(-38-11)
|
.y(-38-11)
|
||||||
.height(11)
|
.height(11)
|
||||||
.fill(darkcol);
|
.fill(speakerhilicol);
|
||||||
}
|
}
|
||||||
|
|
||||||
speakernameedge -= speakernamewidth;
|
speakernameedge -= speakernamewidth;
|
||||||
|
|
||||||
drawer
|
drawer
|
||||||
.xy(speakernamewidthoffset + speakernameedge, -39-9)
|
.xy(speakernamewidthoffset + speakernameedge, -39-9)
|
||||||
.font(srb2::Draw::Font::kConsole)
|
.font(srb2::Draw::Font::kMenu)
|
||||||
.text(speakername);
|
.text(speakername);
|
||||||
|
|
||||||
speakernameedge -= 5;
|
speakernameedge -= 5;
|
||||||
|
|
@ -468,9 +469,18 @@ void Dialogue::Draw(void)
|
||||||
.patch("TUTDIAG2");
|
.patch("TUTDIAG2");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto bt_translate_press = [this]() -> std::optional<bool>
|
||||||
|
{
|
||||||
|
if (Held())
|
||||||
|
return true;
|
||||||
|
if (TextDone())
|
||||||
|
return {};
|
||||||
|
return false;
|
||||||
|
};
|
||||||
|
|
||||||
drawer
|
drawer
|
||||||
.xy(17-14 - BASEVIDWIDTH, -39-16)
|
.xy(17-14 - BASEVIDWIDTH, -39-16)
|
||||||
.button(srb2::Draw::Button::z, Held());
|
.button(srb2::Draw::Button::z, bt_translate_press());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ menuitem_t OPTIONS_ProfileControls[] = {
|
||||||
{IT_CONTROL, "Look back", "Look backwards / Go back",
|
{IT_CONTROL, "Look back", "Look backwards / Go back",
|
||||||
"TLB_B", {.routine = M_ProfileSetControl}, gc_b, 0},
|
"TLB_B", {.routine = M_ProfileSetControl}, gc_b, 0},
|
||||||
|
|
||||||
{IT_CONTROL, "Spindash", "Spindash / Extra",
|
{IT_CONTROL, "Spin Dash", "Spin Dash / Extra",
|
||||||
"TLB_C", {.routine = M_ProfileSetControl}, gc_c, 0},
|
"TLB_C", {.routine = M_ProfileSetControl}, gc_c, 0},
|
||||||
|
|
||||||
{IT_CONTROL, "Brake / Go back", "Brake / Go back",
|
{IT_CONTROL, "Brake / Go back", "Brake / Go back",
|
||||||
|
|
|
||||||
|
|
@ -12316,7 +12316,7 @@ void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing)
|
||||||
mobj->angle = p->drawangle = angle;
|
mobj->angle = p->drawangle = angle;
|
||||||
|
|
||||||
// FAULT
|
// FAULT
|
||||||
if (gamestate == GS_LEVEL && leveltime > introtime && !p->spectator)
|
if (gamestate == GS_LEVEL && leveltime > introtime && !p->spectator && gametype != GT_TUTORIAL)
|
||||||
{
|
{
|
||||||
K_DoIngameRespawn(p);
|
K_DoIngameRespawn(p);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue