Files
Naked-Desire/Source/NakedDesire/UI/Phone/Apps/ForumAppWidget.cpp
T
2026-06-03 21:42:24 +03:00

40 lines
970 B
C++

// © 2025 Naked People Team. All Rights Reserved.
#include "ForumAppWidget.h"
#include "Components/Button.h"
#include "Components/WidgetSwitcher.h"
namespace
{
// Switcher page order — must match the child order authored in the BP.
constexpr int32 CommissionsTabIndex = 0;
constexpr int32 ProfileTabIndex = 1;
}
void UForumAppWidget::NativeOnInitialized()
{
Super::NativeOnInitialized();
if (CommissionsTabButton)
CommissionsTabButton->OnClicked.AddUniqueDynamic(this, &UForumAppWidget::ShowCommissions);
if (ProfileTabButton)
ProfileTabButton->OnClicked.AddUniqueDynamic(this, &UForumAppWidget::ShowProfile);
// Open on the commission board — it is the forum's primary loop surface (§13).
ShowCommissions();
}
void UForumAppWidget::ShowCommissions()
{
if (TabSwitcher)
TabSwitcher->SetActiveWidgetIndex(CommissionsTabIndex);
}
void UForumAppWidget::ShowProfile()
{
if (TabSwitcher)
TabSwitcher->SetActiveWidgetIndex(ProfileTabIndex);
}