Guest User

CPP Musical Range Game Instance

a guest
Feb 21st, 2017
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.40 KB | None | 0 0
  1.  // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3.  #include "MusicalRange.h"
  4.  #include "MusicalRangeInstance.h"
  5.  #include "ThirdParty/Steamworks/Steamv132/sdk/public/steam/isteamutils.h"
  6.  
  7.  //Musical Range Game Instance Elements
  8.  bool UMusicalRangeInstance::InterLevelPersitentValuePONE() {
  9.      InterLevelPersitentValue++;
  10.      return true;
  11.  }
  12.  
  13.  bool UMusicalRangeInstance::RunSteamCallbacks() {
  14.      SteamAPI_RunCallbacks();
  15.      SteamOverlayActive(); //Check for active overlay
  16.      return true;
  17.  }
  18.  
  19.  void UMusicalRangeInstance::SteamOverlayActive() {
  20.      SteamAPICall_t hSteamAPICall = SteamUtils()->IsOverlayEnabled();
  21.      m_callResultGameOverlayActive.Set(hSteamAPICall, this, &UMusicalRangeInstance::OnSteamOverlayEnabled);
  22.      return;
  23.  }
  24.  
  25.  void UMusicalRangeInstance::OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure) {
  26.      IsSteamOverlayActive = (pResult->m_bActive != 0);
  27.      OnSteamOverlayIsActive(IsSteamOverlayActive);
  28.      return;
  29.  }
  30.  
  31.  //FSteamworksCallbackAsync elements
  32.  void FSteamworksCallbackAsync::OnSteamOverlayActive(GameOverlayActivated_t *CallbackData) {
  33.      bool IsOverlayActive = (CallbackData->m_bActive != 0);
  34.      GEngine->AddOnScreenDebugMessage(-1, 15, FColor::Cyan, IsOverlayActive ? "Overlay is ACTIVE" : "Overlay is OFF");
  35.      MusicalRangeGameInstance->OnSteamOverlayIsActive(IsOverlayActive);
  36.  }
Add Comment
Please, Sign In to add comment