#pragma region CPL License /* Nuclex Unreal Module Copyright (C) 2014-2021 Nuclex Development Labs This library is free software; you can redistribute it and/or modify it under the terms of the IBM Common Public License as published by the IBM Corporation; either version 1.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the IBM Common Public License for more details. You should have received a copy of the IBM Common Public License along with this library */ #pragma endregion // CPL License #pragma once #include #include #include #include "VisualNovel/DialogueChoice.h" #include "TrackedParagraphBoxState.h" // --------------------------------------------------------------------------------------------- // /// Displays a paragraph or multiple-choice question class FShowParagraphAction : public FPendingLatentAction { /// Initializes a paragraph display action /// @param latentInfo Information container for the running latent action /// @param paragraphBoxState Provides the current state of the paragraph box /// @param selectedChoice Pointer at which the selected choice will be written public: FShowParagraphAction( const FLatentActionInfo &latentInfo, const TSharedPtr ¶graphBoxState, EDialogueChoice *selectedChoice ); /// Called once per tick to update the state of the latent action /// @param response Helper providing informations and notification capabilities public: void UpdateOperation(FLatentResponse &response) override; #if defined(WITH_EDITOR) && (WITH_EDITOR == 1) /// Returns a human readable description of the latent operation's current state public: FString GetDescription() const override { return FString::Printf( TEXT("Displaying paragraph (%i %%)"), 50 ); } #endif /// Object on which to invoke the callback function to continue execution private: FWeakObjectPtr callbackTarget; /// Callback function to continue execution of the blueprint graph private: FName executionFunction; /// State in which the blueprint graph is current waiting (each node has a number) private: int32 outputLink; /// Current state of the paragraph box private: TSharedPtr paragraphBoxState; /// Receives the choice made by the player in the dialogue private: EDialogueChoice *selectedChoice; }; // --------------------------------------------------------------------------------------------- //