@@ -510,18 +510,43 @@ void ShowControlBar( Bool immediate )
510510 {
511511 TheControlBar->switchControlBarStage (CONTROL_BAR_STAGE_DEFAULT);
512512 TheControlBar->setScaledViewportHeight ();
513-
513+
514514 if (TheControlBar->m_animateWindowManager && !immediate)
515515 {
516516 TheControlBar->m_animateWindowManager ->reset ();
517517 // TheControlBar->m_animateWindowManager->registerGameWindow(window, WIN_ANIMATION_SLIDE_BOTTOM_TIMED, TRUE, 1000, 0);
518518 TheControlBar->m_animateWindowManager ->registerGameWindow (window, WIN_ANIMATION_SLIDE_BOTTOM, TRUE , 500 , 0 );
519519 TheControlBar->animateSpecialPowerShortcut (TRUE );
520520 }
521-
521+
522522 window->winHide (FALSE );
523523 }
524524
525+ const char * siblingNames[] = {
526+ " ControlBar.wnd:RightHUD" ,
527+ " ControlBar.wnd:WinUnitSelected" ,
528+ " ControlBar.wnd:CameoWindow" ,
529+ " ControlBar.wnd:PopupCommunicator" ,
530+ " ControlBar.wnd:ButtonOptions" ,
531+ " ControlBar.wnd:ButtonIdleWorker" ,
532+ " ControlBar.wnd:ButtonPlaceBeacon" ,
533+ " ControlBar.wnd:ButtonGeneral" ,
534+ " ControlBar.wnd:ButtonLarge" ,
535+ " ControlBar.wnd:PowerWindow" ,
536+ " ControlBar.wnd:MoneyDisplay" ,
537+ " ControlBar.wnd:GeneralsExp" ,
538+ " ControlBar.wnd:WinUAttack" ,
539+ " ControlBar.wnd:BackgroundMarker"
540+ };
541+ for (int i = 0 ; i < sizeof (siblingNames)/sizeof (siblingNames[0 ]); ++i)
542+ {
543+ GameWindow *sibling = TheWindowManager->winGetWindowFromId (nullptr , TheNameKeyGenerator->nameToKey (siblingNames[i]));
544+ if (sibling)
545+ {
546+ sibling->winHide (FALSE );
547+ }
548+ }
549+
525550 // We want to get everything recalced since this is a major state change.
526551 TheControlBar->markUIDirty ();
527552}
@@ -554,6 +579,38 @@ void HideControlBar( Bool immediate )
554579 }
555580 }
556581
582+ const char * siblingNames[] = {
583+ " ControlBar.wnd:RightHUD" ,
584+ " ControlBar.wnd:WinUnitSelected" ,
585+ " ControlBar.wnd:CameoWindow" ,
586+ " ControlBar.wnd:PopupCommunicator" ,
587+ " ControlBar.wnd:ButtonOptions" ,
588+ " ControlBar.wnd:ButtonIdleWorker" ,
589+ " ControlBar.wnd:ButtonPlaceBeacon" ,
590+ " ControlBar.wnd:ButtonGeneral" ,
591+ " ControlBar.wnd:ButtonLarge" ,
592+ " ControlBar.wnd:PowerWindow" ,
593+ " ControlBar.wnd:MoneyDisplay" ,
594+ " ControlBar.wnd:GeneralsExp" ,
595+ " ControlBar.wnd:WinUAttack" ,
596+ " ControlBar.wnd:BackgroundMarker" ,
597+ " ControlBar.wnd:UnderConstructionWindow" ,
598+ " ControlBar.wnd:OCLTimerWindow" ,
599+ " ControlBar.wnd:BeaconWindow" ,
600+ " ControlBar.wnd:CommandWindow" ,
601+ " ControlBar.wnd:ProductionQueueWindow" ,
602+ " ControlBar.wnd:ObserverPlayerListWindow" ,
603+ " ControlBar.wnd:ObserverPlayerInfoWindow"
604+ };
605+ for (int i = 0 ; i < sizeof (siblingNames)/sizeof (siblingNames[0 ]); ++i)
606+ {
607+ GameWindow *sibling = TheWindowManager->winGetWindowFromId (nullptr , TheNameKeyGenerator->nameToKey (siblingNames[i]));
608+ if (sibling)
609+ {
610+ sibling->winHide (TRUE );
611+ }
612+ }
613+
557614 if (TheControlBar->m_animateWindowManager && !immediate)
558615 {
559616 TheControlBar->m_animateWindowManager ->reverseAnimateWindow ();
@@ -595,12 +652,69 @@ void ToggleControlBar( Bool immediate )
595652 TheControlBar->m_animateWindowManager ->registerGameWindow (window, WIN_ANIMATION_SLIDE_BOTTOM, TRUE , 500 , 0 );
596653 TheControlBar->animateSpecialPowerShortcut (TRUE );
597654 }
655+
656+ const char * siblingNames[] = {
657+ " ControlBar.wnd:RightHUD" ,
658+ " ControlBar.wnd:WinUnitSelected" ,
659+ " ControlBar.wnd:CameoWindow" ,
660+ " ControlBar.wnd:PopupCommunicator" ,
661+ " ControlBar.wnd:ButtonOptions" ,
662+ " ControlBar.wnd:ButtonIdleWorker" ,
663+ " ControlBar.wnd:ButtonPlaceBeacon" ,
664+ " ControlBar.wnd:ButtonGeneral" ,
665+ " ControlBar.wnd:ButtonLarge" ,
666+ " ControlBar.wnd:PowerWindow" ,
667+ " ControlBar.wnd:MoneyDisplay" ,
668+ " ControlBar.wnd:GeneralsExp" ,
669+ " ControlBar.wnd:WinUAttack" ,
670+ " ControlBar.wnd:BackgroundMarker"
671+ };
672+ for (int i = 0 ; i < sizeof (siblingNames)/sizeof (siblingNames[0 ]); ++i)
673+ {
674+ GameWindow *sibling = TheWindowManager->winGetWindowFromId (nullptr , TheNameKeyGenerator->nameToKey (siblingNames[i]));
675+ if (sibling)
676+ {
677+ sibling->winHide (FALSE );
678+ }
679+ }
598680 }
599681 else
600682 {
601683 TheControlBar->hideSpecialPowerShortcut ();
602684 TheControlBar->setFullViewportHeight ();
603685 window->winHide (TRUE );
686+
687+ const char * siblingNames[] = {
688+ " ControlBar.wnd:RightHUD" ,
689+ " ControlBar.wnd:WinUnitSelected" ,
690+ " ControlBar.wnd:CameoWindow" ,
691+ " ControlBar.wnd:PopupCommunicator" ,
692+ " ControlBar.wnd:ButtonOptions" ,
693+ " ControlBar.wnd:ButtonIdleWorker" ,
694+ " ControlBar.wnd:ButtonPlaceBeacon" ,
695+ " ControlBar.wnd:ButtonGeneral" ,
696+ " ControlBar.wnd:ButtonLarge" ,
697+ " ControlBar.wnd:PowerWindow" ,
698+ " ControlBar.wnd:MoneyDisplay" ,
699+ " ControlBar.wnd:GeneralsExp" ,
700+ " ControlBar.wnd:WinUAttack" ,
701+ " ControlBar.wnd:BackgroundMarker" ,
702+ " ControlBar.wnd:UnderConstructionWindow" ,
703+ " ControlBar.wnd:OCLTimerWindow" ,
704+ " ControlBar.wnd:BeaconWindow" ,
705+ " ControlBar.wnd:CommandWindow" ,
706+ " ControlBar.wnd:ProductionQueueWindow" ,
707+ " ControlBar.wnd:ObserverPlayerListWindow" ,
708+ " ControlBar.wnd:ObserverPlayerInfoWindow"
709+ };
710+ for (int i = 0 ; i < sizeof (siblingNames)/sizeof (siblingNames[0 ]); ++i)
711+ {
712+ GameWindow *sibling = TheWindowManager->winGetWindowFromId (nullptr , TheNameKeyGenerator->nameToKey (siblingNames[i]));
713+ if (sibling)
714+ {
715+ sibling->winHide (TRUE );
716+ }
717+ }
604718 }
605719 }
606720}
0 commit comments