Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Fill out your copyright notice in the Description page of Project Settings.
- #pragma once
- #include "ThirdParty/Steamworks/Steamv132/sdk/public/steam/steam_api.h"
- #include "Engine/GameInstance.h"
- #include "OnlineSubsystemSteam.h"
- #include "MusicalRangeInstance.generated.h"
- /*~~~ Forward Declarations ~~~*/
- class FSteamworksCallbackAsync;
- /**
- *
- */
- UCLASS()
- class MUSICALRANGE_API UMusicalRangeInstance : public UGameInstance
- {
- GENERATED_BODY()
- private:
- protected:
- public:
- UMusicalRangeInstance();
- ~UMusicalRangeInstance();
- /** Cached reference to FSteamworksCallbackAsync */
- FSteamworksCallbackAsync* CallbackAsyncVariable;
- /* test the functionality of the Game Instance */
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Game Instance")
- int32 InterLevelPersitentValue;
- UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Steamworks")
- bool IsSteamOverlayActive;
- /*
- * Fire this from Blueprints to tell the actor when to initialize CPP elements
- */
- UFUNCTION(BlueprintCallable, category = "Steamworks")
- bool InitializeCPPElements();
- UFUNCTION(BlueprintCallable, category = "Game Instance")
- bool InterLevelPersitentValuePONE();
- /*
- * Must be called every frame so callbacks can be received
- * Always Return True!
- */
- UFUNCTION(BlueprintCallable, category = "Steamworks")
- bool RunSteamCallbacks();
- UFUNCTION(BlueprintImplementableEvent, Category = "Steamworks")
- void OnSteamOverlayIsActive(bool isOverlayActive);
- void SteamOverlayActive();
- void OnSteamOverlayEnabled(GameOverlayActivated_t *pResult, bool bIOFailure);
- CCallResult<UMusicalRangeInstance, GameOverlayActivated_t> m_callResultGameOverlayActive;
- };
- /*
- * Class to handle the Steamworks Callbacks, as the UCLASS macro won't allow it to compile otherwise
- * Experimental
- */
- class MUSICALRANGE_API FSteamworksCallbackAsync
- {
- private:
- STEAM_CALLBACK(FSteamworksCallbackAsync, OnSteamOverlayActive, GameOverlayActivated_t, OnSteamOverlayActiveCallback);
- public:
- //Constructors
- FSteamworksCallbackAsync();
- ~FSteamworksCallbackAsync();
- void AssignGameInstance(UMusicalRangeInstance *NewMusicalRangeGameInstance);
- UMusicalRangeInstance *MusicalRangeGameInstance;
- FOnlineSubsystemSteam *LiveSteamSubsystem;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement