#slate

1 messages · Page 12 of 1

fallen rover
#

Anyone know what the difference between DrawContext.DrawBox and FSlateDrawElement:MakeBox is?

#

is it maybe the static function is a new helper?

stuck jewel
#

SAssetDropTarget minor correction on that - it does NOT work with an overlay beside a button, but it has its own content [ ] slot so you can just make a button inside of it and that works wicked cool

#

wish i could figure out why it shows the noentry sign but oh well lol

pallid gyro
#

I'm not an expert but: a DrawContext is usually some struct that can be passed around between Paint methods, if you'll look at its members you'll see they're just the function parameters of a standard OnPaint event, the DrawElements themselves are usually a parameter, from what I recall when messing around with the sequencer the DrawElement comes with some basic convenience functions primarily to draw boxes for things like nodes and sequencer sections, you can access the FSlateDrawElements array to do fancier things.

pallid gyro
# stuck jewel hot stuff comin thru <:edboy:305852770756460546> https://gyazo.com/3e6d37196511...

Very nice! I never got to that point in my plugin, I was just happy with a UE_LOG reading 'asset dropped' and then forgot all about it. As I already mentioned the sequencer if you want to get really fancy unreal has multiple places in the codebase where there's a method that takes in an audio asset and produces a wave form, the sequencer AudioTrack has a great example of it cause it's painted directly in slate and has zooming/slipping and caching all built in. Also uses some DrawContext.

stuck jewel
#

Feature creep go brr

pallid gyro
#

use the harmonix midi clock to make musically timed dialogs, now that's a feature.

paper gale
fallen rover
#

Haha

#

The sneaky macros to hide it

#

Yeah that paint to geometry was very confusing I did see it was just doing some matrix transformation from local space to parent space and back

#

I assume something to do with the rendering

#

I guess the idea maybe is if you have screen space and pass in a widget it creates the transformation matrix for it. Then if you draw into it you just need to give scale and translation within that space and the homogeneous matrix multiplication is done to draw your shapes on it

#

But yeah the draw context hides that matrix multiplication from you and you draw inside that widget as you wish

last forum
#

How can I position and rotate something? I tried using one RenderTransform call but that only accept one input and calling it twice only applies the second call

paper gale
#

or Concatenate

last forum
#

I should have been more precise, i'm working with a text block

paper gale
last forum
# paper gale

ohh so it's used like this, I looked for Concatenate and Transform.Accumulate on the thing directly

last forum
#

That worked perfectly, thanks @paper gale. Now I only need to think of the correct math for where to draw the text blocks...

stuck jewel
#

i finally recorded slate's stupid details widget opening in slow motion, what's even worse is that in this test i created the widget hidden so that it's supposed to "draw" at actual size just not visible, and then changed it to visible after several frames. it made no difference, it still takes three entire frames to reach its final state
https://i.gyazo.com/6cf8bfbb1c04bcb59eb2493d1345b167.mp4

#

(this is basically just a rant)

stuck jewel
#

but curious if there is some solution to stuff like this. seems like anything that is autosized and containing text can encounter it

#

UIs that open, are interactable, and then completely change size some time later are a massive pet peeve of mine

grave hatch
#

It's a massive pile of shite, yes.

#

Everything needs to be specifically sized to avoid it I think.

pallid gyro
#

List views with resizable widgets are the worst thing.

#

It's funny that they also glitch out in the editor all the time, makes me feel a little bit better about myself.

grave hatch
#

Ever seen a details panel where the property widget is larger than the visible area?

#

It doesn't know what to do.

pallid gyro
#

every single one pretty much, editor widgets with detail panels kinda force you to wrap the details panel in a scroll box and put that inside a size box cause otherwise lol, and there's an explicit option to 'allow scroll' on the defails panel that largely seems to do nothing

stuck jewel
#

is this problem caused by slate though or how that particular widget is coded? like my big stupid dialogue widget doesn't do this stupid iterative top-down evaluation, it all draws bottom-up in one frame. i don't want to do a deep dive into these widgets, why am i like this 😭

grave hatch
#

It's how the scrollbox is coded really

stuck jewel
#

i have a few editable text widgets on my thing that do it internally - they draw in a crud way on the first frame, then next frame fix themselves up. but again that's epic's widgets, so maybe they also are made dumb somehow

grave hatch
#

Or the list view.

stuck jewel
#

brutal

#

i can't imagine some masochist deciding to use slate for their game (like Stranger did way back when) and having to deal with this for a shipping product lol

grave hatch
#

You'd get teh same problems with UMG?

#

Or just don't use listviews.

stuck jewel
#

thanks, now i'm going to have nightmares tonight

pallid gyro
#

I recently made a gallery widget thingie that had nested categories so it was a list view inside of a list view, I couldn't really make it a tree because I wanted the top list to flow vertically and each category to have a horizontal wrap box, so, long story short, it just didn't work, you scroll past one category, the list view virtualizes or whatever the one that went out of view and uses it to display the new data but it keeps the size it previously you had, you have to wiggle the scroll bar up and down to get it to refresh. It's bad.

in that case I wound up dropping the list entirely and just added elements to a scroll box ('categories' just being titles while the 'gallery' itself simple being a grid panel). It was also the only way I could figure out how to make it flow right to left because the listview didn't really seem to care.

#

List views in UMG are extra ass compared to Slate cause you don't even get all the useful options like a header row.

stuck jewel
#

