浏览代码

fixed regression

SoundSSGood 1 年之前
父节点
当前提交
4df7de36c1
共有 2 个文件被更改,包括 3 次插入4 次删除
  1. 2 0
      client/widgets/markets/CAltarCreatures.cpp
  2. 1 4
      client/widgets/markets/CTradeBase.cpp

+ 2 - 0
client/widgets/markets/CAltarCreatures.cpp

@@ -51,6 +51,8 @@ CAltarCreatures::CAltarCreatures(const IMarket * market, const CGHeroInstance *
 	assert(leftTradePanel);
 	leftTradePanel->moveBy(Point(45, 110));
 	leftTradePanel->updateSlotsCallback = std::bind(&CCreaturesSelling::updateSubtitle, this);
+	for(const auto & slot : leftTradePanel->slots)
+		slot->clickPressedCallback = [this](const std::shared_ptr<CTradeableItem> & heroSlot) {CAltarCreatures::onSlotClickPressed(heroSlot, hLeft);};
 
 	// Altar creatures panel
 	rightTradePanel = std::make_shared<CreaturesPanel>([this](const std::shared_ptr<CTradeableItem> & altarSlot)

+ 1 - 4
client/widgets/markets/CTradeBase.cpp

@@ -90,10 +90,7 @@ CCreaturesSelling::CCreaturesSelling()
 		if(const auto & creature = hero->getCreature(slotId))
 			slots.emplace_back(std::make_tuple(creature->getId(), slotId, hero->getStackCount(slotId)));
 	}
-	leftTradePanel = std::make_shared<CreaturesPanel>([this](const std::shared_ptr<CTradeableItem> & altarSlot)
-		{
-			CTradeBase::onSlotClickPressed(altarSlot, hLeft);
-		}, slots);
+	leftTradePanel = std::make_shared<CreaturesPanel>(nullptr, slots);
 }
 
 bool CCreaturesSelling::slotDeletingCheck(const std::shared_ptr<CTradeableItem> & slot)