From e6ca5a5ece61d8a4dd69b877a91f567edf2a3f63 Mon Sep 17 00:00:00 2001 From: Howaner Date: Wed, 30 Jul 2014 22:54:19 +0200 Subject: Added window update. --- src/BlockEntities/BeaconEntity.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/BlockEntities/BeaconEntity.cpp') diff --git a/src/BlockEntities/BeaconEntity.cpp b/src/BlockEntities/BeaconEntity.cpp index 38b710181..30d927663 100644 --- a/src/BlockEntities/BeaconEntity.cpp +++ b/src/BlockEntities/BeaconEntity.cpp @@ -127,6 +127,12 @@ bool cBeaconEntity::SelectPrimaryPotion(cEntityEffect::eType a_Potion) } m_PrimaryPotion = a_Potion; + + // Send window update: + if (GetWindow() != NULL) + { + GetWindow()->SetProperty(1, m_PrimaryPotion); + } return true; } @@ -142,6 +148,12 @@ bool cBeaconEntity::SelectSecondaryPotion(cEntityEffect::eType a_Potion) } m_SecondaryPotion = a_Potion; + + // Send window update: + if (GetWindow() != NULL) + { + GetWindow()->SetProperty(2, m_SecondaryPotion); + } return true; } @@ -189,6 +201,8 @@ bool cBeaconEntity::IsMineralBlock(BLOCKTYPE a_BlockType) void cBeaconEntity::UpdateBeacon(void) { + int OldBeaconLevel = m_BeaconLevel; + if (IsBeaconBlocked()) { m_IsActive = false; @@ -200,6 +214,15 @@ void cBeaconEntity::UpdateBeacon(void) m_IsActive = (m_BeaconLevel > 0); } + if (m_BeaconLevel != OldBeaconLevel) + { + // Send window update: + if (GetWindow() != NULL) + { + GetWindow()->SetProperty(0, m_BeaconLevel); + } + } + // TODO: Add achievement } -- cgit v1.2.3