Skip to content

Commit

Permalink
Don't prevent the use of the scroll wheel when the build / research /…
Browse files Browse the repository at this point in the history
… design / whatever window isn't up yet.
  • Loading branch information
vexed committed Apr 4, 2012
1 parent aaeaa41 commit 37a8ee7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/hci.cpp
Expand Up @@ -84,6 +84,7 @@


// Empty edit window // Empty edit window
//#define EDIT_OPTIONS //#define EDIT_OPTIONS
bool SecondaryWindowUp = false;


static UDWORD newMapWidth, newMapHeight; static UDWORD newMapWidth, newMapHeight;


Expand Down Expand Up @@ -768,17 +769,15 @@ static void intDoScreenRefresh(void)
case IOBJ_MANUFACTURE: // The manufacture screen (factorys on bottom bar) case IOBJ_MANUFACTURE: // The manufacture screen (factorys on bottom bar)
case IOBJ_RESEARCH: // The research screen case IOBJ_RESEARCH: // The research screen
//pass in the currently selected object //pass in the currently selected object
intUpdateObject((BASE_OBJECT *)interfaceStructList(),psObjSelected, intUpdateObject((BASE_OBJECT *)interfaceStructList(), psObjSelected, StatsWasUp);
StatsWasUp);
break; break;


case IOBJ_BUILD: case IOBJ_BUILD:
case IOBJ_COMMAND: // the command droid screen case IOBJ_COMMAND: // the command droid screen
case IOBJ_BUILDSEL: // Selecting a position for a new structure case IOBJ_BUILDSEL: // Selecting a position for a new structure
case IOBJ_DEMOLISHSEL: // Selecting a structure to demolish case IOBJ_DEMOLISHSEL: // Selecting a structure to demolish
//pass in the currently selected object //pass in the currently selected object
intUpdateObject((BASE_OBJECT *)apsDroidLists[selectedPlayer],psObjSelected, intUpdateObject((BASE_OBJECT *)apsDroidLists[selectedPlayer], psObjSelected, StatsWasUp);
StatsWasUp);
break; break;


default: default:
Expand Down Expand Up @@ -1182,7 +1181,7 @@ void intResetScreen(bool NoAnim)
default: default:
break; break;
} }

SecondaryWindowUp = false;
intMode = INT_NORMAL; intMode = INT_NORMAL;
//clearSel() sets IntRefreshPending = true by calling intRefreshScreen() but if we're doing this then we won't need to refresh - hopefully! //clearSel() sets IntRefreshPending = true by calling intRefreshScreen() but if we're doing this then we won't need to refresh - hopefully!
IntRefreshPending = false; IntRefreshPending = false;
Expand Down Expand Up @@ -1628,6 +1627,7 @@ INT_RETVAL intRunWidgets(void)
/* Extra code for the design screen to deal with the shadow bar graphs */ /* Extra code for the design screen to deal with the shadow bar graphs */
if (intMode == INT_DESIGN) if (intMode == INT_DESIGN)
{ {
SecondaryWindowUp = true;
intRunDesign(); intRunDesign();
} }


Expand Down Expand Up @@ -4810,7 +4810,7 @@ static bool intAddStats(BASE_STATS **ppsStatsList, UDWORD numStats,
return false; return false;
} }
} }

SecondaryWindowUp = true;
psStatsScreenOwner = psOwner; psStatsScreenOwner = psOwner;


ClearStatBuffers(); ClearStatBuffers();
Expand Down Expand Up @@ -6401,7 +6401,7 @@ bool CoordInBuild(int x, int y)
pos.x = x - RET_X; pos.x = x - RET_X;
pos.y = y - RET_Y + buildmenu_height; // guesstimation 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; return false;
} }
Expand Down
3 changes: 2 additions & 1 deletion src/hci.h
Expand Up @@ -264,7 +264,8 @@ extern UDWORD intLastWidget;


/* The button ID of the objects stat when the stat screen is displayed */ /* The button ID of the objects stat when the stat screen is displayed */
extern UDWORD objStatID; 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*/ /* 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::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. extern std::list<DROID_TEMPLATE> localTemplates; ///< Unsychnronised list, for UI use only.
Expand Down

0 comments on commit 37a8ee7

Please sign in to comment.