diff --git a/Minecraft.Client/Common/BuildVer.h b/Minecraft.Client/Common/BuildVer.h index 5c73109d7..a5a9494ac 100644 --- a/Minecraft.Client/Common/BuildVer.h +++ b/Minecraft.Client/Common/BuildVer.h @@ -1,7 +1,7 @@ #pragma once #define VER_PRODUCTBUILD 560 -#define VER_PRODUCTVERSION_STR_W L"DEV (unknown version)" +#define VER_PRODUCTVERSION_STR_W L"" #define VER_FILEVERSION_STR_W VER_PRODUCTVERSION_STR_W -#define VER_BRANCHVERSION_STR_W L"UNKNOWN BRANCH" -#define VER_NETWORK VER_PRODUCTBUILD \ No newline at end of file +#define VER_BRANCHVERSION_STR_W L"UNKNOWN/" +#define VER_NETWORK VER_PRODUCTBUILD diff --git a/Minecraft.Client/LivingEntityRenderer.cpp b/Minecraft.Client/LivingEntityRenderer.cpp index b3478ba92..e9308e54b 100644 --- a/Minecraft.Client/LivingEntityRenderer.cpp +++ b/Minecraft.Client/LivingEntityRenderer.cpp @@ -465,11 +465,13 @@ void LivingEntityRenderer::renderNameTags(shared_ptr mob, double x { if (mob->isSleeping()) { - renderNameTag(mob, msg, x, y - 1.5f, z, 64); + renderNameTag(mob, msg, x, y - 1.5f, z, 64, mob->nametagColor); //This fills the "color" argument } else { - renderNameTag(mob, msg, x, y, z, 64); + //but THIS. THIS works. ??? + mob->nametagColor = 0xFFFF0000; + renderNameTag(mob, msg, x, y, z, 64, mob->nametagColor); } } @@ -548,7 +550,6 @@ void LivingEntityRenderer::renderNameTag(shared_ptr mob, const wst shared_ptr player = dynamic_pointer_cast(mob); if(app.isXuidDeadmau5( player->getXuid() ) ) offs = -10; - #if defined(__PS3__) || defined(__ORBIS__) // Check we have all the font characters for this player name switch(player->GetPlayerNameValidState()) @@ -649,14 +650,16 @@ void LivingEntityRenderer::renderNameTag(shared_ptr mob, const wst t->end(); glDepthFunc(GL_LEQUAL); glEnable(GL_TEXTURE_2D); - glTranslatef(0.0f, 0.0f, -0.04f); } if( textOpacity > 0.0f ) { + //This works as intended int textColor = ( ( static_cast(textOpacity * 255) << 24 ) | 0xffffff ); - font->draw(playerName, -font->width(playerName) / 2, offs, textColor); + font->draw(L"PLR " + mob->SettingThis ? L"YES" : L"NO", -font->width(playerName) / 2, offs, textColor); + + } glEnable(GL_LIGHTING); diff --git a/Minecraft.Client/LocalPlayer.cpp b/Minecraft.Client/LocalPlayer.cpp index 7988416ad..75906f986 100644 --- a/Minecraft.Client/LocalPlayer.cpp +++ b/Minecraft.Client/LocalPlayer.cpp @@ -120,6 +120,7 @@ LocalPlayer::LocalPlayer(Minecraft *minecraft, Level *level, User *user, int dim lastClickTolerance = 0.0f; m_bHasAwardedStayinFrosty = false; + } LocalPlayer::~LocalPlayer() diff --git a/Minecraft.Client/PlayerRenderer.cpp b/Minecraft.Client/PlayerRenderer.cpp index a9b945440..05bee6433 100644 --- a/Minecraft.Client/PlayerRenderer.cpp +++ b/Minecraft.Client/PlayerRenderer.cpp @@ -65,8 +65,7 @@ PlayerRenderer::PlayerRenderer() : LivingEntityRenderer( new HumanoidModel(0), 0 unsigned int PlayerRenderer::getNametagColour(int index) { - if( index >= 0 && index < MINECRAFT_NET_MAX_PLAYERS) - return nametagColorForIndex(index); + if( index >= 0 && index < MINECRAFT_NET_MAX_PLAYERS) return nametagColorForIndex(index); return 0xFF000000; } @@ -496,6 +495,23 @@ void PlayerRenderer::renderNameTags(shared_ptr player, double x, d } #endif + //Check if the player is a local or server player, and if so, add the gamertag prefix to the nametag + //For some reason this is a LivingEntity instead of a Player, but this is derived from LivingEntityRenderer so it makes sense + //Anyways just recast + + if (player->instanceof(eTYPE_PLAYER)) { + shared_ptr plr = static_pointer_cast(player); + //This doesn't work for some reason + player->nametagColor = 0xFF0000FF; + + //But this does??? nametagColor is still black in the renderNameTag method, but it is set to the correct color here, so maybe the renderNameTag method is using a different player instance or something? + + + player->SettingThis = true; //This is how I know + } + + //Set it literally right before, mind you both player and mob are LivingEntity + player->nametagColor = 0xFF0000FF; //This doesn't do anything and is still black. LivingEntityRenderer::renderNameTags(player, x, y, z, msg, scale, dist); } diff --git a/Minecraft.World/LivingEntity.cpp b/Minecraft.World/LivingEntity.cpp index 036adea3b..cb40a442b 100644 --- a/Minecraft.World/LivingEntity.cpp +++ b/Minecraft.World/LivingEntity.cpp @@ -93,6 +93,8 @@ void LivingEntity::_init() speed = 0.0f; noJumpDelay = 0; absorptionAmount = 0.0f; + + nametagColor = 0xff000000; //default black } LivingEntity::LivingEntity( Level* level) : Entity(level) @@ -114,6 +116,7 @@ LivingEntity::LivingEntity( Level* level) : Entity(level) yHeadRot = yRot; footSize = 0.5f; + } LivingEntity::~LivingEntity() diff --git a/Minecraft.World/LivingEntity.h b/Minecraft.World/LivingEntity.h index cc8ed79dd..3069f716b 100644 --- a/Minecraft.World/LivingEntity.h +++ b/Minecraft.World/LivingEntity.h @@ -80,6 +80,9 @@ public: float yHeadRot, yHeadRotO; float flyingSpeed; + //New + int nametagColor; + bool SettingThis = false; protected: shared_ptr lastHurtByPlayer; int lastHurtByPlayerTime; diff --git a/Minecraft.World/Player.cpp b/Minecraft.World/Player.cpp index 480366c4b..a6d4f568d 100644 --- a/Minecraft.World/Player.cpp +++ b/Minecraft.World/Player.cpp @@ -41,6 +41,7 @@ #include "..\Minecraft.Client\LocalPlayer.h" #include "..\Minecraft.Client\HumanoidModel.h" +#include "..\Minecraft.Client\Common\Colours\ColourTable.h" #include "SoundTypes.h" @@ -101,6 +102,7 @@ void Player::_init() m_bCheckedForModelParts=false; m_bCheckedDLCForModelParts=false; + #if defined(__PS3__) || defined(__ORBIS__) m_ePlayerNameValidState=ePlayerNameValid_NotSet; #endif @@ -108,6 +110,8 @@ void Player::_init() enderChestInventory = std::make_shared(); m_bAwardedOnARail=false; + + } Player::Player(Level *level, const wstring &name) : LivingEntity( level ) @@ -145,13 +149,18 @@ Player::Player(Level *level, const wstring &name) : LivingEntity( level ) setShowOnMaps(app.GetGameHostOption(eGameHostOption_Gamertags)!=0?true:false); m_bIsGuest = false; + + #ifndef _XBOX_ONE // 4J: Set UUID to name on none-XB1 consoles, may change in future but for now // ownership of animals on these consoles is done by name setUUID(name); #endif -} + + + +} Player::~Player() { // TODO 4J diff --git a/Minecraft.World/Player.h b/Minecraft.World/Player.h index 2e223a1e5..0ba8daa80 100644 --- a/Minecraft.World/Player.h +++ b/Minecraft.World/Player.h @@ -72,6 +72,7 @@ protected: int jumpTriggerTime; public: + BYTE userType; float oBob, bob;