How coul I give you some code I made? Here it is for now( nothing special, just a litle diferent hover effect in base). I guess that it was better to send diff file... This is from src/client/cl_basemanagement.c
/*======================
MN_DrawBase
======================*/
void MN_DrawBase( menuNode_t *node )
{
float x, y;
int mx, my, width, height, row, col, isBuilding, drawBuildingText=0;
static vec4_t color = {1.0, 1.0, 1.0, 0.5};
char image[MAX_QPATH], statusImage[MAX_QPATH];
building_t *entry, *secondEntry,*mousePointed;
if ( ! baseCurrent )
Cbuf_ExecuteText( EXEC_NOW, "mn_pop" );
width = node->size[0] / BASE_SIZE;
height = ( node->size[1] + BASE_SIZE*20 ) / BASE_SIZE;
IN_GetMousePos( &mx, &my );
for ( row = 0; row < BASE_SIZE; row++ )
{
for ( col = 0; col < BASE_SIZE; col++ )
{
// 20 is the height of the part where the images overlap
x = node->pos[0] + col * width;
y = node->pos[1] + row * height - row * 20 ;
// maybe we are out
if ( x < node->pos[0] - width ) continue;
if ( y < node->pos[1] - height) break;
if ( x > node->pos[0] + node->size[0] ) break;
if ( y > node->pos[1] + node->size[1] ) return;
baseCurrent->posX[row][col][baseCurrent->baseLevel] = x;
baseCurrent->posY[row][col][baseCurrent->baseLevel] = y;
if ( baseCurrent->map[row][col][baseCurrent->baseLevel] != -1 )
{
entry = B_GetBuildingByID(baseCurrent->map[row][col][baseCurrent->baseLevel]);
isBuilding=1;
if ( ! entry )
Sys_Error("Error in DrawBase - no building with id %i\n", baseCurrent->map[row][col][baseCurrent->baseLevel] );
if ( entry->buildingStatus[entry->howManyOfThisType] == B_UPGRADE )
Q_strncpyz( statusImage, "base/upgrade", MAX_QPATH );
else if ( entry->buildingStatus[entry->howManyOfThisType] == B_DOWN )
Q_strncpyz( statusImage, "base/down", MAX_QPATH );
else if ( entry->buildingStatus[entry->howManyOfThisType] == B_REPAIRING
|| entry->buildingStatus[entry->howManyOfThisType] == B_MAINTENANCE )
Q_strncpyz( statusImage, "base/repair", MAX_QPATH );
else if ( entry->buildingStatus[entry->howManyOfThisType] == B_UNDER_CONSTRUCTION )
Q_strncpyz( statusImage, "base/construct", MAX_QPATH );
if ( !entry->used )
{
if ( entry->needs )
entry->used = 1;
Q_strncpyz( image, entry->image, MAX_QPATH );
}
else
{
secondEntry = B_GetBuilding ( entry->needs );
if ( ! secondEntry )
Sys_Error( "Error in ufo-scriptfile - could not find the needed building\n" );
Q_strncpyz( image, secondEntry->image, MAX_QPATH );
entry->used = 0;
}
}
else
{
isBuilding=0;
Q_strncpyz( image, "base/grid", MAX_QPATH );
}
if ( mx > x && mx < x + width && my > y && my < y + height - 20 )
{
re.DrawColor( color );
if(isBuilding)
{
mousePointed = entry;
drawBuildingText = 1;
}
}
if ( *image )
re.DrawNormPic( x, y, width, height, 0, 0, 0, 0, 0, qfalse, image );
if ( mx > x && mx < x + width && my > y && my < y + height - 20 )
re.DrawColor( NULL );
if ( *statusImage )
{
// re.DrawNormPic( x + 20 , y + 60, width, height, 0, 0, 0, 0, 0, false, statusImage );
statusImage[0] = '\0';
}
}
}
if(drawBuildingText)
{
VectorSet( color, 0.5f, 1.0f, 0.5f );
color[3] = 1.0f;
re.DrawColor( color );
re.FontLength( "f_small", mousePointed->name, &width, &height );
re.FontDrawString( "f_small", 0, mx, my, width, mousePointed->title);
re.DrawColor( NULL );
}
}