Permalink
Browse files

Don't prevent the use of the scroll wheel when the build / research /…

… design / whatever window isn't up yet.
  • Loading branch information...
1 parent aaeaa41 commit 37a8ee7409e49c2ca6c1928768834d7a14ec3c8a @vexed vexed committed Apr 3, 2012
Showing with 9 additions and 8 deletions.
  1. +7 −7 src/hci.cpp
  2. +2 −1 src/hci.h
View
@@ -84,6 +84,7 @@
// Empty edit window
//#define EDIT_OPTIONS
+bool SecondaryWindowUp = false;
static UDWORD newMapWidth, newMapHeight;
@@ -768,17 +769,15 @@ static void intDoScreenRefresh(void)
case IOBJ_MANUFACTURE: // The manufacture screen (factorys on bottom bar)
case IOBJ_RESEARCH: // The research screen
//pass in the currently selected object
- intUpdateObject((BASE_OBJECT *)interfaceStructList(),psObjSelected,
- StatsWasUp);
+ intUpdateObject((BASE_OBJECT *)interfaceStructList(), psObjSelected, StatsWasUp);
break;
case IOBJ_BUILD:
case IOBJ_COMMAND: // the command droid screen
case IOBJ_BUILDSEL: // Selecting a position for a new structure
case IOBJ_DEMOLISHSEL: // Selecting a structure to demolish
//pass in the currently selected object
- intUpdateObject((BASE_OBJECT *)apsDroidLists[selectedPlayer],psObjSelected,
- StatsWasUp);
+ intUpdateObject((BASE_OBJECT *)apsDroidLists[selectedPlayer], psObjSelected, StatsWasUp);
break;
default:
@@ -1182,7 +1181,7 @@ void intResetScreen(bool NoAnim)
default:
break;
}
-
+ SecondaryWindowUp = false;
intMode = INT_NORMAL;
//clearSel() sets IntRefreshPending = true by calling intRefreshScreen() but if we're doing this then we won't need to refresh - hopefully!
IntRefreshPending = false;
@@ -1628,6 +1627,7 @@ INT_RETVAL intRunWidgets(void)
/* Extra code for the design screen to deal with the shadow bar graphs */
if (intMode == INT_DESIGN)
{
+ SecondaryWindowUp = true;
intRunDesign();
}
@@ -4810,7 +4810,7 @@ static bool intAddStats(BASE_STATS **ppsStatsList, UDWORD numStats,
return false;
}
}
-
+ SecondaryWindowUp = true;
psStatsScreenOwner = psOwner;
ClearStatBuffers();
@@ -6401,7 +6401,7 @@ bool CoordInBuild(int x, int y)
pos.x = x - RET_X;
pos.y = y - RET_Y + buildmenu_height; // guesstimation
- if (pos.x < 0 || pos.y < 0 || pos.x >= RET_FORMWIDTH || pos.y >= buildmenu_height)
+ if ((pos.x < 0 || pos.y < 0 || pos.x >= RET_FORMWIDTH || pos.y >= buildmenu_height) || !SecondaryWindowUp)
{
return false;
}
View
@@ -264,7 +264,8 @@ extern UDWORD intLastWidget;
/* The button ID of the objects stat when the stat screen is displayed */
extern UDWORD objStatID;
-
+// when the window for building / whatever else is up...
+extern bool SecondaryWindowUp;
/* The current template for the design screen to start with*/
extern std::vector<DROID_TEMPLATE *> apsTemplateList; ///< Either a list of templates a factory can build or a list of designable templates, for UI use only.
extern std::list<DROID_TEMPLATE> localTemplates; ///< Unsychnronised list, for UI use only.

0 comments on commit 37a8ee7

Please sign in to comment.