mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
Merged from revision: 7678
Editor Fixes (by Buggler): - '~' (tilde) hotkey to toggle level cursor if applicable; CTRL hotkey for placing objects on roof removed - Fixed missing roof cursor for non-vanilla size maps - Updated editor popup text git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7679 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -51,10 +51,6 @@ void ForceAreaSelectionWidth();
|
||||
BOOLEAN HandleAreaSelection();
|
||||
void EnsureSelectionType();
|
||||
|
||||
//Used for offseting cursor to show that it is on the roof rather than on the ground.
|
||||
//This can be conveniently executed by moving the cursor up and right 3 gridnos for a
|
||||
//total of -483 -(160*3)-(1*3)
|
||||
#define ROOF_OFFSET (-483)
|
||||
BOOLEAN gfUsingOffset;
|
||||
|
||||
//Based on the density level setting and the selection type, this test will
|
||||
@@ -112,7 +108,7 @@ void RemoveCursors()
|
||||
pNode = gpWorldLevelData[ iMapIndex ].pTopmostHead;
|
||||
while( pNode )
|
||||
{
|
||||
if( pNode->usIndex == FIRSTPOINTERS1 || pNode->usIndex == FIRSTPOINTERS5 )
|
||||
if( pNode->usIndex == FIRSTPOINTERS1 || pNode->usIndex == FIRSTPOINTERS5 || pNode->usIndex == BADMARKER1 )
|
||||
{
|
||||
RemoveTopmost( iMapIndex, pNode->usIndex );
|
||||
break;
|
||||
@@ -193,11 +189,12 @@ void UpdateCursorAreas()
|
||||
//Draw all of the area cursors here.
|
||||
if( fValidCursor )
|
||||
{
|
||||
if( iDrawMode == DRAW_MODE_ENEMY || iDrawMode == DRAW_MODE_CREATURE ||
|
||||
if( gfRoofPlacement || iDrawMode == DRAW_MODE_ENEMY || iDrawMode == DRAW_MODE_CREATURE ||
|
||||
iDrawMode == DRAW_MODE_REBEL || iDrawMode == DRAW_MODE_CIVILIAN ||
|
||||
iDrawMode == DRAW_MODE_SCHEDULEACTION )
|
||||
{
|
||||
iMapIndex = gSelectRegion.iTop * WORLD_COLS + gSelectRegion.iLeft;
|
||||
|
||||
if( !IsLocationSittable( iMapIndex, gfRoofPlacement ) && iDrawMode != DRAW_MODE_SCHEDULEACTION ||
|
||||
!IsLocationSittableExcludingPeople( iMapIndex, gfRoofPlacement ) && iDrawMode == DRAW_MODE_SCHEDULEACTION )
|
||||
{
|
||||
@@ -207,7 +204,8 @@ void UpdateCursorAreas()
|
||||
if( gfRoofPlacement && FlatRoofAboveGridNo( iMapIndex ) )
|
||||
{
|
||||
AddTopmostToTail( iMapIndex + ROOF_OFFSET, BADMARKER1 );
|
||||
sBadMarker = iMapIndex + ROOF_OFFSET ;
|
||||
sBadMarker = iMapIndex + ROOF_OFFSET;
|
||||
gfUsingOffset = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -33,6 +33,11 @@ extern STR16 wszSelType[6];
|
||||
|
||||
extern BOOLEAN gfCurrentSelectionWithRightButton;
|
||||
|
||||
//Used for offseting cursor to show that it is on the roof rather than on the ground.
|
||||
//This can be conveniently executed by moving the cursor up and right 3 gridnos for a
|
||||
//total of -483 -(160*3)-(1*3)
|
||||
#define ROOF_OFFSET -(WORLD_COLS*3)-(1*3)
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+4
-4
@@ -55,7 +55,7 @@ UINT16 CurrentStruct = NO_TILE;
|
||||
UINT32 gDoBanks = NO_BANKS;
|
||||
UINT32 gDoCliffs = NO_CLIFFS;
|
||||
|
||||
|
||||
extern BOOLEAN FlatRoofAboveGridNo( INT32 iMapIndex );
|
||||
|
||||
//---------------------------------------------------------------------------------------------------------------
|
||||
// QuickEraseMapTile
|
||||
@@ -255,7 +255,7 @@ void PasteDebris( INT32 iMapIndex )
|
||||
AddToUndoList( iMapIndex );
|
||||
|
||||
// anv: add anything on the roof, cause why not
|
||||
if ( _KeyDown(17) )
|
||||
if ( ( gfRoofPlacement && FlatRoofAboveGridNo( iMapIndex ) ) )
|
||||
{
|
||||
// Add debris to the world
|
||||
usUseIndex = pSelList[ iCurBank ].usIndex;
|
||||
@@ -395,7 +395,7 @@ void PasteSingleWallCommon( INT32 iMapIndex )
|
||||
usUseObjIndex = (UINT16)pSelList[ iCurBank ].uiObject;
|
||||
|
||||
// TEMP STUFF FOR ONROOF THINGS!
|
||||
if ( ( (usUseObjIndex >= FIRSTONROOF) && (usUseObjIndex <= SECONDONROOF ) ) || _KeyDown(17) )
|
||||
if ( ( (usUseObjIndex >= FIRSTONROOF) && (usUseObjIndex <= SECONDONROOF ) ) || ( gfRoofPlacement && FlatRoofAboveGridNo( iMapIndex ) ) )
|
||||
{
|
||||
// WANNE: Disabled the next line, because if makes placing sandbags on rooftops impossible!
|
||||
//dnl Remove all onroof things before placing new one to avoid stacking problems of same element
|
||||
@@ -602,7 +602,7 @@ void PasteStructureCommon( INT32 iMapIndex )
|
||||
*/
|
||||
|
||||
// anv: add anything on the roof, cause why not
|
||||
if ( _KeyDown(17) )
|
||||
if ( ( gfRoofPlacement && FlatRoofAboveGridNo( iMapIndex ) ) )
|
||||
{
|
||||
if ( /*fDoPaste &&*/ iMapIndex < 0x80000000 )
|
||||
{
|
||||
|
||||
@@ -774,6 +774,8 @@ BOOLEAN DrawTempMouseCursorObject(void)
|
||||
{
|
||||
if ( (iCurBankMapIndex = MAPROWCOLTOPOS( sMouseY_M, sMouseX_M )) < 0x80000000 )
|
||||
{
|
||||
if( gfRoofPlacement && FlatRoofAboveGridNo( iCurBankMapIndex ) )
|
||||
iCurBankMapIndex += ROOF_OFFSET;
|
||||
|
||||
//Hook into the smart methods to override the selection window methods.
|
||||
if( iDrawMode == DRAW_MODE_SMART_WALLS )
|
||||
@@ -1709,6 +1711,29 @@ void HandleKeyboardShortcuts( )
|
||||
iCurrentAction = ACTION_SHADE_DWN;
|
||||
break;
|
||||
|
||||
case '`':
|
||||
// Buggler: Swap Cursor Level
|
||||
if( !gfRoofPlacement )
|
||||
{
|
||||
gfRoofPlacement = TRUE;
|
||||
if( !fBuildingShowRoofs )
|
||||
{
|
||||
fBuildingShowRoofs = TRUE;
|
||||
ClickEditorButton( BUILDING_TOGGLE_ROOF_VIEW );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gfRoofPlacement = FALSE;
|
||||
if( fBuildingShowRoofs )
|
||||
{
|
||||
fBuildingShowRoofs = FALSE;
|
||||
UnclickEditorButton( BUILDING_TOGGLE_ROOF_VIEW );
|
||||
}
|
||||
}
|
||||
UpdateRoofsView();
|
||||
break;
|
||||
|
||||
case '0':
|
||||
case '1':
|
||||
case '2':
|
||||
|
||||
Reference in New Issue
Block a user