Adaptation of viewport for confirm mode.

This commit is contained in:
Juanjo
2013-10-25 17:26:13 +00:00
committed by pelya
parent 77a101280b
commit 90c00f5b58
4 changed files with 4873 additions and 5 deletions

View File

@@ -2841,9 +2841,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;
@@ -2860,9 +2869,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);