Guest User

Header File Musical Range Game Instance

a guest
Feb 21st, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.04 KB | None | 0 0
  1.  // Fill out your copyright notice in the Description page of Project Settings.
  2.  
  3.  #pragma once
  4.  
  5.  #include "ThirdParty/Steamworks/Steamv132/sdk/public/steam/steam_api.h"
  6.  #include "Engine/GameInstance.h"
  7.  #include "MusicalRangeInstance.generated.h"
  8.  
  9.  /**
  10.   *
  11.   */
  12.  UCLASS()
  13.  class MUSICALRANGE_API UMusicalRangeInstance : public UGameInstance
  14.  {
  15.      GENERATED_BODY()
  16.  
  17.  private:
  18.  
  19.  public:
  20.      /* test the functionality of the Game Instance */
  21.      UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Instance")
  22.      int32 InterLevelPersitentValue;
  23.  
  24.      UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Steamworks")
  25.      bool IsSteamOverlayActive;
  26.  
  27.      
  28.      UFUNCTION(BlueprintCallable, category = "Game Instance")
  29.      bool InterLevelPersitentValuePONE();
  30.      
  31.      /*
  32.      * Must be called every frame so callbacks can be received
  33.      * Always Return True!
  34.      */
  35.      UFUNCTION(BlueprintCallable, category = "Steamworks")
  36.      bool RunSteamCallbacks();
  37.  
  38.  
  39.      UFUNCTION(BlueprintImplementableEvent, Category = "Steamworks")
  40.      void OnSteamOverlayIsActive(bool isOverlayActive);
  41.  
  42.      void SteamOverlayActive();
  43.          
  44.      void OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure);
  45.      CCallResult<UMusicalRangeInstance, GameOverlayActivated_t> m_callResultGameOverlayActive;
  46.      
  47.  };
  48.  
  49.  /*
  50.  *
  51.  */
  52.  class FSteamworksCallbackAsync
  53.  {
  54.  
  55.  private:
  56.      STEAM_CALLBACK(FSteamworksCallbackAsync, OnSteamOverlayActive, GameOverlayActivated_t, OnSteamOverlayActiveCallback);
  57.      UMusicalRangeInstance *MusicalRangeGameInstance;
  58.  
  59.  public:
  60.  
  61.      FSteamworksCallbackAsync() :
  62.          OnSteamOverlayActiveCallback(this, &FSteamworksCallbackAsync::OnSteamOverlayActive)
  63.      {
  64.          if (GEngine->GetWorld() != nullptr && GEngine->GetWorld()->GetGameInstance() != nullptr)
  65.          {
  66.              MusicalRangeGameInstance = Cast<UMusicalRangeInstance>(GEngine->GetWorld()->GetGameInstance());
  67.          }
  68.      }
  69.  
  70.      ~FSteamworksCallbackAsync() {
  71.  
  72.      }
  73.  };
Add Comment
Please, Sign In to add comment