-
Notifications
You must be signed in to change notification settings - Fork 4
/
SentFriendRequestsWidget_Starter.cpp
58 lines (44 loc) · 1.59 KB
/
SentFriendRequestsWidget_Starter.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) 2023 AccelByte Inc. All Rights Reserved.
// This is licensed software from AccelByte Inc, for limitations
// and restrictions contact your company contract manager.
#include "SentFriendRequestsWidget_Starter.h"
#include "Core/System/AccelByteWarsGameInstance.h"
#include "Core/UI/Components/AccelByteWarsWidgetSwitcher.h"
#include "Components/ListView.h"
#include "CommonButtonBase.h"
void USentFriendRequestsWidget_Starter::NativeConstruct()
{
Super::NativeConstruct();
UAccelByteWarsGameInstance* GameInstance = Cast<UAccelByteWarsGameInstance>(GetGameInstance());
ensure(GameInstance);
FriendsSubsystem = GameInstance->GetSubsystem<UFriendsSubsystem_Starter>();
ensure(FriendsSubsystem);
}
void USentFriendRequestsWidget_Starter::NativeOnActivated()
{
Super::NativeOnActivated();
Btn_Back->OnClicked().AddUObject(this, &ThisClass::DeactivateWidget);
// Reset widgets.
Ws_FriendRequests->SetWidgetState(EAccelByteWarsWidgetSwitcherState::Empty);
Lv_FriendRequests->ClearListItems();
// TODO: Bind event to refresh sent friend request list here.
GetSentFriendRequestList();
}
void USentFriendRequestsWidget_Starter::NativeOnDeactivated()
{
Btn_Back->OnClicked().Clear();
// TODO: Unbind event to refresh sent friend request list here.
Super::NativeOnDeactivated();
}
UWidget* USentFriendRequestsWidget_Starter::NativeGetDesiredFocusTarget() const
{
if (Lv_FriendRequests->GetListItems().IsEmpty())
{
return Btn_Back;
}
return Lv_FriendRequests;
}
void USentFriendRequestsWidget_Starter::GetSentFriendRequestList()
{
// TODO: Get and display sent friend request list here.
}