Ejemplo n.º 1
0
void DetermineItemsScrolling()
{
	if( !eInfo.sScrollIndex )
		DisableEditorButton( ITEMS_LEFTSCROLL );
	else
		EnableEditorButton( ITEMS_LEFTSCROLL );
	//Right most scroll position.	Calculated by taking every pair of numItems rounded up,
	//and subtracting 7 (because a scroll index 0 is disabled if there are <=12 items,
	//index 1 for <=14 items, index 2 for <=16 items...
	if( eInfo.sScrollIndex == max( ((eInfo.sNumItems+1)/2)-6, 0 ) )
		DisableEditorButton( ITEMS_RIGHTSCROLL );
	else
		EnableEditorButton( ITEMS_RIGHTSCROLL );
}
Ejemplo n.º 2
0
void EnsureSelectionType()
{
	BOOLEAN fPrevBrushEnabledState = gfBrushEnabled;

	//At time of writing, the only drawing mode supporting right mouse button 
	//area selections is the cave drawing mode.
	gfAllowRightButtonSelections = ( iDrawMode == DRAW_MODE_CAVES );
	
	//if we are erasing, we have more flexibility with the drawing modes.
	if( iDrawMode >= DRAW_MODE_ERASE )
	{
		//erase modes supporting any cursor mode
		gusSavedSelectionType = gusSelectionType;
		gusSelectionWidth = gusPreserveSelectionWidth;
		gfBrushEnabled = TRUE;
	}
	else switch( iDrawMode )
	{ //regular modes
		case DRAW_MODE_SAW_ROOM:
		case DRAW_MODE_ROOM:
		case DRAW_MODE_CAVES:
			gusSavedBuildingSelectionType = gusSelectionType;
			gusSelectionWidth = gusPreserveSelectionWidth;
			gfBrushEnabled = TRUE;
			break;
		case DRAW_MODE_SLANTED_ROOF:
			gusSelectionType = LINESELECTION;
			gusSelectionWidth = 8;
			gfBrushEnabled = FALSE;
			break;
		case DRAW_MODE_EXITGRID:
		case DRAW_MODE_ROOMNUM:
		case DRAW_MODE_FLOORS:
		case DRAW_MODE_GROUND:
		case DRAW_MODE_OSTRUCTS:
		case DRAW_MODE_OSTRUCTS1:
		case DRAW_MODE_OSTRUCTS2:
		case DRAW_MODE_DEBRIS:
			//supports all modes
			gusSavedSelectionType = gusSelectionType;
			gusSelectionWidth = gusPreserveSelectionWidth;
			gfBrushEnabled = TRUE;
			break;
		default:
			gusSelectionType = SMALLSELECTION;
			gusSelectionWidth = gusPreserveSelectionWidth;
			gfBrushEnabled = FALSE;

			if ( !gfSummaryWindowActive )
			{
				gfRenderTaskbar = TRUE;
			}
			break;
	}

	if( gfBrushEnabled != fPrevBrushEnabledState )
	{
		if( gfBrushEnabled )
		{
			EnableEditorButton( TERRAIN_CYCLE_BRUSHSIZE );
			EnableEditorButton( BUILDING_CYCLE_BRUSHSIZE );
			EnableEditorButton( MAPINFO_CYCLE_BRUSHSIZE );
		}
		else
		{
			DisableEditorButton( TERRAIN_CYCLE_BRUSHSIZE );
			DisableEditorButton( BUILDING_CYCLE_BRUSHSIZE );
			DisableEditorButton( MAPINFO_CYCLE_BRUSHSIZE );
		}
	}
}