@ -63,6 +63,8 @@ bool VirusAttack::OnUserCreate(){
unitCreationBox . SetVisible ( false ) ;
testBox . Initialize ( " Hello world, this is a test of the textbox system. \n Maybe even with some newline characters snuck in there. " , { } ) ;
testBox . SetVisible ( false ) ;
memoryAllocatorBox . Initialize ( CONSTANT : : MEMORY_ALLOCATOR_BOX_DISPLAY_STRING , { } , CONSTANT : : MEMORY_ALLOCATOR_BOX_HEADER_STRING ) ;
memoryAllocatorBox . SetVisible ( false ) ;
IMAGES [ MINIMAP_OUTLINE ] = std : : make_unique < Renderable > ( ) ;
IMAGES [ MINIMAP_OUTLINE ] - > Create ( 64 , 64 ) ;
@ -183,12 +185,14 @@ void VirusAttack::UpdateUnitCreationListGUI(bool allocatorSelected){
void VirusAttack : : HandleDraggingSelection ( ) {
auto NotClickingOnMinimap = [ & ] ( ) { return ! ( GetMouseX ( ) > = ScreenWidth ( ) - 64 & & GetMouseY ( ) > = ScreenHeight ( ) - 64 ) ; } ;
bool allocatorSelected = false ;
bool memoryAllocatorBoxHovered = false ;
for ( auto & u : units ) {
u - > UpdateGUIState ( game , player_resources ) ;
u - > UpdateGUIState ( game , player_resources , memoryAllocatorBox , memoryAllocatorBoxHovered ) ;
if ( u - > IsSelected ( ) & & u - > IsAllocator ( ) ) {
allocatorSelected = true ;
}
}
if ( ! memoryAllocatorBoxHovered ) memoryAllocatorBox . SetVisible ( false ) ;
UpdateUnitCreationListGUI ( allocatorSelected ) ;
if ( GetMouse ( 0 ) . bPressed ) {
if ( NotClickingOnMinimap ( ) ) {
@ -540,8 +544,9 @@ bool VirusAttack::OnUserUpdate(float fElapsedTime){
DrawMinimap ( ) ;
unitCreationBox . UpdateAndDraw ( GetMousePos ( ) , this , player_resources , IMAGES ) ;
unitCreationBox . UpdateAndDraw ( GetMousePos ( ) + vi2d { 8 , - 28 } , this , player_resources , IMAGES ) ;
testBox . UpdateAndDraw ( GetMousePos ( ) - testBox . GetSize ( ) / 2 , this , player_resources , IMAGES ) ;
memoryAllocatorBox . UpdateAndDraw ( GetMousePos ( ) + vi2d { 8 , - 28 } , this , player_resources , IMAGES ) ;
std : : sort ( units . begin ( ) , units . end ( ) , [ & ] ( auto & u1 , auto & u2 ) {
float dist1 = geom2d : : line < float > ( u1 - > GetGhostPos ( ) , GetWorldMousePos ( ) ) . length ( ) ;