i am now questioning if i should start researching 3rd party UI systems (our game's UI is barely developed yet lol)

#

i hate love you guys

pallid gyro
#

It depends on the usecase really, I wouldn't use list views for any widget that doesn't have a fixed size, if they don't work for Epic in the editor they won't work for me either, but for elements with fixed size, it's fine, and really, even the epic docs make it clear that you're not really getting too much mileage out of the widget virtualization when dealing with 'hundreds' of items, the virtualized lists are meant to solve problems that occur once you have like thousands of items. so I don't know, it works, but I wouldn't use it in game and instead make some other more static container.

#

And really, if you must have a virtualizable list view with THOUSANDs of resizable items well, it'll take some work probably.

stuck jewel
#

yeah, all fair enough (and sad enough)

pallid gyro
#

Dropping the glitchy tree and making my own simple container was so simple I felt stupid for having tried to 'fix it' for so long, it actually gave me much nicer results.

stuck jewel
#

lol, i even tried rendering my widget 10000 pixels away for 3 frames - nope, it's smart enough that it's not rendering it when it's out of viewport either of course. no way to avoid this cute 3-frame jank

#

render opacity works! except a few of the children don't respect the parent's opacity 🤣

pallid gyro
#

That looks good.

#

are you fading in with a tick? or some other trick?

stuck jewel
#

yeah lol

#

i probably won't keep it because i'm too utilitarian but it's fun

pallid gyro
#

probably if the tick happens in the node itself and it manages the opacity of its children it won't be too bad, I think it looks cute.

tribal bolt
#

Could you open menu and then spawn info on next tick? Might reduce the original problem.

Although, not sure how janky that would look visually

stuck jewel
#

nope! it won't render, and thus, won't update 😄 the only solution i found at all is setting render opacity except children can override that 😄

#

top-down updating method go brrr

pallid gyro
#

Can’t you construct it with the right data? That’s what epic do in the sequencer and the pattern I stole from them in my sequencer.

#

Just pass a pointer to the data as a slate arg, or possible as an extra parameter in the constructor which seem to be what epic do when there’s some explicit hierarchy and the widgets are drawn via the parent paint event rather than through the slate hierarchy

stuck jewel
#

in this case 100% of the problem comes from SClassPropertyEntryBox and PropertyEditorModule.CreateDetailView(Args) both epic widgets

#

as in both of these things are somehow rendering themselves top-down based on previous frame's cached geometry of their own widgets

pallid gyro
#

I see, actually in my janky widget I avoided that and used janky accessors using the metasound builder subsystem, I believe a similar trick could possibly be achieved by iterating over the FProperties of a uobject or a struct to create your own non-editor-dependent viewer (which you could then also run in game builds, which was kind of what I was going for).

A bad screenshot but I'm not going to fire up the project to get a better one but basically all of these edgraphnodes wrap my own slate class that in turn iterates over the variables exposed by the metasound class and picks the right 'controller widget' type.

tribal bolt
#

I'm trying to figure out how the engine does this dynamic resizing between header and child columns. Right now mines isnt working because I feel it's the way I'm generating my lists just as horizontal boxes with child horizontal boxes inside for each information bloc is suboptimal but I am not thinking of a better way to approach this

stuck jewel
#

looking at the outliner in the widget inspector it looks like it draws the header separately from the data pane... the header is a horizontal box, and the data pane is a horizontal box. i'm sure somewhere they're just maintaining column widths info and using the same info for both somehow, how are you controlling the width of your header sections? what's stopping you from using that same setting to drive the width of the data sections?

pallid gyro
#

I did something kinda similar only with one 'major tab' inspired by the unreal sequencer for my sequencer, what I saw in the epic sequencer was basically that they have some SSpacer widget or the equivalent they override the mouse move and mouse down events on (need to capture the mouse on click) and then you can fire some delegate for the resizing event you can cascade down to the rows, which usually have simplex SBoxes you can easily resize as needed. this can easily be applied to a multi column situation my just passing the index.

In my own messy experiments I figured that you don't really need the 'handle' widget if you just use the top level widget's mouse events (including the cursor type reply) and paint event (to actually draw the 'handle mouse over' highlight) you can kinda just roll your own resizable grid, and you can put the content rows in a scroll box or a list view.

My implementation thingie is as always really messy and it's not actually a functional music sequencer but the tabs and rows are resizable and show the general mechanism at work - https://github.com/Amir-BK/unDAW/blob/main/Source/BKMusicWidgets/Public/Sequencer/UndawMusicSequencer.h

Because I'm a terrible c++ programmer all the relevant slate classes are actually in the same header, it's a mess.

pallid gyro
#

I'm actually planning to make some 'runtime spreadsheet-esque' thingie because I hate the UMG listview and I figured out how to use the FProperty trickery to make do all the nice things the actual unreal data table editor does like the 'quasi-type-agnostic' sorting, you just give it the name of the field in the struct you wish to sort by and it works, I found it to be delightful myself.

last forum
#

Finally did it, but something is still off...

cinder oriole
#

id probably use a splitter

#

just tie them together, disable the child resizing, if header is adjusted , propagate the adjustment to child and Bobs your uncle

#

unless im missing something

#

but nuh id still use splitter panels. im willing to bet that’s what they are using… run the widget reflector to confirm

pallid gyro
#

Yeah they use a splitter, not a spacer as I wrote earlier

fallen rover
#

Little question about slate, I have some slate code in editor code I have a sharedPointer to. The issue for me is that the Widget Height is hard coded by the orignal programmer, I'd like to change it dynamically because it's a horizontal box that is used as a label for another seperate widget with another horiziontal box. To align them visually they are both hardcoded to the same widget size. Since the first widget is hard coded then the second one must be equal to the hardcoded value in terms of height to align nicely visually. I found a work to grab that widget at runtime and change it without doing any code changes. Is this allowed or something people do in slate I am Calling Get Children and traversing the Widget Hierarchy and mutating the value?

#

The widget is part of a ListView and within that its an STableRow.

#

just experimenting I did something naive like this in code

            TSharedRef<SRewindDebugger> RewindDebuggerWidget = RewindDebuggerModule->GetRewindDebuggerWidget().Pin().ToSharedRef();
            
            if(RewindDebuggerWidget.ToSharedPtr().IsValid())
            {
                TSharedPtr<SRewindDebuggerComponentTree> ComponentTree = RewindDebuggerWidget->GetComponentTreeView().Pin();
                if(ComponentTree.IsValid())
                {
                    // Need ItemsPanel To Adjust Track Name Heights
                    auto ComponentTreeWidgetChild = ComponentTree->GetChildren();
                    auto ListView = ComponentTreeWidgetChild->GetChildAt(0);
                    auto ListViewChildren = ListView->GetChildren();
                    if(ListViewChildren == nullptr)
                    {
                        return;
                    }
                    auto ListPanel = ListViewChildren->GetChildAt(0);
                    auto ListPanelChildren = ListPanel->GetChildren();
                    if(ListViewChildren == nullptr){
                        return;
                    }
                    auto FirstRow = ListPanelChildren->GetChildAt(0);
                    // Table Row Tpe
                    auto RewindRow = StaticCastSharedPtr<STableRow<TSharedPtr<RewindDebugger::FRewindDebuggerTrack>>>(FirstRow.ToSharedPtr());
                }
                    
            }

#

just to experiment to see

#

I used the widget reflector to make sure I was indexing it to the right spot since the hierarchy is the same every frame.

pallid gyro
#

I did it once, I was surprised/amused to learn that pretty much any widget in a slate hierarchy can hijack any container and make it do whatever it wants, I don't think this is something you ever see in Epic's code of course, you're kind of at the mercy of the hierarchy not changing and in your case of the indexes forever remaining stable etc.

Like, if there's any option to do some code changes and expose the height as a parameter or to just arrange these two widgets in a more 'sensible' slate way (just put them in the same container? auto size? etc), I'd strongly prefer to do that, but if it's a game project and you're not planning to redistribute this code to others and its the only thing that works, then well, if it works it works.

fallen rover
#

well I am adding tracks to a timeline

#

I am using an existing plugin and trying to create an extension for it. I came across the pain of it being hardcoded I can add my own widget track but the name for it next to it is not exposed. I've already had to extend the engine plugin very minisculely so far i've exported the class and added some weak pointer getters

#

the weak pointer getters you can kinda see from the code snippet

#

as I am pinning it

pallid gyro
#

if it's a plugin then just change it

fallen rover
#

there is many ways to skin this cat

#

there is this interesting trade off where I decide to make major code changes to extend some features or hack around it with minimal changes

#

These widgets do have name tags so you could write recurssive function to traverse it

#

but that seems a little hacky lol

pallid gyro
#

I think that if you're already modifying the plugin you could do it in a way that exposes these properties you want without needing to traverse the hierarchy, I think it'd be more reasonable in the long run, you're already at a point where if that other plugin is updated and you want to pull the changes you'll need to do some 'patching' to bring your changes over, but right now you're also exposed to potential changes in the hierarchy, I would personally prefer to avoid that latter bit.

fallen rover
#

I will likely just leave it at the hard coded value.

#

I just was suprised you can traverse the hierarchy like that

#

and mutate the container at runtime.

pallid gyro
#

I spent a lot of time this month working on UMG widgets where the person who made them before me thought it's great to have code that depends on the specific hierarchy of the widget, move something outside of the horizontal box its in and suddenly half the UI stops working, so, I don't know, I think it's generally something to be avoided, someone down the line will not realize why it stopped working and it'll be a fun investigation.

fallen rover
#

Side question

#

about ticking slate widgets

#

At least from my debugging of the widgets I am investigating

#

I found that TICK is called once and the widget is reinstanced is this normal?

pallid gyro
#

BTW as you mentioned 'timeline', the unreal sequencer is EXTENSIBLE like, there's a whole framework for adding custom tracks

fallen rover
#

I am not using the sequencer

#

to extend

#

I am using rewind debugger because I am feeding Insights data into it

#

the rewind debugger has some extensibility

pallid gyro
#

re: ticking, I don't know, from my experience it seemed widget ticks generally behave normally, but I am not sure I exactly understand what you're asking.

fallen rover
#

So I was doing some work with OnPaint right

pallid gyro
#

I have a widget that would crash if it isn't initialized correctly and I have IsValid checks and they don't print a failure on the first tick or something like that, so, I don't know.

#

And widgets generally not supposed to tick if they're not in the hiearchy, but, weird things can happen and everything can be overriden, so, idk

fallen rover
#

I wanted to do some work every second inside OnPaint, Ie draw a box every frame or something just for testing. I overrode the Tick function for the widget to increment a value then set a bool or w.e so when onPaint is ran after tick it would draw. Found out after that the Widget per engine tick is reconstructed so my widget actually ticked once

#

I think because its a realtime object it needs to be reinstanced

pallid gyro
#

perhaps the widget is volatile or something due to things in its parent hierarchy?

fallen rover
#

thats what I was thinking maybe, when I put the widget reflector on some of the items I did see the memory address flucuating thats how I knew it was being recreated

pallid gyro
#

Epic like volatile widgets, Mr. Slate Expert and Patron Saint of this channel Daekesh said that the epic 'guideline' is to prefer volatile widgets and reinstancing, so perhaps that's what you're seeing.

#

I guess that would be another possible implication of 'hijacking' the hierarchy.

stuck jewel
#

i've never messed with onpaint yet but i use tick all the time just like any other thing

fallen rover
#

I have to use OnPaint to Draw my primitives

#

eventually I will have to make a TArrayView and all that to read from

#

and cull out data per frame

#

Timeline data is gonna re read the data structure from looking at source code in engine it seems to be the way

#

plus you have a cull rectangle for removing values outside the range of the timeline

#

you can cache that also

pallid gyro
#

My piano roll graph uses both OnPaint and OnTick, and it generally behaves 'predictably', the changes from OnTick are reflected in subsequent OnPaint, I do this in a bunch of widgets and other than needing to check that my points are valid in the beginning of OnPaint I never had issues.

fallen rover
#

I suppose if the widget isn't destroyed

#

and reused per frame and you wanna do some querying or logic before onpaint

#

then you'd use on tick or w.e

pallid gyro
#

OnPaint should be able to reflect the 'state' of the widget, you can't know for certain that every tick will only get painted once, but technically this shouldn't matter.

#

(in normal circumstances)

fallen rover
#

well if I am reinstancing every tick anyway

#

on construction id load the data

#

then do my logic on paint

#

from what that timeline logic works it seems

#

I got some shit working UI wise

#

I pulled out that track tho Into a seperate Track entirely. The extension only gives you the flexiblity to add a child track to an ObjectType Track

#

So I extended it so I can add a seperate DebugObject Track

cinder heart
#

Is there a way to serialize editor only values between launches? I copied a post but it doesn't seem to work, and I'm trying to save the value I entered into the numOfPathTextBox EditableTextBox into the numOfPaths integer. I thought UPROPERTY would handle it but sadly not. (UE4.27)

stuck jewel
cinder heart
#

I don't know which UObject that would be, cause all the info exists in the FSurfaceGraphDetailsPanel class

stuck jewel
#

the UObject?

#

the one you're editing?

cinder heart
#

I attach the custom details panel to the UObject on selection, but I want to store the info in the details panel if possible

stuck jewel
#

the UObject stores serialized data, not the editor

cinder heart
#

aight I'll just wrap it with an editor macro then, thanks for the help

lunar carbon
stuck jewel
#

c++ slate, i would not want to attempt to make anything clean or complex with any bp tools

stuck jewel
#

Don't get too excited. My whole dialog engine is probably like 2000 loc and my slate for that one node is like 5000 loc lol

lunar carbon
#

O_O

warm vault
#

hello! I am experiencing Slate for the first time. lmao

#

I'll get there

grave hatch
#

It's a slate of being.

stuck jewel
#

i was going to react 👨‍👧‍👦 to represent "dad joke" but apparently society has decided that gendered emojis are too offensive and all of the different family emoji combinations are now just generic slop icons lol

warm vault
#

that's not a family, it's a corporate org chart

vernal epoch
#

HI everyone, quick question as I've not been able to find what I'm looking for. I have a C++ function defined for retrieving the current pawn's clip ammo amount, which I want to bind directly to a text block. I can't find a way to expose that C++ function directly when picking a function from the drop-down list here:

#

The binding it's currently set to is a widget blueprint function which just calls the C++ function. Seems wasteful, so I was wondering how to directly bind the C++ function

#

Ah never mind, it was because I had it set to BlueprintCallable rather than BlueprintPure. It's showing up now!

warm vault
#

Can I pass a widget into a widget, higher-order-component-like?

#

I want to inject buttons into different containers, use any button with any container, easy-like

stuck jewel
warm vault
#

okay beware copy-paste hell

#

I genuinely take better care of everything except this

stuck jewel
#

i will only judge a little bit

warm vault
#

Slap-shod, hoping to improve a tiny bit tho

#

sec

stuck jewel
#

my slate looks like a dead cat's butt until the 17th iteration too

warm vault
#

phosphorous is my component library name

#

so those are the legos

#

that's also my main menu in SquadLoadout

#

okay I think I ... get it

#

I can probably write one

stuck jewel
#

oh ok lol. Well ask away if you need to. Did you figure out like sassignnew, and using ->AddSlot(...) stuff?

warm vault
#

[ magic operator overload ]

#

just looking up now how to pass in a dynamic array

#

and with those legos I control the universe

#

yeah and I'm getting the hang of how the delegates can appear anywhere in code, ideally controller, HUD

#

pretty decent framework

#

enough to build a pretty editor i guess

#

thank you btw

stuck jewel
warm vault
#

it’s verbose but familiar if squint

#

yeah

unborn bone
#

Yo! I've been battling with this for a few days now and it seems I really need help. I'm trying to make a button that knows when it receives and loses focus. The primary idea was to be able to link focus and hover together so that it acts identically in both cases but so far I've simplified it to just have an OnFocusReceived/Lost delegates on a UButton.

Things quickly turned to Slate and now I'm lost. I made a slate class inheriting from SButton and used it in my UButton derived class. However I've lost the ability to display anything coming from the parent class. Color, styles, OnClicked and other delegates also do not seem to work. It seems I need to pass the parameters to the underlying button but I don't know how to... Could anybody push me in the right direction?

#

My UButton:
.h

UCLASS(Blueprintable, BlueprintType)
class MY_API UFocusableButton : public UButton
{
    GENERATED_BODY()

    virtual TSharedRef<SWidget> RebuildWidget() override;

    virtual void HandleFocusReceived();
    virtual void HandleFocusLost();

public:
    UPROPERTY(BlueprintCallable, BlueprintAssignable, Category="Button|Event")
    FOnFocusReceived OnFocusReceived;
    
    UPROPERTY(BlueprintCallable, BlueprintAssignable, Category="Button|Event")
    FOnFocusLost OnFocusLost;
};

.cpp

TSharedRef<SWidget> UFocusableButton::RebuildWidget()
{
    TSharedRef<SFocusableButton> CreatedButton = SNew(SFocusableButton);
    
    CreatedButton->OnFocused.BindUObject(this, &UFocusableButton::HandleFocusReceived);
    CreatedButton->OnUnfocused.BindUObject(this, &UFocusableButton::HandleFocusLost);
    
    return CreatedButton;
}

void UFocusableButton::HandleFocusReceived()
{
    OnFocusReceived.Broadcast(this);
}

void UFocusableButton::HandleFocusLost()
{
    OnFocusLost.Broadcast(this);
}
#

My SButton:

stuck jewel
#

how good are you with your debugger?

unborn bone
#

Yes, they are being called. I've been a programmer for several years now so I know my way around a debugger 😄

#

Also somebody else recommended Common UI and on the first look it seems just like what I need. I think I'll explore that route for now

stuck jewel
#

ah, sure (and i think i may have misunderstood on first read - looks like you said your focus is working but everything else stopped)

unborn bone
stuck jewel
#

if commonui provides a solution great, if not just come back and say still working on this 😄

unborn bone
#

That's the plan 😄 Thank you!

warm vault
#

slaters gonna slate

low bluff
#

Is there some secret to getting Slate Imges Brushes to be "sharper"?
Got 256x256 image set up as an IMAGE_BRUSH for a custom Editor, but no matter what size I gave that SlateBrush, the icon in the Edtior looks low-res.

stuck jewel
#

I just always render them 1:1... Or maybe try for svg but I hate editing vector art

low bluff
#

Hm yeah, it's a small icon on a custom node. It can totally be smaller than 256x256 for what it#s worth. Still looks like the image settings (e.g. what one could do on UTextures) are wrong.

#

I will try making the image smaller.

#

Wonder how that behaves with zooming into the graph, given they would get bigger then

stuck jewel
#

Oh yeah it'll look like ass

#

Svg is the only way to save that

low bluff
#

UE supports Slate Brushes from svg?

stuck jewel
#

But I feel like nobody in the real world uses extra zoom anyway

#

Yes

low bluff
low bluff
# stuck jewel Yes

Thanks, that sounds like a reasonable route. I think they are SVGs anyway and we exported them as PNG out of habit.

stuck jewel
#

Godspeed

lucid thistle
#

Why can't I run the same code?

#

I now realize that the UUserWidget does not inherit SObjectWidget. How do I override SObjectWidget's OnKeyDown?

#
FReply SObjectWidget::OnKeyDown(const FGeometry& MyGeometry, const FKeyEvent& InKeyEvent)
{
    if ( CanRouteEvent() )
    {
        FReply Result = WidgetObject->NativeOnKeyDown( MyGeometry, InKeyEvent );
        if ( !Result.IsEventHandled() )
        {
            return SCompoundWidget::OnKeyDown(MyGeometry, InKeyEvent);
        }

        return Result;
    }

    return FReply::Unhandled();
}

I want button to ignore the left and right Input, but if I return to UnHandled in NativeOnKeyDown it will continue to run SCompoundWidget: : OnKeyDown (MyGeometry InKeyEvent) which will change Reply to Handled.

craggy holly
#

It routes to SWidget::OnKeyDown which only handles the event if it sets focus on the widget.

#

whatever key your using is probably being hijacked by generic widget navigation

lucid thistle
#

I found a lot of problems with ue Button. OnKeyDown for the first keystroke did not trigger. I observed that Path was SButton, and the second time Path was SCompoundWidget. Is it better to customize a Button that is handled by the UserWidget?

lucid thistle
orchid nova
#

Are there any good examples of how SMultiColumnTableRow is intended to be used?

#

For some reason calling GetItemForThis(OwnerTablePtr.Pin().ToSharedRef()) inside GenerateWidgetForColumn is tripping on a checkf

#

seems it's failing to get the item and I'm not sure if I'm using this incorrectly or what's up, because as far as I can tell, it should have an item

#

Looking at engine code it seems like this should work 🤔

pallid gyro
#

I don't know I also looked for one, I started trying to duplicate the data table editor and strip away its editor only code but that thing goes deep.

orchid nova
#

Yeah I fixed it in the meantime by passing in the item as a parameter to the widget, but I kinda fail to see the purpose of the widget having access to the item via the parent table if you can't access it

pulsar remnant
#

For a custom panel like WidgetSwitcher, should I inherit from SPanel or SCompoundWidget?
I wanna have custom transitions like having multiple childs visible at times

craggy holly
#

SPanel if it needs children

#

Well, more accurately I guess, if it needs to arrange it's children

pulsar remnant
#

Got any idea what is #if WITH_ACCESSIBILITY?
I saw it bunch of times in widget code

paper gale
pulsar remnant
paper gale
#

Same way sources required for dedicated server build

pulsar remnant
#

I know but having such a feature forced or unavaliable on marketplace version doesn't sound very smart

#

Is it on by default?

paper gale
#

raw templates like 3rd person one have good performance

pulsar remnant
#

I'm not, I'm just trying to implement an alternative panel, but original panel has accesibility code. So I'm just trying to understand it. Not copying blindly you know

orchid nova
#

What's the correct way to extend a Slate widget? I'm trying to extend the tree view, and provide some args in the Construct for it, but it's not quite cooperating. I'm adding a HeaderRow, and it seems to accept that it has a header (the multi column rows don't crash as they do without one), but the header never renders

#
void SZGSActorEventTree::Construct(const FArguments& InArgs)
{
    bShowReceivedEvents = InArgs._ShowReceivedEvents;

    STreeView::Construct(InArgs._TreeViewArgs);
    
    HeaderRow =
        SNew(SHeaderRow)
        + SHeaderRow::Column("Object")
        .DefaultLabel(bShowReceivedEvents ? INVTEXT("Event Source") : INVTEXT("Event Target"))
        .FillWidth(1)
        + SHeaderRow::Column("Name")
        .DefaultLabel(bShowReceivedEvents ? INVTEXT("Event") : INVTEXT("Handler Function"))
        .FillWidth(1)
        + SHeaderRow::Column("Actions")
        .DefaultLabel(INVTEXT(""))
        .FillWidth(0.1);
}
#

Actually, it looks like it works correctly if I copy InArgs so I can call HeaderRow(...) on it, and pass that copy into STreeView::Construct... but given it's passed with const, I'm not sure if this is the intended way to use it

#

This kinda makes me wonder if it's more intended that you'd use an SCompoundWidget and wrap it instead of directly extending 🤔

paper gale
#

extending directly looks kinda popular

orchid nova
#

Yeah I noticed there's a number of them, but all the ones I looked at basically extended it to take some extra args and none of them changed anything in the TreeView's args

#

For a moment I considered just creating some structs with UPROPERTYs in the configuration I want so that I could use the default details view widgets without the customization but eh, I don't think it'll let me show the data in the way I want :D

paper gale
orchid nova
#

No. It does work if I modify the args for the parent construct call, but the fact that the args are passed as const just makes me wonder if it's intended to work like that or not

#

Eg. this works:

void SZGSActorEventTree::Construct(const FArguments& InArgs)
{
    bShowReceivedEvents = InArgs._ShowReceivedEvents;

    auto MutableArgs = InArgs._TreeViewArgs;
    MutableArgs
        .HeaderRow(SNew(SHeaderRow)
            + SHeaderRow::Column("Object")
            .DefaultLabel(bShowReceivedEvents ? INVTEXT("Event Source") : INVTEXT("Event Target"))
            .FillWidth(1)
            + SHeaderRow::Column("Name")
            .DefaultLabel(bShowReceivedEvents ? INVTEXT("Event") : INVTEXT("Handler Function"))
            .FillWidth(1)
            + SHeaderRow::Column("Actions")
            .DefaultLabel(INVTEXT(""))
            .FillWidth(0.1)
        )
    ;
    STreeView::Construct(MutableArgs);
}
paper gale
orchid nova
#

Yeah it works with that but if you want to also pass in args from outside of it then you have to juggle it like this as far as I can tell

paper gale
#

SLATE_ARGUMENT just declares member property in struct + convenient setter function. See no problem in nesting FArguments inside another one

#

I don't see where you create a copy btw

#

isn't it L-value refs everywhere?

orchid nova
#

auto MutableArgs = InArgs._TreeViewArgs;

#

when you extend it you need to set it up like that,

class SZGSActorEventTree : public STreeView<TSharedPtr<FZGSActorEventTreeNode>>
{
public:
    SLATE_BEGIN_ARGS(SZGSActorEventTree) { }
        SLATE_ARGUMENT(STreeView<TSharedPtr<FZGSActorEventTreeNode>>::FArguments, TreeViewArgs)

stuck jewel
#

lol - rotated text - the box it's contained in renders it as if it is not rotated. is there a correct way to do this?

#

i can dick it with negative padding but that feels wrong lol

#

it's just ```cpp

            SNew(STextBlock)
            .Text(INVTEXT("SPEAKER"))
            .RenderTransformPivot(FVector2D(0.5, 0.5))
            .RenderTransform(FSlateRenderTransform(FQuat2D(FMath::DegreesToRadians(-90.0f))))
            .Font(FCoreStyle::GetDefaultFontStyle("Bold", 12))```
stuck jewel
#

heck it, negative padding it is

stuck jewel
#

i see what u did there

pulsar remnant
#

How would I implement a custom SPanel with some extra widgets?

#

In my case, I want a custom WidgetSwitcher (which I got by copying most of existing SWidgetSwitcher) to also have tabs built in. Like clickable buttons that switches active index

#

But I'm not sure where I should but that "tabs"

#

I basically want a horizontal box with a fixed size to be part of my custom panel. Filling it with specific widgets are irrelevant

#

Note: I know I can use my panel within another slate widget to get desired result. I want it to be self contained

stuck jewel
#

have you looked at how other simpler examples are made, like SBox? and other things with SLATE_DEFAULT_SLOT and SLATE_NAMED_SLOT ?

pallid gyro
#

It's actually much easier to make custom container widgets by overriding the paint event instead of trying to do it 'correctly' through panel widgets and the slate hierarchy, imo.

#

Always easier to have a widget with a custom paint event and stick that fella inside an SBox than to deal with the madness that is slate layouts.

pulsar remnant
pallid gyro
#

Yup, I mean, you could expose uproperty members and pass those to the widget on native construct or some other appropriate event

#

but you wouldn't be able to drag widgets onto it like it's a container widget with a 'slot'

#

for that you need it to be a slot.

#

to have

#

a

stuck jewel
#

safe to assume SVG's can't be used for box/border brushes? i see literally only one example in the whole engine and it's for rendering a "corner" so i'm guessing not actually used with any box/border stretching

tribal bolt
#

Is there a resource out there (or a better way to search source) for tab ID's?

I'm trying to extend movie render queue window and some other things. I found the ID for it on UDN forums but wondering if there's an actual way to find them easily

pulsar remnant
#

So in theory I can just create a SBox, put a SHorizontalBox on top and put another SBox on bottom. Set their size, use SBox on bottom to put childs in?

#

So my custom panel always has a horizontal box on top to put whatever inside (buttons to switch tabs in my case)

grave hatch
#

Why would you override GetChildren, though? Extend from SCompoundWidget, add a vertical box to it, put your horizontal boxes and sbox in there and then expose the sbox to add content. Or use the slot arguments, like hojo suggested.

#

Or add a methods which get and set the content of the sbox.

#

Or a combination of all 3.

#

You don't need to replace or copy SWidgetSwitcher, you use it as a child widget of yours.

#

SYourWidget : SCompoundWidget

  • SVerticalBox
    • SHorizontalBox (with tabs)
    • SWidgetSwitcher (for content)
    • SHorizontalBox (status bar?)
pulsar remnant
#

The reason I want a custom one is I wanna have a custom transition to switch between widgets

#

It's simultaneous alpha change

grave hatch
#

You could use an soverlay for that. 😛

#

But, yes, you could customise widget switcher for that.

pulsar remnant
# grave hatch You could use an soverlay for that. 😛

How? What I mean is let's say WidgetSwitcher has to widgets A and B.
I want to transition from A to B like this:
A opacity: 1.00 - B opacity: 0.00
A opacity: 0.75 - B opacity: 0.25
A opacity: 0.25 - B opacity: 0.75
A opacity: 0.00 - B opacity: 1.00

grave hatch
#

So you want both to be translucent by the time it gets to 50%?

#

Because if it's 0.5 - 0.5, you'll be able to see through them to the window background.

pulsar remnant
#

Yeah, That's what I want. Basically both old and new widgets become visible at the same time

grave hatch
#

You want the coming in widget to always be 100% opacity and the fading out one to go from 100 to 0. You could use an overlay widget to do that. Overlay the fading out widget on top of the fading in one and adjust its translucency.

#

Honestly I'm not sure how you adjust the translucency of a widget, though.

#

Unless it's just a brush.

pulsar remnant
#

But how? WidgetSwitcher doesn't allow that kinda transition

#

Including common UI one

#

It's always a single widget visible. Not more

grave hatch
#

Don't use SWidgetSwitcher at all. Make your own class.

#

And choose which to display using an SOverlay.

#

You don't even need a separate class for it, you can manage the available widgets in your main "tab panel" class.

pulsar remnant
#

Would UMG editor work with this approach

grave hatch
#

You can't use SWidgets in UMG anyway. They need an interface. The U-whatever widget that you implement.

#

So, yes, it will work, but you need to write the widget BP.

#

That is the same for any slate widget you write.

pulsar remnant
#

No, I mean without inheriting from a SPanel

#

Like drag and drop child

grave hatch
#

Same answer. None of that is implemented in SPanel. It's all in the U-widget.

pulsar remnant
#

Cause you suggested I make widgetswitcher contained within another widget

#

How that would go

#

Oh

#

I see

grave hatch
#

UMG cannot interact with Slate at all. It all has to go through a third party - some kind of uobject.

#

Maybe SPanel has the logic and the U-widget just forwards the drag and drop calls, I don't know.

#

But if you're dropping uwidgets onto another uwidget, the uwidget has to manage it and store the uobject references, etc. Slate doesn't do that.

pulsar remnant
#

Another kinda related question:
How would I change render opacity of child widgets contained by my switcher?
I thought wrapping them with an SBox and changing its opacity instead, but I couldn't make it work

#

Slot types are incompatible

#

This is the original code for AddSlot that I copied from SWidgetSwitcher:

STabSwitcher::FScopedWidgetSlotArguments STabSwitcher::AddSlot(int32 SlotIndex)
{
    TWeakPtr<STabSwitcher> WeakSwitcher = SharedThis(this);
    if(!AllChildren.IsValidIndex(SlotIndex))
    {
        // Insert at the end
        return FScopedWidgetSlotArguments{ MakeUnique<FSlot>(), AllChildren, INDEX_NONE, [WeakSwitcher](const FSlot*, int32 SlotIndex)
        {
            if(TSharedPtr<STabSwitcher> Switcher = WeakSwitcher.Pin())
                Switcher->OnSlotAdded(SlotIndex);
        }};
    }
    
    return FScopedWidgetSlotArguments{ MakeUnique<FSlot>(), AllChildren, SlotIndex, [WeakSwitcher](const FSlot*, int32 SlotIndex)
    {
        if(TSharedPtr<STabSwitcher> Switcher = WeakSwitcher.Pin())
        {
            // adjust the active WidgetIndex based on this slot change
            if(!Switcher->WidgetIndex.IsBound() && Switcher->WidgetIndex.Get() >= SlotIndex)
                Switcher->WidgetIndex = Switcher->WidgetIndex.Get() + 1;
            
            Switcher->OnSlotAdded(SlotIndex);
        }
    }};
}
#

I thought that I would create slot myself, add an SBox inside and return SBoxs slot to the user
But I can't do that since SBoxs slot isn't compatible with return type

#

For reference:

class STabSwitcher : public SPanel
{
public:
    using FSlot = FBasicLayoutWidgetSlot;
    using FScopedWidgetSlotArguments = TPanelChildren<FSlot>::FScopedWidgetSlotArguments;
...
    FScopedWidgetSlotArguments AddSlot(int32 SlotIndex = INDEX_NONE);
};
grave hatch
#

Yeah, the sbox slot type is private. It's really annoying. Or one of them is. I can't remember which.

pulsar remnant
#

I can bypass that by directly copying whatever SBox uses as it's slot type

#

Problem is when you call this function, you normally do this:

Switcher->AddSlot()
[
    SNew(STextBlock)
    ...
];
#

I can't do this if I use SBox's slot

grave hatch
#

Right.

pulsar remnant
#

afaik it expects to be only created by defining as a member, so doesn't support that

grave hatch
#

MyBox->SetContent

pulsar remnant
#

Oh, so I can create a custom slot and override operator[] then do ->SetContent ?

#

I'm looking to access this member, right?

struct FBoxOneChildSlot : ::TSingleWidgetChildrenWithBasicLayoutSlot<EInvalidateWidgetReason::None> // we want to add it to the Attribute descriptor
    {
        friend SBox;
        using ::TSingleWidgetChildrenWithBasicLayoutSlot<EInvalidateWidgetReason::None>::TSingleWidgetChildrenWithBasicLayoutSlot;
    };
    FBoxOneChildSlot ChildSlot;
#

From SBox

grave hatch
#

SBox already has a slot, no?

#

I'm not sure how slots are defined, tbh.

#

The word "mixin" just annoyed me so much for some reason I didn't look into it.

pulsar remnant
#

My thought was it has one, but it doesn't provide operator[], so I create a wrapper for it

pulsar remnant
#

I decided fck it. I'll just go with SetContent

grave hatch
#

😛

zealous token
#

Does anyone have any tips on where to get started with Slate? i am having issues finding a good starter guide / documentation on it for ue5

zealous token
#

Thank you ^^

grave hatch
#

Check the pins here.

#

The qt to slate thing guide is pretty good.

mild oracle
zealous token
#

I actually remember watching your videos a bit back and saw your site, thanks for reminding me about you😀 haha, gotta refresh my memory a bit. Hoping to get into making custom UI & tools within the engine

pallid gyro
#

Ben's videos literally made me stop being afraid of slate so, it does what it says on the box.

grave hatch
#

On the SBox*

river thunder
#

i'm trying to make a child type of SExpandableArea, how would i pass the things for HeaderContent, BodyContent etc. to the parent?

river thunder
#

chatgpt told me something along the lines

SExpandableArea::Construct(SExpandableArea::FArguments()
  .HeaderPadding(FMargin(2, 4))
);

which seems to be correct?!

pallid gyro
river thunder
#

otherwise the Construct call might be sufficient?!

pallid gyro
#

Yes I think you just call the parent constructor in your own constructor

#

I think

river thunder
#

thanks 🙂 looks like it's working

orchid nova
#

^this is the way to do it yeah, it seems a bit weird but it is what it is

river thunder
#

i want that the textinput takes up the whole space, can someone point me out on where i'm messing up?

SNew(SHorizontalBox)
            +SHorizontalBox::Slot()
            .FillContentWidth(1.0)
            [
                SNew(SBox)
                .MinDesiredWidth(300)
                [
                    SAssignNew(TextBox, SEditableTextBox)
                    .HintText(INVTEXT("search"))
                    .OnTextChanged_Lambda([this](const FText& Text)
                    {
                        OnTextChanged.ExecuteIfBound(Text.ToString());
                    })
                ]
            ]
            +SHorizontalBox::Slot()
            [
                SNew(SSpacer)
                .Size(FVector2D(20, 1))
            ]
            +SHorizontalBox::Slot()
            .AutoWidth()
            [
                SAssignNew(CheckBox_AutoSetRanges, SCheckBox)
                .IsChecked(true)
                [
                    SNew(STextBlock)
                    .Text(INVTEXT("update ranges"))
                ]
            ]
stuck jewel
#

add autowidth on everything except the one you want to stretch

#

also before you do that

#

if you want some academics

#

use the widget reflector to inspect each element and look at its "desired size" vs "actual size"

#

sometimes that can help cement in your brain how this weird thing known as Slate Syntax logics itself

river thunder
#

thanks, didn't notice that i forgot about the spacer

#

the SBox might need .HAlign(HAlign_Fill), too?

#

or is that default behavior 🤔

#

apparently it is

#

but yea, adding AutoFill() to the spacer did the trick 🥳

stuck jewel
#

normally H or V boxes like that you have slot.autowidth slot.autowidth slot.NOTautowidth
for the non-autowidth ones, you use fill content % to determine their % of the total stretch

river thunder
#

yea, that's what i'm used to from UMG, so guess most things from there translate 1:1 to slate

stuck jewel
#

(obviously notautowidth is not a command, i just mean you don't write autowidth)

river thunder
#
SNew(SHeader)
.HAlign(HAlign_Left)
[
  SNew(STextBlock)
  .Text(INVTEXT("search settings"))
]

why is it centered?

#

all of those are in the same vertical box, so there should be enough width?!

#

is that even what epic uses as divider in menus

#

it ooks kind of similar, but also not

#

e.g. theirs doesn't use a faded brush

stuck jewel
river thunder
#

the dropdown closes when i hit TakeSnapshot...

#

but i've figured now

#

they use their own menu builder

stuck jewel
#

ah right.

for future: use the "hit test" button and keep the widget reflector visible off to the side

river thunder
#

oh nice

#

i wonder if i should just use their widget or mess with their menu builder 🤔

stuck jewel
#

the sheadingblock?

well teh menubuilder is good for... building a whole menu

river thunder
#

hmm, i also can't see how i would just add an entry with some custom content

#

seems like it's all pretty much tied to editor commands?!

stuck jewel
#

maybe, i think i've only toyed with it once

#

looking at your image, have you used SComboButton? it might do you better... or if you want to go one more level raw, you can use SMenuAnchor to go full DIY

river thunder
#

the Cog is SComboButton

#

if that's what you mean

stuck jewel
#

ah yeah.

river thunder
#

i just want to get close to editor UI styling, but i don't really want to sacrifice the option to have custom widgets as menu content

#

maybe i should just stick to the widgets they use to finally construct their menu 🤔

stuck jewel
#

i feel like FMenuBuilder should support arbitrary widgets

#

but been 5 months since i used it and i abandoned it in the end for what i was doing

#

like it has AddWidget(...)

#

which just takes SWidget

river thunder
#

oh wait

#
FToolMenuSection& Section = InMenu->AddSection("Browse", LOCTEXT("BrowseHeader", "Browse"));
                Section.AddEntry(FToolMenuEntry::InitWidget("PickClassWidget", Widget, FText::GetEmpty()));

maybe like this

#

gonna test it

#

after i've recompiled 500 modules because i just hit enter in the editor source 😄

#

got some weird padding tho 😄

stuck jewel
#

37 more live codings and you'll have it fixed i'm confident

#

no wait, aren't you on linux

river thunder
#

yea...

stuck jewel
#

holy fuck man

river thunder
#

seen my screenshot the other day?

#

with the 58 crashreports within one day? 😄

#

and that was just the crashes...

stuck jewel
#

masochist

river thunder
#

but tbf, it starts rather quick

#

< 30 seconds

paper gale
stuck jewel
#

yeah no thanks i'll take my 3 second iterations lol

#

(ok actually more like 6 second)

river thunder
#

well its rare that i don't spend that time to think

#

or write the next change

stuck jewel
#

have to throw in like five entries of something and write them all different ways to see how each way differs

river thunder
#

now i just gotta figure out how to handle the checkbox switch graceful

river thunder
#
FUIAction AutoSetRangeAction = FUIAction(
  FExecuteAction::CreateLambda([this]()
  {
    bAutoSetRange = !bAutoSetRange;
    TriggerUpdate();
  }),
  FCanExecuteAction(),
  FIsActionChecked::CreateLambda([this]() { return bAutoSetRange; })
);
        
SettingsMenu.AddMenuEntry("AutoSetRange", INVTEXT("update ranges"), INVTEXT(""), FSlateIcon(), AutoSetRangeAction, EUserInterfaceActionType::ToggleButton);

it's wild but works

#

i wonder if there's no way to read the current state from the menu checkbox

#

but chatgpt failed me hard on this

#

but it works and looks genuine 😛

glossy sage
#

So weird seeing other people besides Daekesh answer slate questions.

river thunder
#

is there something like DeltaTime in slate?

#

for something like that

SNew(SBorder)
.ColorAndOpacity_Lambda([this](){
            return FSlateColor(FMath::FInterpConstantTo(GetColorAndOpacity(), FLinearColor::White,   2.0));
        })
#

FSlateApplication::Get().GetDeltaTime() ?

#

i'm really relying heavy on chatgpt to get going with Slate 😄

paper gale
#

SWidget::Paint(const FPaintArgs& Args,

grave hatch
#

Or override tick, get the delta time from there, save it to your object, then refer to that delta time in your lambda...

river thunder
#

i had to read it twice 😄 but thanks

#

it's beautiful now 🙂

river thunder
#

anyone got an idea why the overdraw happens after scrolling around?

#

SUnicodeRangeWidget and SUnicodeCharacterGridEntry are childs of SInvalidationPanel

#

i tried to invalide the layout of the SUnicodeRangeWidget when scrolling but that doesn't seem to fix the issue

pallid gyro
#

did you try the .clipping settings? i think that in slate it actually works sometimes, unlike in UMG.

river thunder
#

no. i would add it to the scrollbar?

pallid gyro
#

I think that in this case you'd want to add it to the expandable area, and potentially to the content borders, as it looks like it's their contents which don't respect the layout?

#

all widgets hierarchies in unreal are a nightmare. imo.

river thunder
#

i had this issue before, afaik in a UMG widget, but i don't recall where

#

and somehow that clipping thing sounds familiar...

pallid gyro
#

unreal widgets will all happily draw outside their bounds

#

The expandable areas are particularly ugly with this cause as soon as you expand them their contents will get drawn and they'll overdraw on top of whatever widget is below them. you'd really think respecting the bounding box of the widget would be a core and reliable feature in a widget framework.

river thunder
#

this is from one frame and several of my containers overlap the geometry

#

some are clipped down to 0px height, but not all

#

i think that's my main issue

#

i wonder if i should even spend time investing, plan is to change the whole thing to a listview soon or later

#

i feel like that will get rid of the issue to begin with

ember monolith
#

UMG has Property Binds but they should not be used because they will be updated every frame which is significantly more taxing on the CPU than using an event based framework.

#

i saw this in the compendium

#

but like

#

aren't there some things that you might as well bind? like a property that you would otherwise be updating in NativeTick anyway

#

e.g. stamina

#

feel like updating stamina from all places that could potentially modify a stamina attribute might be less performant than just updating it on the widget every tick

paper gale
#

Are there any best practices for type safety with SlateStyle? Relying on FName literals for Get/Set style entries looks weird susge

stuck jewel
#

i came up with a gross yet effective-for-me setup while making yap. i store all the fnames into global namespaced structs in the header and use macros to assign everything in the cpp

#

... ah, extremely ugly indent-formatting. the usecase where i must concede spaces are unequivocally better than tabs

#

then my calls turned into stuff like this
.ButtonStyle(FYapEditorStyle::Get(), YapStyles.ButtonStyle_NoBorder)
.BorderImage(FYapEditorStyle::GetImageBrush(YapBrushes.Border_RoundedSquare))

#

if you don't intend to make something big you could just do the header bit and predefine UE's stupid hardcoded names. it would at least help a ton with discovering the ones you want

#

in the early stages i wasted so much time searching for names again and again

paper gale
pulsar remnant
#

What is the difference between SCanvas and SConstraintCanvas?

paper gale
#

UMG CanvasPanel uses SConstraintCanvas btw

pulsar remnant
#

So that I would only have top left anchor and no alignment, if I use SCanvas?

#

In terms of UMG canvas I mean 😄

pulsar remnant
#

But that's the logical one, right? Like you'd expect it to happen

paper gale
#

it still supports alignment
I guess it lacks flexibility for percent-based restriction area

pulsar remnant
#

No, like the alignment I'm talking about is the pivot of the widget

#

Like the value between 0 and 1

paper gale
#

I guess so

pulsar remnant
#

An unrelated question: How would I set a timer for next tick in slate code?

#

Can I access the world to get timer manager?

#

Or does slate have it's own timer manager?

#

Like the usual way is this:

GetWorld()->GetTimerManager().SetTimerForNextTick()

But how could I get access to world in slate?

pallid gyro
#

You can get world from the active viewport but it's generally better to provide the world reference to the widget, presumably somewhere along the hierarchy as you create the widget you shoulld have it.

paper gale
#

what's the use case?
I would built logic on a higher level, like in actor/component etc Jokerge

orchid nova
#

If it's editor only you can always get one through GEditor/GEngine/GWorld/etc.

paper gale
#

in general I don't like side effects in tick/paint etc

#

so on next-frame concept sounds weird to me

pallid gyro
#

I think if a world is neccesary it's usually better to pass it to the widget, this is very common in the engine, usually as some 'world context object' uobject that has a valid GetWorld() return, using the static options whether the editor or viewport will potentially cause issues if/when you want to use the widget in other contexts, issues that will not occur if you just let the callers pass the world as a context object.

I also tend to agree with @paper gale though that needing to call on next tick or w/e in slate doesn't really sound right, if you have some initialization issue that forces you to invoke some logic on next-tick it'd be better to figure that out and maybe change the order in which things are called/created. Like, slate widgets sometimes gotta tick and sometimes they have deferred initializations for whatever reason, but the combination of a widget that doesn't tick that for some reason needs to delay something until next tick and use a world timer to achieve it sounds like a design that could be improved, in my opinion.

paper gale
#

0.f means next frame (actually every frame, but callback returns EActiveTimerReturnType::Stop)

#

inline example (lambda)

#

mentioned approach is editor-only

paper gale
#

tried to use -trace=slate in Lyra project

paper gale
kind parrot
#

Hi all, do you know of best practices how to get the current navigation input which Slates receives in a blueprint?
I am trying to get Slate to either provide me an event whenever it gets inavigation input or to configure Slate so the key events are additionally forwarded to the EnhancedInput system and not fully handled by Slate already.

Background: In my UI, I use a combination of focusable typical elements like Sliders and checkboxes. Slate automatically recognizes this as list of menu items but refuses to recognize a custom button widget at the very bottom. I need to find a way to escape the magic of Slate and set focus on the custom button whenever I receive a "navigate down" input while being on the last widget which Slate recognizes.

crystal atlas
#

Does any know how to fix following bug occuring in ue5.5

In ue5.3 the blueprint widgets work fine

still has living Slate widgets, it or the parent xxx (xyz) is
keeping them in memory. Make sure all Slate resources (SharedPtr<SWidget>'s) are being released in the UWidget's ReleaseSlateResources). Also check the USlot's ReleaseSlateResources).

grave hatch
#

Are you releasing the resouces in ReleaseSlateResources ?

crystal atlas
#

How can I do this in blueprints?

crystal atlas
#

@grave hatch to use this I should do "remove from parent"?

And when this should be called?

grave hatch
#

I'm not sure. Ask in #umg ?!

crystal atlas
#

I asked there also

paper gale
crystal atlas
#

It is from a bought framework which isnt updated anymore. I updated it from 5.1 til 5.4 without any issues. Now with 5.5 it started.

So yeah my projects widgets.

paper gale
# crystal atlas It is from a bought framework which isnt updated anymore. I updated it from 5.1 ...

Looks like it contains memory leaks.
According to engine sources, mentioned error occur as a result of simulation test which

  1. creates temp widget hierarchy
  2. "kills" root widget
  3. tests children for validity (nobody should keep strong ref to them anymore)

if someone keeps such refs then it shows error about memory leak.

I can't say it's 100% solid approach to find memory leaks. I assume it may provide false-positive reports.
e.g. system may be designed in a way that root widget always has longer lifespan then external entities that keep refs to children widgets.

At the same time marketplace full of crap stuff so I would not be too optimistic Jokerge Ratge

crystal atlas
#

@paper gale thanks for your help so far. so I need to look into the construct‘s of my widgets.

Because if it creates the widget. -> release it -> test if it‘s still valid

There is a problem in construct and destruct?

paper gale
#

you can search plugin's codebase for TSharedRef and TSharedPtr
cuz test relies on SmartPtr's IsValid which can't track raw ptr so if it detects smth, it definitely some Smart Ptr

#

there is a chance that some other code keeps strong ref, i.e. you pass smart this to some function which implicitly Ratge saves ref to provided param (shares ownership).

crystal atlas
#

It is a 100% blueprint based framework, so no c++

crystal atlas
#

@paper gale
The issued widget is Overlay (Engine site) or the Parent which is a widget from class Border (Engine)

paper gale
#

are you C++ dev?

crystal atlas
#

I know c++ and have written my own c++ plugins or maintained stuff from github. From UE 4.27 -> 5.5.1.

If you want I could show you the Blueprint Widgets

paper gale
#

you can put breakpoint to line where error is printed and inspect stuff

#

to check what child is leaked

#

WidgetBlueprint.cpp ~830 line

crystal atlas
#

The errors or crash comes while clicking compile or save, without any issues before.

I can create a new project based from my template and click around until it crashs.

After a crash the whole project won't start anymore.

This error comes in the output log:

paper gale
#

though it may lack info in non debug build

crystal atlas
paper gale
#

you need debug symbols

#

if it's epic launcher's engine

crystal atlas
#

never thought about that. started the download.

Will I get more details about a crash, even using non c++ project (Sorry for being inexperienced dev, I only know basic stuff)

paper gale
#

C++ compiler can "optimize out" some stuff, so there is no guarantee you will find useful info, though in general debugging with symbols from launcher works decent enough

crystal atlas
#

Got now detailed errors

paper gale
#

looks like a different bug Jokerge

#

*from memory leak

paper gale
paper gale
final sleet
#

hey, does anyone know what is the "outline settings" equivalent on Slate for a text block ?

#

nvm its a property of the font 🙂 thanks anyway

vocal flame
#

im trying just a very basic property type customization for a struct i have and im trying to add a border to the bottom of it just to see if the customization works. It works when used normally, but when i use the struct as an instanced struct it no longer applies? what am i missing, is there a method and what is the method to apply customizations to structs even when they are used as instanced structs?

stuck jewel
#

yougottabeshittingme if that's true then instanced structs would be trash to me...

grave hatch
#

Are you hitting that early return?

vocal flame
#

i dont think i am but let me check

#

i sure hope i am

#

well, its not calling anything at all

#

im gonna see if maybe its only instanced structs or if its my setup first, but i know its not an issue with registration or something cause everything works fine when used outside an instanced struct still

#

Yeah seems to be only instanced structs for me. I am in 5.1 so maybe they hadn't extended that yet, but i think its much more likely i'm just ignorant of what to do here

#

maybe i need to register it as a struct on scope property?

#

im way too unfamiliar with slates game rn

vocal flame
#

i don't know how to go about this right now but best idea i have is to create a override of FInstancedStructDetails and register my customization as an instanced struct ``` PropertyModule.RegisterCustomPropertyTypeLayout("InstancedStruct", FOnGetPropertyTypeCustomizationInstance::CreateStatic(&FInstancedStructDetails::MakeInstance));

that uses the optional Indentifier to differentiate it somehow. I don't really know if thats right or how to structure the code, but if anyone has thoughts or wants to try i would love to know what to do here! Thank you!
grave hatch
#

There's a "can customise" callback I'm sure.

#

And it'll check those callsbacks before using the default one.

chrome jasper
#

I've done something quiet interesting KEK

Wanna now what you guys think of it

(Context): I'm researching on the IPropertyTypeCustomization type. My creativity blow up and i've embeded some bullshit into the slate mechanisms

orchid nova
#

I was thinking about embedding Doom into a BP node :)

#

Like literally display a little window where you can play Doom by placing the BP node into the graph

#

Spent a while screwing around with Chocolate Doom but I never figured out how to compile it into a DLL so I could connect it into UE

chrome jasper
#

if you want i could help you with that. that would be an absolute meme here in this discord. "Doom Inside Unreal Engine". That would be absolutely ridiculous

vocal flame
grave hatch
#

If it's what I'm thinking, it is one of the parameters of the register customisation method.

#

If it isn't... I'm thinking of a different customisation in the property editor.

vocal flame
#

Yeah I think its not possible without engine edits which is a massive bummer

grave hatch
#

It's that last parameter.

vocal flame
#

Hopefully i can find some time to try it, but i don't have it in my soul right now to be crushed by trial and error for another 10 hours on mr. Sweeny's wild ride 💔

grave hatch
#

Every example in the engine just checks if the property being customisd has a meta tag 😂

safe shale
#

hello! first time in this chat

#

got a question about convention. did a bit of fiddling, first foray into it today. for any non-trivial slate widgets, is it generally a good idea to just define a struct for all configuration and expose that through SLATE_ARGUMENT

#

so calling code can be like

SNew(SFooWidget)
  .Configuration(/* build config struct in-situ or pass it in */);
#

or at least for like configuration categories it makes sense, like ColorSettings or something

grave hatch
#

Why not have individual settings?

stuck jewel
#

in typical c++ it is commonplace to switch to a struct when passing in several args but ... in slate, everything is so verbose, and already generally set up to work with individual .Settings ... i would not use a struct

stuck jewel
#

what's the "proper" way to make something like an SGridPanel with clean separator lines? like this is just a horizontal box with three slots, the middle slot has a SSeparator. but i want horizontal separators and the whole thing to autolayout like a grid

#

hmm maybe i am just a moron who never found SSplitter yet?

stuck jewel
#

seems like the formal answer is to make a child of STreeView and a bunch of other classes for rows and such. screw it, my ghetto solution will do.

grave hatch
#

Lol.

#

Sgridpanel where ever other row and column is a 1 pixel scolorblock 😂

fluid jewel
grave hatch
#

You mean there's no USplitter for umg?

fluid jewel
#

yup

#

last time i checked in 5.4 at least

stuck jewel
#

rude, epic, rude

grave hatch
#

Very

paper gale
#

Since Slate docs do not exists, nobody can discover such injustice Ratge

grave hatch
#

It's the source code! 😂

stuck jewel
#

wish there was an actual massive test suite that showed every widget instead of just a bunch of random common ones

fluid jewel
#

Just need a good slate compendium.
idk if I've run across one.

grave hatch
#

Channel pins?

#

Also, fuck sake, teh new discord design is horrendous.

fluid jewel
#

don't get me wrong, nice to see the structure, of how other widgets are created, but it'd be nice if we could use it to adjust our own slate widgets. something like the dev tools for browsers would be nice

stuck jewel
#

it's really just for "how do i make something that looks like that fucking thing? what kind of type is it?" and also useful for debugging size/layout a bit

(And yes the cursing is a mandatory part of that thought process. This is slate)

grave hatch
#

Widget reflector is amazing.

#

If you think it's bad, you're doing it wrong!

fluid jewel
#

Then I'm doing it wrong.

paper gale
stuck jewel
#

yeah

vocal flame
# grave hatch It's the source code! 😂

I think this is the funniest thing about unreal. You go the documentation, maybe even have an idea on the toilet and check your phone and then boom

The Documentation: "check the code lmao"

The Code :

// TODO: some shit that will never be done. This code is from 4.4 and the person who started it left 5 years ago
SEatMyAss : public .... 
{
 //Actual code that's like 400 lines of boiler plate and 2 functions you absolutely need to know about but won't understand unless you search the entire engine source and find Asslicker.h which include an example of this being used on line 225 with another slate api implementation of something you've never seen before. 
}
#

Then you Google it and some guy with a name like Jeremy Barbunkle actually wrote an entire blog post on it 4 years ago that you only find on the 3rd page of Google or on a link in this discord when you type in the perfect keywords with the right filters.
I imagine this is what wizards would feel like trying to find an ancient spell to make water purple or something.

paper gale
stuck needle
#

does anyone know how to disable FGameplayDebuggerExtension_HUD? as it keeps enabling my HUD when i don't want it to be visible yet... 😅
i assume that this wont be a problem when actually packaging the game. but its just difficult to test HUD related functionality when it behaves like this in the editor...

zealous token
stuck jewel
#

Fine slate you win I'll add another 400 lines of boilerplate

mellow totem
vocal flame
vocal flame
river thunder
fluid jewel
#

that looks gorgeous

stuck jewel
#

thanks (fishing for compliments is probably my primary source of motivation to keep going on this HideThePain )

fluid jewel
#

fish away. I'm jelly (pun intended)

umbral stone
#

Hey quick question - does the SListView widget automatically support resizing the columns if I resize the header? Or is it something that needs to be implemented manually

grave hatch
#

It will resize the entire column.

umbral stone
grave hatch
#

I'd say so.

#

How are you doing it?

#

You're meant to create header cells and then add them to the listview. Then use the listview's create cell callback (or whatever it's called) to create the individual cells.

#

And you should be inheriting from the multi-column row.

#

Damn, it's been a while.

umbral stone
grave hatch
#

Great!

modest needle
#

Hey Everybody 🙂
Hope you are well!
I'm building a EUW with a detail panel and I was wondering how to access this red popup in cpp?
I don't need the duplicate name check just triggering this red popup in my tool 🤔

Any help would be greatly appreciated 😁

modest needle
#

I was able to find the popup error from the engine but the EUW details view doesn't give access to any row so i might be stuck, might not be possible

grave hatch
#

It's on the text entry's validation method.

#

You set the out error text parameter to that string.

#

They appear to be doing it very differently?

#

Generally details panel are extremely opaque. If you want to access widget details, make a customisation and make the row yourself.

barren kayak
#

does anyone know why UWidgetBlueprintLibrary::IsDragDropping() seems to be replicated between clients in PIE?
ahh, it seems its due to both PIE sessions using the same FSlateUser so GetCursorUser()->IsDragDropping() returns true for all sessions

umbral stone
#

What's the simplest widget I can use for a super basic dropdown menu like this with some pre-set text options? SComboBox? Or is there an even simpler one?

grave hatch
#

For use in the editor?

#

It's a pretty complex widget, tbh

#

There's a lot going on.

stuck jewel
#

no way i bet i can do that in less than 2700 lines of code thinkfast

scombobox is probably what you're looking for though yes. i would consider scombobox very simple in the grand scheme of slatethings

#

if you want the scrollbox too though that might be extra

umbral stone
#

Nice ok. No scrolling needed, just 2 options. I also just discovered something called FMenuBuilder, could that help?

stuck jewel
#

IIRC the FMenuBuilder can help you build a list of things - like for your image above, you could use FMenuBuilder to build a single widget that contained 7 buttons on a panel, one for each color

#

i can't remember if SComboBox takes in a single widget for the dropdown, or if it has a function or delegate you set up to build each entry from an array

grave hatch
#

FMenuBuilder is the very old system.

#

You should investigate UToolMenus and UToolMenu.

stuck jewel
#

hm good to know about. but at the same time... really? looking at one or two cases of it, this looks like absolute dog shit if you just need to build something really small.

#

or maybe i just found a bad example (looking at one in UMG editor, needs like multiple UObjects and multiple delegate hookups but this should be a little complex seeing what it does)

#

so make a named UToolMenu by calling UToolMenus RegisterMenu.... then add sections... then add entries to it...
then completely unrelated to that elsewhere in your code, you call UToolMenus::GenerateWidget with a name and a context... it's still a lot more complex but alright, looks good for complex needs

grave hatch
#

You register the menu, add a callback to build it and then implement hte callback.

#

Maybe add a context object if you need some parameters.

#

But I'm not sure why you'd use either of those systems instead of a combo box.

safe shale
#

whats the appropriate way to integrate a level viewport into a nomad tab?

#

i've tried several things and its usually throwing stuff like null ref access or compilation errors

grave hatch
#

An actual level viewport? Or just a preview scene? (Like a static mesh preview)

safe shale
grave hatch
#

Why not use the actual level editor?

#

Or is this for runtime?

safe shale
#

suppose i could use the main level editor. but i'd still need a way to reference and control it

grave hatch
#

You realise none of the actual editor tooling is available for runtime and you'll have to remake all of it?

#

Just making sure you know!

#

And you didn't answer whether this is for runtime within your game or for level editor time, making maps in the editor.

safe shale
#

can you use nomad tabs at runtime

grave hatch
#

Sure.

#

Slate is entirely cool to use at runtime. All of its base features.

#

Only things in developer or editor folders are unusable.

#

That include editor only plugins, etc.

safe shale
#

its an editor tool

grave hatch
#

Then why ask if yoiu can use nomad tabs at runtime?!

safe shale
#

Was trying to understand your line of questioning

#

Sorry icing my back couldnt lean forqard to type with both hands. Got my phone now

#

Is there no benefit to making it an editor tool and rather just make the editor its own game mode instead

grave hatch
#

Well, you get to use the level editor and all its tooling...

#

But then your players can't use it.

#

Making a "level editor" as a game mode is pretty simple and doesn't involve any kind of extra tabs or whatnot. Just make a game mode where you place tiles on a blank map (or some kind of default background maps) and save the tiles to a json file or some such.

#

Your players could use that.

#

But you won't get teh cool features like baked lighting, terrain editors, etc.

safe shale
#

Mm

grave hatch
#

If you want to use the UE editor features, it'll be editor/developer only and you would just extend the level editor itself, not create your own.

safe shale
#

Yeah I'm aware of that. Phase 1 for me was to add constraints as to what CAN be done that was the thinking

grave hatch
#

You can do pretty much anything with the level editor.

#

There are hooks for everything if you know where to find them.

safe shale
#

First feature was axis mirroring

#

Which iirc isnt something you can do. Like set a 1km/1km map, raise terrain and have it symmetrical over one or both axes

grave hatch
#

I don't know about the landscape editor.

#

But you'd probably be better off creating landscape in something like Gaea or World Forge, which do have these functions, and then importing the heightmap.

safe shale
#

need something a la starcrafts map editor. so it needs a concept of in-game components, biome-based pallettes etc. and the terrain needs to incorporate things like updating the nav mesh

grave hatch
#

All doable. You'll have to investigate the landscape editor yourself, though.

stuck jewel
#

Well... Building a landscape in a specialized third party tool and importing the height map into the game engine is no different than using Maya or 3DS and importing game models, pretty standard practice

safe shale
#

alright guys lol

#

just for shits and giggles can someone answer my question lol

#

i'm trying to build a tool to demonstrate a skillset to show off in my portfolio for a specific role that i'm applying for and it's not importing 3D terrain from another tool

#

even if i'm not gonna do it this way and divert to going the game mode route i'd like to not leave potential learning on the table. ostensibly there is a way to get a level editor view port inside a nomad tab and i just wanna know how to do that

#

i do appreciate the insight though!

grave hatch
#

Create an SLevelEditorViewport and see what happens.

bronze vigil
#

if you can't straight up shove a level editor viewport in a widget you could probably get good enough results with a SViewport and some scriptable tools & regular widgets for manipulating the scene
basically recreating the level editor functionalities you need but with the newer high level editor apis

mild dune
#

Hello! I have problem with my in world widget component. im using "project world to widget position" function in widget blueprint but the function giving viewports coordinate but beacause of canvas panel is not fit in viewport not giving right coordinates. How can i fix this

grave hatch
#

"not fit in viewport"?

#

The canvas of the viewport covers the entire thing.

#

There might be DPI issues with the canvas, though. If you have a high res screen and you have your screen dpi > 1 then it can have scaling issues if you don't account for it.

mild dune
#

beacause of im using widget blueprint in world canvas panel dont fit in viewport looks like in picture and cordinates are not matching

paper gale
mild dune
grave hatch
#

What are you expecting to see in that viewpoint?

#

The yellow box is the same size as the screen?

paper gale
paper gale
#

Camera-based direction for trace multiple can hit both you Canvas(or dummy collision box) and object behind it

mild dune
#

i add a image to canvas panel for reference. i am projecting aircraft in front of me but function giving the viewports coordinates but i need widget cordinates how can i convert these cordinates to widget cordinates?

untold dagger
#

someone has mentioned once that you can get 3d widgets to always face camera via materials
anyone has the code for that?

untold dagger
#

Actually, it works, so...

nocturne charm
#

Do .cpp files inheriting from slate classes not show up in the content browser? I have them all created in the same folder, the user widgets display the slate and works in game, just the files missing here

pallid gyro
#

probably only shows classes that are exposed to UE reflection or something

grave hatch
#

I'd expect that's the case.

toxic badger
#

Any idea why the SOverlays height and width is 0?

stuck jewel
#

well, just looking at that... what do you think its width and height should be?

toxic badger
pallid gyro
#

Slate layouts are a nightmare.

#

overlays take in a VAlign/Halign arguments and one of the options is _fill

toxic badger
pallid gyro
#

but also in the example you provided you have an overlay inside an overlay, which might not help.

toxic badger
paper gale
#

what UI are you trying to make?

toxic badger
pallid gyro
#

I try to avoid canvases cause everyone says you should avoid them.

Looking at my code that largely uses overlays I think it's important to provide the VAlign/HAlign arguments and set them to fill if you want the overlay to well, fill up the space its been alotted.

toxic badger
paper gale
#

Overlay kinda the same as Canvas in a way that both uses new layer id for every child i.e. disables optimizations like draw call batching (between layers) (I'm not an expert here though Pepechill )

#

VerticalBox and HorizontalBox is a good choice for most UI tasks

toxic badger
#

But if you want to freely align items on the x and y axis?

paper gale
#

Maybe you need low level drawing i.e. OnPaint -> drawLine, drawBox etc but it depends on how complex your tree is

toxic badger
#

jfyi i already have done the tree with a canvas and paint for the lines, just wanted to redo it

#

and have regretted it instantly 😅

#

so its more about understanding it

paper gale
#

maybe you need custom Panel with OnArrangeChildren which will orchestrate other high level widgets instead of primitive drawing. Have no experience in that though, so can't advice more than that Jokerge

#

@toxic badger

pallid gyro
#

I had a most miserable time trying to use OnArrangeChildren, for some reason things are much easier to do with custom paint events.

#

But I am also very stupid, so.

stuck jewel
#

so if you wrap an empty overlay in an SBox that has overrides, the final bottom-level widget (the nested overlay) may have a desired size of 0 and an actual size of whatever the box containing it is forcing

paper gale
#

SNodePanel might be interesting as a reference

#

This class is designed to serve as the base class for a panel/ canvas that contains interactive widgets which can be selected and moved around by the user. It also manages zooming and panning, allowing a larger virtual space to be used for the widget placement.
The user is responsible for creating widgets (which must be derived from SNode) and any custom drawing code desired. The other main restriction is that each SNode instance must have a unique UObject* associated with it.

#

though it's from Editor Module, but I mean it as a reference only

pallid gyro
#

someone needs to take all those graph/panel widgets and sanitize them from editor only dependencies. one day.

vale stump
vale stump
#

Good find tho

pallid gyro
#

override the mouse events (mouse move, mouse wheel, mouse been down), save some offset vector and a zoom vector, offset the geometry in the paint event.

vale stump
#

Could make the massive image allow drag and drop events too.

#

I've not rly looked into how those work

pallid gyro
vale stump
#

This is cool

pallid gyro
#

really you just use the ToPaintGeometry with the offsets and transforms

vale stump
#

I have no idea what's going on lol. Not good enough at slate yet

#

I think I kinda get it. One of those note dropping piano things right? I don't rly understand how the offset and making new boxes works to scroll it

pallid gyro
#

it's also very messy code written by someone who barely knows how to code so, I guess it could be pretty confusing, but really, anything that has a paint event, you can offset the geometry before passing it to the paint event.

vale stump
#

I guess you put a new box at the top, and then scroll the lower boxes down until they go under the piano

#

So it keeps refreshing itself?

pallid gyro
#

mmm, well, that whole class is a little different but yes it can also be like a 'note scroller', the point was more along the lines that if you right click it and pan in a certain direction all the contents are offset in the opposite direction, making it 'pannable'

vale stump
#

Ooh ic. I thought it was scrolling automatically.
This is cool though, I'll have to rly try to understand it a bit more

#

Thanks for showing me

pallid gyro
#

well, I mean, it also scrolls automatically, but generally I just wanted to show how to do panning/zooming via manipulating the geometry in the paint event

#

in my thingie the horizontal zoom is also seperate from the vertical zoom, which slightly complicates the math a bit more and is not neccesary for things like the SGraphPanel

vale stump
#

Woooooow that's fucking lovely dude

#

It looks so smooth

stuck jewel
#

this thing is proof that amirbk is a vampire. how many centuries have you been building this for

vale stump
#

I'm just speechless honestly. Insane work

pallid gyro
#

I actually completely lost motivation and haven't worked on it for 2-3 month, it makes me sad 😦

vale stump
#

Also you're creating new segments I thought, but you're also populating it with the new notes that come into view

pallid gyro
#

it relies heavily on work Epic/Harmonix did with the Harmonix plugin in unreal 5.4, I really didn't start from scratch, only the widgets are mine really.

#

And it's really simpler than it might appear, just some for loops and the geometry offsets. I'm really not very clever.

vale stump
#

Yeah that's what Einstein said

#

Get off your high horse and get on this moose

#

It's taller

vale stump
#

does someone want to test my slate plugin? i just made some changes and i want a guinea pig to see if they work on another machine

fallen mango
#

What Plugins are pretty new/good for learning purposes? I'm looking for some plugin/mode to learn/observe how epic builds their tools nowadays.

grave hatch
#

Newer ones. Older the code, the worse it is.

#

Most of the stuff in the Avalanche suite is pretty decent. Though there are some exceptions.

vale stump
vale stump
#

Is there a way to make a button somewhere in the menu dropdowns or on the toolbar that can open the editor preferences and also navigate to a settings page?

#

Manual navigation each time i want to look at the settings is so 2024

paper gale
#

though it takes infinity for settings page to open Jokerge

#

I guess you need some delegate

vale stump
#

The real question is where would I find the proper way to force open the editor preferences and a certain category

stuck jewel
#

hang on

vale stump
#

My hero!

vale stump
stuck jewel
paper gale
#

sometimes you have to look at the parent for unique one

#

recursively

vale stump
#

Sometimes it just goes all the way up and says "this is Slate. Bet you didn't know that"

#

Lol

stuck jewel
stuck jewel
vale stump
#

Thanks mate

stuck jewel
#

what's that, brain? why yes, it would be a good idea for me to use my brain and combine both of these and put a setting into my plugin to place a button on the toolbar for quick access to this plugin's settings thinkfast

vale stump
#

hey that was my brain's idea! get your own!

#

lul

stuck jewel
#

too late, stolen!

vale stump
#

do you think i should have this button in my module interface class or my DeveloperSettings class?

#

and setting open func

stuck jewel
#

honestly i don't know what the best way would be to cleanly contain the button's code. that GC button thing was literally about 7 minutes work starting from one of the editor plugin templates

#

i absolutely hate how convoluted command code is, it feels like 7 classes split over 4 different files just to make a button that runs one line of code

vale stump
#

you made your own namespace for the func

#

i dont rly know how namespaces work

stuck jewel
#

(it's obviously not quite that bad but it's still pretty bad)

vale stump
#

is it like pure static stuff?

stuck jewel
#

yeah pretty much

#

it's just a global (globals usually bad, but for static fire-and-forgets, clean inside a namespace, meh)

vale stump
#

ill just put it inside my module

pallid gyro
#

I used an "FAutoConsoleCommandWithWorldAndArgs" a couple of days ago. I thought it'd be 'quick and dirty', at the end it was mostly just dirty? I think.

vale stump
#

damn youre doing some crazy shit

#

wtf is this lol

#

i dont get how it works

#

this is what i get for not actually learning c++ i guess

stuck jewel
#

it's ok, it's merely a class that is inheriting from a template of itself thinkextreme

vale stump
#

it hasnt been created yet so how can it inherit from its own template

pallid gyro
#

Commands are annoying but it really isn't that awful, like, I agree that it seems like it's something that should be simpler but if you look at a few examples in the source code you kinda get the pattern

#

it's not like they do all that much

#

you still need to bind them

stuck jewel
#

it was created! it was created about 8 alphanumeric characters before the template is encountered HaroldHaha

pallid gyro
#

if you use the plugin template for an editor mode it has a commands class you can extend

#

those plugin templates are quite handy, imo.

vale stump
#

do i need to use these complicated things?
can i just register a new button within my other module and just use my existing details customization to bind the button click to a function, or do i have to do all this other stuff?

pallid gyro
#

registering a command will allow you to register some key chord that will invoke it even when the widget is not focused

#

seems to be the main purpose

vale stump
#

ah hotkey stuff.

#

not sure i care enough. ill just do it the boring way

vale stump
#

is there a reason or just because?

#

like the bracketing

stuck jewel
#

i didn't write this code actually, epic did - but that extra scope looks useless here

vale stump
#

ic

stuck jewel
#

most of this was from one of the aforementioned new plugin templates

pallid gyro
#

If anyone ever figures out how to make a level editor tool that enables the default transform/translate gizmos, I'd love to know! I spent at least 3 hours trying to figure that out.

#

Super annoying that it works in the legacy modes by default but not in the new ones.

vale stump
#

what do you mean?

#

by enables the default

pallid gyro
#

wait let me fire up the old unreal to take a screenshot

vale stump
#

like, is there a transform property that doesnt have them in the details panel?

pallid gyro
#

So this default level editor 'gizmo' thingie right here -

#

In my custom editor mode it gets disabled -

vale stump
#

oh ic. interesting

pallid gyro
#

in modes that use the older FModeToolkit (or whatever) modes they're enabled -

vale stump
#

i have no idea tbh. i dont even know where those are created

pallid gyro
#

they're also enabled in the modeling mode, which uses the new style with the UToolMenus, but it seems assosciated with the tool, I think.

Either way, I couldn't figure it out.

waxen gorge
#

Hi all.
I barely use Slate but I did use this button to make a few shortcuts:

#

And then I try to use this button to delete those shortcut buttons when I don't want them anymore:

#

It does delete the button, but next time I open Unreal it has come back. Anyone know what I need to do to make it stay gone?

vale stump
# waxen gorge It does delete the button, but next time I open Unreal it has come back. Anyone ...

every time you load your module it recreates everything from scratch.
if you want changes to be carried over from one session to another, you have to save the current state of your module.
usually, thats as easy as putting Config into your UCLASS macro, and doing something like in the photo. you call that whenever you want to make a permanent change to your plugin, and at startup you should call LoadConfig

paper gale
paper gale
#

Haven't used address-breakpoints btw, just plain widget reflector navigation feature Pepechill

waxen gorge
pallid gyro
#

It's not a part of the UEdMode Interface

paper gale
#

implement both, though I never used custom modes, so IDK what burden it gives you besides requirement to implement bool UsesTransformWidget() @pallid gyro

waxen gorge
# vale stump no clue

Alright, thanks. I'm not so sure how to use your advice since I'm not doing any specific module development or anything like that. I just did Window -> Developer Tools -> Session Frontend, and typed the command there (and pressed the promote button). This place:

#

I can make a button that does "WinnieThePooh", and not be able to delete it

vale stump
#

idk what that is

waxen gorge
#

np, thanks anyway.
Seems super hard to google this issue

vale stump
#

google is a blank slate when it comes to Slate

pallid gyro
#

For some reason this is considered blasphemous but copilot within visual studio is getting better and better for unreal related questions and it's pretty good with slate.

paper gale
pallid gyro
#

nope, the ILegacyEdMode interface has a ton of pure virtuals I'll need to implement first, decided it's not worth it right now

vale stump
pallid gyro
#

This is 100% Epic's fault, an incomprehensible mess, really.

#

Don't extend UEdMode, instead extend UBaseLegacyWidgetEdMode

pallid gyro
#

I was convinced this was intentional and that there was some way to 'enable' the gizmo from the tool.

grave hatch
#

I think there's an interface you extend from for the extra gizmo stuff?

#

The legacy one implements it.

stray hill
#

Is it possible to use slate icons in something like UButton ?
Context: I want to use the icons that come with the engine for UI of an editor only plugin

grave hatch
#

Yes? Put an image on the button and use a slate brush.

vale stump
#

images are one of the things that weren't rly changed from slate to UMG. UWidgets still use FSlateBrushes for everything

stray hill
#

I meant FSlateIcon

vale stump
#

does FSlateIcon use an FSlateBrush?

stray hill
#

Haven't dug deep tbh that's why I asked

#

Basically I want to use these icons in my widget, possible?

#

UI is my achilles tendon

vale stump
#

those are just normal images (textures), and you can use them

#

you can just use the path to that and load it as a texture, and then use the UImage's SetBrushFromTexture method

stray hill
#

They are not, well technically they are but they have different pathway, they exist in engine/editor/slate but are png and not imported as textures

#

You can not find them or set them as image, I also enabled engine content so that shouldn't be the case

vale stump
#
static FSlateBrush* CreateImageBrush(const FString& Path, FVector2D Size) {
        UTexture2D* Texture = LoadObject<UTexture2D>(nullptr, *Path);
        FSlateBrush* Brush = new FSlateBrush();
        Brush->SetResourceObject(Texture);
        Brush->DrawAs = ESlateBrushDrawType::Box;
        Brush->ImageSize = Size;
        return Brush;
    }
#

you use a method like this

pallid gyro
#

FSlateIcons resolve to an FSlateBrush with the GetIcon() method, it seems

stray hill
#

Thanks, I will try that

pallid gyro
vale stump
pallid gyro
#

you apply the font to some text box and then just insert the unicode for the glyph you want as text

vale stump
#

like for rich textblocks?

pallid gyro
#

well actually as a TCHAR

#

not really, I mean, you could maybe also do that but I think it'd get confusing, it works best for single glyphs or for scenarios where you need multiple glyphs from the same font

#

like my transport buttons in my pianoroll thiongie, those are glyphs from that UI-Icon font

vale stump
#

ah ic

#

thats a square-ass arrow lol

pallid gyro
#

I learned that many of the UI icons in windows and other operating systems are rendered like this, it's allegedly fast, I don't know.

#

there's also an entire open source standard for musical notation using ttf fonts so that's also kinda how I stumbled upon this thing:

#

that whole thing is rendered with fonts and offsets (not by me)

vale stump
#

this is pretty cool tho. i might need to update my plugin to use this. i couldnt figure out using icons in my settings panel

#

*without it being annoying and doing more work than i rly wanted to

stray hill
#

I stumbled upon this somewhere before but I don't remember, its a very good method but my personal favourite is multichannel SDF

#

and btw I solved my issue, the getIcon() worked

#

Thanks guys

pallid gyro
#

SDF is a combination of letters that scares me.

vale stump
#

making an sdf icon sounds complicated. i can make a rounded box with an SDF and thats about it lol

#

i wouldnt know about using it as a font either

stray hill
#

you can convert fonts to multichannel sdf with a tool on github, its excellent because of quality and size

vale stump
#

I copped a free graph plugin off GitHub that comes with a barebones editor graph and node tree system.
I was thinking of using it to make a tech tree in UMG, but I realize that I can't think of a way to generate a widget out of the layout of my graph, and I would have to remake the entire thing in UMG anyway, which I don't really want to do.
I'd have to manually place all the things, and moving something around would be difficult with so many widgets.

Can you guys think of a way to take the graph and slap that into UMG, where I can then runtime generate some widgets to go in the positions where the nodes would be?
My explanation is bad but I don't have a clear enough idea on what I want to explain it

pallid gyro
#

SGraphEditorPanel or whatever its called is in an editor only module, so using editor graphs that derive from UEdGraph in runtime is problematic (UEdGraph itself is actually not editor only, just the widgets)

#

It should be possible with some effort to copy all the relevant SGraphWhatever related classes and create a runtime module that contains them, but really no trivial way to otherwise do it, as far as I know.

#

but for a hacky solution than what you're suggesting should be possible with a canvas/overlay if you have the X/Y positions of the graph, just attach widgets to the panel?

vale stump
#

ill see if i can figure out how to extract the graph position of the nodes. thats a possible idea

pallid gyro
#

I think it's right there, like the UEdNode has .X and .Y members? I think?

#

probably not .X/Y but I remember it's not 'hidden', you can get the positions for the UEdGraph.

vale stump
#

i dont see it looking through the base class for that. it might be in a method or something. ill look more closely later

pallid gyro
vale stump
#

oh in the node. duh. i was looking in the graph

#

nobody claimed i was smart

pallid gyro
#

well, nobody said I was eloquent

#

I think it evens out

vale stump
#

true

sinful remnant
#

You shouldcheck out heartgraph by drakynfly. He has a full implementation of k2 node graphs reverse engineered and entirely accessible through slate and umg

#

It's on github. Took about a week for me to do my own implementation of it.

vale stump
#

i was kind of despairing at losing motivation for the thing i wanted to do since i couldnt think of a decent method, but there is new wind in my sails

sinful remnant
#

The discord is good for any questions.

#

If you actually read his c++ code it'll give you a deeper understanding of how nodes work, and how information is passed between them.

vale stump
#

ill start diving into it tomorrow

livid marsh
#

is there a simple way to get the locations involved in "under cursor" collision tests?

#

or rather, is there a way to limit the range

#

i basically want to either set a vector where a hit occurs, or 1000 units away from cursor in direction of the camera

#

(think: aiming an ability)

#

but i don't see any way to limit the range of the collision test

craggy holly
#

APlayerController::HitResultTraceDistance

chrome fog
#

Is there some way to get a primitive convex render geometry of a text widget? Like a geometrical shape the text covers

pallid gyro
#

I don't think there's something out-of-the-box but probably the 3d text renderer component might have some relevant starting points

grave hatch
#

The motion design 3d text actor has some improvements on that too.

vale stump
# sinful remnant It's on github. Took about a week for me to do my own implementation of it.

so im looking through it now, and there's actually so much here. so many modules and files to read through and its quite complicated.
do you have any tips for where i can start? I find it easier to make some inherited classes, and slowly learn the important parts of a system by trying real implementations, and when i run into a problem doing targeted searches and research to fix it. usually that ends up giving me a pretty good rundown of how a system works after some time of using it.

basically, i need a starting point and hoping you can shed some light on that. the docs are empty lol

#

apparently there are a couple demo projects, so ill check those out

sinful remnant
#

Look at the calculator demo. It's entirely in blueprints. You've got an object class for what the node actually does, a umg widget for the visuals, and then a heartgraph node class to register them with the graph.

#

Then the graph itself has several classes like a runner that contains all the logic for your graph, and a schema that sets up the rules for how nodes connect.

vale stump
#

alright thanks, ill take a look at that.

sinful remnant
#

It is in fact complicated, but it works at runtime and it doesn't rely on anything external to tge ue5.5 engine, and it's very flexible. I used it to create a runtime texture and mesh editor using noise algorithms.

#

That took two weeks of after work late nights.

#

The fact that it's designed for many use cases is an asset, but definitely adds to the initial learning curve.

vale stump
#

yo thats cool

#

fuck. i built the 5.4 demo and it has no content in it. woops

#

guess i need to do the 5.5 one

#

oh ic. the content is separate from the demo itself. weird.

#

everything is very broken for some reason

#

ok i was dumb.

vale stump
#

im not sure whats going on now

vale stump
#

ok i cant get these demos to work at all. idk, ill just go blind

sinful remnant
#

The git repo uses large file storage. I'm guessing you downloaded the pointers to the files and not the files themselves.

pallid gyro
#

Git lfs feels like something from some ancient past.

vale stump
#

i downloaded the project and separately downloaded the content and put the actual plugin and Flakes into it

#

all from the same version

vale stump
sinful remnant
#

Indeed

vale stump
#

ok ill do that then

vale stump
#

i keep getting this.
I tried relogging, i tried forking.
everything is going wrong today

#

ok maybe its just private

#

idk what to do then

sinful remnant
#

Do you have an ssh key tied to your github account?

vale stump
#

yes. i had to remember how to use it. i think im getting somewhere. had to go into my WSL, use git from there. cloned the repo.
then i had to init the submodules and update them

#

i have files now so maybe it all works

#

every few months i have to completely relearn all the git stuff

#

lol

#

tho i didnt even know submodules were a thing before

#

NOOO still happening

#

everyone online says to use git lfs pull command, but thats not working

#

im not sure i even have whatever git lfs is

#

oh ic. its a different git program

#

fuck me