Skip to content

Instantly share code, notes, and snippets.

@pnegri
Created August 19, 2014 02:35
Show Gist options
  • Save pnegri/abd6ec9d520d62e7db52 to your computer and use it in GitHub Desktop.
Save pnegri/abd6ec9d520d62e7db52 to your computer and use it in GitHub Desktop.
FSlateColor SStrategySlateHUDWidget::GetOverlayColor() const
{
const FStrategyHUDSoundsStyle& HUDSounds = FStrategyStyle::Get().GetWidgetStyle<FStrategyHUDSoundsStyle>("DefaultStrategyHUDSoundsStyle");
FLinearColor Result(0,0,0,0.3f);
const float PosExiting = FMath::Max(MenuHelper::GetSoundPlaybackPosition(OwnerHUD->PlayerOwner->GetWorld(),HUDSounds.ExitGameSound,this, &SStrategySlateHUDWidget::ExitGame),
MenuHelper::GetSoundPlaybackPosition(OwnerHUD->PlayerOwner->GetWorld(),HUDSounds.ExitGameSound,this, &SStrategySlateHUDWidget::ReturnToMainMenu));
Result.A = 0.3f + 0.7f * PosExiting;
if (PosExiting > 0.95f)
{
OwnerHUD->ShowBlackScreen();
}
return Result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment