Skip to content
154 changes: 154 additions & 0 deletions Game.Assets/hl2/resource/ConsoleExtraItems.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
"ConsoleExtraItems"
{
"0"
{
"type" "Cvar"
"text" "Enable Developer Mode (Extra console prints)"
"cmd" "developer"
"value" "1"
}
"1"
{
"type" "Cvar"
"text" "Extra Developer Mode (Map I/O and others)"
"cmd" "developer"
"value" "3"
}
"2"
{
"type" "Separator"
}
"3"
{
"type" "Cvar"
"text" "Visualize GUI Layouts"
"cmd" "vgui_visualizelayout"
}
"4"
{
"type" "Cvar"
"text" "(Cheat) Show Hitboxes"
"cmd" "cl_showhitboxes"
}
"5"
{
"type" "Cvar"
"text" "Show Prediction Errors in Console"
"cmd" "cl_showerror"
"value" "2"
}
"6"
{
"type" "Cvar"
"text" "(Cheat) Show Active Sounds"
"cmd" "snd_show"
}
"7"
{
"type" "Cvar"
"text" "(Cheat) Log Sound Playback"
"cmd" "snd_showstart"
}
"8"
{
"type" "Cvar"
"text" "Show Network Graph with Extra Info"
"cmd" "net_graph"
}
"9"
{
"type" "Cvar"
"text" "Show Player Position and Velocity"
"cmd" "cl_showpos"
}
"10"
{
"type" "Cvar"
"text" "(Cheat) Show Particle Bounding Boxes"
"cmd" "cl_particle_show_bbox"
}
"11"
{
"type" "Cvar"
"text" "(Cheat) Show Collision Models"
"cmd" "vcollide_wireframe"
}
"12"
{
"type" "Separator"
}
"13"
{
"type" "Cvar"
"text" "Show Bullet Impacts"
"cmd" "sv_showimpacts"
}
"14"
{
"type" "Cvar"
"text" "Turn on sv_cheats"
"cmd" "sv_cheats"
}
"15"
{
"type" "Separator"
}
"16"
{
"type" "Command"
"text" "Open Color Correction UI"
"cmd" "colorcorrectionui"
}
"17"
{
"type" "Command"
"text" "Open Fog UI"
"cmd" "fogui"
}
"18"
{
"type" "Command"
"text" "Open Texture List UI"
"cmd" "+mat_texture_list"
}
"19"
{
"type" "Command"
"text" "Open Derma Icon Browser"
"cmd" "derma_icon_browser"
}
"20"
{
"type" "Separator"
}
"21"
{
"type" "Command"
"text" "Print Used Material List"
"cmd" "mat_showmaterials"
}
"22"
{
"type" "Command"
"text" "Print Used Texture List"
"cmd" "mat_showtextures"
}
"23"
{
"type" "Command"
"text" "Print Used Model List"
"cmd" ""
}
"24"
{
"type" "Command"
"text" "Print Stringtable Usage"
"cmd" ""
}
"25"
{
"type" "Command"
"text" "Print All Entity Classes on the Map"
"cmd" ""
}
}
8 changes: 3 additions & 5 deletions Game.Client/C_BasePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public virtual void PreThink() {
public bool IsInAVehicle() => Vehicle.Get() != null;
public virtual void SetAnimation(PlayerAnim playerAnim) { } // todo

public virtual Vector3 GetAutoaimVector(float scale){
public virtual Vector3 GetAutoaimVector(float scale) {
MathLib.AngleVectors(GetAbsAngles(), out Vector3 forward, out _, out _);
return forward;
}
Expand All @@ -126,7 +126,7 @@ public virtual void SetSuitUpdate(ReadOnlySpan<char> name, int fgroup, int noRep
[MethodImpl(MethodImplOptions.AggressiveInlining)] public void SetSuitUpdate(ReadOnlySpan<char> name, bool fgroup, int noRepeat) => SetSuitUpdate(name, fgroup ? 1 : 0, noRepeat);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public void SetSuitUpdate(ReadOnlySpan<char> name, int fgroup, bool noRepeat) => SetSuitUpdate(name, fgroup, noRepeat ? 1 : 0);
[MethodImpl(MethodImplOptions.AggressiveInlining)] public void SetSuitUpdate(ReadOnlySpan<char> name, bool fgroup, bool noRepeat) => SetSuitUpdate(name, fgroup ? 1 : 0, noRepeat ? 1 : 0);

public virtual void PostThink() {
if (IsAlive()) {
// Need to do this on the client to avoid prediction errors
Expand Down Expand Up @@ -180,9 +180,7 @@ public override void OnDataChanged(DataUpdateType updateType) {
if (pWeaponData == null || (pWeaponData.Flags & WeaponFlags.NoAmmoPickups) == 0) {
// We got more ammo for this ammo index. Add it to the ammo history
HudHistoryResource? pHudHR = GET_HUDELEMENT<HudHistoryResource>();
// if (pHudHR != null)
//pHudHR.AddToHistory(HISTSLOT_AMMO, i, abs(GetAmmoCount(i) - m_iOldAmmo[i]));

pHudHR?.AddToHistory(HRType.Ammo, i, Math.Abs(GetAmmoCount(i) - OldAmmo[i]));
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions Game.Client/HL2/HudPoisonDamageIdicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@

namespace Game.Client.HL2;

[DeclareHudElement(Name = "CHudPoisonDamageIndicator")]
// [DeclareHudElement(Name = "CHudPoisonDamageIndicator")] // FIXME: Animations
public class HudPoisonDamageIndicator : EditableHudElement, IHudElement
{
[PanelAnimationVar("TextFont", "Default", "Font")] protected IFont Font;
[PanelAnimationVar("TextFont", "Default", "HFont")] protected IFont Font;
[PanelAnimationVar("TextColor", "FgColor", "Color")] protected Color TextColor;
[PanelAnimationVar("text_xpos", "8", "proportional_float")] protected float TextXPos;
[PanelAnimationVar("text_ypos", "8", "proportional_float")] protected float TextYPos;
Expand Down
11 changes: 5 additions & 6 deletions Game.Client/HL2/HudSuitPower.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Game.Client.HL2;

[DeclareHudElement(Name = "CHudSuitPower")]
// [DeclareHudElement(Name = "CHudSuitPower")] // FIXME: Animations are not working here? just sits at the topleft of the screen :(
public class HudSuitPower : EditableHudElement, IHudElement
{
[PanelAnimationVar("AuxPowerColor", "255 0 0 255", "Color")] protected Color AuxPowerColor;
Expand All @@ -18,7 +18,7 @@ public class HudSuitPower : EditableHudElement, IHudElement
[PanelAnimationVarAliasType("BarHeight", "10", "proportional_float")] protected float BarHeight;
[PanelAnimationVarAliasType("BarChunkWidth", "10", "proportional_float")] protected float BarChunkWidth;
[PanelAnimationVarAliasType("BarChunkGap", "2", "proportional_float")] protected float BarChunkGap;
[PanelAnimationVar("TextFont", "Default", "Font")] protected IFont TextFont;
[PanelAnimationVar("TextFont", "Default", "HFont")] protected IFont TextFont;
[PanelAnimationVarAliasType("text_xpos", "8", "proportional_float")] protected float text_xpos;
[PanelAnimationVarAliasType("text_ypos", "20", "proportional_float")] protected float text_ypos;
[PanelAnimationVarAliasType("text2_xpos", "8", "proportional_float")] protected float text2_xpos;
Expand All @@ -31,9 +31,8 @@ public class HudSuitPower : EditableHudElement, IHudElement
const int SUIT_POWER_INIT = -1;

public HudSuitPower(string? panelName) : base(null, "HudSuitPower") {
var parent = clientMode.GetViewport();
SetParent(parent);

ElementName = panelName;
SetParent(clientMode.GetViewport());
((IHudElement)this).SetHiddenBits(HideHudBits.Health | HideHudBits.NeedSuit | HideHudBits.PlayerDead);
}

Expand All @@ -50,7 +49,7 @@ public bool ShouldDraw() {
if (player == null)
return false;

bool needsDraw = (player.HL2Local.SuitPower != SuitPower) || AuxPowerColor[3] > 0;
bool needsDraw = (player.HL2Local.SuitPower != SuitPower) || AuxPowerColor.A > 0;
return needsDraw && IHudElement.DefaultShouldDraw(this);
}

Expand Down
5 changes: 2 additions & 3 deletions Game.Client/HL2/HudWeaponSelection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
using Source.Common.MaterialSystem;
using Source.GUI.Controls;

using System.Security.Cryptography;

namespace Game.Client.HL2;

[DeclareHudElement(Name = "CHudWeaponSelection")]
Expand Down Expand Up @@ -90,7 +88,7 @@ public override void SetWeaponSelected() {

void OnWeaponPickup(BaseCombatWeapon weapon) {
HudHistoryResource? hr = gHUD.FindElement("CHudHistoryResource") as HudHistoryResource;
// hr?.AddToHistory(weapon);
hr?.AddToHistory(weapon);
}

public override void OnThink() {
Expand Down Expand Up @@ -174,6 +172,7 @@ void ActivateFastswitchWeaponDisplay(BaseCombatWeapon selectedWeapon) {
cWeapons++;
}
}

if (lastSelectedWeaponBox == -1)
LastWeapon = null;

Expand Down
2 changes: 1 addition & 1 deletion Game.Client/HUD/BaseTimer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Game.Client.HUD;

[DeclareHudElement(Name = "CHudBaseTimer")]
// [DeclareHudElement(Name = "CHudBaseTimer")]
class HudBaseTimer : HudNumericDisplay, IHudElement
{
int Minutes;
Expand Down
Loading