mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Show option description on hovering
This commit is contained in:
		| @@ -351,11 +351,11 @@ void CGarrisonSlot::gesture(bool on, const Point & initialPosition, const Point | ||||
| 		return; | ||||
|  | ||||
| 	std::vector<RadialMenuConfig> menuElements = { | ||||
| 		{ RadialMenuConfig::ITEM_NW, "stackMerge", "", [this](){owner->bulkMergeStacks(this);} }, | ||||
| 		{ RadialMenuConfig::ITEM_NE, "stackInfo", "", [this](){viewInfo();} }, | ||||
| 		{ RadialMenuConfig::ITEM_WW, "stackSplitOne", "", [this](){splitIntoParts(this->getGarrison(), 1); } }, | ||||
| 		{ RadialMenuConfig::ITEM_EE, "stackSplitEqual", "", [this](){owner->bulkSmartSplitStack(this);} }, | ||||
| 		{ RadialMenuConfig::ITEM_SW, "heroMove", "", [this](){owner->moveStackToAnotherArmy(this);} }, | ||||
| 		{ RadialMenuConfig::ITEM_NW, "stackMerge", "Merge same units", [this](){owner->bulkMergeStacks(this);} }, | ||||
| 		{ RadialMenuConfig::ITEM_NE, "stackInfo", "Show unit information", [this](){viewInfo();} }, | ||||
| 		{ RadialMenuConfig::ITEM_WW, "stackSplitOne", "Split off single unit", [this](){splitIntoParts(this->getGarrison(), 1); } }, | ||||
| 		{ RadialMenuConfig::ITEM_EE, "stackSplitEqual", "Split unit equally", [this](){owner->bulkSmartSplitStack(this);} }, | ||||
| 		{ RadialMenuConfig::ITEM_SW, "heroMove", "Move unit to another army", [this](){owner->moveStackToAnotherArmy(this);} }, | ||||
| 	}; | ||||
|  | ||||
| 	GH.windows().createAndPushWindow<RadialMenu>(pos.center(), menuElements); | ||||
|   | ||||
| @@ -106,7 +106,6 @@ public: | ||||
|  | ||||
| 	bool smallIcons;      ///< true - 32x32 imgs, false - 58x64 | ||||
| 	bool removableUnits;  ///< player Can remove units from up | ||||
| 	bool twoRows;         ///< slots Will be placed in 2 rows | ||||
|  | ||||
| 	ESlotsLayout layout; | ||||
|  | ||||
|   | ||||
| @@ -69,7 +69,16 @@ void RadialMenu::addItem(const Point & offset, const std::string & path, const s | ||||
|  | ||||
| void RadialMenu::gesturePanning(const Point & initialPosition, const Point & currentPosition, const Point & lastUpdateDistance) | ||||
| { | ||||
| 	GH.statusbar()->clear(); | ||||
|  | ||||
| 	for(const auto & item : items) | ||||
| 	{ | ||||
| 		if (item->isInside(currentPosition)) | ||||
| 		{ | ||||
| 			GH.statusbar()->write(item->hoverText); | ||||
| 			break; | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
|  | ||||
| void RadialMenu::gesture(bool on, const Point & initialPosition, const Point & finalPosition) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user