diff options
| author | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
|---|---|---|
| committer | daoge_cmd <3523206925@qq.com> | 2026-03-01 12:16:08 +0800 |
| commit | b691c43c44ff180d10e7d4a9afc83b98551ff586 (patch) | |
| tree | 3e9849222cbc6ba49f2f1fc6e5fe7179632c7390 /Minecraft.World/CompassItem.cpp | |
| parent | def8cb415354ac390b7e89052a50605285f1aca9 (diff) | |
Initial commit
Diffstat (limited to 'Minecraft.World/CompassItem.cpp')
| -rw-r--r-- | Minecraft.World/CompassItem.cpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/Minecraft.World/CompassItem.cpp b/Minecraft.World/CompassItem.cpp new file mode 100644 index 00000000..57ad65d0 --- /dev/null +++ b/Minecraft.World/CompassItem.cpp @@ -0,0 +1,42 @@ +#include "stdafx.h" +#include "CompassItem.h" +#include "..\Minecraft.Client\Minecraft.h" +#include "..\Minecraft.Client\MultiPlayerLocalPlayer.h" +#include "net.minecraft.world.h" + +#ifdef __PSVITA__ +const wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0"}; +#else +const wstring CompassItem::TEXTURE_PLAYER_ICON[XUSER_MAX_COUNT] = {L"compassP0",L"compassP1",L"compassP2",L"compassP3"}; +#endif + +CompassItem::CompassItem(int id) : Item(id) +{ + icons = NULL; +} + +// 4J Added so that we can override the icon id used to calculate the texture UV's for each player + +Icon *CompassItem::getIcon(int auxValue) +{ + Icon *icon = Item::getIcon(auxValue); + Minecraft *pMinecraft = Minecraft::GetInstance(); + + if( pMinecraft->player != NULL && auxValue == 0 ) + { + icon = icons[pMinecraft->player->GetXboxPad()]; + } + return icon; +} + +void CompassItem::registerIcons(IconRegister *iconRegister) +{ + Item::registerIcons(iconRegister); + + icons = new Icon *[XUSER_MAX_COUNT]; + + for (int i = 0; i < XUSER_MAX_COUNT; i++) + { + icons[i] = iconRegister->registerIcon(TEXTURE_PLAYER_ICON[i]); + } +} |
