Skip to content

Commit

Permalink
chore: isolated source code for ue5
Browse files Browse the repository at this point in the history
  • Loading branch information
YermekG committed Dec 13, 2024
1 parent 5609008 commit 5d92e40
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
19 changes: 16 additions & 3 deletions Source/Immutable/Private/Immutable/Transak/TransakWebBrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "PlatformHttp.h"
#include "Immutable/ImmutableUtilities.h"
#include "Immutable/TransakConfig.h"
#include "Immutable/Misc/ImtblLogging.h"


#define LOCTEXT_NAMESPACE "Immutable"
Expand Down Expand Up @@ -35,8 +36,8 @@ TSharedRef<SWidget> UTransakWebBrowser::RebuildWidget()
WebBrowserWidget = SNew(SWebBrowser)
.InitialURL(TEXT("about:blank"))
.ShowControls(false)
.SupportsTransparency(bSupportsTransparency)
.OnUrlChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, OnUrlChanged))
.SupportsTransparency(false)
.OnUrlChanged(BIND_UOBJECT_DELEGATE(FOnTextChanged, HandleOnUrlChanged))
.OnBeforePopup(BIND_UOBJECT_DELEGATE(FOnBeforePopupDelegate, HandleOnBeforePopup))
.OnConsoleMessage(BIND_UOBJECT_DELEGATE(FOnConsoleMessageDelegate, HandleOnConsoleMessage));
return WebBrowserWidget.ToSharedRef();
Expand All @@ -46,7 +47,8 @@ TSharedRef<SWidget> UTransakWebBrowser::RebuildWidget()
}
}

void UTransakWebBrowser::OnUrlChanged(const FText& Text)
#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1)
void UTransakWebBrowser::HandleOnUrlChanged(const FText& Text)
{
if (Text.EqualToCaseIgnored(FText::FromString(TEXT("about:blank"))))
{
Expand All @@ -55,6 +57,17 @@ void UTransakWebBrowser::OnUrlChanged(const FText& Text)
}
}

void UTransakWebBrowser::HandleOnConsoleMessage(const FString& Message, const FString& Source, int32 Line, EWebBrowserConsoleLogSeverity Severity)
{
IMTBL_LOG("Transak Web Browser console message: %s, Source: %s, Line: %d", *Message, *Source, Line);
}

bool UTransakWebBrowser::HandleOnBeforePopup(FString URL, FString Frame)
{
return false;
}
#endif

void UTransakWebBrowser::Load(const FString& WalletAddress, const FString& Email, const FString& ProductsAvailed, const FString& ScreenTitle)
{
if (!WebBrowserWidget.IsValid())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,12 @@ class IMMUTABLE_API UTransakWebBrowser : public UWidget

private:
FString ComputePath(const FString& WalletAddress, const FString& Email, const FString& ProductsAvailed, const FString& ScreenTitle);
void OnUrlChanged(const FText& Text);

#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1)
void HandleOnConsoleMessage(const FString& Message, const FString& Source, int32 Line, EWebBrowserConsoleLogSeverity Severity);
void HandleOnUrlChanged(const FText& Text);
bool HandleOnBeforePopup(FString URL, FString Frame);
#endif

protected:
#if (ENGINE_MAJOR_VERSION >= 5 && ENGINE_MINOR_VERSION >= 1)
Expand Down

0 comments on commit 5d92e40

Please sign in to comment.