mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-23 16:32:36 +00:00
Small improvements to Dialogue internals
- Guarantee not-visible dialogue on map transition/invalidation - Don't grab a portrait for skins that don't have portraits
This commit is contained in:
parent
4c284680ff
commit
42f37e7ded
1 changed files with 11 additions and 5 deletions
|
|
@ -70,14 +70,19 @@ void Dialogue::SetSpeaker(std::string skinName, int portraitID)
|
||||||
if (sprdef->numframes > 0)
|
if (sprdef->numframes > 0)
|
||||||
{
|
{
|
||||||
portraitID %= sprdef->numframes;
|
portraitID %= sprdef->numframes;
|
||||||
}
|
|
||||||
|
|
||||||
const spriteframe_t *sprframe = &sprdef->spriteframes[portraitID];
|
const spriteframe_t *sprframe = &sprdef->spriteframes[portraitID];
|
||||||
|
|
||||||
speaker = skin->realname;
|
|
||||||
|
|
||||||
portrait = static_cast<patch_t *>( W_CachePatchNum(sprframe->lumppat[0], PU_CACHE) );
|
portrait = static_cast<patch_t *>( W_CachePatchNum(sprframe->lumppat[0], PU_CACHE) );
|
||||||
portraitColormap = R_GetTranslationColormap(skinID, static_cast<skincolornum_t>(skin->prefcolor), GTC_CACHE);
|
portraitColormap = R_GetTranslationColormap(skinID, static_cast<skincolornum_t>(skin->prefcolor), GTC_CACHE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
portrait = nullptr;
|
||||||
|
portraitColormap = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
speaker = skin->realname;
|
||||||
|
|
||||||
voiceSfx = skin->soundsid[ S_sfx[sfx_ktalk].skinsound ];
|
voiceSfx = skin->soundsid[ S_sfx[sfx_ktalk].skinsound ];
|
||||||
}
|
}
|
||||||
|
|
@ -333,6 +338,7 @@ void Dialogue::Unset(void)
|
||||||
{
|
{
|
||||||
Dismiss();
|
Dismiss();
|
||||||
SetSpeaker();
|
SetSpeaker();
|
||||||
|
slide = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue