mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-02-07 08:21:04 +00:00
- Fixed: When the player setup menu cycles the random players, it needs to rebuild the translation for each one.
SVN r3657 (trunk)
This commit is contained in:
parent
6d993b8c04
commit
71e02e2d9e
5 changed files with 28 additions and 5 deletions
|
@ -346,6 +346,7 @@ class FListMenuItemPlayerDisplay : public FListMenuItem
|
||||||
void SetPlayerClass(int classnum, bool force = false);
|
void SetPlayerClass(int classnum, bool force = false);
|
||||||
bool UpdatePlayerClass();
|
bool UpdatePlayerClass();
|
||||||
void UpdateRandomClass();
|
void UpdateRandomClass();
|
||||||
|
void UpdateTranslation();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@
|
||||||
#include "gi.h"
|
#include "gi.h"
|
||||||
#include "r_defs.h"
|
#include "r_defs.h"
|
||||||
#include "r_state.h"
|
#include "r_state.h"
|
||||||
|
#include "r_data/r_translate.h"
|
||||||
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
|
@ -386,9 +387,33 @@ void FListMenuItemPlayerDisplay::UpdateRandomClass()
|
||||||
mPlayerState = GetDefaultByType (mPlayerClass->Type)->SeeState;
|
mPlayerState = GetDefaultByType (mPlayerClass->Type)->SeeState;
|
||||||
mPlayerTics = mPlayerState->GetTics();
|
mPlayerTics = mPlayerState->GetTics();
|
||||||
mRandomTimer = 6;
|
mRandomTimer = 6;
|
||||||
|
|
||||||
|
// Since the newly displayed class may used a different translation
|
||||||
|
// range than the old one, we need to update the translation, too.
|
||||||
|
UpdateTranslation();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=============================================================================
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//
|
||||||
|
//=============================================================================
|
||||||
|
|
||||||
|
void FListMenuItemPlayerDisplay::UpdateTranslation()
|
||||||
|
{
|
||||||
|
int PlayerColor = players[consoleplayer].userinfo.color;
|
||||||
|
int PlayerSkin = players[consoleplayer].userinfo.skin;
|
||||||
|
int PlayerColorset = players[consoleplayer].userinfo.colorset;
|
||||||
|
|
||||||
|
if (mPlayerClass != NULL)
|
||||||
|
{
|
||||||
|
PlayerSkin = R_FindSkin (skins[PlayerSkin].name, int(mPlayerClass - &PlayerClasses[0]));
|
||||||
|
R_GetPlayerTranslation(PlayerColor,
|
||||||
|
P_GetPlayerColorSet(mPlayerClass->Type->TypeName, PlayerColorset),
|
||||||
|
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
|
|
|
@ -55,8 +55,6 @@ EXTERN_CVAR (Float, autoaim)
|
||||||
EXTERN_CVAR(Bool, neverswitchonpickup)
|
EXTERN_CVAR(Bool, neverswitchonpickup)
|
||||||
EXTERN_CVAR (Bool, cl_run)
|
EXTERN_CVAR (Bool, cl_run)
|
||||||
|
|
||||||
void R_GetPlayerTranslation (int color, const FPlayerColorSet *colorset, FPlayerSkin *skin, FRemapTable *table);
|
|
||||||
|
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
//
|
//
|
||||||
// Player's name
|
// Player's name
|
||||||
|
|
|
@ -1117,4 +1117,3 @@ void R_GetPlayerTranslation (int color, const FPlayerColorSet *colorset, FPlayer
|
||||||
|
|
||||||
R_CreatePlayerTranslation (h, s, v, colorset, skin, table, NULL);
|
R_CreatePlayerTranslation (h, s, v, colorset, skin, table, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -98,8 +98,8 @@ FRemapTable *TranslationToTable(int translation);
|
||||||
void R_InitTranslationTables (void);
|
void R_InitTranslationTables (void);
|
||||||
void R_DeinitTranslationTables();
|
void R_DeinitTranslationTables();
|
||||||
|
|
||||||
// [RH] Actually create a player's translation table.
|
void R_BuildPlayerTranslation (int player); // [RH] Actually create a player's translation table.
|
||||||
void R_BuildPlayerTranslation (int player);
|
void R_GetPlayerTranslation (int color, const struct FPlayerColorSet *colorset, class FPlayerSkin *skin, struct FRemapTable *table);
|
||||||
|
|
||||||
extern const BYTE IcePalette[16][3];
|
extern const BYTE IcePalette[16][3];
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue