@@ -501,121 +501,114 @@ extern void toggleReplayControls( void );
501
501
// -------------------------------------------------------------------------------------------------
502
502
void ShowControlBar ( Bool immediate )
503
503
{
504
+ if (!TheWindowManager || !TheControlBar || !TheTacticalView)
505
+ return ;
506
+
504
507
showReplayControls ();
505
- if (TheControlBar)
506
- TheControlBar->showSpecialPowerShortcut ();
507
- if (TheWindowManager)
508
+
509
+ TheControlBar->showSpecialPowerShortcut ();
510
+
511
+ Int id = (Int)TheNameKeyGenerator->nameToKey (AsciiString (" ControlBar.wnd:ControlBarParent" ));
512
+ GameWindow *window = TheWindowManager->winGetWindowFromId (NULL , id);
513
+
514
+ if (window)
508
515
{
509
- Int id = (Int)TheNameKeyGenerator-> nameToKey ( AsciiString ( " ControlBar.wnd:ControlBarParent " ) );
510
- GameWindow *window = TheWindowManager-> winGetWindowFromId ( NULL , id );
516
+ TheControlBar-> switchControlBarStage (CONTROL_BAR_STAGE_DEFAULT );
517
+ TheTacticalView-> setHeight ((Int)(TheDisplay-> getHeight () * 0 . 80f ) );
511
518
512
- if (window)
513
- {
514
- TheControlBar->switchControlBarStage (CONTROL_BAR_STAGE_DEFAULT);
515
- TheTacticalView->setHeight ((Int)(TheDisplay->getHeight () * 0 .80f ));
516
- if (TheControlBar->m_animateWindowManager && !immediate)
517
- {
518
- TheControlBar->m_animateWindowManager ->reset ();
519
- // TheControlBar->m_animateWindowManager->registerGameWindow(window, WIN_ANIMATION_SLIDE_BOTTOM_TIMED, TRUE, 1000, 0);
520
- TheControlBar->m_animateWindowManager ->registerGameWindow (window, WIN_ANIMATION_SLIDE_BOTTOM, TRUE , 500 , 0 );
521
- TheControlBar->animateSpecialPowerShortcut (TRUE );
522
- }
523
- window->winHide (FALSE );
519
+ if (TheControlBar->m_animateWindowManager && !immediate)
520
+ {
521
+ TheControlBar->m_animateWindowManager ->reset ();
522
+ // TheControlBar->m_animateWindowManager->registerGameWindow(window, WIN_ANIMATION_SLIDE_BOTTOM_TIMED, TRUE, 1000, 0);
523
+ TheControlBar->m_animateWindowManager ->registerGameWindow (window, WIN_ANIMATION_SLIDE_BOTTOM, TRUE , 500 , 0 );
524
+ TheControlBar->animateSpecialPowerShortcut (TRUE );
524
525
}
525
526
526
- }
527
+ window->winHide (FALSE );
528
+ }
527
529
528
530
// We want to get everything recalced since this is a major state change.
529
- if (TheControlBar)
530
- TheControlBar->markUIDirty ();
531
-
532
- }// void ShowControlBar(void)
531
+ TheControlBar->markUIDirty ();
532
+ }
533
533
534
534
// -------------------------------------------------------------------------------------------------
535
535
/* * Force the control bar to be hidden */
536
536
// -------------------------------------------------------------------------------------------------
537
537
void HideControlBar ( Bool immediate )
538
538
{
539
+ if (!TheWindowManager || !TheControlBar || !TheTacticalView)
540
+ return ;
541
+
539
542
hideReplayControls ();
540
- if (TheControlBar)
541
- TheControlBar->hideSpecialPowerShortcut ();
542
- if (TheWindowManager)
543
- {
544
- Int id = (Int)TheNameKeyGenerator->nameToKey (AsciiString (" ControlBar.wnd:ControlBarParent" ));
545
- GameWindow *window = TheWindowManager->winGetWindowFromId (NULL , id);
546
543
547
- if (window)
548
- {
544
+ TheControlBar->hideSpecialPowerShortcut ();
545
+
546
+ Int id = (Int)TheNameKeyGenerator->nameToKey (AsciiString (" ControlBar.wnd:ControlBarParent" ));
547
+ GameWindow *window = TheWindowManager->winGetWindowFromId (NULL , id);
548
+
549
+ if (window)
550
+ {
549
551
#ifdef SLIDE_LETTERBOX
550
- TheTacticalView->setHeight ((Int)(TheDisplay->getHeight () * 0 .80f ));
552
+ TheTacticalView->setHeight ((Int)(TheDisplay->getHeight () * 0 .80f ));
551
553
#else
552
- TheTacticalView->setHeight (TheDisplay->getHeight ());
554
+ TheTacticalView->setHeight (TheDisplay->getHeight ());
553
555
#endif
554
- }
555
556
if (immediate)
556
557
{
557
558
window->winHide (TRUE );
558
- if (TheControlBar)
559
- TheControlBar->hideSpecialPowerShortcut ();
560
-
561
- }
562
- else
563
- {
564
- TheControlBar->m_animateWindowManager ->reverseAnimateWindow ();
565
- TheControlBar->animateSpecialPowerShortcut (FALSE );
566
559
}
560
+ }
567
561
568
- // Always get rid of the purchase science screen!
569
- if ( TheControlBar )
570
- {
571
- TheControlBar->hidePurchaseScience ();
572
- }
573
- }
574
- }// void HideControlBar( void )
562
+ if (TheControlBar->m_animateWindowManager && !immediate)
563
+ {
564
+ TheControlBar->m_animateWindowManager ->reverseAnimateWindow ();
565
+ TheControlBar->animateSpecialPowerShortcut (FALSE );
566
+ }
567
+
568
+ // Always get rid of the purchase science screen!
569
+ TheControlBar->hidePurchaseScience ();
570
+ }
575
571
576
572
// -------------------------------------------------------------------------------------------------
577
573
/* * Toggle the control bar on or off */
578
574
// -------------------------------------------------------------------------------------------------
579
575
void ToggleControlBar ( Bool immediate )
580
576
{
577
+ if (!TheWindowManager || !TheControlBar || !TheTacticalView)
578
+ return ;
579
+
581
580
toggleReplayControls ();
582
581
583
- if (TheWindowManager)
584
- {
585
- Int id = (Int)TheNameKeyGenerator->nameToKey (AsciiString (" ControlBar.wnd:ControlBarParent" ));
586
- GameWindow *window = TheWindowManager->winGetWindowFromId (NULL , id);
582
+ Int id = (Int)TheNameKeyGenerator->nameToKey (AsciiString (" ControlBar.wnd:ControlBarParent" ));
583
+ GameWindow *window = TheWindowManager->winGetWindowFromId (NULL , id);
587
584
588
- if (window)
585
+ if (window)
586
+ {
587
+ if (window->winIsHidden ())
589
588
{
590
- if (window->winIsHidden ())
591
- {
592
- if (TheControlBar)
593
- TheControlBar->showSpecialPowerShortcut ();
594
-
595
- // now hidden, we're making it visible again so shrink viewport under the window
596
- TheTacticalView->setHeight ((Int)(TheDisplay->getHeight () * 0 .80f ));
597
- window->winHide (!window->winIsHidden ());
598
- TheControlBar->switchControlBarStage (CONTROL_BAR_STAGE_DEFAULT);
599
- if (TheControlBar->m_animateWindowManager && !immediate)
600
- {
601
- TheControlBar->m_animateWindowManager ->reset ();
602
- // TheControlBar->m_animateWindowManager->registerGameWindow(window, WIN_ANIMATION_SLIDE_BOTTOM_TIMED, FALSE, 500, 0);
603
- TheControlBar->m_animateWindowManager ->registerGameWindow (window, WIN_ANIMATION_SLIDE_BOTTOM, TRUE , 500 , 0 );
604
- TheControlBar->animateSpecialPowerShortcut (TRUE );
605
- }
606
- }
607
- else
589
+ TheControlBar->showSpecialPowerShortcut ();
590
+
591
+ // now hidden, we're making it visible again so shrink viewport under the window
592
+ TheTacticalView->setHeight ((Int)(TheDisplay->getHeight () * 0 .80f ));
593
+ window->winHide (FALSE );
594
+ TheControlBar->switchControlBarStage (CONTROL_BAR_STAGE_DEFAULT);
595
+
596
+ if (TheControlBar->m_animateWindowManager && !immediate)
608
597
{
609
- if ( TheControlBar)
610
- TheControlBar->hideSpecialPowerShortcut ( );
611
- TheTacticalView-> setHeight (TheDisplay-> getHeight () );
612
- window-> winHide (!window-> winIsHidden () );
598
+ TheControlBar-> m_animateWindowManager -> reset ();
599
+ // TheControlBar->m_animateWindowManager->registerGameWindow(window, WIN_ANIMATION_SLIDE_BOTTOM_TIMED, FALSE, 500, 0 );
600
+ TheControlBar-> m_animateWindowManager -> registerGameWindow (window, WIN_ANIMATION_SLIDE_BOTTOM, TRUE , 500 , 0 );
601
+ TheControlBar-> animateSpecialPowerShortcut ( TRUE );
613
602
}
614
-
615
603
}
616
-
604
+ else
605
+ {
606
+ TheControlBar->hideSpecialPowerShortcut ();
607
+ TheTacticalView->setHeight (TheDisplay->getHeight ());
608
+ window->winHide (TRUE );
609
+ }
617
610
}
618
- }// end void ToggleControlBar( void )
611
+ }
619
612
620
613
// -------------------------------------------------------------------------------------------------
621
614
/* * Resize the control bar */
0 commit comments