Merge pull request 'martin' (#11) from martin into main
Reviewed-on: #11
This commit is contained in:
commit
a187e105c3
Content
Blueprint
Core
DATA/Enums
Game
RobotPawnActors
BP_DroneRobot.uassetBP_HumanoidRobot.uassetBP_MujocoBostonDynamicsSpotWithArm.uassetBP_MujocoUnitreeGo2.uassetBP_PuralinkRobot.uassetBP_RevoluteRobot.uassetBP_WheeledRobot.uassetBP_mujokoArm.uassetBP_mujokoStretch.uasset
component
oldRobotsBP
vehicle
GameBP
IanDevFolder
Vehicles
luckyBot
Luckywidget
ChildItems
WB_GrabAndPull.uassetWB_NavigateSimpleEnvironments.uassetWB_ObjectsListBox.uassetWB_ObjectsListItem.uassetWB_PickAndPlace.uassetWB_SimplePick.uassetWB_SimplePlace.uassetWB_TaskListBox.uasset
WB_GameWidget.uassetWB_MainScreen.uassetmenu
SkeletalMesh
StretchRobot/SkeletalMesh
Unitree_G1
Source/Luckyrobots
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/GameBP/BP_LuckyRobotsLibrary.uasset
Normal file
BIN
Content/GameBP/BP_LuckyRobotsLibrary.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
17
Source/Luckyrobots/Private/GameUserWidget.cpp
Normal file
17
Source/Luckyrobots/Private/GameUserWidget.cpp
Normal file
@ -0,0 +1,17 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "GameUserWidget.h"
|
||||
#include "LuckyRobotsFunctionLibrary.h"
|
||||
#include "LuckyRobotsGameInstance.h"
|
||||
|
||||
void UGameUserWidget::NativeConstruct()
|
||||
{
|
||||
Super::NativeConstruct();
|
||||
|
||||
ULuckyRobotsGameInstance* LuckyRobotsGameInstance = ULuckyRobotsFunctionLibrary::GetLuckyRobotsGameInstance(this);
|
||||
if (LuckyRobotsGameInstance)
|
||||
{
|
||||
LuckyRobotsGameInstance->GameUserWidget = this;
|
||||
}
|
||||
}
|
@ -2,6 +2,42 @@
|
||||
|
||||
|
||||
#include "LuckyRobotsGameInstance.h"
|
||||
#include "LuckyRobotsGameState.h"
|
||||
#include "Kismet/GameplayStatics.h"
|
||||
#include "GameUserWidget.h"
|
||||
|
||||
void ULuckyRobotsGameInstance::DoSendMessage(FString SendValue)
|
||||
{
|
||||
ALuckyRobotsGameState* LuckyRobotsGameState = Cast<ALuckyRobotsGameState>(UGameplayStatics::GetGameState(this));
|
||||
if (LuckyRobotsGameState)
|
||||
{
|
||||
LuckyRobotsGameState->DoSendMessage(SendValue);
|
||||
}
|
||||
|
||||
DoLogItemAdd("Receive", SendValue, 0);
|
||||
}
|
||||
|
||||
void ULuckyRobotsGameInstance::DoLogItemAdd(FString Topic, FString MsgText, int Type)
|
||||
{
|
||||
if (GameUserWidget)
|
||||
{
|
||||
GameUserWidget->DoLogItemAdd(Topic, MsgText, Type);
|
||||
}
|
||||
}
|
||||
|
||||
void ULuckyRobotsGameInstance::SwitchGamePaused()
|
||||
{
|
||||
UGameplayStatics::SetGamePaused(this, !UGameplayStatics::IsGamePaused(this));
|
||||
|
||||
if (UGameplayStatics::IsGamePaused(this))
|
||||
{
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(this, "r.SceneRendering 0");
|
||||
}
|
||||
else
|
||||
{
|
||||
UKismetSystemLibrary::ExecuteConsoleCommand(this, "r.SceneRendering 1");
|
||||
}
|
||||
}
|
||||
|
||||
void ULuckyRobotsGameInstance::ClearTaskList()
|
||||
{
|
||||
@ -79,4 +115,21 @@ void ULuckyRobotsGameInstance::ReSetTaskList()
|
||||
TArray<FGoalsTaskData> ULuckyRobotsGameInstance::GetTaskList()
|
||||
{
|
||||
return TaskList;
|
||||
}
|
||||
}
|
||||
|
||||
void ULuckyRobotsGameInstance::DoSetTempTaskValueChange(bool IsClear)
|
||||
{
|
||||
if (IsClear)
|
||||
{
|
||||
ClearTaskList();
|
||||
}
|
||||
else
|
||||
{
|
||||
AddTask(TempTask);
|
||||
}
|
||||
|
||||
if (GameUserWidget)
|
||||
{
|
||||
GameUserWidget->DoRefreshListView();
|
||||
}
|
||||
}
|
||||
|
26
Source/Luckyrobots/Public/GameUserWidget.h
Normal file
26
Source/Luckyrobots/Public/GameUserWidget.h
Normal file
@ -0,0 +1,26 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "Blueprint/UserWidget.h"
|
||||
#include "GameUserWidget.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class LUCKYROBOTS_API UGameUserWidget : public UUserWidget
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
protected:
|
||||
virtual void NativeConstruct();
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void DoLogItemAdd(const FString& Topic, const FString& MsgText,int Type);
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void DoRefreshListView();
|
||||
};
|
@ -8,6 +8,7 @@
|
||||
#include "LuckyRobotsGameInstance.generated.h"
|
||||
|
||||
class USIOJsonValue;
|
||||
class UGameUserWidget;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -39,10 +40,23 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FGoalsTaskData TempTask;
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void DoGetDispatch(const FString& EventName, USIOJsonValue* EventData);
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
UGameUserWidget* GameUserWidget;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
TArray<FLuckyCode> LuckyCodeList;
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void DoSendMessage(FString SendValue);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void DoLogItemAdd(FString Topic, FString MsgText, int Type);
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SwitchGamePaused();
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void ClearTaskList();
|
||||
|
||||
@ -69,4 +83,11 @@ public:
|
||||
|
||||
UFUNCTION(BlueprintPure)
|
||||
TArray<FGoalsTaskData> GetTaskList();
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void DoSetTempTaskValueChange(bool IsClear);
|
||||
|
||||
public:
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void DoGetDispatch(const FString& EventName, USIOJsonValue* EventData);
|
||||
};
|
||||
|
@ -98,6 +98,17 @@ enum class EGoalType : uint8
|
||||
Place UMETA(DisplayName = "Place")
|
||||
};
|
||||
|
||||
UENUM(BlueprintType)
|
||||
enum class ESaveDataType : uint8
|
||||
{
|
||||
file UMETA(DisplayName = "file"),
|
||||
webserver UMETA(DisplayName = "webserver"),
|
||||
http UMETA(DisplayName = "http"),
|
||||
debug UMETA(DisplayName = "debug"),
|
||||
none UMETA(DisplayName = "none")
|
||||
};
|
||||
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FRobotData : public FTableRowBase
|
||||
{
|
||||
@ -358,3 +369,21 @@ public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bIsActive;
|
||||
};
|
||||
|
||||
USTRUCT(BlueprintType)
|
||||
struct FLuckyCode : public FTableRowBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
public:
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
int ID;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
FString Code;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
float Time;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite)
|
||||
bool bCallback;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user