Lots of work on the lua read-eval-print loop

This commit is contained in:
2026-05-21 18:41:09 -04:00
parent f7983b1f02
commit 2bfa3024f1
15 changed files with 70 additions and 120 deletions

View File

@@ -7,6 +7,7 @@
#include "Input/Events.h"
#include "Common.h"
#include "Kismet/BlueprintFunctionLibrary.h"
#include "Components/CanvasPanelSlot.h"
#include "UtilityLibrary.generated.h"
@@ -91,51 +92,15 @@ public:
ETraceTypeQuery TraceChannel, bool bTraceComplex, EDrawDebugTrace::Type DrawDebugType, bool bIgnorePlayerPawn,
const TArray<AActor*>& ActorsToIgnore, FHitResult& HitResult);
// Set Position of GridPanel Middle Cell
//
// Sometimes, you want to specify the position of a widget, and you
// don't want to specify the position in slate units, instead, you
// want to specify the position using fractions: ie, (0,0) is the
// upper left corner of the screen, and (1,1) is the lower-right corner.
//
// One way to accomplish this is to put your widget in the middle cell
// of a 3x3 GridPanel. Then, you can position it by adjusting the grid
// fill rules. This utility routine can do the math necessary to
// correctly populate those fill rules.
//
// This routine must be passed a 3x3 GridPanel. This will reposition
// the middle cell. You must specify the upper-left and lower-right
// corners of the middle cell as fractions between (0,0) and (1,1).
//
// Be aware that if the content of a grid cell overflows the amount of
// space allocated for it, then the grid will adjust to make room.
// But that will mean that the grid is no longer faithful to the
// positions specified in its fill rules. One way to ensure that the
// grid remains faithful to its fill rules is to put an Overlay
// into the GridPanel cell, then put -1000 padding into the
// Overlay's GridPanel slot, then put +1000 padding into the Overlay
// slot. The two paddings cancel each other out, leaving the item in
// the Overlay at the originally-intended position. But if the item
// in the overlay overflows, it doesn't cause the Grid to deform.
// Instead, the item exceeds the bounds of the grid cell, but it leaves
// the grid cell where it belongs.
//
UFUNCTION(BlueprintCallable, Category="Widget")
static void SetPositionOfGridPanelMiddleCell(UGridPanel *GridPanel, FVector2D UpperLeftXY, FVector2D LowerRightXY);
// Get Position of GridPanel Middle Cell
// Configure a CanvasPanelSlot's parameters in a single call.
//
// The routine must be passed a 3x3 GridPanel. This will return the
// position of the middle cell of the gridpanel, expressed on a scale
// from (0,0) to (1,1).
//
// The numbers returned by this routine are based entirely on the
// GridPanel fill rules. If an item in the grid is overflowing its
// allocated space, causing the grid to deform, then that won't be
// reflected in the output of this routine.
// Target must be either a UCanvasPanelSlot directly, or a UWidget whose
// Slot is a UCanvasPanelSlot. If it is neither, logs an error and
// does nothing.
//
UFUNCTION(BlueprintPure, Category="Widget")
static void GetPositionOfGridPanelMiddleCell(UGridPanel *GridPanel, FVector2D &UpperLeftXY, FVector2D &LowerRightXY);
UFUNCTION(BlueprintCallable, Category = "Widget", meta = (SizeToContent = "true"))
static void ConfigureCanvasPanelSlot(UObject *Target, FAnchors Anchors, FVector2D Position, FVector2D Size, FVector2D Alignment, bool SizeToContent);
// Check if a given key is used by the specified mapping context.
//