Guest User

MusicalRangeInstance Header

a guest
Feb 28th, 2017
86
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 "OnlineSubsystemSteam.h"
  8. #include "MusicalRangeInstance.generated.h"
  9.  
  10.  
  11. /*~~~ Forward Declarations ~~~*/
  12. class FSteamworksCallbackAsync;
  13.  
  14. /**
  15.  *
  16.  */
  17. UCLASS()
  18. class MUSICALRANGE_API UMusicalRangeInstance : public UGameInstance
  19. {
  20.     GENERATED_BODY()
  21.  
  22. private:
  23.  
  24. protected:
  25.  
  26. public:
  27.     UMusicalRangeInstance();
  28.     ~UMusicalRangeInstance();
  29.  
  30.     /** Cached reference to FSteamworksCallbackAsync */
  31.     FSteamworksCallbackAsync* CallbackAsyncVariable;
  32.  
  33.     /* test the functionality of the Game Instance */
  34.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Instance")
  35.     int32 InterLevelPersitentValue;
  36.  
  37.     UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Steamworks")
  38.     bool IsSteamOverlayActive;
  39.    
  40.     /*
  41.     * Fire this from Blueprints to tell the actor when to initialize CPP elements
  42.     */
  43.     UFUNCTION(BlueprintCallable, category = "Steamworks")
  44.     bool InitializeCPPElements();
  45.  
  46.     UFUNCTION(BlueprintCallable, category = "Game Instance")
  47.     bool InterLevelPersitentValuePONE();
  48.    
  49.     /*
  50.     * Must be called every frame so callbacks can be received
  51.     * Always Return True!
  52.     */
  53.     UFUNCTION(BlueprintCallable, category = "Steamworks")
  54.     bool RunSteamCallbacks();
  55.  
  56.     UFUNCTION(BlueprintImplementableEvent, Category = "Steamworks")
  57.     void OnSteamOverlayIsActive(bool isOverlayActive);
  58.  
  59.     void SteamOverlayActive();
  60.        
  61.     void OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure);
  62.     CCallResult<UMusicalRangeInstance, GameOverlayActivated_t> m_callResultGameOverlayActive;
  63. };
  64.  
  65.  
  66. /*
  67. * Class to handle the Steamworks Callbacks, as the UCLASS macro won't allow it to compile otherwise
  68. * Experimental
  69. */
  70. class MUSICALRANGE_API FSteamworksCallbackAsync
  71. {
  72.  
  73. private:
  74.     STEAM_CALLBACK(FSteamworksCallbackAsync, OnSteamOverlayActive, GameOverlayActivated_t, OnSteamOverlayActiveCallback);
  75.  
  76. public:
  77.  
  78.     //Constructors
  79.  
  80.     FSteamworksCallbackAsync();
  81.     ~FSteamworksCallbackAsync();
  82.  
  83.     void AssignGameInstance(UMusicalRangeInstance *NewMusicalRangeGameInstance);
  84.  
  85.     UMusicalRangeInstance *MusicalRangeGameInstance;
  86.     FOnlineSubsystemSteam *LiveSteamSubsystem;
  87. };
RAW Paste Data