Apply patch #1820 - Easier queueing of building/demolishing while holding down Shift. refs ticket:1820
git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@10766 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
2883c1c9e2
commit
4a21f58307
|
@ -1984,6 +1984,18 @@ static void dealWithLMBStructure(STRUCTURE* psStructure, SELECTION_TYPE selectio
|
|||
clearSelection();
|
||||
assignSensorTarget((BASE_OBJECT *)psStructure);
|
||||
}
|
||||
if (intDemolishSelectMode())
|
||||
{
|
||||
// we were demolishing something - now we're done
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
quickQueueMode = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
intDemolishCancel();
|
||||
}
|
||||
}
|
||||
|
||||
driveDisableTactical();
|
||||
}
|
||||
|
@ -2385,7 +2397,6 @@ static void dealWithRMB( void )
|
|||
BASE_OBJECT *psClickedOn;
|
||||
DROID *psDroid;
|
||||
STRUCTURE *psStructure;
|
||||
BOOL bDemolish = false;
|
||||
|
||||
if (driveModeActive() || mouseOverRadar ||
|
||||
InGameOpUp == true || widgGetFromID(psWScreen,INTINGAMEOP))
|
||||
|
@ -2514,23 +2525,19 @@ static void dealWithRMB( void )
|
|||
// addGameMessage("Right clicked on own building",1000,true);
|
||||
// addConsoleMessage("Right clicked on own building",DEFAULT_JUSTIFY,SYSTEM_MESSAGE);
|
||||
|
||||
// Moderately inefficient, but I can't think of a better way.
|
||||
if (bRightClickOrders)
|
||||
{
|
||||
for (psDroid = apsDroidLists[selectedPlayer]; psDroid; psDroid=psDroid->psNext)
|
||||
{
|
||||
if (psDroid->selected &&
|
||||
chooseOrderObj(psDroid, psClickedOn, false) == DORDER_DEMOLISH)
|
||||
{
|
||||
bDemolish = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bDemolish)
|
||||
if (bRightClickOrders && intDemolishSelectMode())
|
||||
{
|
||||
orderSelectedObjAdd(selectedPlayer, psClickedOn, ctrlShiftDown());
|
||||
FeedbackOrderGiven();
|
||||
// we were demolishing something - now we're done
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
quickQueueMode = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
intDemolishCancel();
|
||||
}
|
||||
}
|
||||
else if (psStructure->selected==true)
|
||||
{
|
||||
|
|
28
src/edit3d.c
28
src/edit3d.c
|
@ -43,6 +43,7 @@ BUILDDETAILS sBuildDetails;
|
|||
HIGHLIGHT buildSite;
|
||||
int brushSize = 1;
|
||||
bool editMode = false;
|
||||
bool quickQueueMode = false;
|
||||
|
||||
// Initialisation function for statis & globals in this module.
|
||||
//
|
||||
|
@ -173,6 +174,11 @@ BOOL process3DBuilding(void)
|
|||
//if not trying to build ignore
|
||||
if (buildState == BUILD3D_NONE)
|
||||
{
|
||||
if (quickQueueMode && !ctrlShiftDown())
|
||||
{
|
||||
quickQueueMode = false;
|
||||
intDemolishCancel();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -241,6 +247,11 @@ BOOL process3DBuilding(void)
|
|||
buildState = BUILD3D_NONE;
|
||||
return true;
|
||||
}
|
||||
if (quickQueueMode && !ctrlShiftDown())
|
||||
{
|
||||
buildState = BUILD3D_NONE;
|
||||
quickQueueMode = false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -257,7 +268,15 @@ BOOL found3DBuilding(UDWORD *x, UDWORD *y)
|
|||
*x = sBuildDetails.x;
|
||||
*y = sBuildDetails.y;
|
||||
|
||||
buildState = BUILD3D_NONE;
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
quickQueueMode = true;
|
||||
init3DBuilding(sBuildDetails.psStats, NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
buildState = BUILD3D_NONE;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -285,6 +304,13 @@ BOOL found3DBuildLocTwo(UDWORD *px1, UDWORD *py1, UDWORD *px2, UDWORD *py2)
|
|||
*py1 = wallDrag.y1;
|
||||
*px2 = wallDrag.x2;
|
||||
*py2 = wallDrag.y2;
|
||||
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
quickQueueMode = true;
|
||||
init3DBuilding(sBuildDetails.psStats, NULL, NULL);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -75,8 +75,9 @@ extern BUILDDETAILS sBuildDetails;
|
|||
|
||||
extern UDWORD buildState;
|
||||
extern UDWORD temp;
|
||||
extern bool editMode;
|
||||
extern int brushSize;
|
||||
extern bool editMode;
|
||||
extern bool quickQueueMode;
|
||||
|
||||
/*returns true if the build state is not equal to BUILD3D_NONE*/
|
||||
extern BOOL tryingToGetLocation(void);
|
||||
|
|
45
src/hci.c
45
src/hci.c
|
@ -411,10 +411,6 @@ static BASE_OBJECT *apsPreviousObj[IOBJ_MAX];
|
|||
/* The jump position for each object on the base bar */
|
||||
static Vector2i asJumpPos[IOBJ_MAX];
|
||||
|
||||
// whether to reopen the build menu
|
||||
// chnaged back to pre Mark Donald setting at Jim's request - AlexM
|
||||
static BOOL bReopenBuildMenu = false;
|
||||
|
||||
/***************************************************************************************/
|
||||
/* Function Prototypes */
|
||||
static BOOL intUpdateObject(BASE_OBJECT *psObjects, BASE_OBJECT *psSelected,BOOL bForceStats);
|
||||
|
@ -696,12 +692,13 @@ BOOL intInitialise(void)
|
|||
|
||||
void intReopenBuild(BOOL reopen)
|
||||
{
|
||||
bReopenBuildMenu = reopen;
|
||||
// obsolete
|
||||
}
|
||||
|
||||
BOOL intGetReopenBuild(void)
|
||||
{
|
||||
return bReopenBuildMenu;
|
||||
// obsolete
|
||||
return false;
|
||||
}
|
||||
|
||||
//initialise all the previous obj - particularly useful for when go Off world!
|
||||
|
@ -2034,19 +2031,9 @@ INT_RETVAL intRunWidgets(void)
|
|||
}
|
||||
}
|
||||
|
||||
// put the build menu up again after the structure position has been chosen
|
||||
//or ctrl/shift is down and we're queing the build orders
|
||||
#ifdef DISABLE_BUILD_QUEUE
|
||||
if (bReopenBuildMenu)
|
||||
#else
|
||||
if (bReopenBuildMenu || ctrlShiftDown())
|
||||
#endif
|
||||
if (!quickQueueMode)
|
||||
{
|
||||
intAddBuild(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the object screen
|
||||
// Clear the object screen, only if we aren't immediately building something else
|
||||
intResetScreen(false);
|
||||
}
|
||||
|
||||
|
@ -2097,22 +2084,15 @@ INT_RETVAL intRunWidgets(void)
|
|||
// DeSelectDroid((DROID*)psObjSelected);
|
||||
// }
|
||||
|
||||
// put the build menu up again after the structure position has been chosen
|
||||
// or ctrl/shift is down and we're queuing the build orders
|
||||
#ifdef DISABLE_BUILD_QUEUE
|
||||
if (bReopenBuildMenu)
|
||||
if (!quickQueueMode)
|
||||
{
|
||||
intAddBuild(NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Clear the object screen
|
||||
// Clear the object screen, only if we aren't immediately building something else
|
||||
intResetScreen(false);
|
||||
}
|
||||
#else
|
||||
// Clear the object screen
|
||||
}
|
||||
if (buildState == BUILD3D_NONE)
|
||||
{
|
||||
intResetScreen(false);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (intMode == INT_EDITSTAT && editPosMode == IED_POS)
|
||||
|
@ -2217,7 +2197,10 @@ INT_RETVAL intRunWidgets(void)
|
|||
psScrCBNewDroid = NULL;
|
||||
}
|
||||
}
|
||||
editPosMode = IED_NOPOS;
|
||||
if (!quickQueueMode)
|
||||
{
|
||||
editPosMode = IED_NOPOS;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
19
src/order.c
19
src/order.c
|
@ -3166,25 +3166,6 @@ void orderSelectedObjAdd(UDWORD player, BASE_OBJECT *psObj, BOOL add)
|
|||
orderPlayOrderObjAudio( player, psObj );
|
||||
|
||||
turnOffMultiMsg(false); //msgs back on.
|
||||
|
||||
//This feels like the wrong place but it has to be done once the order has been received...
|
||||
//demolish queuing...need to bring the interface back up
|
||||
if (psDemolish && player == psObj->player)
|
||||
{
|
||||
/*this will stop the constructor being able to demolish any other
|
||||
buildings until the demolish button is re-selected*/
|
||||
intDemolishCancel();
|
||||
|
||||
//turn off the build queue availability until desired release date!
|
||||
#ifndef DISABLE_BUILD_QUEUE
|
||||
//re-add the stat (side) interface to allow a new selection
|
||||
if (ctrlShiftDown())
|
||||
{
|
||||
intConstructorSelected(psDemolish);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void orderSelectedObj(UDWORD player, BASE_OBJECT *psObj)
|
||||
|
|
Loading…
Reference in New Issue