From e8366993ce3f1cc0c2c6cde1d133773d1f23c474 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 6 Aug 2012 20:10:16 +0000 Subject: 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 --- source/cFurnaceWindow.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'source/cFurnaceWindow.cpp') diff --git a/source/cFurnaceWindow.cpp b/source/cFurnaceWindow.cpp index 963c848ec..8dcd0c8a5 100644 --- a/source/cFurnaceWindow.cpp +++ b/source/cFurnaceWindow.cpp @@ -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 ); -} \ No newline at end of file +} + + + + -- cgit v1.2.3