diff --git a/ClassicalSharp/2D/Screens/Menu/GraphicsOptionsScreen.cs b/ClassicalSharp/2D/Screens/Menu/GraphicsOptionsScreen.cs index e6775dd45..54440c83b 100644 --- a/ClassicalSharp/2D/Screens/Menu/GraphicsOptionsScreen.cs +++ b/ClassicalSharp/2D/Screens/Menu/GraphicsOptionsScreen.cs @@ -106,6 +106,7 @@ namespace ClassicalSharp.Gui.Screens { "&cNote: &eSmooth lighting is still experimental and can heavily reduce performance.", }; descriptions[3] = new string[] { + "&eNone: &fNo names of players are drawn.", "&eHovered: &fName of the targeted player is drawn see-through.", "&eAll: &fNames of all other players are drawn normally.", "&eAllHovered: &fAll names of players are drawn see-through.", diff --git a/ClassicalSharp/Entities/EntityList.cs b/ClassicalSharp/Entities/EntityList.cs index 4450bc107..5b762da74 100644 --- a/ClassicalSharp/Entities/EntityList.cs +++ b/ClassicalSharp/Entities/EntityList.cs @@ -7,7 +7,7 @@ using ClassicalSharp.Physics; namespace ClassicalSharp.Entities { - public enum NameMode { Hovered, All, AllHovered, AllUnscaled } + public enum NameMode { None, Hovered, All, AllHovered, AllUnscaled } public enum EntityShadow { None, SnapToBlock, Circle, CircleAll, } @@ -62,6 +62,7 @@ namespace ClassicalSharp.Entities { /// If ShowHoveredNames is false, this method only renders names of entities that are /// not currently being looked at by the user. public void RenderNames(IGraphicsApi gfx, double delta) { + if (NamesMode == NameMode.None) return; closestId = GetClosetPlayer(game.LocalPlayer); if (!game.LocalPlayer.Hacks.CanSeeAllNames || NamesMode != NameMode.All) return; @@ -83,6 +84,7 @@ namespace ClassicalSharp.Entities { } public void RenderHoveredNames(IGraphicsApi gfx, double delta) { + if (NamesMode == NameMode.None) return; gfx.Texturing = true; gfx.AlphaTest = true; gfx.DepthTest = false; diff --git a/src/Client/Entity.c b/src/Client/Entity.c index d2deaf4e0..8574f73b0 100644 --- a/src/Client/Entity.c +++ b/src/Client/Entity.c @@ -13,7 +13,7 @@ #include "Intersection.h" #include "Lighting.h" -const UInt8* NameMode_Names[4] = { "Hovered", "All", "AllHovered", "AllUnscaled" }; +const UInt8* NameMode_Names[5] = { "None", "Hovered", "All", "AllHovered", "AllUnscaled" }; const UInt8* ShadowMode_Names[4] = { "None", "SnapToBlock", "Circle", "CircleAll" }; Real32 LocationUpdate_Clamp(Real32 degrees) { @@ -237,6 +237,7 @@ void Entities_RenderModels(Real64 delta, Real32 t) { void Entities_RenderNames(Real64 delta) { + if (Entities_NameMode == NAME_MODE_NONE) return; LocalPlayer* p = &LocalPlayer_Instance; closestId = Entities_GetCloset(&p->Base.Base); if (!p->Hacks.CanSeeAllNames || Entities_NameMode != NAME_MODE_ALL) return; @@ -260,6 +261,7 @@ void Entities_RenderNames(Real64 delta) { } void Entities_RenderHoveredNames(Real64 delta) { + if (Entities_NameMode == NAME_MODE_NONE) return; LocalPlayer* p = &LocalPlayer_Instance; bool allNames = !(Entities_NameMode == NAME_MODE_HOVERED || Entities_NameMode == NAME_MODE_ALL) && p->Hacks.CanSeeAllNames; diff --git a/src/Client/Entity.h b/src/Client/Entity.h index 1e653ca84..8882eb38e 100644 --- a/src/Client/Entity.h +++ b/src/Client/Entity.h @@ -22,11 +22,12 @@ typedef struct IModel_ IModel; /* Forward declaration */ #define ENTITIES_SELF_ID 255 UInt32 Entities_NameMode; -#define NAME_MODE_HOVERED 0 -#define NAME_MODE_ALL 1 -#define NAME_MODE_ALL_HOVERED 2 -#define NAME_MODE_ALL_UNSCALED 3 -extern const UInt8* NameMode_Names[4]; +#define NAME_MODE_NONE 0 +#define NAME_MODE_HOVERED 1 +#define NAME_MODE_ALL 2 +#define NAME_MODE_ALL_HOVERED 3 +#define NAME_MODE_ALL_UNSCALED 4 +extern const UInt8* NameMode_Names[5]; UInt32 Entities_ShadowMode; #define SHADOW_MODE_NONE 0