mirror of
https://github.com/smartcmd/MinecraftConsoles.git
synced 2026-05-24 03:23:51 +00:00
Initial commit
This commit is contained in:
parent
def8cb4153
commit
b691c43c44
19437 changed files with 4363922 additions and 0 deletions
45
Minecraft.Client/Common/Tutorial/TakeItemHint.cpp
Normal file
45
Minecraft.Client/Common/Tutorial/TakeItemHint.cpp
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
#include "stdafx.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.item.h"
|
||||
#include "..\..\..\Minecraft.World\net.minecraft.world.level.tile.h"
|
||||
#include "Tutorial.h"
|
||||
#include "TakeItemHint.h"
|
||||
|
||||
|
||||
TakeItemHint::TakeItemHint(eTutorial_Hint id, Tutorial *tutorial, int items[], unsigned int itemsLength)
|
||||
: TutorialHint(id, tutorial, -1, e_Hint_TakeItem)
|
||||
{
|
||||
m_iItemsCount = itemsLength;
|
||||
|
||||
m_iItems= new int [m_iItemsCount];
|
||||
for(unsigned int i=0;i<m_iItemsCount;i++)
|
||||
{
|
||||
m_iItems[i]=items[i];
|
||||
}
|
||||
}
|
||||
|
||||
bool TakeItemHint::onTake(shared_ptr<ItemInstance> item)
|
||||
{
|
||||
if(item != NULL)
|
||||
{
|
||||
bool itemFound = false;
|
||||
for(unsigned int i=0;i<m_iItemsCount;i++)
|
||||
{
|
||||
if(item->id == m_iItems[i])
|
||||
{
|
||||
itemFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(itemFound)
|
||||
{
|
||||
// Display hint
|
||||
Tutorial::PopupMessageDetails *message = new Tutorial::PopupMessageDetails();
|
||||
message->m_messageId = item->getUseDescriptionId();
|
||||
message->m_titleId = item->getDescriptionId();
|
||||
message->m_icon = item->id;
|
||||
message->m_delay = true;
|
||||
return m_tutorial->setMessage(this, message);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue