فهرست منبع

Removed isActive(int) method since its usages were redundant or wrong

Ivan Savenko 2 سال پیش
والد
کامیت
a4000f2fc8

+ 0 - 39
client/ClientCommandManager.cpp

@@ -194,12 +194,6 @@ void ClientCommandManager::handleNotDialogCommand()
 	LOCPLINT->showingDialog->setn(false);
 }
 
-void ClientCommandManager::handleGuiCommand()
-{
-	for(const auto & child : GH.windows().findWindows<CIntObject>())
-		printInfoAboutInterfaceObject(child.get(), 0);
-}
-
 void ClientCommandManager::handleConvertTextCommand()
 {
 	logGlobal->info("Searching for available maps");
@@ -487,36 +481,6 @@ void ClientCommandManager::printCommandMessage(const std::string &commandMessage
 	}
 }
 
-void ClientCommandManager::printInfoAboutInterfaceObject(const CIntObject *obj, int level)
-{
-	std::stringstream sbuffer;
-	sbuffer << std::string(level, '\t');
-
-	sbuffer << typeid(*obj).name() << " *** ";
-	if (obj->isActive())
-	{
-#define PRINT(check, text) if (obj->isActive(CIntObject::check)) sbuffer << text
-		PRINT(LCLICK, 'L');
-		PRINT(RCLICK, 'R');
-		PRINT(HOVER, 'H');
-		PRINT(MOVE, 'M');
-		PRINT(KEYBOARD, 'K');
-		PRINT(TIME, 'T');
-		PRINT(GENERAL, 'A');
-		PRINT(WHEEL, 'W');
-		PRINT(DOUBLECLICK, 'D');
-#undef  PRINT
-	}
-	else
-		sbuffer << "inactive";
-	sbuffer << " at " << obj->pos.x <<"x"<< obj->pos.y;
-	sbuffer << " (" << obj->pos.w <<"x"<< obj->pos.h << ")";
-	printCommandMessage(sbuffer.str(), ELogLevel::INFO);
-
-	for(const CIntObject *child : obj->children)
-		printInfoAboutInterfaceObject(child, level+1);
-}
-
 void ClientCommandManager::giveTurn(const PlayerColor &colorIdentifier)
 {
 	YourTurn yt;
@@ -569,9 +533,6 @@ void ClientCommandManager::processCommand(const std::string & message, bool call
 	else if(commandName == "not dialog")
 		handleNotDialogCommand();
 
-	else if(commandName == "gui")
-		handleGuiCommand();
-
 	else if(message=="convert txt")
 		handleConvertTextCommand();
 

+ 0 - 4
client/ClientCommandManager.h

@@ -51,9 +51,6 @@ class ClientCommandManager //take mantis #2292 issue about account if thinking a
 	// Set the state indicating if dialog box is active to "no"
 	void handleNotDialogCommand();
 
-	// Displays tree view of currently present VCMI common GUI elements
-	void handleGuiCommand();
-
 	// Dumps all game text, maps text and campaign maps text into Client log between BEGIN TEXT EXPORT and END TEXT EXPORT
 	void handleConvertTextCommand();
 
@@ -92,7 +89,6 @@ class ClientCommandManager //take mantis #2292 issue about account if thinking a
 
 	// Prints in Chat the given message
 	void printCommandMessage(const std::string &commandMessage, ELogLevel::ELogLevel messageType = ELogLevel::NOT_SET);
-	void printInfoAboutInterfaceObject(const CIntObject *obj, int level);
 	void giveTurn(const PlayerColor &color);
 
 public:

+ 0 - 5
client/gui/EventsReceiver.cpp

@@ -31,11 +31,6 @@ bool AEventsReceiver::isActive() const
 	return activeState;
 }
 
-bool AEventsReceiver::isActive(int flags) const
-{
-	return activeState & flags;
-}
-
 bool AEventsReceiver::isMouseButtonPressed(MouseButton btn) const
 {
 	return currentMouseState.count(btn) ? currentMouseState.at(btn) : false;

+ 0 - 3
client/gui/EventsReceiver.h

@@ -72,9 +72,6 @@ public:
 	/// Returns true if element is currently active and may receive events
 	bool isActive() const;
 
-	/// Returns true if particular event(s) is active for this element
-	bool isActive(int flags) const;
-
 	/// Returns true if particular mouse button was pressed when inside this element
 	bool isMouseButtonPressed(MouseButton btn) const;
 };

+ 2 - 4
client/widgets/Buttons.cpp

@@ -557,8 +557,7 @@ void CVolumeSlider::wheelScrolled(bool down, bool in)
 
 void CSlider::sliderClicked()
 {
-	if(!isActive(MOVE))
-		addUsedEvents(MOVE);
+	addUsedEvents(MOVE);
 }
 
 void CSlider::mouseMoved (const Point & cursorPosition)
@@ -699,8 +698,7 @@ void CSlider::clickLeft(tribool down, bool previousState)
 		moveTo((int)(rw * positions  +  0.5));
 		return;
 	}
-	if(isActive(MOVE))
-		removeUsedEvents(MOVE);
+	removeUsedEvents(MOVE);
 }
 
 CSlider::CSlider(Point position, int totalw, std::function<void(int)> Moved, int Capacity, int Amount, int Value, bool Horizontal, CSlider::EStyle style)

+ 2 - 4
client/windows/CCastleInterface.cpp

@@ -115,13 +115,11 @@ void CBuildingRect::hover(bool on)
 {
 	if(on)
 	{
-		if(!isActive(MOVE))
-			addUsedEvents(MOVE);
+		addUsedEvents(MOVE);
 	}
 	else
 	{
-		if(isActive(MOVE))
-			removeUsedEvents(MOVE);
+		removeUsedEvents(MOVE);
 
 		if(parent->selectedBuilding == this)
 		{