mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-03-25 14:21:55 +02:00
@@ -75,7 +75,7 @@ void AbstractContainerScreen::render(int xm, int ym, float a)
|
||||
}
|
||||
}
|
||||
|
||||
std::shared_ptr<Inventory> inventory = minecraft->player->inventory;
|
||||
shared_ptr<Inventory> inventory = minecraft->player->inventory;
|
||||
if (inventory->getCarried() != NULL)
|
||||
{
|
||||
glTranslatef(0, 0, 32);
|
||||
@@ -128,7 +128,7 @@ void AbstractContainerScreen::renderSlot(Slot *slot)
|
||||
#if 0
|
||||
int x = slot->x;
|
||||
int y = slot->y;
|
||||
std::shared_ptr<ItemInstance> item = slot->getItem();
|
||||
shared_ptr<ItemInstance> item = slot->getItem();
|
||||
|
||||
if (item == NULL)
|
||||
{
|
||||
@@ -218,7 +218,7 @@ void AbstractContainerScreen::removed()
|
||||
if (minecraft->player == NULL) return;
|
||||
}
|
||||
|
||||
void AbstractContainerScreen::slotsChanged(std::shared_ptr<Container> container)
|
||||
void AbstractContainerScreen::slotsChanged(shared_ptr<Container> container)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ protected:
|
||||
virtual void keyPressed(wchar_t eventCharacter, int eventKey);
|
||||
public:
|
||||
virtual void removed();
|
||||
virtual void slotsChanged(std::shared_ptr<Container> container);
|
||||
virtual void slotsChanged(shared_ptr<Container> container);
|
||||
virtual bool isPauseScreen();
|
||||
virtual void tick();
|
||||
};
|
||||
@@ -3,11 +3,11 @@
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.projectile.h"
|
||||
#include "..\Minecraft.World\Mth.h"
|
||||
|
||||
void ArrowRenderer::render(std::shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a)
|
||||
void ArrowRenderer::render(shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a)
|
||||
{
|
||||
// 4J - original version used generics and thus had an input parameter of type Arrow rather than std::shared_ptr<Entity> we have here -
|
||||
// 4J - original version used generics and thus had an input parameter of type Arrow rather than shared_ptr<Entity> we have here -
|
||||
// do some casting around instead
|
||||
std::shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(_arrow);
|
||||
shared_ptr<Arrow> arrow = dynamic_pointer_cast<Arrow>(_arrow);
|
||||
bindTexture(TN_ITEM_ARROWS); // 4J - was L"/item/arrows.png"
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
@@ -4,5 +4,5 @@
|
||||
class ArrowRenderer : public EntityRenderer
|
||||
{
|
||||
public:
|
||||
virtual void render(std::shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a);
|
||||
virtual void render(shared_ptr<Entity> _arrow, double x, double y, double z, float rot, float a);
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@ int BlazeModel::modelVersion()
|
||||
return 8;
|
||||
}
|
||||
|
||||
void BlazeModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
void BlazeModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
setupAnim(time, r, bob, yRot, xRot, scale);
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ private:
|
||||
public:
|
||||
BlazeModel();
|
||||
int modelVersion();
|
||||
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0);
|
||||
};
|
||||
|
||||
@@ -8,11 +8,11 @@ BlazeRenderer::BlazeRenderer() : MobRenderer(new BlazeModel(), 0.5f)
|
||||
this->modelVersion = ((BlazeModel *) model)->modelVersion();
|
||||
}
|
||||
|
||||
void BlazeRenderer::render(std::shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
|
||||
void BlazeRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
|
||||
{
|
||||
// 4J - original version used generics and thus had an input parameter of type Blaze rather than std::shared_ptr<Entity> we have here -
|
||||
// 4J - original version used generics and thus had an input parameter of type Blaze rather than shared_ptr<Entity> we have here -
|
||||
// do some casting around instead
|
||||
std::shared_ptr<Blaze> mob = dynamic_pointer_cast<Blaze>(_mob);
|
||||
shared_ptr<Blaze> mob = dynamic_pointer_cast<Blaze>(_mob);
|
||||
|
||||
int modelVersion = ((BlazeModel *) model)->modelVersion();
|
||||
if (modelVersion != this->modelVersion)
|
||||
|
||||
@@ -10,5 +10,5 @@ private:
|
||||
public:
|
||||
BlazeRenderer();
|
||||
|
||||
virtual void render(std::shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
|
||||
virtual void render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a);
|
||||
};
|
||||
@@ -42,7 +42,7 @@ BoatModel::BoatModel() : Model()
|
||||
cubes[4]->compile(1.0f/16.0f);
|
||||
}
|
||||
|
||||
void BoatModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
void BoatModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
for (int i = 0; i < 5; i++)
|
||||
{
|
||||
|
||||
@@ -7,5 +7,5 @@ class BoatModel : public Model
|
||||
public:
|
||||
ModelPart *cubes[5];
|
||||
BoatModel();
|
||||
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
};
|
||||
@@ -10,11 +10,11 @@ BoatRenderer::BoatRenderer() : EntityRenderer()
|
||||
model = new BoatModel();
|
||||
}
|
||||
|
||||
void BoatRenderer::render(std::shared_ptr<Entity> _boat, double x, double y, double z, float rot, float a)
|
||||
void BoatRenderer::render(shared_ptr<Entity> _boat, double x, double y, double z, float rot, float a)
|
||||
{
|
||||
// 4J - original version used generics and thus had an input parameter of type Boat rather than std::shared_ptr<Entity> we have here -
|
||||
// 4J - original version used generics and thus had an input parameter of type Boat rather than shared_ptr<Entity> we have here -
|
||||
// do some casting around instead
|
||||
std::shared_ptr<Boat> boat = dynamic_pointer_cast<Boat>(_boat);
|
||||
shared_ptr<Boat> boat = dynamic_pointer_cast<Boat>(_boat);
|
||||
|
||||
glPushMatrix();
|
||||
|
||||
|
||||
@@ -9,5 +9,5 @@ protected:
|
||||
public:
|
||||
BoatRenderer();
|
||||
|
||||
virtual void render(std::shared_ptr<Entity> boat, double x, double y, double z, float rot, float a);
|
||||
virtual void render(shared_ptr<Entity> boat, double x, double y, double z, float rot, float a);
|
||||
};
|
||||
@@ -33,7 +33,7 @@ BookModel::BookModel()
|
||||
|
||||
}
|
||||
|
||||
void BookModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
void BookModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
setupAnim(time, r, bob, yRot, xRot, scale);
|
||||
|
||||
|
||||
@@ -11,6 +11,6 @@ public:
|
||||
ModelPart *seam;
|
||||
|
||||
BookModel();
|
||||
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0);
|
||||
};
|
||||
|
||||
@@ -21,7 +21,7 @@ float Camera::za = 0.0f;
|
||||
float Camera::xa2 = 0.0f;
|
||||
float Camera::za2 = 0.0f;
|
||||
|
||||
void Camera::prepare(std::shared_ptr<Player> player, bool mirror)
|
||||
void Camera::prepare(shared_ptr<Player> player, bool mirror)
|
||||
{
|
||||
glGetFloat(GL_MODELVIEW_MATRIX, modelview);
|
||||
glGetFloat(GL_PROJECTION_MATRIX, projection);
|
||||
@@ -88,12 +88,12 @@ void Camera::prepare(std::shared_ptr<Player> player, bool mirror)
|
||||
ya = cosf(xRot * PI / 180.0f);
|
||||
}
|
||||
|
||||
TilePos *Camera::getCameraTilePos(std::shared_ptr<Mob> player, double alpha)
|
||||
TilePos *Camera::getCameraTilePos(shared_ptr<Mob> player, double alpha)
|
||||
{
|
||||
return new TilePos(getCameraPos(player, alpha));
|
||||
}
|
||||
|
||||
Vec3 *Camera::getCameraPos(std::shared_ptr<Mob> player, double alpha)
|
||||
Vec3 *Camera::getCameraPos(shared_ptr<Mob> player, double alpha)
|
||||
{
|
||||
double xx = player->xo + (player->x - player->xo) * alpha;
|
||||
double yy = player->yo + (player->y - player->yo) * alpha + player->getHeadHeight();
|
||||
@@ -106,7 +106,7 @@ Vec3 *Camera::getCameraPos(std::shared_ptr<Mob> player, double alpha)
|
||||
return Vec3::newTemp(xt, yt, zt);
|
||||
}
|
||||
|
||||
int Camera::getBlockAt(Level *level, std::shared_ptr<Mob> player, float alpha)
|
||||
int Camera::getBlockAt(Level *level, shared_ptr<Mob> player, float alpha)
|
||||
{
|
||||
Vec3 *p = Camera::getCameraPos(player, alpha);
|
||||
TilePos tp = TilePos(p);
|
||||
|
||||
@@ -24,9 +24,9 @@ private:
|
||||
public:
|
||||
static float xa, ya, za, xa2, za2;
|
||||
|
||||
static void prepare(std::shared_ptr<Player> player, bool mirror);
|
||||
static void prepare(shared_ptr<Player> player, bool mirror);
|
||||
|
||||
static TilePos *getCameraTilePos(std::shared_ptr<Mob> player, double alpha);
|
||||
static Vec3 *getCameraPos(std::shared_ptr<Mob> player, double alpha);
|
||||
static int getBlockAt(Level *level, std::shared_ptr<Mob> player, float alpha);
|
||||
static TilePos *getCameraTilePos(shared_ptr<Mob> player, double alpha);
|
||||
static Vec3 *getCameraPos(shared_ptr<Mob> player, double alpha);
|
||||
static int getBlockAt(Level *level, shared_ptr<Mob> player, float alpha);
|
||||
};
|
||||
@@ -18,10 +18,10 @@ ChestRenderer::~ChestRenderer()
|
||||
delete largeChestModel;
|
||||
}
|
||||
|
||||
void ChestRenderer::render(std::shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
|
||||
void ChestRenderer::render(shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha, bool useCompiled)
|
||||
{
|
||||
// 4J Convert as we aren't using a templated class
|
||||
std::shared_ptr<ChestTileEntity> chest = dynamic_pointer_cast<ChestTileEntity>(_chest);
|
||||
shared_ptr<ChestTileEntity> chest = dynamic_pointer_cast<ChestTileEntity>(_chest);
|
||||
|
||||
int data;
|
||||
|
||||
|
||||
@@ -14,5 +14,5 @@ public:
|
||||
ChestRenderer();
|
||||
~ChestRenderer();
|
||||
|
||||
void render(std::shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param
|
||||
void render(shared_ptr<TileEntity> _chest, double x, double y, double z, float a, bool setColor, float alpha=1.0f, bool useCompiled = true); // 4J added setColor param
|
||||
};
|
||||
|
||||
@@ -49,7 +49,7 @@ ChickenModel::ChickenModel() : Model()
|
||||
wing1->compile(1.0f/16.0f);
|
||||
}
|
||||
|
||||
void ChickenModel::render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
void ChickenModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
|
||||
{
|
||||
setupAnim(time, r, bob, yRot, xRot, scale);
|
||||
if (young)
|
||||
|
||||
@@ -6,6 +6,6 @@ public:
|
||||
ModelPart *head, *hair, *body, *leg0, *leg1, *wing0,* wing1, *beak, *redThing;
|
||||
|
||||
ChickenModel();
|
||||
virtual void render(std::shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
|
||||
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim=0);
|
||||
};
|
||||
|
||||
@@ -7,15 +7,15 @@ ChickenRenderer::ChickenRenderer(Model *model, float shadow) : MobRenderer(model
|
||||
{
|
||||
}
|
||||
|
||||
void ChickenRenderer::render(std::shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
|
||||
void ChickenRenderer::render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a)
|
||||
{
|
||||
MobRenderer::render(_mob, x, y, z, rot, a);
|
||||
}
|
||||
|
||||
float ChickenRenderer::getBob(std::shared_ptr<Mob> _mob, float a)
|
||||
float ChickenRenderer::getBob(shared_ptr<Mob> _mob, float a)
|
||||
{
|
||||
// 4J - dynamic cast required because we aren't using templates/generics in our version
|
||||
std::shared_ptr<Chicken> mob = dynamic_pointer_cast<Chicken>(_mob);
|
||||
shared_ptr<Chicken> mob = dynamic_pointer_cast<Chicken>(_mob);
|
||||
|
||||
float flap = mob->oFlap+(mob->flap-mob->oFlap)*a;
|
||||
float flapSpeed = mob->oFlapSpeed+(mob->flapSpeed-mob->oFlapSpeed)*a;
|
||||
|
||||
@@ -5,7 +5,7 @@ class ChickenRenderer : public MobRenderer
|
||||
{
|
||||
public:
|
||||
ChickenRenderer(Model *model, float shadow);
|
||||
virtual void render(std::shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a);
|
||||
virtual void render(shared_ptr<Entity> _mob, double x, double y, double z, float rot, float a);
|
||||
protected:
|
||||
virtual float getBob(std::shared_ptr<Mob> _mob, float a);
|
||||
virtual float getBob(shared_ptr<Mob> _mob, float a);
|
||||
};
|
||||
@@ -204,10 +204,10 @@ void Chunk::rebuild()
|
||||
|
||||
LevelChunk::touchedSky = false;
|
||||
|
||||
// unordered_set<std::shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line
|
||||
// unordered_set<shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line
|
||||
// renderableTileEntities.clear();
|
||||
|
||||
vector<std::shared_ptr<TileEntity> > renderableTileEntities; // 4J - added
|
||||
vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - added
|
||||
|
||||
int r = 1;
|
||||
|
||||
@@ -402,7 +402,7 @@ void Chunk::rebuild()
|
||||
Tile *tile = Tile::tiles[tileId];
|
||||
if (currentLayer == 0 && tile->isEntityTile())
|
||||
{
|
||||
std::shared_ptr<TileEntity> et = region->getTileEntity(x, y, z);
|
||||
shared_ptr<TileEntity> et = region->getTileEntity(x, y, z);
|
||||
if (TileEntityRenderDispatcher::instance->hasRenderer(et))
|
||||
{
|
||||
renderableTileEntities.push_back(et);
|
||||
@@ -554,10 +554,10 @@ void Chunk::rebuild()
|
||||
*/
|
||||
|
||||
|
||||
unordered_set<std::shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end());
|
||||
unordered_set<shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end());
|
||||
|
||||
AUTO_VAR(endIt, oldTileEntities.end());
|
||||
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ )
|
||||
for( unordered_set<shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ )
|
||||
{
|
||||
newTileEntities.erase(*it);
|
||||
}
|
||||
@@ -566,7 +566,7 @@ void Chunk::rebuild()
|
||||
|
||||
EnterCriticalSection(globalRenderableTileEntities_cs);
|
||||
endIt = newTileEntities.end();
|
||||
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ )
|
||||
for( unordered_set<shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ )
|
||||
{
|
||||
globalRenderableTileEntities->push_back(*it);
|
||||
}
|
||||
@@ -574,12 +574,12 @@ void Chunk::rebuild()
|
||||
// 4J - All these new things added to globalRenderableTileEntities
|
||||
|
||||
AUTO_VAR(endItRTE, renderableTileEntities.end());
|
||||
for( vector<std::shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ )
|
||||
for( vector<shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ )
|
||||
{
|
||||
oldTileEntities.erase(*it);
|
||||
}
|
||||
// 4J - oldTileEntities is now the removed items
|
||||
vector<std::shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin();
|
||||
vector<shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin();
|
||||
while( it != globalRenderableTileEntities->end() )
|
||||
{
|
||||
if( oldTileEntities.find(*it) != oldTileEntities.end() )
|
||||
@@ -656,10 +656,10 @@ void Chunk::rebuild_SPU()
|
||||
|
||||
LevelChunk::touchedSky = false;
|
||||
|
||||
// unordered_set<std::shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line
|
||||
// unordered_set<shared_ptr<TileEntity> > oldTileEntities(renderableTileEntities.begin(),renderableTileEntities.end()); // 4J removed this & next line
|
||||
// renderableTileEntities.clear();
|
||||
|
||||
vector<std::shared_ptr<TileEntity> > renderableTileEntities; // 4J - added
|
||||
vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - added
|
||||
|
||||
// List<TileEntity> newTileEntities = new ArrayList<TileEntity>();
|
||||
// newTileEntities.clear();
|
||||
@@ -750,7 +750,7 @@ void Chunk::rebuild_SPU()
|
||||
{
|
||||
if (currentLayer == 0 && Tile::tiles[tileId]->isEntityTile())
|
||||
{
|
||||
std::shared_ptr<TileEntity> et = region.getTileEntity(x, y, z);
|
||||
shared_ptr<TileEntity> et = region.getTileEntity(x, y, z);
|
||||
if (TileEntityRenderDispatcher::instance->hasRenderer(et))
|
||||
{
|
||||
renderableTileEntities.push_back(et);
|
||||
@@ -883,10 +883,10 @@ void Chunk::rebuild_SPU()
|
||||
*/
|
||||
|
||||
|
||||
unordered_set<std::shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end());
|
||||
unordered_set<shared_ptr<TileEntity> > newTileEntities(renderableTileEntities.begin(),renderableTileEntities.end());
|
||||
|
||||
AUTO_VAR(endIt, oldTileEntities.end());
|
||||
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ )
|
||||
for( unordered_set<shared_ptr<TileEntity> >::iterator it = oldTileEntities.begin(); it != endIt; it++ )
|
||||
{
|
||||
newTileEntities.erase(*it);
|
||||
}
|
||||
@@ -895,7 +895,7 @@ void Chunk::rebuild_SPU()
|
||||
|
||||
EnterCriticalSection(globalRenderableTileEntities_cs);
|
||||
endIt = newTileEntities.end();
|
||||
for( unordered_set<std::shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ )
|
||||
for( unordered_set<shared_ptr<TileEntity> >::iterator it = newTileEntities.begin(); it != endIt; it++ )
|
||||
{
|
||||
globalRenderableTileEntities.push_back(*it);
|
||||
}
|
||||
@@ -903,12 +903,12 @@ void Chunk::rebuild_SPU()
|
||||
// 4J - All these new things added to globalRenderableTileEntities
|
||||
|
||||
AUTO_VAR(endItRTE, renderableTileEntities.end());
|
||||
for( vector<std::shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ )
|
||||
for( vector<shared_ptr<TileEntity> >::iterator it = renderableTileEntities.begin(); it != endItRTE; it++ )
|
||||
{
|
||||
oldTileEntities.erase(*it);
|
||||
}
|
||||
// 4J - oldTileEntities is now the removed items
|
||||
vector<std::shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin();
|
||||
vector<shared_ptr<TileEntity> >::iterator it = globalRenderableTileEntities->begin();
|
||||
while( it != globalRenderableTileEntities->end() )
|
||||
{
|
||||
if( oldTileEntities.find(*it) != oldTileEntities.end() )
|
||||
@@ -941,7 +941,7 @@ void Chunk::rebuild_SPU()
|
||||
#endif // _PS3_
|
||||
|
||||
|
||||
float Chunk::distanceToSqr(std::shared_ptr<Entity> player) const
|
||||
float Chunk::distanceToSqr(shared_ptr<Entity> player) const
|
||||
{
|
||||
float xd = (float) (player->x - xm);
|
||||
float yd = (float) (player->y - ym);
|
||||
@@ -949,7 +949,7 @@ float Chunk::distanceToSqr(std::shared_ptr<Entity> player) const
|
||||
return xd * xd + yd * yd + zd * zd;
|
||||
}
|
||||
|
||||
float Chunk::squishedDistanceToSqr(std::shared_ptr<Entity> player)
|
||||
float Chunk::squishedDistanceToSqr(shared_ptr<Entity> player)
|
||||
{
|
||||
float xd = (float) (player->x - xm);
|
||||
float yd = (float) (player->y - ym) * 2;
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
int id;
|
||||
//public:
|
||||
// vector<std::shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed
|
||||
// vector<shared_ptr<TileEntity> > renderableTileEntities; // 4J - removed
|
||||
|
||||
private:
|
||||
LevelRenderer::rteMap *globalRenderableTileEntities;
|
||||
@@ -71,8 +71,8 @@ public:
|
||||
#ifdef __PS3__
|
||||
void rebuild_SPU();
|
||||
#endif // __PS3__
|
||||
float distanceToSqr(std::shared_ptr<Entity> player) const;
|
||||
float squishedDistanceToSqr(std::shared_ptr<Entity> player);
|
||||
float distanceToSqr(shared_ptr<Entity> player) const;
|
||||
float squishedDistanceToSqr(shared_ptr<Entity> player);
|
||||
void reset();
|
||||
void _delete();
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -49,92 +49,92 @@ public:
|
||||
~ClientConnection();
|
||||
void tick();
|
||||
INetworkPlayer *getNetworkPlayer();
|
||||
virtual void handleLogin(std::shared_ptr<LoginPacket> packet);
|
||||
virtual void handleAddEntity(std::shared_ptr<AddEntityPacket> packet);
|
||||
virtual void handleAddExperienceOrb(std::shared_ptr<AddExperienceOrbPacket> packet);
|
||||
virtual void handleAddGlobalEntity(std::shared_ptr<AddGlobalEntityPacket> packet);
|
||||
virtual void handleAddPainting(std::shared_ptr<AddPaintingPacket> packet);
|
||||
virtual void handleSetEntityMotion(std::shared_ptr<SetEntityMotionPacket> packet);
|
||||
virtual void handleSetEntityData(std::shared_ptr<SetEntityDataPacket> packet);
|
||||
virtual void handleAddPlayer(std::shared_ptr<AddPlayerPacket> packet);
|
||||
virtual void handleTeleportEntity(std::shared_ptr<TeleportEntityPacket> packet);
|
||||
virtual void handleMoveEntity(std::shared_ptr<MoveEntityPacket> packet);
|
||||
virtual void handleRotateMob(std::shared_ptr<RotateHeadPacket> packet);
|
||||
virtual void handleMoveEntitySmall(std::shared_ptr<MoveEntityPacketSmall> packet);
|
||||
virtual void handleRemoveEntity(std::shared_ptr<RemoveEntitiesPacket> packet);
|
||||
virtual void handleMovePlayer(std::shared_ptr<MovePlayerPacket> packet);
|
||||
virtual void handleLogin(shared_ptr<LoginPacket> packet);
|
||||
virtual void handleAddEntity(shared_ptr<AddEntityPacket> packet);
|
||||
virtual void handleAddExperienceOrb(shared_ptr<AddExperienceOrbPacket> packet);
|
||||
virtual void handleAddGlobalEntity(shared_ptr<AddGlobalEntityPacket> packet);
|
||||
virtual void handleAddPainting(shared_ptr<AddPaintingPacket> packet);
|
||||
virtual void handleSetEntityMotion(shared_ptr<SetEntityMotionPacket> packet);
|
||||
virtual void handleSetEntityData(shared_ptr<SetEntityDataPacket> packet);
|
||||
virtual void handleAddPlayer(shared_ptr<AddPlayerPacket> packet);
|
||||
virtual void handleTeleportEntity(shared_ptr<TeleportEntityPacket> packet);
|
||||
virtual void handleMoveEntity(shared_ptr<MoveEntityPacket> packet);
|
||||
virtual void handleRotateMob(shared_ptr<RotateHeadPacket> packet);
|
||||
virtual void handleMoveEntitySmall(shared_ptr<MoveEntityPacketSmall> packet);
|
||||
virtual void handleRemoveEntity(shared_ptr<RemoveEntitiesPacket> packet);
|
||||
virtual void handleMovePlayer(shared_ptr<MovePlayerPacket> packet);
|
||||
|
||||
Random *random;
|
||||
|
||||
// 4J Added
|
||||
virtual void handleChunkVisibilityArea(std::shared_ptr<ChunkVisibilityAreaPacket> packet);
|
||||
virtual void handleChunkVisibilityArea(shared_ptr<ChunkVisibilityAreaPacket> packet);
|
||||
|
||||
virtual void handleChunkVisibility(std::shared_ptr<ChunkVisibilityPacket> packet);
|
||||
virtual void handleChunkTilesUpdate(std::shared_ptr<ChunkTilesUpdatePacket> packet);
|
||||
virtual void handleBlockRegionUpdate(std::shared_ptr<BlockRegionUpdatePacket> packet);
|
||||
virtual void handleTileUpdate(std::shared_ptr<TileUpdatePacket> packet);
|
||||
virtual void handleDisconnect(std::shared_ptr<DisconnectPacket> packet);
|
||||
virtual void handleChunkVisibility(shared_ptr<ChunkVisibilityPacket> packet);
|
||||
virtual void handleChunkTilesUpdate(shared_ptr<ChunkTilesUpdatePacket> packet);
|
||||
virtual void handleBlockRegionUpdate(shared_ptr<BlockRegionUpdatePacket> packet);
|
||||
virtual void handleTileUpdate(shared_ptr<TileUpdatePacket> packet);
|
||||
virtual void handleDisconnect(shared_ptr<DisconnectPacket> packet);
|
||||
virtual void onDisconnect(DisconnectPacket::eDisconnectReason reason, void *reasonObjects);
|
||||
void sendAndDisconnect(std::shared_ptr<Packet> packet);
|
||||
void send(std::shared_ptr<Packet> packet);
|
||||
virtual void handleTakeItemEntity(std::shared_ptr<TakeItemEntityPacket> packet);
|
||||
virtual void handleChat(std::shared_ptr<ChatPacket> packet);
|
||||
virtual void handleAnimate(std::shared_ptr<AnimatePacket> packet);
|
||||
virtual void handleEntityActionAtPosition(std::shared_ptr<EntityActionAtPositionPacket> packet);
|
||||
virtual void handlePreLogin(std::shared_ptr<PreLoginPacket> packet);
|
||||
void sendAndDisconnect(shared_ptr<Packet> packet);
|
||||
void send(shared_ptr<Packet> packet);
|
||||
virtual void handleTakeItemEntity(shared_ptr<TakeItemEntityPacket> packet);
|
||||
virtual void handleChat(shared_ptr<ChatPacket> packet);
|
||||
virtual void handleAnimate(shared_ptr<AnimatePacket> packet);
|
||||
virtual void handleEntityActionAtPosition(shared_ptr<EntityActionAtPositionPacket> packet);
|
||||
virtual void handlePreLogin(shared_ptr<PreLoginPacket> packet);
|
||||
void close();
|
||||
virtual void handleAddMob(std::shared_ptr<AddMobPacket> packet);
|
||||
virtual void handleSetTime(std::shared_ptr<SetTimePacket> packet);
|
||||
virtual void handleSetSpawn(std::shared_ptr<SetSpawnPositionPacket> packet);
|
||||
virtual void handleRidePacket(std::shared_ptr<SetRidingPacket> packet);
|
||||
virtual void handleEntityEvent(std::shared_ptr<EntityEventPacket> packet);
|
||||
virtual void handleAddMob(shared_ptr<AddMobPacket> packet);
|
||||
virtual void handleSetTime(shared_ptr<SetTimePacket> packet);
|
||||
virtual void handleSetSpawn(shared_ptr<SetSpawnPositionPacket> packet);
|
||||
virtual void handleRidePacket(shared_ptr<SetRidingPacket> packet);
|
||||
virtual void handleEntityEvent(shared_ptr<EntityEventPacket> packet);
|
||||
private:
|
||||
std::shared_ptr<Entity> getEntity(int entityId);
|
||||
shared_ptr<Entity> getEntity(int entityId);
|
||||
wstring GetDisplayNameByGamertag(wstring gamertag);
|
||||
public:
|
||||
virtual void handleSetHealth(std::shared_ptr<SetHealthPacket> packet);
|
||||
virtual void handleSetExperience(std::shared_ptr<SetExperiencePacket> packet);
|
||||
virtual void handleRespawn(std::shared_ptr<RespawnPacket> packet);
|
||||
virtual void handleExplosion(std::shared_ptr<ExplodePacket> packet);
|
||||
virtual void handleContainerOpen(std::shared_ptr<ContainerOpenPacket> packet);
|
||||
virtual void handleContainerSetSlot(std::shared_ptr<ContainerSetSlotPacket> packet);
|
||||
virtual void handleContainerAck(std::shared_ptr<ContainerAckPacket> packet);
|
||||
virtual void handleContainerContent(std::shared_ptr<ContainerSetContentPacket> packet);
|
||||
virtual void handleSignUpdate(std::shared_ptr<SignUpdatePacket> packet);
|
||||
virtual void handleTileEntityData(std::shared_ptr<TileEntityDataPacket> packet);
|
||||
virtual void handleContainerSetData(std::shared_ptr<ContainerSetDataPacket> packet);
|
||||
virtual void handleSetEquippedItem(std::shared_ptr<SetEquippedItemPacket> packet);
|
||||
virtual void handleContainerClose(std::shared_ptr<ContainerClosePacket> packet);
|
||||
virtual void handleTileEvent(std::shared_ptr<TileEventPacket> packet);
|
||||
virtual void handleTileDestruction(std::shared_ptr<TileDestructionPacket> packet);
|
||||
virtual void handleSetHealth(shared_ptr<SetHealthPacket> packet);
|
||||
virtual void handleSetExperience(shared_ptr<SetExperiencePacket> packet);
|
||||
virtual void handleRespawn(shared_ptr<RespawnPacket> packet);
|
||||
virtual void handleExplosion(shared_ptr<ExplodePacket> packet);
|
||||
virtual void handleContainerOpen(shared_ptr<ContainerOpenPacket> packet);
|
||||
virtual void handleContainerSetSlot(shared_ptr<ContainerSetSlotPacket> packet);
|
||||
virtual void handleContainerAck(shared_ptr<ContainerAckPacket> packet);
|
||||
virtual void handleContainerContent(shared_ptr<ContainerSetContentPacket> packet);
|
||||
virtual void handleSignUpdate(shared_ptr<SignUpdatePacket> packet);
|
||||
virtual void handleTileEntityData(shared_ptr<TileEntityDataPacket> packet);
|
||||
virtual void handleContainerSetData(shared_ptr<ContainerSetDataPacket> packet);
|
||||
virtual void handleSetEquippedItem(shared_ptr<SetEquippedItemPacket> packet);
|
||||
virtual void handleContainerClose(shared_ptr<ContainerClosePacket> packet);
|
||||
virtual void handleTileEvent(shared_ptr<TileEventPacket> packet);
|
||||
virtual void handleTileDestruction(shared_ptr<TileDestructionPacket> packet);
|
||||
virtual bool canHandleAsyncPackets();
|
||||
virtual void handleGameEvent(std::shared_ptr<GameEventPacket> gameEventPacket);
|
||||
virtual void handleComplexItemData(std::shared_ptr<ComplexItemDataPacket> packet);
|
||||
virtual void handleLevelEvent(std::shared_ptr<LevelEventPacket> packet);
|
||||
virtual void handleAwardStat(std::shared_ptr<AwardStatPacket> packet);
|
||||
virtual void handleUpdateMobEffect(std::shared_ptr<UpdateMobEffectPacket> packet);
|
||||
virtual void handleRemoveMobEffect(std::shared_ptr<RemoveMobEffectPacket> packet);
|
||||
virtual void handleGameEvent(shared_ptr<GameEventPacket> gameEventPacket);
|
||||
virtual void handleComplexItemData(shared_ptr<ComplexItemDataPacket> packet);
|
||||
virtual void handleLevelEvent(shared_ptr<LevelEventPacket> packet);
|
||||
virtual void handleAwardStat(shared_ptr<AwardStatPacket> packet);
|
||||
virtual void handleUpdateMobEffect(shared_ptr<UpdateMobEffectPacket> packet);
|
||||
virtual void handleRemoveMobEffect(shared_ptr<RemoveMobEffectPacket> packet);
|
||||
virtual bool isServerPacketListener();
|
||||
virtual void handlePlayerInfo(std::shared_ptr<PlayerInfoPacket> packet);
|
||||
virtual void handleKeepAlive(std::shared_ptr<KeepAlivePacket> packet);
|
||||
virtual void handlePlayerAbilities(std::shared_ptr<PlayerAbilitiesPacket> playerAbilitiesPacket);
|
||||
virtual void handleSoundEvent(std::shared_ptr<LevelSoundPacket> packet);
|
||||
virtual void handleCustomPayload(std::shared_ptr<CustomPayloadPacket> customPayloadPacket);
|
||||
virtual void handlePlayerInfo(shared_ptr<PlayerInfoPacket> packet);
|
||||
virtual void handleKeepAlive(shared_ptr<KeepAlivePacket> packet);
|
||||
virtual void handlePlayerAbilities(shared_ptr<PlayerAbilitiesPacket> playerAbilitiesPacket);
|
||||
virtual void handleSoundEvent(shared_ptr<LevelSoundPacket> packet);
|
||||
virtual void handleCustomPayload(shared_ptr<CustomPayloadPacket> customPayloadPacket);
|
||||
virtual Connection *getConnection();
|
||||
|
||||
// 4J Added
|
||||
virtual void handleServerSettingsChanged(std::shared_ptr<ServerSettingsChangedPacket> packet);
|
||||
virtual void handleTexture(std::shared_ptr<TexturePacket> packet);
|
||||
virtual void handleTextureAndGeometry(std::shared_ptr<TextureAndGeometryPacket> packet);
|
||||
virtual void handleUpdateProgress(std::shared_ptr<UpdateProgressPacket> packet);
|
||||
virtual void handleServerSettingsChanged(shared_ptr<ServerSettingsChangedPacket> packet);
|
||||
virtual void handleTexture(shared_ptr<TexturePacket> packet);
|
||||
virtual void handleTextureAndGeometry(shared_ptr<TextureAndGeometryPacket> packet);
|
||||
virtual void handleUpdateProgress(shared_ptr<UpdateProgressPacket> packet);
|
||||
|
||||
// 4J Added
|
||||
static int HostDisconnectReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
static int ExitGameAndSaveReturned(void *pParam,int iPad,C4JStorage::EMessageResult result);
|
||||
virtual void handleTextureChange(std::shared_ptr<TextureChangePacket> packet);
|
||||
virtual void handleTextureAndGeometryChange(std::shared_ptr<TextureAndGeometryChangePacket> packet);
|
||||
virtual void handleUpdateGameRuleProgressPacket(std::shared_ptr<UpdateGameRuleProgressPacket> packet);
|
||||
virtual void handleXZ(std::shared_ptr<XZPacket> packet);
|
||||
virtual void handleTextureChange(shared_ptr<TextureChangePacket> packet);
|
||||
virtual void handleTextureAndGeometryChange(shared_ptr<TextureAndGeometryChangePacket> packet);
|
||||
virtual void handleUpdateGameRuleProgressPacket(shared_ptr<UpdateGameRuleProgressPacket> packet);
|
||||
virtual void handleXZ(shared_ptr<XZPacket> packet);
|
||||
|
||||
void displayPrivilegeChanges(std::shared_ptr<MultiplayerLocalPlayer> player, unsigned int oldPrivileges);
|
||||
void displayPrivilegeChanges(shared_ptr<MultiplayerLocalPlayer> player, unsigned int oldPrivileges);
|
||||
};
|
||||
@@ -43,7 +43,7 @@ class ConsoleSoundEngine
|
||||
public:
|
||||
|
||||
ConsoleSoundEngine() : m_bIsPlayingStreamingCDMusic(false),m_bIsPlayingStreamingGameMusic(false), m_bIsPlayingEndMusic(false),m_bIsPlayingNetherMusic(false){};
|
||||
virtual void tick(std::shared_ptr<Mob> *players, float a) =0;
|
||||
virtual void tick(shared_ptr<Mob> *players, float a) =0;
|
||||
virtual void destroy()=0;
|
||||
virtual void play(int iSound, float x, float y, float z, float volume, float pitch) =0;
|
||||
virtual void playStreaming(const wstring& name, float x, float y , float z, float volume, float pitch, bool bMusicDelay=true) =0;
|
||||
|
||||
@@ -32,7 +32,7 @@ void SoundEngine::init(Options *pOptions)
|
||||
{
|
||||
}
|
||||
|
||||
void SoundEngine::tick(std::shared_ptr<Mob> *players, float a)
|
||||
void SoundEngine::tick(shared_ptr<Mob> *players, float a)
|
||||
{
|
||||
}
|
||||
void SoundEngine::destroy() {}
|
||||
@@ -622,7 +622,7 @@ static float fVal=0.0f;
|
||||
static S32 running = AIL_ms_count();
|
||||
#endif
|
||||
|
||||
void SoundEngine::tick(std::shared_ptr<Mob> *players, float a)
|
||||
void SoundEngine::tick(shared_ptr<Mob> *players, float a)
|
||||
{
|
||||
#ifdef __DISABLE_MILES__
|
||||
return;
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
virtual void updateSystemMusicPlaying(bool isPlaying);
|
||||
virtual void updateSoundEffectVolume(float fVal);
|
||||
virtual void init(Options *);
|
||||
virtual void tick(std::shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one
|
||||
virtual void tick(shared_ptr<Mob> *players, float a); // 4J - updated to take array of local players rather than single one
|
||||
virtual void add(const wstring& name, File *file);
|
||||
virtual void addMusic(const wstring& name, File *file);
|
||||
virtual void addStreaming(const wstring& name, File *file);
|
||||
|
||||
@@ -365,7 +365,7 @@ void CMinecraftApp::HandleButtonPresses(int iPad)
|
||||
// ProfileManager.WriteToProfile(iPad,true);
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack)
|
||||
bool CMinecraftApp::LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -388,7 +388,7 @@ bool CMinecraftApp::LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> play
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack)
|
||||
bool CMinecraftApp::LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -411,7 +411,7 @@ bool CMinecraftApp::LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> playe
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> player)
|
||||
bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -437,7 +437,7 @@ bool CMinecraftApp::LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> pl
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> player, int x, int y, int z)
|
||||
bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -463,7 +463,7 @@ bool CMinecraftApp::LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> pl
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inventory, int x, int y, int z, Level *level)
|
||||
bool CMinecraftApp::LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -489,7 +489,7 @@ bool CMinecraftApp::LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inven
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace)
|
||||
bool CMinecraftApp::LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -514,7 +514,7 @@ bool CMinecraftApp::LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventor
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand)
|
||||
bool CMinecraftApp::LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -540,7 +540,7 @@ bool CMinecraftApp::LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inv
|
||||
}
|
||||
|
||||
|
||||
bool CMinecraftApp::LoadContainerMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<Container> container)
|
||||
bool CMinecraftApp::LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -574,7 +574,7 @@ bool CMinecraftApp::LoadContainerMenu(int iPad,std::shared_ptr<Container> invent
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap)
|
||||
bool CMinecraftApp::LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -599,7 +599,7 @@ bool CMinecraftApp::LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory,
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> sign)
|
||||
bool CMinecraftApp::LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -615,7 +615,7 @@ bool CMinecraftApp::LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> s
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z)
|
||||
bool CMinecraftApp::LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -634,7 +634,7 @@ bool CMinecraftApp::LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> invent
|
||||
return success;
|
||||
}
|
||||
|
||||
bool CMinecraftApp::LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level *level)
|
||||
bool CMinecraftApp::LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level)
|
||||
{
|
||||
bool success = true;
|
||||
|
||||
@@ -1272,7 +1272,7 @@ void CMinecraftApp::ActionGameSettings(int iPad,eGameSetting eVal)
|
||||
PlayerList *players = MinecraftServer::getInstance()->getPlayerList();
|
||||
for(AUTO_VAR(it3, players->players.begin()); it3 != players->players.end(); ++it3)
|
||||
{
|
||||
std::shared_ptr<ServerPlayer> decorationPlayer = *it3;
|
||||
shared_ptr<ServerPlayer> decorationPlayer = *it3;
|
||||
decorationPlayer->setShowOnMaps((app.GetGameHostOption(eGameHostOption_Gamertags)!=0)?true:false);
|
||||
}
|
||||
}
|
||||
@@ -2240,7 +2240,7 @@ unsigned int CMinecraftApp::GetGameSettingsDebugMask(int iPad,bool bOverridePlay
|
||||
}
|
||||
if(iPad < 0) iPad = 0;
|
||||
|
||||
std::shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
|
||||
shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
|
||||
|
||||
if(bOverridePlayer || player==NULL)
|
||||
{
|
||||
@@ -2260,7 +2260,7 @@ void CMinecraftApp::SetGameSettingsDebugMask(int iPad, unsigned int uiVal)
|
||||
GameSettingsA[iPad]->uiDebugBitmask=uiVal;
|
||||
|
||||
// update the value so the network server can use it
|
||||
std::shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
|
||||
shared_ptr<Player> player = Minecraft::GetInstance()->localplayers[iPad];
|
||||
|
||||
if(player)
|
||||
{
|
||||
@@ -2427,7 +2427,7 @@ void CMinecraftApp::HandleXuiActions(void)
|
||||
eTMSAction eTMS;
|
||||
LPVOID param;
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player;
|
||||
shared_ptr<MultiplayerLocalPlayer> player;
|
||||
|
||||
// are there any global actions to deal with?
|
||||
eAction = app.GetGlobalXuiAction();
|
||||
|
||||
@@ -125,18 +125,18 @@ public:
|
||||
bool GetGameStarted() {return m_bGameStarted;}
|
||||
void SetGameStarted(bool bVal) { if(bVal) DebugPrintf("SetGameStarted - true\n"); else DebugPrintf("SetGameStarted - false\n"); m_bGameStarted = bVal; m_bIsAppPaused = !bVal;}
|
||||
int GetLocalPlayerCount(void);
|
||||
bool LoadInventoryMenu(int iPad,std::shared_ptr<LocalPlayer> player, bool bNavigateBack=false);
|
||||
bool LoadCreativeMenu(int iPad,std::shared_ptr<LocalPlayer> player,bool bNavigateBack=false);
|
||||
bool LoadEnchantingMenu(int iPad,std::shared_ptr<Inventory> inventory, int x, int y, int z, Level *level);
|
||||
bool LoadFurnaceMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<FurnaceTileEntity> furnace);
|
||||
bool LoadBrewingStandMenu(int iPad,std::shared_ptr<Inventory> inventory, std::shared_ptr<BrewingStandTileEntity> brewingStand);
|
||||
bool LoadContainerMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<Container> container);
|
||||
bool LoadTrapMenu(int iPad,std::shared_ptr<Container> inventory, std::shared_ptr<DispenserTileEntity> trap);
|
||||
bool LoadCrafting2x2Menu(int iPad,std::shared_ptr<LocalPlayer> player);
|
||||
bool LoadCrafting3x3Menu(int iPad,std::shared_ptr<LocalPlayer> player, int x, int y, int z);
|
||||
bool LoadSignEntryMenu(int iPad,std::shared_ptr<SignTileEntity> sign);
|
||||
bool LoadRepairingMenu(int iPad,std::shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
|
||||
bool LoadTradingMenu(int iPad, std::shared_ptr<Inventory> inventory, std::shared_ptr<Merchant> trader, Level *level);
|
||||
bool LoadInventoryMenu(int iPad,shared_ptr<LocalPlayer> player, bool bNavigateBack=false);
|
||||
bool LoadCreativeMenu(int iPad,shared_ptr<LocalPlayer> player,bool bNavigateBack=false);
|
||||
bool LoadEnchantingMenu(int iPad,shared_ptr<Inventory> inventory, int x, int y, int z, Level *level);
|
||||
bool LoadFurnaceMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<FurnaceTileEntity> furnace);
|
||||
bool LoadBrewingStandMenu(int iPad,shared_ptr<Inventory> inventory, shared_ptr<BrewingStandTileEntity> brewingStand);
|
||||
bool LoadContainerMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<Container> container);
|
||||
bool LoadTrapMenu(int iPad,shared_ptr<Container> inventory, shared_ptr<DispenserTileEntity> trap);
|
||||
bool LoadCrafting2x2Menu(int iPad,shared_ptr<LocalPlayer> player);
|
||||
bool LoadCrafting3x3Menu(int iPad,shared_ptr<LocalPlayer> player, int x, int y, int z);
|
||||
bool LoadSignEntryMenu(int iPad,shared_ptr<SignTileEntity> sign);
|
||||
bool LoadRepairingMenu(int iPad,shared_ptr<Inventory> inventory, Level *level, int x, int y, int z);
|
||||
bool LoadTradingMenu(int iPad, shared_ptr<Inventory> inventory, shared_ptr<Merchant> trader, Level *level);
|
||||
|
||||
bool GetTutorialMode() { return m_bTutorialMode;}
|
||||
void SetTutorialMode(bool bSet) {m_bTutorialMode=bSet;}
|
||||
|
||||
@@ -43,7 +43,7 @@ void AddEnchantmentRuleDefinition::addAttribute(const wstring &attributeName, co
|
||||
}
|
||||
}
|
||||
|
||||
bool AddEnchantmentRuleDefinition::enchantItem(std::shared_ptr<ItemInstance> item)
|
||||
bool AddEnchantmentRuleDefinition::enchantItem(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
bool enchanted = false;
|
||||
if (item != NULL)
|
||||
|
||||
@@ -19,5 +19,5 @@ public:
|
||||
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
bool enchantItem(std::shared_ptr<ItemInstance> item);
|
||||
bool enchantItem(shared_ptr<ItemInstance> item);
|
||||
};
|
||||
@@ -94,13 +94,13 @@ void AddItemRuleDefinition::addAttribute(const wstring &attributeName, const wst
|
||||
}
|
||||
}
|
||||
|
||||
bool AddItemRuleDefinition::addItemToContainer(std::shared_ptr<Container> container, int slotId)
|
||||
bool AddItemRuleDefinition::addItemToContainer(shared_ptr<Container> container, int slotId)
|
||||
{
|
||||
bool added = false;
|
||||
if(Item::items[m_itemId] != NULL)
|
||||
{
|
||||
int quantity = min(m_quantity, Item::items[m_itemId]->getMaxStackSize());
|
||||
std::shared_ptr<ItemInstance> newItem = std::shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) );
|
||||
shared_ptr<ItemInstance> newItem = shared_ptr<ItemInstance>(new ItemInstance(m_itemId,quantity,m_auxValue) );
|
||||
newItem->set4JData(m_dataTag);
|
||||
|
||||
for(AUTO_VAR(it, m_enchantments.begin()); it != m_enchantments.end(); ++it)
|
||||
|
||||
@@ -26,5 +26,5 @@ public:
|
||||
virtual GameRuleDefinition *addChild(ConsoleGameRules::EGameRuleType ruleType);
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
bool addItemToContainer(std::shared_ptr<Container> container, int slotId);
|
||||
bool addItemToContainer(shared_ptr<Container> container, int slotId);
|
||||
};
|
||||
@@ -74,7 +74,7 @@ void CollectItemRuleDefinition::populateGameRule(GameRulesInstance::EGameRulesIn
|
||||
GameRuleDefinition::populateGameRule(type, rule);
|
||||
}
|
||||
|
||||
bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item)
|
||||
bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
bool statusChanged = false;
|
||||
if(item != NULL && item->id == m_itemId && item->getAuxValue() == m_auxValue && item->get4JData() == m_4JDataValue)
|
||||
@@ -94,7 +94,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<It
|
||||
|
||||
if(rule->getConnection() != NULL)
|
||||
{
|
||||
rule->getConnection()->send( std::shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0)));
|
||||
rule->getConnection()->send( shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId, m_itemId, m_auxValue, this->m_4JDataValue,NULL,0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,7 +102,7 @@ bool CollectItemRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<It
|
||||
return statusChanged;
|
||||
}
|
||||
|
||||
wstring CollectItemRuleDefinition::generateXml(std::shared_ptr<ItemInstance> item)
|
||||
wstring CollectItemRuleDefinition::generateXml(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
// 4J Stu - This should be kept in sync with the GameRulesDefinition.xsd
|
||||
wstring xml = L"";
|
||||
|
||||
@@ -31,9 +31,9 @@ public:
|
||||
|
||||
void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
|
||||
|
||||
bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item);
|
||||
bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item);
|
||||
|
||||
static wstring generateXml(std::shared_ptr<ItemInstance> item);
|
||||
static wstring generateXml(shared_ptr<ItemInstance> item);
|
||||
|
||||
private:
|
||||
//static wstring generateXml(CollectItemRuleDefinition *ruleDef);
|
||||
|
||||
@@ -17,7 +17,7 @@ bool CompleteAllRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, int
|
||||
return statusChanged;
|
||||
}
|
||||
|
||||
bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item)
|
||||
bool CompleteAllRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
bool statusChanged = CompoundGameRuleDefinition::onCollectItem(rule,item);
|
||||
if(statusChanged) updateStatus(rule);
|
||||
@@ -51,7 +51,7 @@ void CompleteAllRuleDefinition::updateStatus(GameRule *rule)
|
||||
auxValue = m_lastRuleStatusChanged->getAuxValue();
|
||||
m_lastRuleStatusChanged = NULL;
|
||||
}
|
||||
rule->getConnection()->send( std::shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData))));
|
||||
rule->getConnection()->send( shared_ptr<UpdateGameRuleProgressPacket>( new UpdateGameRuleProgressPacket(getActionType(), this->m_descriptionId,icon, auxValue, 0,&data,sizeof(PacketData))));
|
||||
}
|
||||
app.DebugPrintf("Updated CompleteAllRule - Completed %d of %d\n", progress, goal);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
virtual void getChildren(vector<GameRuleDefinition *> *children);
|
||||
|
||||
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
|
||||
virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item);
|
||||
virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item);
|
||||
|
||||
static wstring generateDescriptionString(const wstring &description, void *data, int dataLength);
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ bool CompoundGameRuleDefinition::onUseTile(GameRule *rule, int tileId, int x, in
|
||||
return statusChanged;
|
||||
}
|
||||
|
||||
bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item)
|
||||
bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
bool statusChanged = false;
|
||||
for(AUTO_VAR(it, rule->m_parameters.begin()); it != rule->m_parameters.end(); ++it)
|
||||
@@ -109,7 +109,7 @@ bool CompoundGameRuleDefinition::onCollectItem(GameRule *rule, std::shared_ptr<I
|
||||
return statusChanged;
|
||||
}
|
||||
|
||||
void CompoundGameRuleDefinition::postProcessPlayer(std::shared_ptr<Player> player)
|
||||
void CompoundGameRuleDefinition::postProcessPlayer(shared_ptr<Player> player)
|
||||
{
|
||||
for(AUTO_VAR(it, m_children.begin()); it != m_children.end(); ++it)
|
||||
{
|
||||
|
||||
@@ -18,6 +18,6 @@ public:
|
||||
virtual void populateGameRule(GameRulesInstance::EGameRulesInstanceType type, GameRule *rule);
|
||||
|
||||
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z);
|
||||
virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item);
|
||||
virtual void postProcessPlayer(std::shared_ptr<Player> player);
|
||||
virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item);
|
||||
virtual void postProcessPlayer(shared_ptr<Player> player);
|
||||
};
|
||||
@@ -116,7 +116,7 @@ void ConsoleSchematicFile::load(DataInputStream *dis)
|
||||
for (int i = 0; i < tileEntityTags->size(); i++)
|
||||
{
|
||||
CompoundTag *teTag = tileEntityTags->get(i);
|
||||
std::shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag);
|
||||
shared_ptr<TileEntity> te = TileEntity::loadStatic(teTag);
|
||||
|
||||
if(te == NULL)
|
||||
{
|
||||
@@ -433,7 +433,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
{
|
||||
for(AUTO_VAR(it, m_tileEntities.begin()); it != m_tileEntities.end();++it)
|
||||
{
|
||||
std::shared_ptr<TileEntity> te = *it;
|
||||
shared_ptr<TileEntity> te = *it;
|
||||
|
||||
double targetX = te->x;
|
||||
double targetY = te->y + destinationBox->y0;
|
||||
@@ -444,7 +444,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
Vec3 *pos = Vec3::newTemp(targetX,targetY,targetZ);
|
||||
if( chunkBox->containsIncludingLowerBound(pos) )
|
||||
{
|
||||
std::shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
|
||||
shared_ptr<TileEntity> teCopy = chunk->getTileEntity( (int)targetX & 15, (int)targetY & 15, (int)targetZ & 15 );
|
||||
|
||||
if ( teCopy != NULL )
|
||||
{
|
||||
@@ -495,11 +495,11 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
}
|
||||
|
||||
CompoundTag *eTag = it->second;
|
||||
std::shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL);
|
||||
shared_ptr<Entity> e = EntityIO::loadStatic(eTag, NULL);
|
||||
|
||||
if( e->GetType() == eTYPE_PAINTING )
|
||||
{
|
||||
std::shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
|
||||
shared_ptr<Painting> painting = dynamic_pointer_cast<Painting>(e);
|
||||
|
||||
double tileX = painting->xTile;
|
||||
double tileZ = painting->zTile;
|
||||
@@ -512,7 +512,7 @@ void ConsoleSchematicFile::applyTileEntities(LevelChunk *chunk, AABB *chunkBox,
|
||||
}
|
||||
else if( e->GetType() == eTYPE_ITEM_FRAME )
|
||||
{
|
||||
std::shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
|
||||
shared_ptr<ItemFrame> frame = dynamic_pointer_cast<ItemFrame>(e);
|
||||
|
||||
double tileX = frame->xTile;
|
||||
double tileZ = frame->zTile;
|
||||
@@ -678,12 +678,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
{
|
||||
for (int zc = zc0; zc <= zc1; zc++)
|
||||
{
|
||||
vector<std::shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize);
|
||||
vector<shared_ptr<TileEntity> > *tileEntities = getTileEntitiesInRegion(level->getChunk(xc, zc), xStart, yStart, zStart, xStart + xSize, yStart + ySize, zStart + zSize);
|
||||
for(AUTO_VAR(it, tileEntities->begin()); it != tileEntities->end(); ++it)
|
||||
{
|
||||
std::shared_ptr<TileEntity> te = *it;
|
||||
shared_ptr<TileEntity> te = *it;
|
||||
CompoundTag *teTag = new CompoundTag();
|
||||
std::shared_ptr<TileEntity> teCopy = te->clone();
|
||||
shared_ptr<TileEntity> teCopy = te->clone();
|
||||
|
||||
// Adjust the tileEntity position to schematic coords from world co-ords
|
||||
teCopy->x -= xStart;
|
||||
@@ -698,12 +698,12 @@ void ConsoleSchematicFile::generateSchematicFile(DataOutputStream *dos, Level *l
|
||||
tag.put(L"TileEntities", tileEntitiesTag);
|
||||
|
||||
AABB *bb = AABB::newTemp(xStart,yStart,zStart,xEnd,yEnd,zEnd);
|
||||
vector<std::shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb);
|
||||
vector<shared_ptr<Entity> > *entities = level->getEntities(nullptr, bb);
|
||||
ListTag<CompoundTag> *entitiesTag = new ListTag<CompoundTag>(L"entities");
|
||||
|
||||
for(AUTO_VAR(it, entities->begin()); it != entities->end(); ++it)
|
||||
{
|
||||
std::shared_ptr<Entity> e = *it;
|
||||
shared_ptr<Entity> e = *it;
|
||||
|
||||
bool mobCanBeSaved = false;
|
||||
if(bSaveMobs)
|
||||
@@ -1005,12 +1005,12 @@ void ConsoleSchematicFile::setBlocksAndData(LevelChunk *chunk, byteArray blockDa
|
||||
}
|
||||
}
|
||||
|
||||
vector<std::shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1)
|
||||
vector<shared_ptr<TileEntity> > *ConsoleSchematicFile::getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1)
|
||||
{
|
||||
vector<std::shared_ptr<TileEntity> > *result = new vector<std::shared_ptr<TileEntity> >;
|
||||
vector<shared_ptr<TileEntity> > *result = new vector<shared_ptr<TileEntity> >;
|
||||
for (AUTO_VAR(it, chunk->tileEntities.begin()); it != chunk->tileEntities.end(); ++it)
|
||||
{
|
||||
std::shared_ptr<TileEntity> te = it->second;
|
||||
shared_ptr<TileEntity> te = it->second;
|
||||
if (te->x >= x0 && te->y >= y0 && te->z >= z0 && te->x < x1 && te->y < y1 && te->z < z1)
|
||||
{
|
||||
result->push_back(te);
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
} XboxSchematicInitParam;
|
||||
private:
|
||||
int m_xSize, m_ySize, m_zSize;
|
||||
vector<std::shared_ptr<TileEntity> > m_tileEntities;
|
||||
vector<shared_ptr<TileEntity> > m_tileEntities;
|
||||
vector< pair<Vec3 *, CompoundTag *> > m_entities;
|
||||
|
||||
public:
|
||||
@@ -83,7 +83,7 @@ private:
|
||||
void load_tags(DataInputStream *dis);
|
||||
|
||||
static void getBlocksAndData(LevelChunk *chunk, byteArray *data, int x0, int y0, int z0, int x1, int y1, int z1, int &blocksP, int &dataP, int &blockLightP, int &skyLightP);
|
||||
static vector<std::shared_ptr<TileEntity> > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1);
|
||||
static vector<shared_ptr<TileEntity> > *getTileEntitiesInRegion(LevelChunk *chunk, int x0, int y0, int z0, int x1, int y1, int z1);
|
||||
|
||||
void chunkCoordToSchematicCoord(AABB *destinationBox, int chunkX, int chunkZ, ESchematicRotation rot, int &schematicX, int &schematicZ);
|
||||
void schematicCoordToChunkCoord(AABB *destinationBox, double schematicX, double schematicZ, ESchematicRotation rot, double &chunkX, double &chunkZ);
|
||||
|
||||
@@ -53,7 +53,7 @@ GameRuleDefinition *GameRule::getGameRuleDefinition()
|
||||
}
|
||||
|
||||
void GameRule::onUseTile(int tileId, int x, int y, int z) { m_definition->onUseTile(this,tileId,x,y,z); }
|
||||
void GameRule::onCollectItem(std::shared_ptr<ItemInstance> item) { m_definition->onCollectItem(this,item); }
|
||||
void GameRule::onCollectItem(shared_ptr<ItemInstance> item) { m_definition->onCollectItem(this,item); }
|
||||
|
||||
void GameRule::write(DataOutputStream *dos)
|
||||
{
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
|
||||
// All the hooks go here
|
||||
void onUseTile(int tileId, int x, int y, int z);
|
||||
void onCollectItem(std::shared_ptr<ItemInstance> item);
|
||||
void onCollectItem(shared_ptr<ItemInstance> item);
|
||||
|
||||
// 4J-JEV: For saving.
|
||||
//CompoundTag *toTags(unordered_map<GameRuleDefinition *, int> *map);
|
||||
|
||||
@@ -53,8 +53,8 @@ public:
|
||||
|
||||
// Here we should have functions for all the hooks, with a GameRule* as the first parameter
|
||||
virtual bool onUseTile(GameRule *rule, int tileId, int x, int y, int z) { return false; }
|
||||
virtual bool onCollectItem(GameRule *rule, std::shared_ptr<ItemInstance> item) { return false; }
|
||||
virtual void postProcessPlayer(std::shared_ptr<Player> player) { }
|
||||
virtual bool onCollectItem(GameRule *rule, shared_ptr<ItemInstance> item) { return false; }
|
||||
virtual void postProcessPlayer(shared_ptr<Player> player) { }
|
||||
|
||||
vector<GameRuleDefinition *> *enumerate();
|
||||
unordered_map<GameRuleDefinition *, int> *enumerateMap();
|
||||
|
||||
@@ -130,7 +130,7 @@ void UpdatePlayerRuleDefinition::addAttribute(const wstring &attributeName, cons
|
||||
}
|
||||
}
|
||||
|
||||
void UpdatePlayerRuleDefinition::postProcessPlayer(std::shared_ptr<Player> player)
|
||||
void UpdatePlayerRuleDefinition::postProcessPlayer(shared_ptr<Player> player)
|
||||
{
|
||||
if(m_bUpdateHealth)
|
||||
{
|
||||
|
||||
@@ -29,5 +29,5 @@ public:
|
||||
virtual void writeAttributes(DataOutputStream *dos, UINT numAttributes);
|
||||
virtual void addAttribute(const wstring &attributeName, const wstring &attributeValue);
|
||||
|
||||
virtual void postProcessPlayer(std::shared_ptr<Player> player);
|
||||
virtual void postProcessPlayer(shared_ptr<Player> player);
|
||||
};
|
||||
@@ -78,7 +78,7 @@ bool XboxStructureActionPlaceContainer::placeContainerInLevel(StructurePiece *st
|
||||
}
|
||||
|
||||
level->setTile( worldX, worldY, worldZ, m_tile );
|
||||
std::shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ ));
|
||||
shared_ptr<Container> container = dynamic_pointer_cast<Container>(level->getTileEntity( worldX, worldY, worldZ ));
|
||||
|
||||
app.DebugPrintf("XboxStructureActionPlaceContainer - placing a container at (%d,%d,%d)\n", worldX, worldY, worldZ);
|
||||
if ( container != NULL )
|
||||
|
||||
@@ -54,7 +54,7 @@ bool XboxStructureActionPlaceSpawner::placeSpawnerInLevel(StructurePiece *struct
|
||||
}
|
||||
|
||||
level->setTile( worldX, worldY, worldZ, m_tile );
|
||||
std::shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ ));
|
||||
shared_ptr<MobSpawnerTileEntity> entity = dynamic_pointer_cast<MobSpawnerTileEntity>(level->getTileEntity( worldX, worldY, worldZ ));
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
wprintf(L"XboxStructureActionPlaceSpawner - placing a %ls spawner at (%d,%d,%d)\n", m_entityId.c_str(), worldX, worldY, worldZ);
|
||||
|
||||
@@ -316,7 +316,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
return false;
|
||||
}
|
||||
|
||||
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(minecraft->user->name) ) );
|
||||
|
||||
// Tick connection until we're ready to go. The stages involved in this are:
|
||||
// (1) Creating the ClientConnection sends a prelogin packet to the server
|
||||
@@ -403,7 +403,7 @@ bool CGameNetworkManager::StartNetworkGame(Minecraft *minecraft, LPVOID lpParame
|
||||
// Open the socket on the server end to accept incoming data
|
||||
Socket::addIncomingSocket(socket);
|
||||
|
||||
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) );
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket(convStringToWstring( ProfileManager.GetGamertag(idx) )) ) );
|
||||
|
||||
createdConnections.push_back( connection );
|
||||
|
||||
@@ -1134,7 +1134,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
PlayerList *players = pServer->getPlayers();
|
||||
for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it)
|
||||
{
|
||||
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||
shared_ptr<ServerPlayer> servPlayer = *it;
|
||||
if( servPlayer->connection->isLocal() && !servPlayer->connection->isGuest() )
|
||||
{
|
||||
servPlayer->connection->connection->getSocket()->setPlayer(NULL);
|
||||
@@ -1202,7 +1202,7 @@ int CGameNetworkManager::ChangeSessionTypeThreadProc( void* lpParam )
|
||||
PlayerList *players = pServer->getPlayers();
|
||||
for(AUTO_VAR(it, players->players.begin()); it < players->players.end(); ++it)
|
||||
{
|
||||
std::shared_ptr<ServerPlayer> servPlayer = *it;
|
||||
shared_ptr<ServerPlayer> servPlayer = *it;
|
||||
if( servPlayer->getXuid() == localPlayerXuid )
|
||||
{
|
||||
servPlayer->connection->connection->getSocket()->setPlayer( g_NetworkManager.GetLocalPlayerByUserIndex(index) );
|
||||
@@ -1391,7 +1391,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
Socket *socket = NULL;
|
||||
std::shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
|
||||
shared_ptr<MultiplayerLocalPlayer> mpPlayer = pMinecraft->localplayers[pNetworkPlayer->GetUserIndex()];
|
||||
if( localPlayer && mpPlayer != NULL && mpPlayer->connection != NULL)
|
||||
{
|
||||
// If we already have a MultiplayerLocalPlayer here then we are doing a session type change
|
||||
@@ -1428,7 +1428,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
|
||||
if( connection->createdOk )
|
||||
{
|
||||
connection->send( std::shared_ptr<PreLoginPacket>( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) );
|
||||
connection->send( shared_ptr<PreLoginPacket>( new PreLoginPacket( pNetworkPlayer->GetOnlineName() ) ) );
|
||||
pMinecraft->addPendingLocalConnection(idx, connection);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -60,10 +60,10 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
{
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
|
||||
{
|
||||
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -101,10 +101,10 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
{
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
|
||||
{
|
||||
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -125,10 +125,10 @@ void ChangeStateConstraint::tick(int iPad)
|
||||
{
|
||||
// Send update settings packet to server
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
shared_ptr<MultiplayerLocalPlayer> player = minecraft->localplayers[iPad];
|
||||
if(player != NULL && player->connection && player->connection->getNetworkPlayer() != NULL)
|
||||
{
|
||||
player->connection->send( std::shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
player->connection->send( shared_ptr<PlayerInfoPacket>( new PlayerInfoPacket( player->connection->getNetworkPlayer()->GetSmallId(), -1, playerPrivs) ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ bool CompleteUsingItemTask::isCompleted()
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void CompleteUsingItemTask::completeUsingItem(std::shared_ptr<ItemInstance> item)
|
||||
void CompleteUsingItemTask::completeUsingItem(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(!hasBeenActivated() && !isPreCompletionEnabled()) return;
|
||||
for(int i=0;i<m_iValidItemsCount;i++)
|
||||
|
||||
@@ -16,5 +16,5 @@ public:
|
||||
CompleteUsingItemTask(Tutorial *tutorial, int descriptionId, int itemIds[], unsigned int itemIdsLength, bool enablePreCompletion = false);
|
||||
virtual ~CompleteUsingItemTask();
|
||||
virtual bool isCompleted();
|
||||
virtual void completeUsingItem(std::shared_ptr<ItemInstance> item);
|
||||
virtual void completeUsingItem(shared_ptr<ItemInstance> item);
|
||||
};
|
||||
@@ -40,7 +40,7 @@ CraftTask::~CraftTask()
|
||||
delete[] m_auxValues;
|
||||
}
|
||||
|
||||
void CraftTask::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
void CraftTask::onCrafted(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
wprintf(L"CraftTask::onCrafted - %ls\n", item->toString().c_str() );
|
||||
|
||||
@@ -14,7 +14,7 @@ public:
|
||||
~CraftTask();
|
||||
|
||||
virtual bool isCompleted() { return bIsCompleted; }
|
||||
virtual void onCrafted(std::shared_ptr<ItemInstance> item);
|
||||
virtual void onCrafted(shared_ptr<ItemInstance> item);
|
||||
|
||||
private:
|
||||
int *m_items;
|
||||
|
||||
@@ -20,7 +20,7 @@ DiggerItemHint::DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descri
|
||||
tutorial->addMessage(IDS_TUTORIAL_HINT_ATTACK_WITH_TOOL, true);
|
||||
}
|
||||
|
||||
int DiggerItemHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
|
||||
int DiggerItemHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
@@ -46,7 +46,7 @@ int DiggerItemHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *
|
||||
return -1;
|
||||
}
|
||||
|
||||
int DiggerItemHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity)
|
||||
int DiggerItemHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
|
||||
@@ -13,6 +13,6 @@ private:
|
||||
|
||||
public:
|
||||
DiggerItemHint(eTutorial_Hint id, Tutorial *tutorial, int descriptionId, int items[], unsigned int itemsLength);
|
||||
virtual int startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity);
|
||||
virtual int startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity);
|
||||
};
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "stdafx.h"
|
||||
#include "PickupTask.h"
|
||||
|
||||
void PickupTask::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
void PickupTask::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
{
|
||||
if(item->id == m_itemId)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ public:
|
||||
{}
|
||||
|
||||
virtual bool isCompleted() { return bIsCompleted; }
|
||||
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
|
||||
private:
|
||||
int m_itemId;
|
||||
|
||||
@@ -111,7 +111,7 @@ bool ProcedureCompoundTask::isCompleted()
|
||||
return allCompleted;
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
void ProcedureCompoundTask::onCrafted(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
@@ -222,7 +222,7 @@ bool ProcedureCompoundTask::AllowFade()
|
||||
return allowFade;
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
void ProcedureCompoundTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
@@ -232,7 +232,7 @@ void ProcedureCompoundTask::useItemOn(Level *level, std::shared_ptr<ItemInstance
|
||||
}
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
void ProcedureCompoundTask::useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
@@ -242,7 +242,7 @@ void ProcedureCompoundTask::useItem(std::shared_ptr<ItemInstance> item, bool bTe
|
||||
}
|
||||
}
|
||||
|
||||
void ProcedureCompoundTask::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
void ProcedureCompoundTask::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
{
|
||||
AUTO_VAR(itEnd, m_taskSequence.end());
|
||||
for(AUTO_VAR(it, m_taskSequence.begin()); it < itEnd; ++it)
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
virtual int getDescriptionId();
|
||||
virtual int getPromptId();
|
||||
virtual bool isCompleted();
|
||||
virtual void onCrafted(std::shared_ptr<ItemInstance> item);
|
||||
virtual void onCrafted(shared_ptr<ItemInstance> item);
|
||||
virtual void handleUIInput(int iAction);
|
||||
virtual void setAsCurrentTask(bool active = true);
|
||||
virtual bool ShowMinimumTime();
|
||||
@@ -26,9 +26,9 @@ public:
|
||||
virtual void setShownForMinimumTime();
|
||||
virtual bool AllowFade();
|
||||
|
||||
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
virtual void useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
virtual void onStateChange(eTutorial_State newState);
|
||||
|
||||
private:
|
||||
|
||||
@@ -17,7 +17,7 @@ TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], u
|
||||
}
|
||||
}
|
||||
|
||||
bool TakeItemHint::onTake(std::shared_ptr<ItemInstance> item)
|
||||
bool TakeItemHint::onTake(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
|
||||
@@ -15,5 +15,5 @@ public:
|
||||
TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength);
|
||||
~TakeItemHint();
|
||||
|
||||
virtual bool onTake( std::shared_ptr<ItemInstance> item );
|
||||
virtual bool onTake( shared_ptr<ItemInstance> item );
|
||||
};
|
||||
@@ -1681,7 +1681,7 @@ void Tutorial::showTutorialPopup(bool show)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly)
|
||||
void Tutorial::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly)
|
||||
{
|
||||
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
|
||||
{
|
||||
@@ -1690,7 +1690,7 @@ void Tutorial::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
void Tutorial::useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
{
|
||||
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
|
||||
{
|
||||
@@ -1699,7 +1699,7 @@ void Tutorial::useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item)
|
||||
void Tutorial::completeUsingItem(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
for(AUTO_VAR(it, activeTasks[m_CurrentState].begin()); it < activeTasks[m_CurrentState].end(); ++it)
|
||||
{
|
||||
@@ -1718,7 +1718,7 @@ void Tutorial::completeUsingItem(std::shared_ptr<ItemInstance> item)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
|
||||
void Tutorial::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1754,7 +1754,7 @@ void Tutorial::destroyBlock(Tile *tile)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity)
|
||||
void Tutorial::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1772,7 +1772,7 @@ void Tutorial::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> en
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::itemDamaged(std::shared_ptr<ItemInstance> item)
|
||||
void Tutorial::itemDamaged(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1803,7 +1803,7 @@ void Tutorial::handleUIInput(int iAction)
|
||||
currentTask[m_CurrentState]->handleUIInput(iAction);
|
||||
}
|
||||
|
||||
void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake)
|
||||
void Tutorial::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
|
||||
{
|
||||
int hintNeeded = -1;
|
||||
for(AUTO_VAR(it, hints[m_CurrentState].begin()); it < hints[m_CurrentState].end(); ++it)
|
||||
@@ -1821,7 +1821,7 @@ void Tutorial::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMa
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
void Tutorial::onCrafted(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
for(unsigned int state = 0; state < e_Tutorial_State_Max; ++state)
|
||||
{
|
||||
@@ -1833,7 +1833,7 @@ void Tutorial::onCrafted(std::shared_ptr<ItemInstance> item)
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
void Tutorial::onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux)
|
||||
{
|
||||
if( !m_hintDisplayed )
|
||||
{
|
||||
@@ -1860,7 +1860,7 @@ void Tutorial::onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCo
|
||||
}
|
||||
}
|
||||
|
||||
void Tutorial::onSelectedItemChanged(std::shared_ptr<ItemInstance> item)
|
||||
void Tutorial::onSelectedItemChanged(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
// We only handle this if we are in a state that allows changing based on the selected item
|
||||
// Menus and states like riding in a minecart will NOT allow this
|
||||
|
||||
@@ -151,19 +151,19 @@ public:
|
||||
|
||||
void showTutorialPopup(bool show);
|
||||
|
||||
void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly=false);
|
||||
void useItemOn(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
void completeUsingItem(std::shared_ptr<ItemInstance> item);
|
||||
void startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile);
|
||||
void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly=false);
|
||||
void useItemOn(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
void completeUsingItem(shared_ptr<ItemInstance> item);
|
||||
void startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
|
||||
void destroyBlock(Tile *tile);
|
||||
void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity);
|
||||
void itemDamaged(std::shared_ptr<ItemInstance> item);
|
||||
void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
|
||||
void itemDamaged(shared_ptr<ItemInstance> item);
|
||||
|
||||
void handleUIInput(int iAction);
|
||||
void createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake);
|
||||
void onCrafted(std::shared_ptr<ItemInstance> item);
|
||||
void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
void onSelectedItemChanged(std::shared_ptr<ItemInstance> item);
|
||||
void createItemSelected(shared_ptr<ItemInstance> item, bool canMake);
|
||||
void onCrafted(shared_ptr<ItemInstance> item);
|
||||
void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux);
|
||||
void onSelectedItemChanged(shared_ptr<ItemInstance> item);
|
||||
void onLookAt(int id, int iData=0);
|
||||
void onLookAtEntity(eINSTANCEOF type);
|
||||
void onEffectChanged(MobEffect *effect, bool bRemoved=false);
|
||||
|
||||
@@ -14,7 +14,7 @@ TutorialHint::TutorialHint(eTutorial_Hint id, Tutorial *tutorial, int descriptio
|
||||
tutorial->addMessage(descriptionId, type != e_Hint_NoIngredients);
|
||||
}
|
||||
|
||||
int TutorialHint::startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile)
|
||||
int TutorialHint::startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile)
|
||||
{
|
||||
int returnVal = -1;
|
||||
switch(m_type)
|
||||
@@ -59,7 +59,7 @@ int TutorialHint::destroyBlock(Tile *tile)
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
int TutorialHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity)
|
||||
int TutorialHint::attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity)
|
||||
{
|
||||
/*
|
||||
switch(m_type)
|
||||
@@ -71,7 +71,7 @@ int TutorialHint::attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Ent
|
||||
return -1;
|
||||
}
|
||||
|
||||
int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake)
|
||||
int TutorialHint::createItemSelected(shared_ptr<ItemInstance> item, bool canMake)
|
||||
{
|
||||
int returnVal = -1;
|
||||
switch(m_type)
|
||||
@@ -86,7 +86,7 @@ int TutorialHint::createItemSelected(std::shared_ptr<ItemInstance> item, bool ca
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item)
|
||||
int TutorialHint::itemDamaged(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
int returnVal = -1;
|
||||
switch(m_type)
|
||||
@@ -100,7 +100,7 @@ int TutorialHint::itemDamaged(std::shared_ptr<ItemInstance> item)
|
||||
return returnVal;
|
||||
}
|
||||
|
||||
bool TutorialHint::onTake( std::shared_ptr<ItemInstance> item )
|
||||
bool TutorialHint::onTake( shared_ptr<ItemInstance> item )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ public:
|
||||
|
||||
eTutorial_Hint getId() { return m_id; }
|
||||
|
||||
virtual int startDestroyBlock(std::shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int startDestroyBlock(shared_ptr<ItemInstance> item, Tile *tile);
|
||||
virtual int destroyBlock(Tile *tile);
|
||||
virtual int attack(std::shared_ptr<ItemInstance> item, std::shared_ptr<Entity> entity);
|
||||
virtual int createItemSelected(std::shared_ptr<ItemInstance> item, bool canMake);
|
||||
virtual int itemDamaged(std::shared_ptr<ItemInstance> item);
|
||||
virtual bool onTake( std::shared_ptr<ItemInstance> item );
|
||||
virtual int attack(shared_ptr<ItemInstance> item, shared_ptr<Entity> entity);
|
||||
virtual int createItemSelected(shared_ptr<ItemInstance> item, bool canMake);
|
||||
virtual int itemDamaged(shared_ptr<ItemInstance> item);
|
||||
virtual bool onTake( shared_ptr<ItemInstance> item );
|
||||
virtual bool onLookAt(int id, int iData=0);
|
||||
virtual bool onLookAtEntity(eINSTANCEOF type);
|
||||
virtual int tick();
|
||||
|
||||
@@ -36,7 +36,7 @@ bool TutorialMode::destroyBlock(int x, int y, int z, int face)
|
||||
int t = minecraft->level->getTile(x, y, z);
|
||||
tutorial->destroyBlock(Tile::tiles[t]);
|
||||
}
|
||||
std::shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
shared_ptr<ItemInstance> item = minecraft->player->getSelectedItem();
|
||||
int damageBefore;
|
||||
if(item != NULL)
|
||||
{
|
||||
@@ -78,7 +78,7 @@ void TutorialMode::tick()
|
||||
*/
|
||||
}
|
||||
|
||||
bool TutorialMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem)
|
||||
bool TutorialMode::useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly, bool *pbUsedItem)
|
||||
{
|
||||
bool haveItem = false;
|
||||
int itemCount = 0;
|
||||
@@ -110,7 +110,7 @@ bool TutorialMode::useItemOn(std::shared_ptr<Player> player, Level *level, std::
|
||||
return result;
|
||||
}
|
||||
|
||||
void TutorialMode::attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity)
|
||||
void TutorialMode::attack(shared_ptr<Player> player, shared_ptr<Entity> entity)
|
||||
{
|
||||
if(!tutorial->m_allTutorialsComplete)
|
||||
tutorial->attack(player, entity);
|
||||
|
||||
@@ -19,8 +19,8 @@ public:
|
||||
virtual void startDestroyBlock(int x, int y, int z, int face);
|
||||
virtual bool destroyBlock(int x, int y, int z, int face);
|
||||
virtual void tick();
|
||||
virtual bool useItemOn(std::shared_ptr<Player> player, Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual void attack(std::shared_ptr<Player> player, std::shared_ptr<Entity> entity);
|
||||
virtual bool useItemOn(shared_ptr<Player> player, Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, int face, Vec3 *hit, bool bTestUseOnly=false, bool *pbUsedItem=NULL);
|
||||
virtual void attack(shared_ptr<Player> player, shared_ptr<Entity> entity);
|
||||
|
||||
virtual bool isInputAllowed(int mapping);
|
||||
|
||||
|
||||
@@ -52,12 +52,12 @@ public:
|
||||
bool TaskReminders() { return m_bTaskReminders;}
|
||||
virtual bool ShowMinimumTime() { return m_bShowMinimumTime;}
|
||||
|
||||
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { }
|
||||
virtual void useItem(std::shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { }
|
||||
virtual void completeUsingItem(std::shared_ptr<ItemInstance> item) { }
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false) { }
|
||||
virtual void useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly=false) { }
|
||||
virtual void completeUsingItem(shared_ptr<ItemInstance> item) { }
|
||||
virtual void handleUIInput(int iAction) { }
|
||||
virtual void onCrafted(std::shared_ptr<ItemInstance> item) { }
|
||||
virtual void onTake(std::shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { }
|
||||
virtual void onCrafted(shared_ptr<ItemInstance> item) { }
|
||||
virtual void onTake(shared_ptr<ItemInstance> item, unsigned int invItemCountAnyAux, unsigned int invItemCountThisAux) { }
|
||||
virtual void onStateChange(eTutorial_State newState) { }
|
||||
virtual void onEffectChanged(MobEffect *effect, bool bRemoved=false) { }
|
||||
};
|
||||
@@ -16,7 +16,7 @@ bool UseItemTask::isCompleted()
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void UseItemTask::useItem(std::shared_ptr<ItemInstance> item,bool bTestUseOnly)
|
||||
void UseItemTask::useItem(shared_ptr<ItemInstance> item,bool bTestUseOnly)
|
||||
{
|
||||
if(bTestUseOnly) return;
|
||||
|
||||
|
||||
@@ -16,5 +16,5 @@ public:
|
||||
UseItemTask(const int itemId, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true );
|
||||
virtual bool isCompleted();
|
||||
virtual void useItem(std::shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
virtual void useItem(shared_ptr<ItemInstance> item, bool bTestUseOnly=false);
|
||||
};
|
||||
@@ -25,7 +25,7 @@ bool UseTileTask::isCompleted()
|
||||
return bIsCompleted;
|
||||
}
|
||||
|
||||
void UseTileTask::useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
void UseTileTask::useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z,bool bTestUseOnly)
|
||||
{
|
||||
if(bTestUseOnly) return;
|
||||
|
||||
|
||||
@@ -20,5 +20,5 @@ public:
|
||||
UseTileTask(const int tileId, Tutorial *tutorial, int descriptionId,
|
||||
bool enablePreCompletion = false, vector<TutorialConstraint *> *inConstraints = NULL, bool bShowMinimumTime = false, bool bAllowFade = true, bool bTaskReminders = true);
|
||||
virtual bool isCompleted();
|
||||
virtual void useItemOn(Level *level, std::shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
virtual void useItemOn(Level *level, shared_ptr<ItemInstance> item, int x, int y, int z, bool bTestUseOnly=false);
|
||||
};
|
||||
@@ -704,11 +704,11 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
// Determine appropriate context sensitive tool tips, based on what is carried on the pointer and what is under the pointer.
|
||||
|
||||
// What are we carrying on pointer.
|
||||
std::shared_ptr<LocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
std::shared_ptr<ItemInstance> carriedItem = nullptr;
|
||||
shared_ptr<LocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
shared_ptr<ItemInstance> carriedItem = nullptr;
|
||||
if(player != NULL) carriedItem = player->inventory->getCarried();
|
||||
|
||||
std::shared_ptr<ItemInstance> slotItem = nullptr;
|
||||
shared_ptr<ItemInstance> slotItem = nullptr;
|
||||
Slot *slot = NULL;
|
||||
int slotIndex = 0;
|
||||
if(bPointerIsOverSlot)
|
||||
@@ -889,7 +889,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
|
||||
if((eSectionUnderPointer==eSectionInventoryUsing)||(eSectionUnderPointer==eSectionInventoryInventory))
|
||||
{
|
||||
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
ArmorRecipes::_eArmorType eArmourType=ArmorRecipes::GetArmorType(item->id);
|
||||
|
||||
if(eArmourType==ArmorRecipes::eArmorType_None)
|
||||
@@ -952,7 +952,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
else if((eSectionUnderPointer==eSectionFurnaceUsing)||(eSectionUnderPointer==eSectionFurnaceInventory))
|
||||
{
|
||||
// Get the info on this item.
|
||||
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
bool bValidFuel = FurnaceTileEntity::isFuel(item);
|
||||
bool bValidIngredient = FurnaceRecipes::getInstance()->getResult(item->getItem()->id) != NULL;
|
||||
|
||||
@@ -962,7 +962,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
if(!isSlotEmpty(eSectionFurnaceIngredient,0))
|
||||
{
|
||||
// is it the same as this item
|
||||
std::shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0);
|
||||
shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0);
|
||||
if(IngredientItem->id == item->id)
|
||||
{
|
||||
buttonY = eToolTipQuickMoveIngredient;
|
||||
@@ -991,7 +991,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
if(!isSlotEmpty(eSectionFurnaceFuel,0))
|
||||
{
|
||||
// is it the same as this item
|
||||
std::shared_ptr<ItemInstance> fuelItem = getSlotItem(eSectionFurnaceFuel,0);
|
||||
shared_ptr<ItemInstance> fuelItem = getSlotItem(eSectionFurnaceFuel,0);
|
||||
if(fuelItem->id == item->id)
|
||||
{
|
||||
buttonY = eToolTipQuickMoveFuel;
|
||||
@@ -1002,7 +1002,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
if(!isSlotEmpty(eSectionFurnaceIngredient,0))
|
||||
{
|
||||
// is it the same as this item
|
||||
std::shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0);
|
||||
shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionFurnaceIngredient,0);
|
||||
if(IngredientItem->id == item->id)
|
||||
{
|
||||
buttonY = eToolTipQuickMoveIngredient;
|
||||
@@ -1044,7 +1044,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
else if((eSectionUnderPointer==eSectionBrewingUsing)||(eSectionUnderPointer==eSectionBrewingInventory))
|
||||
{
|
||||
// Get the info on this item.
|
||||
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
int iId=item->id;
|
||||
|
||||
// valid ingredient?
|
||||
@@ -1062,7 +1062,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
if(!isSlotEmpty(eSectionBrewingIngredient,0))
|
||||
{
|
||||
// is it the same as this item
|
||||
std::shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionBrewingIngredient,0);
|
||||
shared_ptr<ItemInstance> IngredientItem = getSlotItem(eSectionBrewingIngredient,0);
|
||||
if(IngredientItem->id == item->id)
|
||||
{
|
||||
buttonY = eToolTipQuickMoveIngredient;
|
||||
@@ -1104,7 +1104,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
else if((eSectionUnderPointer==eSectionEnchantUsing)||(eSectionUnderPointer==eSectionEnchantInventory))
|
||||
{
|
||||
// Get the info on this item.
|
||||
std::shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
shared_ptr<ItemInstance> item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
int iId=item->id;
|
||||
|
||||
// valid enchantable tool?
|
||||
@@ -1199,7 +1199,7 @@ void IUIScene_AbstractContainerMenu::onMouseTick()
|
||||
SetPointerOutsideMenu( false );
|
||||
}
|
||||
|
||||
std::shared_ptr<ItemInstance> item = nullptr;
|
||||
shared_ptr<ItemInstance> item = nullptr;
|
||||
if(bPointerIsOverSlot && bSlotHasItem) item = getSlotItem(eSectionUnderPointer, iNewSlotIndex);
|
||||
overrideTooltips(eSectionUnderPointer, item, bIsItemCarried, bSlotHasItem, bCarriedIsSameAsSlot, iSlotStackSizeRemaining, buttonA, buttonX, buttonY, buttonRT);
|
||||
|
||||
@@ -1410,7 +1410,7 @@ bool IUIScene_AbstractContainerMenu::handleKeyDown(int iPad, int iAction, bool b
|
||||
bool bSlotHasItem = !isSlotEmpty(m_eCurrSection, currentIndex);
|
||||
if ( bSlotHasItem )
|
||||
{
|
||||
std::shared_ptr<ItemInstance> item = getSlotItem(m_eCurrSection, currentIndex);
|
||||
shared_ptr<ItemInstance> item = getSlotItem(m_eCurrSection, currentIndex);
|
||||
if( Minecraft::GetInstance()->localgameModes[iPad] != NULL )
|
||||
{
|
||||
Tutorial::PopupMessageDetails *message = new Tutorial::PopupMessageDetails;
|
||||
@@ -1569,7 +1569,7 @@ int IUIScene_AbstractContainerMenu::getCurrentIndex(ESceneSection eSection)
|
||||
return currentIndex + getSectionStartOffset(eSection);
|
||||
}
|
||||
|
||||
bool IUIScene_AbstractContainerMenu::IsSameItemAs(std::shared_ptr<ItemInstance> itemA, std::shared_ptr<ItemInstance> itemB)
|
||||
bool IUIScene_AbstractContainerMenu::IsSameItemAs(shared_ptr<ItemInstance> itemA, shared_ptr<ItemInstance> itemB)
|
||||
{
|
||||
if(itemA == NULL || itemB == NULL) return false;
|
||||
|
||||
@@ -1583,7 +1583,7 @@ int IUIScene_AbstractContainerMenu::GetEmptyStackSpace(Slot *slot)
|
||||
|
||||
if(slot != NULL && slot->hasItem())
|
||||
{
|
||||
std::shared_ptr<ItemInstance> item = slot->getItem();
|
||||
shared_ptr<ItemInstance> item = slot->getItem();
|
||||
if ( item->isStackable() )
|
||||
{
|
||||
int iCount = item->GetCount();
|
||||
|
||||
@@ -201,15 +201,15 @@ protected:
|
||||
virtual void setSectionSelectedSlot(ESceneSection eSection, int x, int y) = 0;
|
||||
virtual void setFocusToPointer(int iPad) = 0;
|
||||
virtual void SetPointerText(const wstring &description, vector<wstring> &unformattedStrings, bool newSlot) = 0;
|
||||
virtual std::shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot) = 0;
|
||||
virtual shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot) = 0;
|
||||
virtual bool isSlotEmpty(ESceneSection eSection, int iSlot) = 0;
|
||||
virtual void adjustPointerForSafeZone() = 0;
|
||||
|
||||
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT) { return false; }
|
||||
|
||||
private:
|
||||
bool IsSameItemAs(std::shared_ptr<ItemInstance> itemA, std::shared_ptr<ItemInstance> itemB);
|
||||
bool IsSameItemAs(shared_ptr<ItemInstance> itemA, shared_ptr<ItemInstance> itemB);
|
||||
int GetEmptyStackSpace(Slot *slot);
|
||||
wstring GetItemDescription(Slot *slot, vector<wstring> &unformattedStrings);
|
||||
|
||||
|
||||
@@ -245,15 +245,15 @@ void IUIScene_AnvilMenu::updateItemName()
|
||||
ByteArrayOutputStream baos;
|
||||
DataOutputStream dos(&baos);
|
||||
dos.writeUTF(m_itemName);
|
||||
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(std::shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray())));
|
||||
Minecraft::GetInstance()->localplayers[getPad()]->connection->send(shared_ptr<CustomPayloadPacket>(new CustomPayloadPacket(CustomPayloadPacket::SET_ITEM_NAME_PACKET, baos.toByteArray())));
|
||||
}
|
||||
|
||||
void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector<std::shared_ptr<ItemInstance> > *items)
|
||||
void IUIScene_AnvilMenu::refreshContainer(AbstractContainerMenu *container, vector<shared_ptr<ItemInstance> > *items)
|
||||
{
|
||||
slotChanged(container, RepairMenu::INPUT_SLOT, container->getSlot(0)->getItem());
|
||||
}
|
||||
|
||||
void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr<ItemInstance> item)
|
||||
void IUIScene_AnvilMenu::slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if (slotIndex == RepairMenu::INPUT_SLOT)
|
||||
{
|
||||
|
||||
@@ -16,7 +16,7 @@ class RepairMenu;
|
||||
class IUIScene_AnvilMenu : public virtual IUIScene_AbstractContainerMenu, public net_minecraft_world_inventory::ContainerListener
|
||||
{
|
||||
protected:
|
||||
std::shared_ptr<Inventory> m_inventory;
|
||||
shared_ptr<Inventory> m_inventory;
|
||||
RepairMenu *m_repairMenu;
|
||||
wstring m_itemName;
|
||||
|
||||
@@ -39,7 +39,7 @@ protected:
|
||||
void updateItemName();
|
||||
|
||||
// ContainerListenr
|
||||
void refreshContainer(AbstractContainerMenu *container, vector<std::shared_ptr<ItemInstance> > *items);
|
||||
void slotChanged(AbstractContainerMenu *container, int slotIndex, std::shared_ptr<ItemInstance> item);
|
||||
void refreshContainer(AbstractContainerMenu *container, vector<shared_ptr<ItemInstance> > *items);
|
||||
void slotChanged(AbstractContainerMenu *container, int slotIndex, shared_ptr<ItemInstance> item);
|
||||
void setContainerData(AbstractContainerMenu *container, int id, int value);
|
||||
};
|
||||
@@ -208,7 +208,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
int iSlot=iVSlotIndexA[m_iCurrentSlotVIndex];
|
||||
|
||||
int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot];
|
||||
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
|
||||
|
||||
if( pMinecraft->localgameModes[iPad] != NULL)
|
||||
@@ -244,7 +244,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
iSlot=0;
|
||||
}
|
||||
int iRecipe= CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot];
|
||||
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
|
||||
|
||||
if( pMinecraft->localgameModes[iPad] != NULL )
|
||||
@@ -272,7 +272,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
{
|
||||
for(int j=0;j<pRecipeIngredientsRequired[iRecipe].iIngValA[i];j++)
|
||||
{
|
||||
std::shared_ptr<ItemInstance> ingItemInst = nullptr;
|
||||
shared_ptr<ItemInstance> ingItemInst = nullptr;
|
||||
// do we need to remove a specific aux value?
|
||||
if(pRecipeIngredientsRequired[iRecipe].iIngAuxValA[i]!=Recipes::ANY_AUX_VALUE)
|
||||
{
|
||||
@@ -291,7 +291,7 @@ bool IUIScene_CraftingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
if (ingItemInst->getItem()->hasCraftingRemainingItem())
|
||||
{
|
||||
// replace item with remaining result
|
||||
m_pPlayer->inventory->add( std::shared_ptr<ItemInstance>( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) );
|
||||
m_pPlayer->inventory->add( shared_ptr<ItemInstance>( new ItemInstance(ingItemInst->getItem()->getCraftingRemainingItem()) ) );
|
||||
}
|
||||
|
||||
}
|
||||
@@ -624,7 +624,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
|
||||
|
||||
// for (int i = 0; i < iRecipeC; i++)
|
||||
// {
|
||||
// std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL);
|
||||
// shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(NULL);
|
||||
// if (pTempItemInst != NULL)
|
||||
// {
|
||||
// wstring itemstring=pTempItemInst->toString();
|
||||
@@ -761,7 +761,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
|
||||
if(iHSlotBrushControl<=m_iCraftablesMaxHSlotC)
|
||||
{
|
||||
bool bFound=false;
|
||||
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[i].pRecipy->assemble(nullptr);
|
||||
//int iIcon=pTempItemInst->getItem()->getIcon(pTempItemInst->getAuxValue());
|
||||
int iID=pTempItemInst->getItem()->id;
|
||||
int iBaseType;
|
||||
@@ -835,7 +835,7 @@ void IUIScene_CraftingMenu::CheckRecipesAvailable()
|
||||
|
||||
while((iIndex<m_iCraftablesMaxHSlotC) && CanBeMadeA[iIndex].iCount!=0)
|
||||
{
|
||||
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[iIndex].iRecipeA[0]].pRecipy->assemble(nullptr);
|
||||
assert(pTempItemInst->id!=0);
|
||||
unsigned int uiAlpha;
|
||||
|
||||
@@ -903,7 +903,7 @@ void IUIScene_CraftingMenu::UpdateHighlight()
|
||||
{
|
||||
iSlot=0;
|
||||
}
|
||||
std::shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr);
|
||||
|
||||
// special case for the torch coal/charcoal
|
||||
int id=pTempItemInstAdditional->getDescriptionId();
|
||||
@@ -991,7 +991,7 @@ void IUIScene_CraftingMenu::UpdateVerticalSlots()
|
||||
{
|
||||
if(i!=1) continue;
|
||||
}
|
||||
std::shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInstAdditional=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iVSlotIndexA[i]]].pRecipy->assemble(nullptr);
|
||||
|
||||
assert(pTempItemInstAdditional->id!=0);
|
||||
unsigned int uiAlpha;
|
||||
@@ -1057,7 +1057,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
|
||||
int iBoxWidth=(m_iContainerType==RECIPE_TYPE_2x2)?2:3;
|
||||
int iRecipe=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot];
|
||||
bool bCanMakeRecipe = pRecipeIngredientsRequired[iRecipe].bCanMake[getPad()];
|
||||
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[iRecipe].pRecipy->assemble(nullptr);
|
||||
|
||||
m_iIngredientsC=pRecipeIngredientsRequired[iRecipe].iIngC;
|
||||
|
||||
@@ -1077,7 +1077,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
|
||||
iAuxVal = 0xFF;
|
||||
}
|
||||
|
||||
std::shared_ptr<ItemInstance> itemInst= std::shared_ptr<ItemInstance>(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal));
|
||||
shared_ptr<ItemInstance> itemInst= shared_ptr<ItemInstance>(new ItemInstance(item,pRecipeIngredientsRequired[iRecipe].iIngValA[i],iAuxVal));
|
||||
|
||||
setIngredientDescriptionItem(getPad(),i,itemInst);
|
||||
setIngredientDescriptionRedBox(i,false);
|
||||
@@ -1141,7 +1141,7 @@ void IUIScene_CraftingMenu::DisplayIngredients()
|
||||
{
|
||||
iAuxVal = 0xFF;
|
||||
}
|
||||
std::shared_ptr<ItemInstance> itemInst= std::shared_ptr<ItemInstance>(new ItemInstance(id,1,iAuxVal));
|
||||
shared_ptr<ItemInstance> itemInst= shared_ptr<ItemInstance>(new ItemInstance(id,1,iAuxVal));
|
||||
setIngredientSlotItem(getPad(),index,itemInst);
|
||||
// show the ingredients we don't have if we can't make the recipe
|
||||
if(app.DebugSettingsOn() && app.GetGameSettingsDebugMask(ProfileManager.GetPrimaryPad())&(1L<<eDebugSetting_CraftAnything))
|
||||
@@ -1218,7 +1218,7 @@ void IUIScene_CraftingMenu::UpdateDescriptionText(bool bCanBeMade)
|
||||
//iRecipy=CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[0];
|
||||
}
|
||||
|
||||
std::shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr);
|
||||
shared_ptr<ItemInstance> pTempItemInst=pRecipeIngredientsRequired[CanBeMadeA[m_iCurrentSlotHIndex].iRecipeA[iSlot]].pRecipy->assemble(nullptr);
|
||||
int iID=pTempItemInst->getItem()->id;
|
||||
int iAuxVal=pTempItemInst->getAuxValue();
|
||||
int iBaseType;
|
||||
|
||||
@@ -49,7 +49,7 @@ protected:
|
||||
int m_iCurrentSlotVIndex;
|
||||
int m_iRecipeC;
|
||||
int m_iContainerType; // 2x2 or 3x3
|
||||
std::shared_ptr<LocalPlayer> m_pPlayer;
|
||||
shared_ptr<LocalPlayer> m_pPlayer;
|
||||
int m_iGroupIndex;
|
||||
|
||||
int iVSlotIndexA[3]; // index of the v slots currently displayed
|
||||
@@ -96,13 +96,13 @@ protected:
|
||||
virtual void hideAllHSlots() = 0;
|
||||
virtual void hideAllVSlots() = 0;
|
||||
virtual void hideAllIngredientsSlots() = 0;
|
||||
virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
||||
virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
||||
virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr<ItemInstance> item) = 0;
|
||||
virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
||||
virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha) = 0;
|
||||
virtual void setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item) = 0;
|
||||
virtual void setCraftingOutputSlotRedBox(bool show) = 0;
|
||||
virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr<ItemInstance> item) = 0;
|
||||
virtual void setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item) = 0;
|
||||
virtual void setIngredientSlotRedBox(int index, bool show) = 0;
|
||||
virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr<ItemInstance> item) = 0;
|
||||
virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item) = 0;
|
||||
virtual void setIngredientDescriptionRedBox(int index, bool show) = 0;
|
||||
virtual void setIngredientDescriptionText(int index, LPCWSTR text) = 0;
|
||||
virtual void setShowCraftHSlot(int iIndex, bool show) = 0;
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
// 4J JEV - Images for each tab.
|
||||
IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL;
|
||||
|
||||
vector< std::shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount];
|
||||
vector< shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[eCreativeInventoryGroupsCount];
|
||||
|
||||
#define ITEM(id) list->push_back( std::shared_ptr<ItemInstance>(new ItemInstance(id, 1, 0)) );
|
||||
#define ITEM_AUX(id, aux) list->push_back( std::shared_ptr<ItemInstance>(new ItemInstance(id, 1, aux)) );
|
||||
#define ITEM(id) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, 0)) );
|
||||
#define ITEM_AUX(id, aux) list->push_back( shared_ptr<ItemInstance>(new ItemInstance(id, 1, aux)) );
|
||||
#define DEF(index) list = &categoryGroups[index];
|
||||
|
||||
|
||||
void IUIScene_CreativeMenu::staticCtor()
|
||||
{
|
||||
vector< std::shared_ptr<ItemInstance> > *list;
|
||||
vector< shared_ptr<ItemInstance> > *list;
|
||||
|
||||
|
||||
// Building Blocks
|
||||
@@ -708,7 +708,7 @@ unsigned int IUIScene_CreativeMenu::TabSpec::getPageCount()
|
||||
|
||||
|
||||
// 4J JEV - Item Picker Menu
|
||||
IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( std::shared_ptr<SimpleContainer> smp, std::shared_ptr<Inventory> inv ) : AbstractContainerMenu()
|
||||
IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( shared_ptr<SimpleContainer> smp, shared_ptr<Inventory> inv ) : AbstractContainerMenu()
|
||||
{
|
||||
inventory = inv;
|
||||
creativeContainer = smp;
|
||||
@@ -734,7 +734,7 @@ IUIScene_CreativeMenu::ItemPickerMenu::ItemPickerMenu( std::shared_ptr<SimpleCon
|
||||
containerId = CONTAINER_ID_CREATIVE;
|
||||
}
|
||||
|
||||
bool IUIScene_CreativeMenu::ItemPickerMenu::stillValid(std::shared_ptr<Player> player)
|
||||
bool IUIScene_CreativeMenu::ItemPickerMenu::stillValid(shared_ptr<Player> player)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -794,7 +794,7 @@ bool IUIScene_CreativeMenu::handleValidKeyPress(int iPad, int buttonNum, BOOL qu
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
|
||||
{
|
||||
std::shared_ptr<ItemInstance> newItem = m_menu->getSlot(i)->getItem();
|
||||
shared_ptr<ItemInstance> newItem = m_menu->getSlot(i)->getItem();
|
||||
|
||||
if(newItem != NULL)
|
||||
{
|
||||
@@ -813,7 +813,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q
|
||||
// Drop items.
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
|
||||
std::shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[iPad]->inventory;
|
||||
shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[iPad]->inventory;
|
||||
if (playerInventory->getCarried() != NULL)
|
||||
{
|
||||
if (buttonNum == 0)
|
||||
@@ -823,7 +823,7 @@ void IUIScene_CreativeMenu::handleOutsideClicked(int iPad, int buttonNum, BOOL q
|
||||
}
|
||||
if (buttonNum == 1)
|
||||
{
|
||||
std::shared_ptr<ItemInstance> removedItem = playerInventory->getCarried()->remove(1);
|
||||
shared_ptr<ItemInstance> removedItem = playerInventory->getCarried()->remove(1);
|
||||
pMinecraft->localgameModes[iPad]->handleCreativeModeItemDrop(removedItem);
|
||||
if (playerInventory->getCarried()->count == 0) playerInventory->setCarried(nullptr);
|
||||
}
|
||||
@@ -894,9 +894,9 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
|
||||
if (buttonNum == 0)
|
||||
{
|
||||
|
||||
std::shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
|
||||
std::shared_ptr<ItemInstance> carried = playerInventory->getCarried();
|
||||
std::shared_ptr<ItemInstance> clicked = m_menu->getSlot(currentIndex)->getItem();
|
||||
shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
|
||||
shared_ptr<ItemInstance> carried = playerInventory->getCarried();
|
||||
shared_ptr<ItemInstance> clicked = m_menu->getSlot(currentIndex)->getItem();
|
||||
if (clicked != NULL)
|
||||
{
|
||||
playerInventory->setCarried(ItemInstance::clone(clicked));
|
||||
@@ -928,7 +928,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
|
||||
quickKeyHeld = FALSE;
|
||||
}
|
||||
m_menu->clicked(currentIndex, buttonNum, quickKeyHeld?AbstractContainerMenu::CLICK_QUICK_MOVE:AbstractContainerMenu::CLICK_PICKUP, pMinecraft->localplayers[getPad()]);
|
||||
std::shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem();
|
||||
shared_ptr<ItemInstance> newItem = m_menu->getSlot(currentIndex)->getItem();
|
||||
// call this function to synchronize multiplayer item bar
|
||||
pMinecraft->localgameModes[getPad()]->handleCreativeModeItemAdd(newItem, currentIndex - (int)m_menu->slots->size() + 9 + InventoryMenu::USE_ROW_SLOT_START);
|
||||
|
||||
@@ -941,7 +941,7 @@ void IUIScene_CreativeMenu::handleSlotListClicked(ESceneSection eSection, int bu
|
||||
m_iCurrSlotX = m_creativeSlotX;
|
||||
m_iCurrSlotY = m_creativeSlotY;
|
||||
|
||||
std::shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
|
||||
shared_ptr<Inventory> playerInventory = pMinecraft->localplayers[getPad()]->inventory;
|
||||
playerInventory->setCarried(nullptr);
|
||||
m_bCarryingCreativeItem = false;
|
||||
}
|
||||
@@ -970,14 +970,14 @@ bool IUIScene_CreativeMenu::CanHaveFocus( ESceneSection eSection )
|
||||
return false;
|
||||
}
|
||||
|
||||
bool IUIScene_CreativeMenu::getEmptyInventorySlot(std::shared_ptr<ItemInstance> item, int &slotX)
|
||||
bool IUIScene_CreativeMenu::getEmptyInventorySlot(shared_ptr<ItemInstance> item, int &slotX)
|
||||
{
|
||||
bool sameItemFound = false;
|
||||
bool emptySlotFound = false;
|
||||
// Jump to the slot with this item already on it, if we can stack more
|
||||
for(unsigned int i = TabSpec::MAX_SIZE; i < TabSpec::MAX_SIZE + 9; ++i)
|
||||
{
|
||||
std::shared_ptr<ItemInstance> slotItem = m_menu->getSlot(i)->getItem();
|
||||
shared_ptr<ItemInstance> slotItem = m_menu->getSlot(i)->getItem();
|
||||
if( slotItem != NULL && slotItem->sameItem(item) && (slotItem->GetCount() + item->GetCount() <= item->getMaxStackSize() ))
|
||||
{
|
||||
sameItemFound = true;
|
||||
@@ -1020,7 +1020,7 @@ int IUIScene_CreativeMenu::getSectionStartOffset(ESceneSection eSection)
|
||||
return offset;
|
||||
}
|
||||
|
||||
bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
bool IUIScene_CreativeMenu::overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT)
|
||||
{
|
||||
bool _override = false;
|
||||
|
||||
@@ -74,21 +74,21 @@ public:
|
||||
class ItemPickerMenu : public AbstractContainerMenu
|
||||
{
|
||||
protected:
|
||||
std::shared_ptr<SimpleContainer> creativeContainer;
|
||||
std::shared_ptr<Inventory> inventory;
|
||||
shared_ptr<SimpleContainer> creativeContainer;
|
||||
shared_ptr<Inventory> inventory;
|
||||
|
||||
public:
|
||||
ItemPickerMenu( std::shared_ptr<SimpleContainer> creativeContainer, std::shared_ptr<Inventory> inventory );
|
||||
ItemPickerMenu( shared_ptr<SimpleContainer> creativeContainer, shared_ptr<Inventory> inventory );
|
||||
|
||||
virtual bool stillValid(std::shared_ptr<Player> player);
|
||||
virtual bool stillValid(shared_ptr<Player> player);
|
||||
bool isOverrideResultClick(int slotNum, int buttonNum);
|
||||
protected:
|
||||
// 4J Stu - Brought forward from 1.2 to fix infinite recursion bug in creative
|
||||
virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, std::shared_ptr<Player> player) { } // do nothing
|
||||
virtual void loopClick(int slotIndex, int buttonNum, bool quickKeyHeld, shared_ptr<Player> player) { } // do nothing
|
||||
} *itemPickerMenu;
|
||||
|
||||
protected:
|
||||
static vector< std::shared_ptr<ItemInstance> > categoryGroups[eCreativeInventoryGroupsCount];
|
||||
static vector< shared_ptr<ItemInstance> > categoryGroups[eCreativeInventoryGroupsCount];
|
||||
// 4J JEV - Tabs
|
||||
static TabSpec **specs;
|
||||
|
||||
@@ -112,11 +112,11 @@ protected:
|
||||
virtual void handleOutsideClicked(int iPad, int buttonNum, BOOL quickKeyHeld);
|
||||
virtual void handleAdditionalKeyPress(int iAction);
|
||||
virtual void handleSlotListClicked(ESceneSection eSection, int buttonNum, BOOL quickKeyHeld);
|
||||
bool getEmptyInventorySlot(std::shared_ptr<ItemInstance> item, int &slotX);
|
||||
bool getEmptyInventorySlot(shared_ptr<ItemInstance> item, int &slotX);
|
||||
int getSectionStartOffset(ESceneSection eSection);
|
||||
virtual bool IsSectionSlotList( ESceneSection eSection );
|
||||
virtual bool CanHaveFocus( ESceneSection eSection );
|
||||
|
||||
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, std::shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
virtual bool overrideTooltips(ESceneSection sectionUnderPointer, shared_ptr<ItemInstance> itemUnderPointer, bool bIsItemCarried, bool bSlotHasItem, bool bCarriedIsSameAsSlot, int iSlotStackSizeRemaining,
|
||||
EToolTipItem &buttonA, EToolTipItem &buttonX, EToolTipItem &buttonY, EToolTipItem &buttonRT);
|
||||
};
|
||||
@@ -16,7 +16,7 @@ IUIScene_TradingMenu::IUIScene_TradingMenu()
|
||||
m_bHasUpdatedOnce = false;
|
||||
}
|
||||
|
||||
std::shared_ptr<Merchant> IUIScene_TradingMenu::getMerchant()
|
||||
shared_ptr<Merchant> IUIScene_TradingMenu::getMerchant()
|
||||
{
|
||||
return m_merchant;
|
||||
}
|
||||
@@ -70,9 +70,9 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
if(!activeRecipe->isDeprecated())
|
||||
{
|
||||
// Do we have the ingredients?
|
||||
std::shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem();
|
||||
std::shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem();
|
||||
shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem();
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
int buyAMatches = player->inventory->countMatches(buyAItem);
|
||||
int buyBMatches = player->inventory->countMatches(buyBItem);
|
||||
if( (buyAItem != NULL && buyAMatches >= buyAItem->count) && (buyBItem == NULL || buyBMatches >= buyBItem->count) )
|
||||
@@ -84,7 +84,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
player->inventory->removeResources(buyBItem);
|
||||
|
||||
// Add the item we have purchased
|
||||
std::shared_ptr<ItemInstance> result = activeRecipe->getSellItem()->copy();
|
||||
shared_ptr<ItemInstance> result = activeRecipe->getSellItem()->copy();
|
||||
if(!player->inventory->add( result ) )
|
||||
{
|
||||
player->drop(result);
|
||||
@@ -92,7 +92,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
|
||||
// Send a packet to the server
|
||||
int actualShopItem = m_activeOffers.at(selectedShopItem).second;
|
||||
player->connection->send( std::shared_ptr<TradeItemPacket>( new TradeItemPacket(m_menu->containerId, actualShopItem) ) );
|
||||
player->connection->send( shared_ptr<TradeItemPacket>( new TradeItemPacket(m_menu->containerId, actualShopItem) ) );
|
||||
|
||||
updateDisplay();
|
||||
}
|
||||
@@ -149,7 +149,7 @@ bool IUIScene_TradingMenu::handleKeyDown(int iPad, int iAction, bool bRepeat)
|
||||
ByteArrayOutputStream rawOutput;
|
||||
DataOutputStream output(&rawOutput);
|
||||
output.writeInt(actualShopItem);
|
||||
Minecraft::GetInstance()->getConnection(getPad())->send(std::shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
|
||||
Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
|
||||
}
|
||||
}
|
||||
return handled;
|
||||
@@ -203,7 +203,7 @@ void IUIScene_TradingMenu::updateDisplay()
|
||||
ByteArrayOutputStream rawOutput;
|
||||
DataOutputStream output(&rawOutput);
|
||||
output.writeInt(firstValidTrade);
|
||||
Minecraft::GetInstance()->getConnection(getPad())->send(std::shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
|
||||
Minecraft::GetInstance()->getConnection(getPad())->send(shared_ptr<CustomPayloadPacket>( new CustomPayloadPacket(CustomPayloadPacket::TRADER_SELECTION_PACKET, rawOutput.toByteArray())));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -248,8 +248,8 @@ void IUIScene_TradingMenu::updateDisplay()
|
||||
wstring offerDescription = GetItemDescription(activeRecipe->getSellItem(), unformattedStrings);
|
||||
setOfferDescription(offerDescription, unformattedStrings);
|
||||
|
||||
std::shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem();
|
||||
std::shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem();
|
||||
shared_ptr<ItemInstance> buyAItem = activeRecipe->getBuyAItem();
|
||||
shared_ptr<ItemInstance> buyBItem = activeRecipe->getBuyBItem();
|
||||
|
||||
setRequest1Item(buyAItem);
|
||||
setRequest2Item(buyBItem);
|
||||
@@ -262,7 +262,7 @@ void IUIScene_TradingMenu::updateDisplay()
|
||||
|
||||
bool canMake = true;
|
||||
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
int buyAMatches = player->inventory->countMatches(buyAItem);
|
||||
if(buyAMatches > 0)
|
||||
{
|
||||
@@ -321,10 +321,10 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
|
||||
{
|
||||
if(recipe->isDeprecated()) return false;
|
||||
|
||||
std::shared_ptr<ItemInstance> buyAItem = recipe->getBuyAItem();
|
||||
std::shared_ptr<ItemInstance> buyBItem = recipe->getBuyBItem();
|
||||
shared_ptr<ItemInstance> buyAItem = recipe->getBuyAItem();
|
||||
shared_ptr<ItemInstance> buyBItem = recipe->getBuyBItem();
|
||||
|
||||
std::shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
shared_ptr<MultiplayerLocalPlayer> player = Minecraft::GetInstance()->localplayers[getPad()];
|
||||
int buyAMatches = player->inventory->countMatches(buyAItem);
|
||||
if(buyAMatches > 0)
|
||||
{
|
||||
@@ -349,19 +349,19 @@ bool IUIScene_TradingMenu::canMake(MerchantRecipe *recipe)
|
||||
}
|
||||
|
||||
|
||||
void IUIScene_TradingMenu::setRequest1Item(std::shared_ptr<ItemInstance> item)
|
||||
void IUIScene_TradingMenu::setRequest1Item(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
}
|
||||
|
||||
void IUIScene_TradingMenu::setRequest2Item(std::shared_ptr<ItemInstance> item)
|
||||
void IUIScene_TradingMenu::setRequest2Item(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
}
|
||||
|
||||
void IUIScene_TradingMenu::setTradeItem(int index, std::shared_ptr<ItemInstance> item)
|
||||
void IUIScene_TradingMenu::setTradeItem(int index, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
}
|
||||
|
||||
wstring IUIScene_TradingMenu::GetItemDescription(std::shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings)
|
||||
wstring IUIScene_TradingMenu::GetItemDescription(shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings)
|
||||
{
|
||||
if(item == NULL) return L"";
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ class IUIScene_TradingMenu
|
||||
{
|
||||
protected:
|
||||
MerchantMenu *m_menu;
|
||||
std::shared_ptr<Merchant> m_merchant;
|
||||
shared_ptr<Merchant> m_merchant;
|
||||
vector< pair<MerchantRecipe *,int> > m_activeOffers;
|
||||
|
||||
int m_validOffersCount;
|
||||
@@ -42,17 +42,17 @@ protected:
|
||||
|
||||
virtual void setOfferDescription(const wstring &name, vector<wstring> &unformattedStrings) = 0;
|
||||
|
||||
virtual void setRequest1Item(std::shared_ptr<ItemInstance> item);
|
||||
virtual void setRequest2Item(std::shared_ptr<ItemInstance> item);
|
||||
virtual void setTradeItem(int index, std::shared_ptr<ItemInstance> item);
|
||||
virtual void setRequest1Item(shared_ptr<ItemInstance> item);
|
||||
virtual void setRequest2Item(shared_ptr<ItemInstance> item);
|
||||
virtual void setTradeItem(int index, shared_ptr<ItemInstance> item);
|
||||
|
||||
private:
|
||||
void updateDisplay();
|
||||
bool canMake(MerchantRecipe *recipe);
|
||||
wstring GetItemDescription(std::shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings);
|
||||
wstring GetItemDescription(shared_ptr<ItemInstance> item, vector<wstring> &unformattedStrings);
|
||||
|
||||
public:
|
||||
std::shared_ptr<Merchant> getMerchant();
|
||||
shared_ptr<Merchant> getMerchant();
|
||||
|
||||
virtual int getPad() = 0;
|
||||
};
|
||||
@@ -209,7 +209,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
|
||||
if( icon != TUTORIAL_NO_ICON )
|
||||
{
|
||||
m_iconIsFoil = false;
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(icon,1,iAuxVal));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -238,7 +238,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
|
||||
{
|
||||
iAuxVal = 0;
|
||||
}
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(iconId,1,iAuxVal));
|
||||
|
||||
temp.replace(iconTagStartPos, iconEndPos - iconTagStartPos + closeTag.length(), L"");
|
||||
}
|
||||
@@ -247,63 +247,63 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
|
||||
// remove any icon text
|
||||
else if(temp.find(L"{*CraftingTableIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::workBench_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::workBench_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*SticksIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::stick_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::stick_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*PlanksIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::wood_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::wood_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*WoodenShovelIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::shovel_wood_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::shovel_wood_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*WoodenHatchetIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::hatchet_wood_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::hatchet_wood_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*WoodenPickaxeIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::pickAxe_wood_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::pickAxe_wood_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*FurnaceIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::furnace_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::furnace_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*WoodenDoorIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::door_wood,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::door_wood,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*TorchIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::torch_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::torch_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*BoatIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::boat_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::boat_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*FishingRodIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::fishingRod_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*FishIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::fish_raw_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::fish_raw_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*MinecartIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Item::minecart_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Item::minecart_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*RailIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::rail_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::rail_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*PoweredRailIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::goldenRail_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::goldenRail_Id,1,0));
|
||||
}
|
||||
else if(temp.find(L"{*StructuresIcon*}")!=wstring::npos)
|
||||
{
|
||||
@@ -317,7 +317,7 @@ wstring UIComponent_TutorialPopup::_SetIcon(int icon, int iAuxVal, bool isFoil,
|
||||
}
|
||||
else if(temp.find(L"{*StoneIcon*}")!=wstring::npos)
|
||||
{
|
||||
m_iconItem = std::shared_ptr<ItemInstance>(new ItemInstance(Tile::rock_Id,1,0));
|
||||
m_iconItem = shared_ptr<ItemInstance>(new ItemInstance(Tile::rock_Id,1,0));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ private:
|
||||
bool m_lastSceneMovedLeft;
|
||||
bool m_bAllowFade;
|
||||
Tutorial *m_tutorial;
|
||||
std::shared_ptr<ItemInstance> m_iconItem;
|
||||
shared_ptr<ItemInstance> m_iconItem;
|
||||
bool m_iconIsFoil;
|
||||
//int m_iLocalPlayerC;
|
||||
|
||||
|
||||
@@ -100,7 +100,7 @@ void UIControl_EnchantmentBook::tickBook()
|
||||
{
|
||||
UIScene_EnchantingMenu *m_containerScene = (UIScene_EnchantingMenu *)m_parentScene;
|
||||
EnchantmentMenu *menu = m_containerScene->getMenu();
|
||||
std::shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem();
|
||||
shared_ptr<ItemInstance> current = menu->getSlot(0)->getItem();
|
||||
if (!ItemInstance::matches(current, last))
|
||||
{
|
||||
last = current;
|
||||
|
||||
@@ -19,7 +19,7 @@ private:
|
||||
//BOOL m_bDirty;
|
||||
//float m_fScale,m_fAlpha;
|
||||
//int m_iPad;
|
||||
std::shared_ptr<ItemInstance> last;
|
||||
shared_ptr<ItemInstance> last;
|
||||
|
||||
//float m_fScreenWidth,m_fScreenHeight;
|
||||
//float m_fRawWidth,m_fRawHeight;
|
||||
|
||||
@@ -597,7 +597,7 @@ void UIScene::customDraw(IggyCustomDrawCallbackRegion *region)
|
||||
app.DebugPrintf("Handling custom draw for scene with no override!\n");
|
||||
}
|
||||
|
||||
void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, std::shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations)
|
||||
void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations)
|
||||
{
|
||||
if (item!= NULL)
|
||||
{
|
||||
@@ -608,7 +608,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP
|
||||
//Make sure that pMinecraft->player is the correct player so that player specific rendering
|
||||
// eg clock and compass, are rendered correctly
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
std::shared_ptr<MultiplayerLocalPlayer> oldPlayer = pMinecraft->player;
|
||||
shared_ptr<MultiplayerLocalPlayer> oldPlayer = pMinecraft->player;
|
||||
if( iPad >= 0 && iPad < XUSER_MAX_COUNT ) pMinecraft->player = pMinecraft->localplayers[iPad];
|
||||
|
||||
// Setup GDraw, normal game render states and matrices
|
||||
@@ -688,7 +688,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP
|
||||
|
||||
//Make sure that pMinecraft->player is the correct player so that player specific rendering
|
||||
// eg clock and compass, are rendered correctly
|
||||
std::shared_ptr<MultiplayerLocalPlayer> oldPlayer = pMinecraft->player;
|
||||
shared_ptr<MultiplayerLocalPlayer> oldPlayer = pMinecraft->player;
|
||||
if( iPad >= 0 && iPad < XUSER_MAX_COUNT ) pMinecraft->player = pMinecraft->localplayers[iPad];
|
||||
|
||||
_customDrawSlotControl(customDrawRegion, iPad, item, fAlpha, isFoil, bDecorations, false);
|
||||
@@ -701,7 +701,7 @@ void UIScene::customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iP
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, std::shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer)
|
||||
void UIScene::_customDrawSlotControl(CustomDrawData *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer)
|
||||
{
|
||||
Minecraft *pMinecraft=Minecraft::GetInstance();
|
||||
|
||||
|
||||
@@ -187,7 +187,7 @@ public:
|
||||
|
||||
protected:
|
||||
//void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, int iID, int iCount, int iAuxVal, float fAlpha, bool isFoil, bool bDecorations);
|
||||
void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, std::shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations);
|
||||
void customDrawSlotControl(IggyCustomDrawCallbackRegion *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations);
|
||||
|
||||
bool m_cacheSlotRenders;
|
||||
bool m_needsCacheRendered;
|
||||
@@ -196,14 +196,14 @@ private:
|
||||
typedef struct _CachedSlotDrawData
|
||||
{
|
||||
CustomDrawData *customDrawRegion;
|
||||
std::shared_ptr<ItemInstance> item;
|
||||
shared_ptr<ItemInstance> item;
|
||||
float fAlpha;
|
||||
bool isFoil;
|
||||
bool bDecorations;
|
||||
} CachedSlotDrawData;
|
||||
vector<CachedSlotDrawData *> m_cachedSlotDraw;
|
||||
|
||||
void _customDrawSlotControl(CustomDrawData *region, int iPad, std::shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer);
|
||||
void _customDrawSlotControl(CustomDrawData *region, int iPad, shared_ptr<ItemInstance> item, float fAlpha, bool isFoil, bool bDecorations, bool usingCommandBuffer);
|
||||
|
||||
public:
|
||||
// INPUT
|
||||
|
||||
@@ -332,7 +332,7 @@ void UIScene_AbstractContainerMenu::customDraw(IggyCustomDrawCallbackRegion *reg
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
|
||||
|
||||
std::shared_ptr<ItemInstance> item = nullptr;
|
||||
shared_ptr<ItemInstance> item = nullptr;
|
||||
if(wcscmp((wchar_t *)region->name,L"pointerIcon")==0)
|
||||
{
|
||||
m_cacheSlotRenders = false;
|
||||
@@ -398,7 +398,7 @@ void UIScene_AbstractContainerMenu::setFocusToPointer(int iPad)
|
||||
m_focusSection = eSectionNone;
|
||||
}
|
||||
|
||||
std::shared_ptr<ItemInstance> UIScene_AbstractContainerMenu::getSlotItem(ESceneSection eSection, int iSlot)
|
||||
shared_ptr<ItemInstance> UIScene_AbstractContainerMenu::getSlotItem(ESceneSection eSection, int iSlot)
|
||||
{
|
||||
Slot *slot = m_menu->getSlot( getSectionStartOffset(eSection) + iSlot );
|
||||
if(slot) return slot->getItem();
|
||||
|
||||
@@ -49,7 +49,7 @@ protected:
|
||||
virtual void setSectionFocus(ESceneSection eSection, int iPad);
|
||||
void setFocusToPointer(int iPad);
|
||||
void SetPointerText(const wstring &description, vector<wstring> &unformattedStrings, bool newSlot);
|
||||
virtual std::shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot);
|
||||
virtual shared_ptr<ItemInstance> getSlotItem(ESceneSection eSection, int iSlot);
|
||||
virtual bool isSlotEmpty(ESceneSection eSection, int iSlot);
|
||||
virtual void adjustPointerForSafeZone();
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ class InventoryMenu;
|
||||
class UIScene_BrewingStandMenu : public UIScene_AbstractContainerMenu, public IUIScene_BrewingMenu
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<BrewingStandTileEntity> m_brewingStand;
|
||||
shared_ptr<BrewingStandTileEntity> m_brewingStand;
|
||||
|
||||
public:
|
||||
UIScene_BrewingStandMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
|
||||
@@ -435,7 +435,7 @@ void UIScene_CraftingMenu::customDraw(IggyCustomDrawCallbackRegion *region)
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
if(pMinecraft->localplayers[m_iPad] == NULL || pMinecraft->localgameModes[m_iPad] == NULL) return;
|
||||
|
||||
std::shared_ptr<ItemInstance> item = nullptr;
|
||||
shared_ptr<ItemInstance> item = nullptr;
|
||||
int slotId = -1;
|
||||
float alpha = 1.0f;
|
||||
bool decorations = true;
|
||||
@@ -606,21 +606,21 @@ void UIScene_CraftingMenu::hideAllIngredientsSlots()
|
||||
}
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha)
|
||||
void UIScene_CraftingMenu::setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha)
|
||||
{
|
||||
m_hSlotsInfo[iIndex].item = item;
|
||||
m_hSlotsInfo[iIndex].alpha = uiAlpha;
|
||||
m_hSlotsInfo[iIndex].show = true;
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha)
|
||||
void UIScene_CraftingMenu::setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha)
|
||||
{
|
||||
m_vSlotsInfo[iIndex].item = item;
|
||||
m_vSlotsInfo[iIndex].alpha = uiAlpha;
|
||||
m_vSlotsInfo[iIndex].show = true;
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::setCraftingOutputSlotItem(int iPad, std::shared_ptr<ItemInstance> item)
|
||||
void UIScene_CraftingMenu::setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
m_craftingOutputSlotInfo.item = item;
|
||||
m_craftingOutputSlotInfo.alpha = 31;
|
||||
@@ -632,7 +632,7 @@ void UIScene_CraftingMenu::setCraftingOutputSlotRedBox(bool show)
|
||||
m_slotListCraftingOutput.showSlotRedBox(0,show);
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::setIngredientSlotItem(int iPad, int index, std::shared_ptr<ItemInstance> item)
|
||||
void UIScene_CraftingMenu::setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
m_ingredientsSlotsInfo[index].item = item;
|
||||
m_ingredientsSlotsInfo[index].alpha = 31;
|
||||
@@ -644,7 +644,7 @@ void UIScene_CraftingMenu::setIngredientSlotRedBox(int index, bool show)
|
||||
m_slotListIngredientsLayout.showSlotRedBox(index,show);
|
||||
}
|
||||
|
||||
void UIScene_CraftingMenu::setIngredientDescriptionItem(int iPad, int index, std::shared_ptr<ItemInstance> item)
|
||||
void UIScene_CraftingMenu::setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item)
|
||||
{
|
||||
m_ingredientsInfo[index].item = item;
|
||||
m_ingredientsInfo[index].alpha = 31;
|
||||
|
||||
@@ -32,7 +32,7 @@ class UIScene_CraftingMenu : public UIScene, public IUIScene_CraftingMenu
|
||||
private:
|
||||
typedef struct _SlotInfo
|
||||
{
|
||||
std::shared_ptr<ItemInstance> item;
|
||||
shared_ptr<ItemInstance> item;
|
||||
unsigned int alpha;
|
||||
bool show;
|
||||
|
||||
@@ -182,13 +182,13 @@ protected:
|
||||
virtual void hideAllHSlots();
|
||||
virtual void hideAllVSlots();
|
||||
virtual void hideAllIngredientsSlots();
|
||||
virtual void setCraftHSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha);
|
||||
virtual void setCraftVSlotItem(int iPad, int iIndex, std::shared_ptr<ItemInstance> item, unsigned int uiAlpha);
|
||||
virtual void setCraftingOutputSlotItem(int iPad, std::shared_ptr<ItemInstance> item);
|
||||
virtual void setCraftHSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha);
|
||||
virtual void setCraftVSlotItem(int iPad, int iIndex, shared_ptr<ItemInstance> item, unsigned int uiAlpha);
|
||||
virtual void setCraftingOutputSlotItem(int iPad, shared_ptr<ItemInstance> item);
|
||||
virtual void setCraftingOutputSlotRedBox(bool show);
|
||||
virtual void setIngredientSlotItem(int iPad, int index, std::shared_ptr<ItemInstance> item);
|
||||
virtual void setIngredientSlotItem(int iPad, int index, shared_ptr<ItemInstance> item);
|
||||
virtual void setIngredientSlotRedBox(int index, bool show);
|
||||
virtual void setIngredientDescriptionItem(int iPad, int index, std::shared_ptr<ItemInstance> item);
|
||||
virtual void setIngredientDescriptionItem(int iPad, int index, shared_ptr<ItemInstance> item);
|
||||
virtual void setIngredientDescriptionRedBox(int index, bool show);
|
||||
virtual void setIngredientDescriptionText(int index, LPCWSTR text);
|
||||
virtual void setShowCraftHSlot(int iIndex, bool show);
|
||||
|
||||
@@ -21,7 +21,7 @@ UIScene_CreativeMenu::UIScene_CreativeMenu(int iPad, void *_initData, UILayer *p
|
||||
|
||||
InventoryScreenInput *initData = (InventoryScreenInput *)_initData;
|
||||
|
||||
std::shared_ptr<SimpleContainer> creativeContainer = std::shared_ptr<SimpleContainer>(new SimpleContainer( 0, TabSpec::MAX_SIZE ));
|
||||
shared_ptr<SimpleContainer> creativeContainer = shared_ptr<SimpleContainer>(new SimpleContainer( 0, TabSpec::MAX_SIZE ));
|
||||
itemPickerMenu = new ItemPickerMenu(creativeContainer, initData->player->inventory);
|
||||
|
||||
Initialize( initData->iPad, itemPickerMenu, false, -1, eSectionInventoryCreativeUsing, eSectionInventoryCreativeMax, initData->bNavigateBack);
|
||||
|
||||
@@ -127,7 +127,7 @@ void UIScene_DebugOverlay::customDraw(IggyCustomDrawCallbackRegion *region)
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<ItemInstance> item = std::shared_ptr<ItemInstance>( new ItemInstance(itemId,1,0) );
|
||||
shared_ptr<ItemInstance> item = shared_ptr<ItemInstance>( new ItemInstance(itemId,1,0) );
|
||||
if(item != NULL) customDrawSlotControl(region,m_iPad,item,1.0f,false,false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ class InventoryMenu;
|
||||
class UIScene_FurnaceMenu : public UIScene_AbstractContainerMenu, public IUIScene_FurnaceMenu
|
||||
{
|
||||
private:
|
||||
std::shared_ptr<FurnaceTileEntity> m_furnace;
|
||||
shared_ptr<FurnaceTileEntity> m_furnace;
|
||||
|
||||
public:
|
||||
UIScene_FurnaceMenu(int iPad, void *initData, UILayer *parentLayer);
|
||||
|
||||
@@ -161,7 +161,7 @@ void UIScene_HUD::tick()
|
||||
}
|
||||
else
|
||||
{
|
||||
std::shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
|
||||
shared_ptr<EnderDragon> boss = EnderDragonRenderer::bossInstance;
|
||||
// 4J Stu - Don't clear this here as it's wiped for other players
|
||||
//EnderDragonRenderer::bossInstance = nullptr;
|
||||
m_ticksWithNoBoss = 0;
|
||||
@@ -191,7 +191,7 @@ void UIScene_HUD::customDraw(IggyCustomDrawCallbackRegion *region)
|
||||
else
|
||||
{
|
||||
Slot *invSlot = pMinecraft->localplayers[m_iPad]->inventoryMenu->getSlot(InventoryMenu::USE_ROW_SLOT_START + slot);
|
||||
std::shared_ptr<ItemInstance> item = invSlot->getItem();
|
||||
shared_ptr<ItemInstance> item = invSlot->getItem();
|
||||
if(item != NULL)
|
||||
{
|
||||
unsigned char ucAlpha=app.GetGameSettings(ProfileManager.GetPrimaryPad(),eGameSetting_InterfaceOpacity);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user