Skip to content

Commit

Permalink
make default block color customizable
Browse files Browse the repository at this point in the history
  • Loading branch information
siecvi committed Jul 26, 2024
1 parent 61f917b commit ea2ae8b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Sources/Client/NetClient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@

DEFINE_SPADES_SETTING(cg_unicode, "1");

DEFINE_SPADES_SETTING(cg_defaultBlockColorR, "111");
DEFINE_SPADES_SETTING(cg_defaultBlockColorG, "111");
DEFINE_SPADES_SETTING(cg_defaultBlockColorB, "111");

namespace spades {
namespace client {

Expand Down Expand Up @@ -988,6 +992,13 @@ namespace spades {
GetWorld()->GetPlayerPersistent(pId).name = name;

if (pId == GetWorld()->GetLocalPlayerIndex()) {
// override default block color for localplayer
IntVector3 blockColor;
blockColor.x = Clamp((int)cg_defaultBlockColorR, 0, 255);
blockColor.y = Clamp((int)cg_defaultBlockColorG, 0, 255);
blockColor.z = Clamp((int)cg_defaultBlockColorB, 0, 255);
pRef.SetHeldBlockColor(blockColor);

client->LocalPlayerCreated();
lastPlayerInput = 0xFFFFFFFF;
lastWeaponInput = 0xFFFFFFFF;
Expand Down

0 comments on commit ea2ae8b

Please sign in to comment.