|
|
@@ -111,12 +111,13 @@ TickSourceType GrowingPlantBlock::isTickSource() const
|
|
|
return TickSourceType::EACH_TICK;
|
|
|
}
|
|
|
|
|
|
-Framework::Text GrowingPlantBlock::getTargetUIML()
|
|
|
+Framework::XML::Element* GrowingPlantBlock::getTargetUIML() const
|
|
|
{
|
|
|
- return Framework::Text("<targetInfo><text width=\"auto\" height=\"auto\">")
|
|
|
- + name + "\n" + "Growth: "
|
|
|
- + Framework::Text((int)(seblingTicks / (float)seblingTicksMax * 100.f))
|
|
|
- + "%</text></targetInfo>";
|
|
|
+ return new Framework::XML::Element(
|
|
|
+ Framework::Text("<targetInfo><text width=\"auto\" height=\"auto\">")
|
|
|
+ + name + "\n" + "Growth: "
|
|
|
+ + Framework::Text((int)(seblingTicks / (float)seblingTicksMax * 100.f))
|
|
|
+ + "%</text></targetInfo>");
|
|
|
}
|
|
|
|
|
|
GrowingPlantBlock* GrowingPlantBlock::addGrowthState(GrowthState* state)
|
|
|
@@ -270,8 +271,16 @@ const Framework::RCArray<GrowthState>& GrowingPlantBlockType::getStates() const
|
|
|
}
|
|
|
|
|
|
void GrowingPlantBlockType::setBlockTypeNameAfterGrowth(
|
|
|
- Framework::Text blockTypeIdAfterGrowth)
|
|
|
-{}
|
|
|
+ Framework::Text blockTypeNameAfterGrowth)
|
|
|
+{
|
|
|
+ this->blockTypeNameAfterGrowth = blockTypeNameAfterGrowth;
|
|
|
+}
|
|
|
+
|
|
|
+bool GrowingPlantBlockType::initialize(Game* zGame)
|
|
|
+{
|
|
|
+ blockTypeIdAfterGrowth = zGame->getBlockTypeId(blockTypeNameAfterGrowth);
|
|
|
+ return blockTypeIdAfterGrowth >= 0 && BlockType::initialize(zGame);
|
|
|
+}
|
|
|
|
|
|
ItemType* GrowingPlantBlockType::createItemType() const
|
|
|
{
|