浏览代码

Merge pull request #2334 from Laserlicht/patch-3

Battleintro: Skip with mouse button
Ivan Savenko 2 年之前
父节点
当前提交
f23de91fad
共有 2 个文件被更改,包括 12 次插入1 次删除
  1. 11 1
      client/battle/BattleWindow.cpp
  2. 1 0
      client/battle/BattleWindow.h

+ 11 - 1
client/battle/BattleWindow.cpp

@@ -86,7 +86,7 @@ BattleWindow::BattleWindow(BattleInterface & owner):
 	else
 	else
 		tacticPhaseEnded();
 		tacticPhaseEnded();
 
 
-	addUsedEvents(KEYBOARD);
+	addUsedEvents(LCLICK | KEYBOARD);
 }
 }
 
 
 void BattleWindow::createQueue()
 void BattleWindow::createQueue()
@@ -204,6 +204,16 @@ void BattleWindow::keyPressed(EShortcut key)
 	InterfaceObjectConfigurable::keyPressed(key);
 	InterfaceObjectConfigurable::keyPressed(key);
 }
 }
 
 
+void BattleWindow::clickPressed(const Point & cursorPosition)
+{
+	if (owner.openingPlaying())
+	{
+		owner.openingEnd();
+		return;
+	}
+	InterfaceObjectConfigurable::clickPressed(cursorPosition);
+}
+
 void BattleWindow::tacticPhaseStarted()
 void BattleWindow::tacticPhaseStarted()
 {
 {
 	auto menuBattle = widget<CIntObject>("menuBattle");
 	auto menuBattle = widget<CIntObject>("menuBattle");

+ 1 - 0
client/battle/BattleWindow.h

@@ -86,6 +86,7 @@ public:
 	void deactivate() override;
 	void deactivate() override;
 	void keyPressed(EShortcut key) override;
 	void keyPressed(EShortcut key) override;
 	bool captureThisKey(EShortcut key) override;
 	bool captureThisKey(EShortcut key) override;
+	void clickPressed(const Point & cursorPosition) override;
 	void show(Canvas & to) override;
 	void show(Canvas & to) override;
 	void showAll(Canvas & to) override;
 	void showAll(Canvas & to) override;