77alex77
Chieftain
Hi there,
in CivIII there has been an option called "Show units over cities" or something like that. If it was disabled units located in cities were not shown on the map.
I know that there isn't such an option in CivIV but I wanted to have it more than ever, because it doesn't look good if a huge knight or whatever is standing on my city so that all the buildings cannot be seen properly.
I did some research in the SDK and found a simpel but 'suboptimal' solution:
I modified the function "updateCenterUnit()" in CvPlot.cpp:
This solution is 'suboptimal' because units in cities cannot be selected the normal way (left mouse button) anymore.
They have to be selected via the context menu. The context menu for a tile can by default be accessed by "shift + left mouse button" or, if the respective option is activated (Civ4 options menu), by "right mouse button". Once a unit is selected, the usual plot list will appear and units can be selected as normal. It is also possible to select units in the city screen.
I will see if I can get this fixed. Perhaps someone knows a simple solution for this problem.
I don't know if there are other drawbacks. I played with this modification nearly half of a game and I had no problems. I also did some WB experiments to see if it effects bombing, nuking, etc. but it doesn't seem so.
I know that there might be not many civers who want such a 'feature', but I always missed this option and now it is 'really' possible to see all the city buildings on the world map.
I integrated my modification in the BtS 3.17 dll.
Installation instructions are included in the readme.
It is possible to start using this dll in the middle of a game.
So if you are interested, just have a look.
If you don't like it, just restore your old dll.
Don't show units over cities DLL (BtS 3.17):
Download here
in CivIII there has been an option called "Show units over cities" or something like that. If it was disabled units located in cities were not shown on the map.
I know that there isn't such an option in CivIV but I wanted to have it more than ever, because it doesn't look good if a huge knight or whatever is standing on my city so that all the buildings cannot be seen properly.
I did some research in the SDK and found a simpel but 'suboptimal' solution:
I modified the function "updateCenterUnit()" in CvPlot.cpp:
Spoiler :
void CvPlot::updateCenterUnit()
{
if (!GC.IsGraphicsInitialized())
{
return;
}
if (!isActiveVisible(true))
{
setCenterUnit(NULL);
return;
}
setCenterUnit(getSelectedUnit());
// BEGIN 77alex77 don't show units over cities
//if this plot has a city and no unit is selected:
//set no center unit
if (getCenterUnit() == NULL && !(getPlotCity() == NULL))
{
return;
}
// END 77alex77 don't show units over cities
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(GC.getGameINLINE().getActivePlayer(), NO_PLAYER, NULL, false, false, true));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(GC.getGameINLINE().getActivePlayer()));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(NO_PLAYER, GC.getGameINLINE().getActivePlayer(), gDLL->getInterfaceIFace()->getHeadSelectedUnit(), true));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(NO_PLAYER, GC.getGameINLINE().getActivePlayer(), gDLL->getInterfaceIFace()->getHeadSelectedUnit()));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(NO_PLAYER, GC.getGameINLINE().getActivePlayer()));
}
}
{
if (!GC.IsGraphicsInitialized())
{
return;
}
if (!isActiveVisible(true))
{
setCenterUnit(NULL);
return;
}
setCenterUnit(getSelectedUnit());
// BEGIN 77alex77 don't show units over cities
//if this plot has a city and no unit is selected:
//set no center unit
if (getCenterUnit() == NULL && !(getPlotCity() == NULL))
{
return;
}
// END 77alex77 don't show units over cities
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(GC.getGameINLINE().getActivePlayer(), NO_PLAYER, NULL, false, false, true));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(GC.getGameINLINE().getActivePlayer()));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(NO_PLAYER, GC.getGameINLINE().getActivePlayer(), gDLL->getInterfaceIFace()->getHeadSelectedUnit(), true));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(NO_PLAYER, GC.getGameINLINE().getActivePlayer(), gDLL->getInterfaceIFace()->getHeadSelectedUnit()));
}
if (getCenterUnit() == NULL)
{
setCenterUnit(getBestDefender(NO_PLAYER, GC.getGameINLINE().getActivePlayer()));
}
}
This solution is 'suboptimal' because units in cities cannot be selected the normal way (left mouse button) anymore.
They have to be selected via the context menu. The context menu for a tile can by default be accessed by "shift + left mouse button" or, if the respective option is activated (Civ4 options menu), by "right mouse button". Once a unit is selected, the usual plot list will appear and units can be selected as normal. It is also possible to select units in the city screen.
I will see if I can get this fixed. Perhaps someone knows a simple solution for this problem.
I don't know if there are other drawbacks. I played with this modification nearly half of a game and I had no problems. I also did some WB experiments to see if it effects bombing, nuking, etc. but it doesn't seem so.
I know that there might be not many civers who want such a 'feature', but I always missed this option and now it is 'really' possible to see all the city buildings on the world map.
I integrated my modification in the BtS 3.17 dll.
Installation instructions are included in the readme.
It is possible to start using this dll in the middle of a game.
So if you are interested, just have a look.
If you don't like it, just restore your old dll.
Don't show units over cities DLL (BtS 3.17):
Download here