Skip to content

Setting a member to itself - MenuInterface misssing a letter #1

@SkinnyBruv

Description

@SkinnyBruv

// Fill out your copyright notice in the Description page of Project Settings.

#include "MenuWidget.h"

void UMenuWidget::Setup()
{
this->AddToViewport();

UWorld* World = GetWorld();
if (!ensure(World != nullptr)) return;

APlayerController* PlayerController = World->GetFirstPlayerController();
if (!ensure(PlayerController != nullptr)) return;

FInputModeUIOnly InputModeData;
InputModeData.SetWidgetToFocus(this->TakeWidget());
InputModeData.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock);

PlayerController->SetInputMode(InputModeData);

PlayerController->bShowMouseCursor = true;

}

void UMenuWidget::Teardown()
{
this->RemoveFromViewport();

UWorld* World = GetWorld();
if (!ensure(World != nullptr)) return;

APlayerController* PlayerController = World->GetFirstPlayerController();
if (!ensure(PlayerController != nullptr)) return;

FInputModeGameOnly InputModeData;
PlayerController->SetInputMode(InputModeData);

PlayerController->bShowMouseCursor = false;

}

void UMenuWidget::SetMenuInterface(IMenuInterface* MenuInterface)
{
this->MenuInterface = MenuInterface;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions