Add DTFluxRaceResult Module. A Tab to manage RaceResult with a WebConsole interface
This commit is contained in:
@ -0,0 +1,54 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "SWebBrowser.h"
|
||||
#include "Widgets/SCompoundWidget.h"
|
||||
|
||||
class IHttpResponse;
|
||||
class IHttpRequest;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DTFLUXRACERESULT_API SDTFluxRaceResultWidget : public SCompoundWidget
|
||||
{
|
||||
public:
|
||||
SLATE_BEGIN_ARGS(SDTFluxRaceResultWidget)
|
||||
{
|
||||
}
|
||||
|
||||
SLATE_END_ARGS()
|
||||
|
||||
/** Constructs this widget with InArgs */
|
||||
void Construct(const FArguments& InArgs);
|
||||
void OnCookieSet(bool bSuccess);
|
||||
void LoadSpecificURL(const FString& Url);
|
||||
void LoadContentViaHTTP();
|
||||
|
||||
private:
|
||||
TSharedPtr<SWebBrowser> WebBrowser;
|
||||
TSharedPtr<IWebBrowserWindow> Browser;
|
||||
TSharedPtr<IWebBrowserAdapter> BrowserAdapter;
|
||||
FCreateBrowserWindowSettings WindowSettings;
|
||||
|
||||
void OnUrlChanged(const FText& NewUrl);
|
||||
FString ProcessHTMLContent(const FString& Content, const FString& BaseUrl);
|
||||
FString ExtractDomain(const FString& Url);
|
||||
void OnHTTPContentLoaded(TSharedPtr<IHttpRequest> Request, TSharedPtr<IHttpResponse> HttpResponse, bool bWasSuccessful);
|
||||
bool OnBeforeNavigation(const FString& Url, const FWebNavigationRequest& Request);
|
||||
void OnLoadCompleted();
|
||||
void OnLoadStarted();
|
||||
void OnLoadError();
|
||||
|
||||
void OnLoadOverride();
|
||||
|
||||
void OnBeforeResourceLoad(FString Url, FString ResourceType, FContextRequestHeaders& AdditionalHeaders, const bool AllowUserCredentials);
|
||||
|
||||
FString RaceResultUrl = "https://raceresult.tds-france.com";
|
||||
FString Username = "sporkrono";
|
||||
FString Password = "Notre 3ème décennie d'action pour le climat";
|
||||
|
||||
|
||||
void SetupBasicAuth();
|
||||
};
|
||||
@ -0,0 +1,34 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Styling/ISlateStyle.h"
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DTFLUXRACERESULT_API FDTFluxRaceResultStyle
|
||||
{
|
||||
|
||||
public:
|
||||
static void RegisterStyle();
|
||||
static void UnregisterStyle();
|
||||
|
||||
static void ReloadTextures();
|
||||
|
||||
static const ISlateStyle& Get()
|
||||
{
|
||||
return *StyleSet;
|
||||
}
|
||||
|
||||
static const FName& GetStyleSetName()
|
||||
{
|
||||
return StyleSet->GetStyleSetName();
|
||||
}
|
||||
|
||||
private:
|
||||
static TSharedPtr<ISlateStyle> Create();
|
||||
static TSharedPtr<ISlateStyle> StyleSet;
|
||||
};
|
||||
Reference in New Issue
Block a user