blob: 57ad65d0418072cf169d658672bd64b951b78750 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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]);
}
}
|