1.2 update w/ GZDoom 4.9 features:

- Changeable player skins.
 - Ammo LEDs are now 1:1 with UT by using canvas textures.
 - Integrate some add-ons, including reskins.
 - Various fixes (some backported from Demolitionist).
 - Migrated from libeye to Gutamatics.
This commit is contained in:
Marisa the Magician 2022-11-05 23:59:16 +01:00
commit 602a89cc68
1761 changed files with 4461 additions and 1597 deletions

View file

@ -55,6 +55,11 @@ Class UTHud : BaseStatusBar
double CurX, CurY;
double FracTic;
Weapon lastwep;
String ntagstr;
int ntagtic;
Color ntagcol;
override void Init()
{
Super.Init();
@ -179,7 +184,7 @@ Class UTHud : BaseStatusBar
{
Super.Draw(state,TicFrac);
HScale = Screen.GetWidth()/1280.;
switch ( CVar.GetCVar('flak_colorprefs',CPlayer).GetInt() )
switch ( flak_colorprefs )
{
case 0:
if ( CPlayer.GetTeam() >= Teams.Size() )
@ -190,26 +195,26 @@ Class UTHud : BaseStatusBar
tintcolor = CPlayer.GetColor();
break;
case 2:
tintcolor = Color(CVar.GetCVar('flak_colorcustom',CPlayer).GetString());
tintcolor = flak_colorcustom;
break;
}
opacity = CVar.GetCVar('flak_opacity',players[consoleplayer]).GetInt();
opacity = flak_opacity;
bgcolor = Color("Black");
showweapons = CVar.GetCVar('flak_showweapons',players[consoleplayer]).GetBool();
showstatus = CVar.GetCVar('flak_showstatus',players[consoleplayer]).GetBool();
showfrags = CVar.GetCVar('flak_showfrags',players[consoleplayer]).GetBool();
showammo = CVar.GetCVar('flak_showammo',players[consoleplayer]).GetBool();
showinfo = CVar.GetCVar('flak_showinfo',players[consoleplayer]).GetBool();
hudsize = CVar.GetCVar('flak_hudsize',players[consoleplayer]).GetFloat();
weaponsize = CVar.GetCVar('flak_weaponsize',players[consoleplayer]).GetFloat();
statussize = CVar.GetCVar('flak_statussize',players[consoleplayer]).GetFloat();
showweapons = flak_showweapons;
showstatus = flak_showstatus;
showfrags = flak_showfrags;
showammo = flak_showammo;
showinfo = flak_showinfo;
hudsize = flak_hudsize;
weaponsize = flak_weaponsize;
statussize = flak_statussize;
double lbottom = Screen.GetHeight();
if ( showweapons )
{
if ( weaponsize*hudsize>=1.0 ) lbottom -= 64*hudsize*HScale;
if ( showfrags ) lbottom -= 64*hudsize*HScale;
}
if ( (CPlayer.ReadyWeapon is 'UTWeapon') )
if ( CPlayer.ReadyWeapon is 'UTWeapon' )
UTWeapon(CPlayer.ReadyWeapon).PreRender(lbottom);
if ( (state == HUD_StatusBar) || (state == HUD_Fullscreen) )
{
@ -289,7 +294,7 @@ Class UTHud : BaseStatusBar
double flen = 3*step;
double len = digits.length()*step;
double alpha = clamp((opacity+7)/15.,0.0,1.0);
for ( int i=0; i<digits.length(); i++ ) if ( digits.ByteAt(i) == 0x31 ) len -= 0.5*step;
for ( uint i=0; i<digits.length(); i++ ) if ( digits.ByteAt(i) == 0x31 ) len -= 0.5*step;
CurX += (flen-len)*0.5;
if ( digits.ByteAt(0) == 0x31 ) CurX -= 0.5*step;
if ( value < 0 )
@ -298,7 +303,7 @@ Class UTHud : BaseStatusBar
Screen.DrawTexture(BigNum[11],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_LegacyRenderStyle,STYLE_AddShaded,DTA_FillColor,DrawColor);
CurX += step;
}
for ( int i=0; i<digits.length(); i++ )
for ( uint i=0; i<digits.length(); i++ )
{
if ( opacity+7 > 15 ) Screen.DrawTexture(BigNum[digits.ByteAt(i)-0x30],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_FillColor,bgcolor);
Screen.DrawTexture(BigNum[digits.ByteAt(i)-0x30],false,CurX/ss,CurY/ss,DTA_VirtualWidthF,dw,DTA_VirtualHeightF,dh,DTA_KeepRatio,true,DTA_Alpha,alpha,DTA_LegacyRenderStyle,STYLE_AddShaded,DTA_FillColor,DrawColor);
@ -856,22 +861,12 @@ Class UTHud : BaseStatusBar
}
}
private bool IsAutoTaunt( String str )
{
// checks if this critical message is pretending to be a chat msg
if ( str.IndexOf("\c*") == 0 ) return true;
return false;
}
private void SetChatFace( String str, bool isauto = false )
private void SetChatFace( String str )
{
Array<String> splitme;
str.Split(splitme,":");
if ( splitme.Size() < 2 ) return;
String pname = splitme[0];
// autotaunts have a leading chat color escape
if ( isauto && (pname.IndexOf("\c*") == 0) ) pname.Remove(0,2);
if ( pname.RightIndexOf("\c*") == pname.Length()-2 ) pname.Remove(pname.Length()-2,2);
// guess the player
int p = -1;
for ( int i=0; i<MAXPLAYERS; i++ )
@ -882,24 +877,33 @@ Class UTHud : BaseStatusBar
break;
}
if ( (p == -1) || !(players[p].mo is 'UTPlayer') ) return;
String path = "models/Boss";
String skin = "boss";
String face = "";
switch ( UTPlayer(players[p].mo).VoiceType )
{
case UTPlayer.VOICE_FemaleOne:
LastTalkFace = TexMan.CheckForTexture("Ivana",TexMan.Type_Any);
path = "models/FCommando";
skin = CVar.GetCVar('flak_fcmdskin',players[p]).GetString();
face = CVar.GetCVar('flak_fcmdface',players[p]).GetString();
break;
case UTPlayer.VOICE_FemaleTwo:
LastTalkFace = TexMan.CheckForTexture("Lauren",TexMan.Type_Any);
path = "models/SGirl";
skin = CVar.GetCVar('flak_armyskin',players[p]).GetString();
face = CVar.GetCVar('flak_armyface',players[p]).GetString();
break;
case UTPlayer.VOICE_MaleOne:
LastTalkFace = TexMan.CheckForTexture("Blake",TexMan.Type_Any);
path = "models/Commando";
skin = CVar.GetCVar('flak_cmdoskin',players[p]).GetString();
face = CVar.GetCVar('flak_cmdoface',players[p]).GetString();
break;
case UTPlayer.VOICE_MaleTwo:
LastTalkFace = TexMan.CheckForTexture("Brock",TexMan.Type_Any);
break;
case UTPlayer.VOICE_Boss:
LastTalkFace = TexMan.CheckForTexture("Xan",TexMan.Type_Any);
path = "models/Soldier";
skin = CVar.GetCVar('flak_sldrskin',players[p]).GetString();
face = CVar.GetCVar('flak_sldrface',players[p]).GetString();
break;
}
LastTalkFace = TexMan.CheckForTexture(String.Format("%s/%s5%s.png",path,skin,face),TexMan.Type_Any);
LastTalkTic = gametic+90;
}
@ -923,12 +927,6 @@ Class UTHud : BaseStatusBar
SetChatFace(outline);
return true;
}
else if ( IsAutoTaunt(outline) ) // autotaunts
{
AppendMessage(outline,Font.CR_GREEN);
SetChatFace(outline,true);
return true;
}
else // other messages
{
AppendMessage(outline,Font.CR_WHITE);
@ -1045,6 +1043,14 @@ Class UTHud : BaseStatusBar
CurY = Screen.GetHeight()-112*HScale;
Screen.DrawText(mUTFont40.mFont,Font.CR_WHITE,CurX/scl,CurY/scl,PickupMsg,DTA_VirtualWidthF,Screen.GetWidth()/scl,DTA_VirtualHeightF,Screen.GetHeight()/scl,DTA_KeepRatio,true,DTA_Alpha,clamp((PickupMsgTic-gametic+fractic)*0.1,0,1),DTA_LegacyRenderStyle,STYLE_Add);
}
// name tags
if ( ntagtic > gametic )
{
double scl = HScale/2.5;
CurX = (Screen.GetWidth()-mUTFont40.mFont.StringWidth(ntagstr)*scl)/2;
CurY = Screen.GetHeight()-88*HScale;
Screen.DrawText(mUTFont40.mFont,Font.CR_UNTRANSLATED,CurX/scl,CurY/scl,ntagstr,DTA_VirtualWidthF,Screen.GetWidth()/scl,DTA_VirtualHeightF,Screen.GetHeight()/scl,DTA_KeepRatio,true,DTA_Alpha,clamp((ntagtic-gametic+fractic)*0.1,0,1),DTA_LegacyRenderStyle,STYLE_AddShaded,DTA_FillColor,Color(255,ntagcol.r,ntagcol.g,ntagcol.b));
}
// talk face
CurX = 0;
CurY = 0;
@ -1086,8 +1092,9 @@ Class UTHud : BaseStatusBar
{
if ( CPlayer.mo.InvSel )
{
PickupMsg = CPlayer.mo.InvSel.GetTag();
PickupMsgTic = gametic+50;
ntagstr = CPlayer.mo.InvSel.GetTag();
ntagtic = gametic+70;
ntagcol = Color(255,255,255);
S_StartSound("misc/hud_sel",CHAN_BODY,CHANF_UI|CHANF_MAYBE_LOCAL);
}
}
@ -1101,6 +1108,23 @@ Class UTHud : BaseStatusBar
}
justselected = true;
}
// part of gross hackery to override nametag display
if ( CPlayer.PendingWeapon && (CPlayer.PendingWeapon != WP_NOCHANGE) && (CPlayer.PendingWeapon != lastwep) )
{
if ( (displaynametags&2) && (CPlayer == players[consoleplayer]) )
{
ntagstr = CPlayer.PendingWeapon.GetTag();
ntagtic = gametic+70;
ntagcol = (CPlayer.PendingWeapon is 'UTWeapon')?UTWeapon(CPlayer.PendingWeapon).NameColor:Color(255,255,255);
}
}
lastwep = CPlayer.PendingWeapon;
// make sure vanilla nametags don't display
DetachMessageID(0x5745504e); // WEPN
DetachMessageID(0x53494e56); // SINV
// also try with different endianness, just in case
DetachMessageID(0x4e504557); // WEPN
DetachMessageID(0x564e4953); // SINV
if ( deathmatch||teamplay )
{
if ( CPlayer.fragcount != lastfragcnt ) lastfrag = level.time;
@ -1112,7 +1136,7 @@ Class UTHud : BaseStatusBar
lastfragcnt = CPlayer.killcount;
}
vtracer.ignore = CPlayer.mo;
vtracer.trace(CPlayer.mo.Vec2OffsetZ(0,0,CPlayer.viewz),CPlayer.mo.CurSector,(cos(CPlayer.mo.angle)*cos(CPlayer.mo.pitch),sin(CPlayer.mo.angle)*cos(CPlayer.mo.pitch),-sin(CPlayer.mo.pitch)),1000,0);
vtracer.trace(CPlayer.mo.Vec2OffsetZ(0,0,CPlayer.viewz),CPlayer.mo.CurSector,dt_Utility.Vec3FromAngle(CPlayer.mo.angle,CPlayer.mo.pitch),1000,0);
if ( vtracer.Results.HitType != TRACE_HitActor ) return;
lastseen = vtracer.Results.HitActor;
lastseentic = level.time;
@ -1143,10 +1167,10 @@ Class UTHud : BaseStatusBar
int crdefault = Font.FindFontColor('UTHUDTextLight');
int highlight = Font.FindFontColor('UTHUDText');
HScale = Screen.GetWidth()/1280.;
showweapons = CVar.GetCVar('flak_showweapons',players[consoleplayer]).GetBool();
showstatus = CVar.GetCVar('flak_showstatus',players[consoleplayer]).GetBool();
weaponsize = CVar.GetCVar('flak_weaponsize',players[consoleplayer]).GetFloat();
statussize = CVar.GetCVar('flak_statussize',players[consoleplayer]).GetFloat();
showweapons = flak_showweapons;
showstatus = flak_showstatus;
weaponsize = flak_weaponsize;
statussize = flak_statussize;
double cbottom = Screen.GetHeight()*0.99;
let scale = GetHUDScale();
double textdist = 8./scale.Y;