DrawingSurface*surface;
DynamicSprite*sprite, overlay, final;
//sprite.Graphic is the background sprite with all the units drawn on top
function repeatedly_execute()
{
if (player.Room == 1) {
int u = 1;
while (u <= total*2)
{
if (((unit[u].x-13 <= mouse.x) && (mouse.x <= unit[u].x+13)) && ((unit[u].y-13 <= mouse.y) && (mouse.y <= unit[u].y+13))) {
overlay = DynamicSprite.Create(800, 600, true);
final = DynamicSprite.CreateFromExistingSprite(sprite.Graphic);
surface = overlay.GetDrawingSurface();
int slot;
if (unit[u].type == eUnionInfantry) slot = 30;
else if (unit[u].type == eUnionCavalry) slot = 29;
else if (unit[u].type == eUnionArtillery) slot = 28;
else if (unit[u].type == eConfInfantry) slot = 25;
else if (unit[u].type == eConfCavalry) slot = 24;
else if (unit[u].type == eConfArtillery) slot = 8;
if (unit[u].plyr) surface.DrawingColor = 10; else surface.DrawingColor = 12;
int first, second; // make sure the smallest circle is always drawn last
if (unit[u].mvm < unit[u].rng) { first = unit[u].rng; second = unit[u].mvm; }
else if (unit[u].rng < unit[u].mvm) { first = unit[u].mvm; second = unit[u].rng; }
surface.DrawCircle(unit[u].x, unit[u].y, first);
if (unit[u].plyr) surface.DrawingColor = 2; else surface.DrawingColor = 4;
surface.DrawCircle(unit[u].x, unit[u].y, second);
surface.DrawImage(unit[u].x-1-(Game.SpriteWidth[slot]/2), unit[u].y-1-(Game.SpriteHeight[slot]/2), slot);
surface = final.GetDrawingSurface();
surface.DrawImage(0, 0, overlay.Graphic, 60);
surface.Release();
gBattlefield.BackgroundGraphic = final.Graphic;
if (unit[u].type == eUnionInfantry) infoType.Text = "Unionist Infantry";
else if (unit[u].type == eUnionCavalry) infoType.Text = "Unionist Cavalry";
else if (unit[u].type == eUnionArtillery) infoType.Text = "Unionist Artillery";
else if (unit[u].type == eConfInfantry) infoType.Text = "Confederate Infantry";
else if (unit[u].type == eConfCavalry) infoType.Text = "Confederate Cavalry";
else if (unit[u].type == eConfArtillery) infoType.Text = "Confederate Artillery";
infoWeapon.Text = unit[u].weapon;
infoStats.Text = String.Format("Dam: %d Mvm: %d Rng: %d Def: %d", unit[u].dam, unit[u].mvm, unit[u].rng, unit[u].def);
if (unit[u].plyr) infoType.TextColor = 10;
else infoType.TextColor = 12;
int width = GetTextWidth(infoType.Text, infoType.Font);
if (width < GetTextWidth(infoWeapon.Text, infoWeapon.Font)) width = GetTextWidth(infoWeapon.Text, infoWeapon.Font);
if (width < GetTextWidth(infoStats.Text, infoStats.Font)) width = GetTextWidth(infoStats.Text, infoStats.Font);
infoType.Width = width+12; infoWeapon.Width = width+12;
infoStats.Width = width+12; gInfo.Width = width+12;
int x = mouse.x+2, y = mouse.y+2;
if (800-gInfo.Width < x) x = 800-gInfo.Width-5;
if (600-gInfo.Height < y) y = 600-gInfo.Height-5;
gInfo.SetPosition(x, y);
gInfo.Visible = true;
}
else // mouse not over a unit, so change to background sprite
{
gInfo.Visible = false;
gBattlefield.BackgroundGraphic = sprite.Graphic;
}
u++;
}
}
}
Sorry, here's the full code (copied and pasted this time, not translated manually to avoid all my typos

Like I say, the GUI only shows up and circles are only drawn if the mouse is over the last unit in the array, which is always an enemy unit.