61 lines
2.8 KiB
Diff
61 lines
2.8 KiB
Diff
From 46160c673718e5a287e46470ce450df24634ebb2 Mon Sep 17 00:00:00 2001
|
|
From: Juanjo <juanjo.ng.83@gmail.com>
|
|
Date: Fri, 25 Oct 2013 17:26:13 +0000
|
|
Subject: [PATCH 233/249] Adaptation of viewport for confirm mode.
|
|
|
|
---
|
|
src/script/api/game/game_window.hpp.sq | 1 +
|
|
src/window.cpp | 16 +++++++++++-----
|
|
2 files changed, 12 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/script/api/game/game_window.hpp.sq b/src/script/api/game/game_window.hpp.sq
|
|
index f06fae3..6d87c22 100644
|
|
--- a/src/script/api/game/game_window.hpp.sq
|
|
+++ b/src/script/api/game/game_window.hpp.sq
|
|
@@ -1252,6 +1252,7 @@ void SQGSWindow_Register(Squirrel *engine)
|
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_SHIFT, "WID_TT_SHIFT");
|
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_CTRL, "WID_TT_CTRL");
|
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_MOVE, "WID_TT_MOVE");
|
|
+ SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TT_CONFIRM, "WID_TT_CONFIRM");
|
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_SORT_ORDER, "WID_TD_SORT_ORDER");
|
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_SORT_CRITERIA, "WID_TD_SORT_CRITERIA");
|
|
SQGSWindow.DefSQConst(engine, ScriptWindow::WID_TD_FILTER, "WID_TD_FILTER");
|
|
diff --git a/src/window.cpp b/src/window.cpp
|
|
index 71a8977..b783125 100644
|
|
--- a/src/window.cpp
|
|
+++ b/src/window.cpp
|
|
@@ -2843,9 +2843,18 @@ static void MouseLoop(MouseClick click, int mousewheel)
|
|
Window *w = FindWindowFromPt(x, y);
|
|
if (w == NULL) return;
|
|
ViewPort *vp = IsPtInWindowViewport(w, x, y);
|
|
+ bool confirm = (_settings_client.gui.touchscreen_mode == TSC_CONFIRM);
|
|
|
|
- HandlePlacePresize();
|
|
- UpdateTileSelection();
|
|
+ /* Don't allow any action in a viewport if either in menu or when having a modal progress window */
|
|
+ if (vp != NULL && (_game_mode == GM_MENU || HasModalProgress())) return;
|
|
+
|
|
+ /* On confirm mode do not update tile selection unless we are clicking on a viewport. */
|
|
+ if (!confirm || (vp != NULL && _left_button_down && !_move_pressed)) {
|
|
+ HandlePlacePresize();
|
|
+ UpdateTileSelection();
|
|
+ } else {
|
|
+ //if presize, show tooltip if needed
|
|
+ }
|
|
|
|
if (VpHandlePlaceSizingDrag() == ES_HANDLED) return;
|
|
if (HandleMouseDragDrop() == ES_HANDLED) return;
|
|
@@ -2862,9 +2871,6 @@ static void MouseLoop(MouseClick click, int mousewheel)
|
|
|
|
if (click != MC_NONE && click != MC_HOVER && !MaybeBringWindowToFront(w)) return;
|
|
|
|
- /* Don't allow any action in a viewport if either in menu or when having a modal progress window */
|
|
- if (vp != NULL && (_game_mode == GM_MENU || HasModalProgress())) return;
|
|
-
|
|
if (mousewheel != 0) {
|
|
/* Send mousewheel event to window */
|
|
w->OnMouseWheel(mousewheel);
|
|
--
|
|
1.8.1.2
|
|
|