1
0

A bit of cleanup and documentation around the UI window handling

git-svn-id: http://mc-server.googlecode.com/svn/trunk@716 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-08-06 20:10:16 +00:00
parent 0b4a84969c
commit e8366993ce
13 changed files with 143 additions and 86 deletions

View File

@@ -13,21 +13,23 @@
cFurnaceWindow::cFurnaceWindow( cFurnaceEntity* a_Owner )
: cWindow( a_Owner, true )
: cWindow(a_Owner, true, cWindow::Furnace, 1)
, m_Furnace( a_Owner )
{
SetWindowID( 1 );
SetWindowType( cWindow::Furnace ); // Furnace
}
void cFurnaceWindow::Clicked( cPacket_WindowClick* a_ClickPacket, cPlayer & a_Player )
void cFurnaceWindow::Clicked(cPacket_WindowClick * a_ClickPacket, cPlayer & a_Player)
{
cItem Fuel = *GetSlot( 0 );
cWindow::Clicked( a_ClickPacket, a_Player );
if( m_Furnace )
if (m_Furnace != NULL)
{
if( a_ClickPacket->m_SlotNum >= 0 && a_ClickPacket->m_SlotNum <= 2 ) // them important slots
if ((a_ClickPacket->m_SlotNum >= 0) && (a_ClickPacket->m_SlotNum <= 2)) // them important slots
{
if( Fuel.m_ItemID != GetSlot( 0 )->m_ItemID )
m_Furnace->ResetCookTimer();
@@ -40,8 +42,16 @@ void cFurnaceWindow::Clicked( cPacket_WindowClick* a_ClickPacket, cPlayer & a_Pl
}
}
void cFurnaceWindow::Close( cPlayer & a_Player )
{
m_Furnace = 0;
m_Furnace = NULL;
cWindow::Close( a_Player );
}
}