Coherent UI for Unreal Engine 4  2.5.5.0
A modern user interface library for games
 All Classes Functions Variables Pages
CoherentUIOptionsMenu.h
1 /*
2 This file is part of Coherent UI, modern user interface library for
3 games.
4 
5 Copyright (c) 2012-2014 Coherent Labs Limited and/or its licensors. All
6 rights reserved in all media.
7 
8 The coded instructions, statements, computer programs, and/or related
9 material (collectively the "Data") in these files contain confidential
10 and unpublished information proprietary Coherent Labs and/or its
11 licensors, which is protected by United States of America federal
12 copyright law and by international treaties.
13 
14 This software or source code is supplied under the terms of a license
15 agreement and nondisclosure agreement with Coherent Labs Limited and may
16 not be copied, disclosed, or exploited except in accordance with the
17 terms of that agreement. The Data may not be disclosed or distributed to
18 third parties, in whole or in part, without the prior written consent of
19 Coherent Labs Limited.
20 
21 COHERENT LABS MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS
22 SOURCE CODE FOR ANY PURPOSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
23 HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
25 MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, ITS AFFILIATES,
27 PARENT COMPANIES, LICENSORS, SUPPLIERS, OR CONTRIBUTORS BE LIABLE FOR
28 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 ANY WAY OUT OF THE USE OR PERFORMANCE OF THIS SOFTWARE OR SOURCE CODE,
34 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 */
36 
37 #pragma once
38 
39 #include "CoherentBaseComponent.h"
40 #include "CoherentUIOptionsMenuControl.h"
41 
42 #include "CoherentUIOptionsMenu.generated.h"
43 
44 
45 USTRUCT(Blueprintable)
46 struct FCoherentUISavedOptions
47 {
48  GENERATED_USTRUCT_BODY()
49 public:
51  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Menu Options")
52  FString Name;
53 
55  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Menu Options")
56  FString Type;
57 
59  UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Menu Options")
60  FString CurrentValue;
61 };
62 
63 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCoherentOptionsSaved, const TArray<FCoherentUISavedOptions>&, SavedOptions);
64 
65 DECLARE_DYNAMIC_MULTICAST_DELEGATE_OneParam(FCoherentOptionSaved, TArray<int32>, SavedOption);
66 
67 DECLARE_DYNAMIC_MULTICAST_DELEGATE(FCoherentOptionsDiscarded);
68 
69 UCLASS(MinimalAPI, BlueprintType, Blueprintable)
70 class UCoherentUIOptionsMenu : public UObject
71 {
72  GENERATED_UCLASS_BODY()
73 public:
74 
75  UFUNCTION()
76  void Initialize(UCoherentBaseComponent* ViewComponent, TArray<FCoherentUIOptionsMenuControl> controls);
77 
78  UFUNCTION()
79  void OnReadyForScripting(int32 FrameId, const FString& Path, bool IsMainFrame);
80 
81  UPROPERTY(BlueprintAssignable, meta = (HidePin = "WorldContextObject",
82  DefaultToSelf = "WorldContextObject",
83  FriendlyName = "On Options Save"),
84  Category = "Menu UI")
85  FCoherentOptionsSaved OnMenuOptionsSaved;
86 
87  UPROPERTY(BlueprintAssignable, meta = (HidePin = "WorldContextObject",
88  DefaultToSelf = "WorldContextObject",
89  FriendlyName = "On Options Save"),
90  Category = "Menu UI")
91  FCoherentOptionSaved OnTestMenuOptionSaved;
92 
93  UPROPERTY(BlueprintAssignable, meta = (HidePin = "WorldContextObject",
94  DefaultToSelf = "WorldContextObject",
95  FriendlyName = "On Options Discarded"),
96  Category = "Menu UI")
97  FCoherentOptionsDiscarded OnMenuOptionsDiscarded;
98 
99 private:
100  void OnOptionsSaved(TArray<FCoherentUISavedOptions> savedOptions);
101  void OnOptionsDiscarded();
102 
103  void SetupScripting(Coherent::UI::View* View);
104 private:
105  TArray<FCoherentUIOptionsMenuControl> Controls;
106 
107  TWeakObjectPtr<UCoherentBaseComponent> OptionsMenuViewComponent;
108 };
Definition: CoherentBaseComponent.h:76