mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-01 09:41:58 +00:00
Update to ZDoom r2198:
- let players check MF2_NOTRANSLATE so that mods can create player classes which are not subject to default player color handling. - fixed: The ChexPlayer was missing default colorset definitions. - Final Doom needs its finale flats changed, too. - It's "BGCASTCALL", not "BOSSBACK". - Added BOOM/MBF BEX-style narrative background text substitution. There are two changes because of this: * A cluster's flat definition can now be preceded by a $ to do a string table lookup. * Since the standard flat names are now in the LANGUAGE lump, the normal Dehacked substitution for these is no longer handled specially and so will not be automatically disabled merely by providing your own MAPINFO. - Setting a Player.ColorRange now completely disables the translation rather than just making it an identity map. - Added support for the original games' player translations, including Hexen's table-based ones. - Fixed: CheckActorClass needed a NULL check. - Fixed: FFont::StringWidth() counted the ']' character of a named color escape sequence in its width calculation. - Fixed: FSinglePicFont should set the character size by the scaled size of the texture. - Fixed: snd_musicvolume needs to check GSnd for NULL, since somebody might have set an atexit for it, which gets executed after the sound system shuts down. - Fixed: FPlayList::Backup() failed to wrap around below entry 0 because Position is unsigned now. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@744 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
3a83e3ed57
commit
30c977090c
37 changed files with 490 additions and 109 deletions
111
src/m_menu.cpp
111
src/m_menu.cpp
|
@ -118,7 +118,7 @@ protected:
|
|||
|
||||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
|
||||
void R_GetPlayerTranslation (int color, FPlayerSkin *skin, FRemapTable *table);
|
||||
void R_GetPlayerTranslation (int color, const FPlayerColorSet *colorset, FPlayerSkin *skin, FRemapTable *table);
|
||||
|
||||
// PUBLIC FUNCTION PROTOTYPES ----------------------------------------------
|
||||
|
||||
|
@ -188,6 +188,7 @@ static void M_EditPlayerName (int choice);
|
|||
static void M_ChangePlayerTeam (int choice);
|
||||
static void M_PlayerNameChanged (FSaveGameNode *dummy);
|
||||
static void M_PlayerNameNotChanged ();
|
||||
static void M_ChangeColorSet (int choice);
|
||||
static void M_SlidePlayerRed (int choice);
|
||||
static void M_SlidePlayerGreen (int choice);
|
||||
static void M_SlidePlayerBlue (int choice);
|
||||
|
@ -269,6 +270,7 @@ static int PlayerSkin;
|
|||
static FState *PlayerState;
|
||||
static int PlayerTics;
|
||||
static int PlayerRotation;
|
||||
static TArray<int> PlayerColorSets;
|
||||
|
||||
static FTexture *SavePic;
|
||||
static FBrokenLines *SaveComment;
|
||||
|
@ -536,10 +538,11 @@ static oldmenuitem_t PlayerSetupMenu[] =
|
|||
{
|
||||
{ 1,0,'n',NULL,M_EditPlayerName, CR_UNTRANSLATED},
|
||||
{ 2,0,'t',NULL,M_ChangePlayerTeam, CR_UNTRANSLATED},
|
||||
{ 2,0,'c',NULL,M_ChangeColorSet, CR_UNTRANSLATED},
|
||||
{ 2,0,'r',NULL,M_SlidePlayerRed, CR_UNTRANSLATED},
|
||||
{ 2,0,'g',NULL,M_SlidePlayerGreen, CR_UNTRANSLATED},
|
||||
{ 2,0,'b',NULL,M_SlidePlayerBlue, CR_UNTRANSLATED},
|
||||
{ 2,0,'c',NULL,M_ChangeClass, CR_UNTRANSLATED},
|
||||
{ 2,0,'t',NULL,M_ChangeClass, CR_UNTRANSLATED},
|
||||
{ 2,0,'s',NULL,M_ChangeSkin, CR_UNTRANSLATED},
|
||||
{ 2,0,'e',NULL,M_ChangeGender, CR_UNTRANSLATED},
|
||||
{ 2,0,'a',NULL,M_ChangeAutoAim, CR_UNTRANSLATED}
|
||||
|
@ -2088,13 +2091,16 @@ void M_PlayerSetup (void)
|
|||
PlayerClass = &PlayerClasses[players[consoleplayer].CurrentPlayerClass];
|
||||
}
|
||||
PlayerSkin = players[consoleplayer].userinfo.skin;
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color,
|
||||
P_GetPlayerColorSet(PlayerClass->Type->TypeName, players[consoleplayer].userinfo.colorset),
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
PlayerState = GetDefaultByType (PlayerClass->Type)->SeeState;
|
||||
PlayerTics = PlayerState->GetTics();
|
||||
if (FireTexture == NULL)
|
||||
{
|
||||
FireTexture = new FBackdropTexture;
|
||||
}
|
||||
P_EnumPlayerColorSets(PlayerClass->Type->TypeName, &PlayerColorSets);
|
||||
}
|
||||
|
||||
static void M_PlayerSetupTicker (void)
|
||||
|
@ -2112,6 +2118,7 @@ static void M_PlayerSetupTicker (void)
|
|||
item = (MenuTime>>2) % (ClassMenuDef.numitems-1);
|
||||
|
||||
PlayerClass = &PlayerClasses[D_PlayerClassToInt (ClassMenuItems[item].name)];
|
||||
P_EnumPlayerColorSets(PlayerClass->Type->TypeName, &PlayerColorSets);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2125,6 +2132,7 @@ static void M_PlayerSetupTicker (void)
|
|||
|
||||
PlayerSkin = R_FindSkin (skins[PlayerSkin].name, int(PlayerClass - &PlayerClasses[0]));
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color,
|
||||
P_GetPlayerColorSet(PlayerClass->Type->TypeName, players[consoleplayer].userinfo.colorset),
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
}
|
||||
|
||||
|
@ -2280,19 +2288,27 @@ static void M_PlayerSetupDrawer ()
|
|||
DTA_Clean, true, TAG_DONE);
|
||||
}
|
||||
|
||||
// Draw player color sliders
|
||||
//V_DrawTextCleanMove (CR_GREY, PSetupDef.x, PSetupDef.y + LINEHEIGHT, "Color");
|
||||
// Draw player color selection and sliders
|
||||
FPlayerColorSet *colorset = P_GetPlayerColorSet(PlayerClass->Type->TypeName, players[consoleplayer].userinfo.colorset);
|
||||
x = SmallFont->StringWidth("Color") + 8 + PSetupDef.x;
|
||||
screen->DrawText(SmallFont, label, PSetupDef.x, PSetupDef.y + LINEHEIGHT*2+yo, "Color", DTA_Clean, true, TAG_DONE);
|
||||
screen->DrawText(SmallFont, value, x, PSetupDef.y + LINEHEIGHT*2+yo,
|
||||
colorset != NULL ? colorset->Name.GetChars() : "Custom", DTA_Clean, true, TAG_DONE);
|
||||
|
||||
screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + LINEHEIGHT*2+yo, "Red", DTA_Clean, true, TAG_DONE);
|
||||
screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + LINEHEIGHT*3+yo, "Green", DTA_Clean, true, TAG_DONE);
|
||||
screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + LINEHEIGHT*4+yo, "Blue", DTA_Clean, true, TAG_DONE);
|
||||
// Only show the sliders for a custom color set.
|
||||
if (colorset == NULL)
|
||||
{
|
||||
screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + int(LINEHEIGHT*2.875)+yo, "Red", DTA_Clean, true, TAG_DONE);
|
||||
screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + int(LINEHEIGHT*3.5)+yo, "Green", DTA_Clean, true, TAG_DONE);
|
||||
screen->DrawText (SmallFont, label, PSetupDef.x, PSetupDef.y + int(LINEHEIGHT*4.125)+yo, "Blue", DTA_Clean, true, TAG_DONE);
|
||||
|
||||
x = SmallFont->StringWidth ("Green") + 8 + PSetupDef.x;
|
||||
color = players[consoleplayer].userinfo.color;
|
||||
x = SmallFont->StringWidth ("Green") + 8 + PSetupDef.x;
|
||||
color = players[consoleplayer].userinfo.color;
|
||||
|
||||
M_DrawPlayerSlider (x, PSetupDef.y + LINEHEIGHT*2+yo, RPART(color));
|
||||
M_DrawPlayerSlider (x, PSetupDef.y + LINEHEIGHT*3+yo, GPART(color));
|
||||
M_DrawPlayerSlider (x, PSetupDef.y + LINEHEIGHT*4+yo, BPART(color));
|
||||
M_DrawPlayerSlider (x, PSetupDef.y + int(LINEHEIGHT*2.875)+yo, RPART(color));
|
||||
M_DrawPlayerSlider (x, PSetupDef.y + int(LINEHEIGHT*3.5)+yo, GPART(color));
|
||||
M_DrawPlayerSlider (x, PSetupDef.y + int(LINEHEIGHT*4.125)+yo, BPART(color));
|
||||
}
|
||||
|
||||
// [GRB] Draw class setting
|
||||
int pclass = players[consoleplayer].userinfo.PlayerClass;
|
||||
|
@ -2587,7 +2603,9 @@ static void M_ChangeSkin (int choice)
|
|||
PlayerSkin = (PlayerSkin < (int)numskins - 1) ? PlayerSkin + 1 : 0;
|
||||
} while (!PlayerClass->CheckSkin (PlayerSkin));
|
||||
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color, &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
R_GetPlayerTranslation (players[consoleplayer].userinfo.color,
|
||||
P_GetPlayerColorSet(PlayerClass->Type->TypeName, players[consoleplayer].userinfo.colorset),
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
|
||||
cvar_set ("skin", skins[PlayerSkin].name);
|
||||
}
|
||||
|
@ -2708,13 +2726,50 @@ static void M_ChangePlayerTeam (int choice)
|
|||
}
|
||||
}
|
||||
|
||||
static void M_ChangeColorSet (int choice)
|
||||
{
|
||||
int curpos = (int)PlayerColorSets.Size();
|
||||
int mycolorset = players[consoleplayer].userinfo.colorset;
|
||||
while (--curpos >= 0)
|
||||
{
|
||||
if (PlayerColorSets[curpos] == mycolorset)
|
||||
break;
|
||||
}
|
||||
if (choice == 0)
|
||||
{
|
||||
curpos--;
|
||||
}
|
||||
else
|
||||
{
|
||||
curpos++;
|
||||
}
|
||||
if (curpos < -1)
|
||||
{
|
||||
curpos = (int)PlayerColorSets.Size() - 1;
|
||||
}
|
||||
else if (curpos >= (int)PlayerColorSets.Size())
|
||||
{
|
||||
curpos = -1;
|
||||
}
|
||||
mycolorset = (curpos >= 0) ? PlayerColorSets[curpos] : -1;
|
||||
|
||||
char command[24];
|
||||
mysnprintf(command, countof(command), "colorset %d", mycolorset);
|
||||
C_DoCommand(command);
|
||||
R_GetPlayerTranslation(players[consoleplayer].userinfo.color,
|
||||
P_GetPlayerColorSet(PlayerClass->Type->TypeName, mycolorset),
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
}
|
||||
|
||||
static void SendNewColor (int red, int green, int blue)
|
||||
{
|
||||
char command[24];
|
||||
|
||||
mysnprintf (command, countof(command), "color \"%02x %02x %02x\"", red, green, blue);
|
||||
C_DoCommand (command);
|
||||
R_GetPlayerTranslation (MAKERGB (red, green, blue), &skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
R_GetPlayerTranslation(MAKERGB (red, green, blue),
|
||||
P_GetPlayerColorSet(PlayerClass->Type->TypeName, players[consoleplayer].userinfo.colorset),
|
||||
&skins[PlayerSkin], translationtables[TRANSLATION_Players][MAXPLAYERS]);
|
||||
}
|
||||
|
||||
static void M_SlidePlayerRed (int choice)
|
||||
|
@ -3646,8 +3701,31 @@ void M_Drawer ()
|
|||
// [RH] Use options menu cursor for the player setup menu.
|
||||
if (skullAnimCounter < 6)
|
||||
{
|
||||
double item;
|
||||
// The green slider is halfway between lines, and the red and
|
||||
// blue ones are offset slightly to make room for it.
|
||||
if (itemOn < 3)
|
||||
{
|
||||
item = itemOn;
|
||||
}
|
||||
else if (itemOn > 5)
|
||||
{
|
||||
item = itemOn - 1;
|
||||
}
|
||||
else if (itemOn == 3)
|
||||
{
|
||||
item = 2.875;
|
||||
}
|
||||
else if (itemOn == 4)
|
||||
{
|
||||
item = 3.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
item = 4.125;
|
||||
}
|
||||
screen->DrawText (ConFont, CR_RED, x - 16,
|
||||
currentMenu->y + itemOn*PLAYERSETUP_LINEHEIGHT +
|
||||
currentMenu->y + int(item*PLAYERSETUP_LINEHEIGHT) +
|
||||
(!(gameinfo.gametype & (GAME_DoomStrifeChex)) ? 6 : -1), "\xd",
|
||||
DTA_Clean, true, TAG_DONE);
|
||||
}
|
||||
|
@ -4037,4 +4115,5 @@ static void PickPlayerClass ()
|
|||
}
|
||||
|
||||
PlayerClass = &PlayerClasses[pclass];
|
||||
P_EnumPlayerColorSets(PlayerClass->Type->TypeName, &PlayerColorSets);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue