#slate
1 messages · Page 12 of 1
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
hot stuff comin thru
https://gyazo.com/3e6d37196511de120ebe42810dafdbdd.mp4
wish i could figure out why it shows the noentry sign but oh well lol
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.
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.
Feature creep go brr
use the harmonix midi clock to make musically timed dialogs, now that's a feature.
DrawContext has better API for x,y, w,h, while DrawElement uses cringe toPaintGeometry with confusing overloads that takes unintuitive combination of vectors and transforms
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
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
I guess it's Transform.Accumulate(other)
or Concatenate
I should have been more precise, i'm working with a text block
why do you need to call it twice?
ohh so it's used like this, I looked for Concatenate and Transform.Accumulate on the thing directly
That worked perfectly, thanks @paper gale. Now I only need to think of the correct math for where to draw the text blocks...
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)
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
It's a massive pile of shite, yes.
Everything needs to be specifically sized to avoid it I think.
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.
Ever seen a details panel where the property widget is larger than the visible area?
It doesn't know what to do.
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
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 😭
It's how the scrollbox is coded really
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
Or the list view.
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
thanks, now i'm going to have nightmares tonight
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.
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
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.
yeah, all fair enough (and sad enough)
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.
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 🤣
ooo i'm getting fancier than an angelfire website https://gyazo.com/558e770cc19f384ed22b9e4343eec3ee.mp4
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.
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
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
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
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
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.
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
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?
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.
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.
Finally did it, but something is still off...
maybe a simple splitterpanel
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
Yeah they use a splitter, not a spacer as I wrote earlier
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.
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.
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
if it's a plugin then just change it
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
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.
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.
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.
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?
BTW as you mentioned 'timeline', the unreal sequencer is EXTENSIBLE like, there's a whole framework for adding custom tracks
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
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.
So I was doing some work with OnPaint right
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
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
perhaps the widget is volatile or something due to things in its parent hierarchy?
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
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.
i've never messed with onpaint yet but i use tick all the time just like any other thing
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
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.
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
https://github.com/Amir-BK/unDAW/blob/main/Source/BKMusicWidgets/Private/SPianoRollGraph.cpp
It exists in a widget hierarchy I create myself though.
With Slate really everything can be customized by the implementer of the hierarchy so, it's hard to tell.
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)
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
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)
yes, UPROPERTY
are you "forgetting" to call Modify() on the UObject that you're modifying?
I don't know which UObject that would be, cause all the info exists in the FSurfaceGraphDetailsPanel class
I attach the custom details panel to the UObject on selection, but I want to store the info in the details panel if possible
the UObject stores serialized data, not the editor
aight I'll just wrap it with an editor macro then, thanks for the help
Damn that looks cool. Cpp slate is necasseary for such widgets or new editor utility widget + bp could do the same?
c++ slate, i would not want to attempt to make anything clean or complex with any bp tools
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
O_O
It's a slate of being.
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
that's not a family, it's a corporate org chart
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!
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
yes, there are different ways to do this, can you show like a slate code chunk you want to do something with?
i will only judge a little bit
my slate looks like a dead cat's butt until the 17th iteration too
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
oh ok lol. Well ask away if you need to. Did you figure out like sassignnew, and using ->AddSlot(...) stuff?
[ 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
This is where one way is to save the parent X/Ybox to a class member (sassignnew) and then call addslot in a loop
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:
have you set breakpoints in your slate widget functions? in Construct, and in OnFocusReceived, to see if they are even getting called at all?
how good are you with your debugger?
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
ah, sure (and i think i may have misunderstood on first read - looks like you said your focus is working but everything else stopped)
Right now it's at a stage where some visual stuff stopped working in-editor and all native delegates don't work as well. Managed to bring back some visuals as well as hook up the new delegates. I still feel like I lost more stuff than I gained so far :/
if commonui provides a solution great, if not just come back and say still working on this 😄
That's the plan 😄 Thank you!
slaters gonna slate
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.
I just always render them 1:1... Or maybe try for svg but I hate editing vector art
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
UE supports Slate Brushes from svg?
I reached level 30 and started zooming. Don't insult me.
Thanks, that sounds like a reasonable route. I think they are SVGs anyway and we exported them as PNG out of habit.
Godspeed
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.

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
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?
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 🤔
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.
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
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
SPanel if it needs children
Well, more accurately I guess, if it needs to arrange it's children
Got any idea what is #if WITH_ACCESSIBILITY?
I saw it bunch of times in widget code
it's self-explanatory, Engine contains extra functionality for accessibility(like screen reader). Obviously not every game needs it, so they wrapped some code with macro.
But that's the engine code. Like I can't recompile with/without that macro can I? (marketplace version)
UE can be built from sources (github)
Same way sources required for dedicated server build
I know but having such a feature forced or unavaliable on marketplace version doesn't sound very smart
Is it on by default?
IDK, why do you so bothered with it? Do your game lags? If so I doubt it's due to accessibility
raw templates like 3rd person one have good performance
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
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 🤔
extending directly looks kinda popular
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
Do you paint header? I mean SCompoundWidget calls paint for it's children. If you just constructed some SWidget inside Construct functions it doesn't make it renderable out of the box
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);
}
it's fine, it should work even with bare STreeView::FArguments() , at least every SWidget can declare default values for crucial args after SLATE_BEGIN_ARGS macro (C++ init list after C-tor)
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
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?
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)
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))```
heck it, negative padding it is
That looks sweeny
XD
i see what u did there
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
have you looked at how other simpler examples are made, like SBox? and other things with SLATE_DEFAULT_SLOT and SLATE_NAMED_SLOT ?
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.
But then UMG editor wouldn't work would it? Like adding childs, etc
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
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
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
So it just works by taking whatever you return from virtual FChildren* GetChildren() override ?
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)
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?)
The reason I want a custom one is I wanna have a custom transition to switch between widgets
It's simultaneous alpha change
You could use an soverlay for that. 😛
But, yes, you could customise widget switcher 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
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.
Yeah, That's what I want. Basically both old and new widgets become visible at the same time
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.
But how? WidgetSwitcher doesn't allow that kinda transition
Including common UI one
It's always a single widget visible. Not more
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.
Would UMG editor work with this approach
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.
Same answer. None of that is implemented in SPanel. It's all in the U-widget.
Cause you suggested I make widgetswitcher contained within another widget
How that would go
Oh
I see
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.
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);
};
Yeah, the sbox slot type is private. It's really annoying. Or one of them is. I can't remember which.
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
Right.
afaik it expects to be only created by defining as a member, so doesn't support that
MyBox->SetContent
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
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.
My thought was it has one, but it doesn't provide operator[], so I create a wrapper for it
To support this syntax
I decided fck it. I'll just go with SetContent
😛
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
- official docs https://dev.epicgames.com/documentation/en-us/unreal-engine/slate-user-interface-programming-framework-for-unreal-engine
- engine sources (examples of widgets)
- search in this discord server (1-2 keywords is optimal)
- UMG-Slate-Compendium https://github.com/YawLighthouse/UMG-Slate-Compendium
Thank you ^^
Am I allowed to shamelessly plug my own stuff? I'm not sure if this talk is any good but it's about starting with Slate:
https://www.youtube.com/watch?v=1n3oIfI7nBM&t=2m13s
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
Ben's videos literally made me stop being afraid of slate so, it does what it says on the box.
On the SBox*
i'm trying to make a child type of SExpandableArea, how would i pass the things for HeaderContent, BodyContent etc. to the parent?
chatgpt told me something along the lines
SExpandableArea::Construct(SExpandableArea::FArguments()
.HeaderPadding(FMargin(2, 4))
);
which seems to be correct?!
SLATE_ARGUMENT(SExpandableArea::FArguments, ParentArgs)
i guess that's only necessary when i want to expose the parent args, too. Right?
otherwise the Construct call might be sufficient?!
thanks 🙂 looks like it's working
^this is the way to do it yeah, it seems a bit weird but it is what it is
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"))
]
]
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
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 🥳
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
yea, that's what i'm used to from UMG, so guess most things from there translate 1:1 to slate
(obviously notautowidth is not a command, i just mean you don't write autowidth)
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
did you manage to get the widget reflector to see what those are?
the dropdown closes when i hit TakeSnapshot...
but i've figured now
they use their own menu builder
ah right.
for future: use the "hit test" button and keep the widget reflector visible off to the side
oh nice
i wonder if i should just use their widget or mess with their menu builder 🤔
the sheadingblock?
well teh menubuilder is good for... building a whole menu
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?!
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
ah yeah.
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 🤔
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
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 😄
37 more live codings and you'll have it fixed i'm confident
no wait, aren't you on linux
yea...
holy fuck man
seen my screenshot the other day?
with the 58 crashreports within one day? 😄
and that was just the crashes...
masochist
usually IDE is smart enough to avoid recompilation via ctrl + z at least rider does
yeah no thanks i'll take my 3 second iterations lol
(ok actually more like 6 second)
have to throw in like five entries of something and write them all different ways to see how each way differs
now i just gotta figure out how to handle the checkbox switch graceful
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 😛
So weird seeing other people besides Daekesh answer slate questions.
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 😄
Args.GetDeltaTime()
SWidget::Paint(const FPaintArgs& Args,
Or override tick, get the delta time from there, save it to your object, then refer to that delta time in your lambda...
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
did you try the .clipping settings? i think that in slate it actually works sometimes, unlike in UMG.
no. i would add it to the scrollbar?
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.
i had this issue before, afaik in a UMG widget, but i don't recall where
and somehow that clipping thing sounds familiar...
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.
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
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
Are there any best practices for type safety with SlateStyle? Relying on FName literals for Get/Set style entries looks weird 
"weird" is a strange way to spell completely fucking fucked tbh
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
Is there a reason to wrap whole definition into macro? Currently I'm thinking in a lazy way i.e. just moving names into consts
What is the difference between SCanvas and SConstraintCanvas?
UMG CanvasPanel uses SConstraintCanvas btw
So that I would only have top left anchor and no alignment, if I use SCanvas?
In terms of UMG canvas I mean 😄
never used regular SCanvas 
But that's the logical one, right? Like you'd expect it to happen
it still supports alignment
I guess it lacks flexibility for percent-based restriction area
No, like the alignment I'm talking about is the pivot of the widget
Like the value between 0 and 1
I guess so
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?
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.
what's the use case?
I would built logic on a higher level, like in actor/component etc 
If it's editor only you can always get one through GEditor/GEngine/GWorld/etc.
in general I don't like side effects in tick/paint etc
so on next-frame concept sounds weird to me
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.
@pulsar remnant btw check this out https://dev.epicgames.com/documentation/en-us/unreal-engine/slate-ui-sleeping-and-active-timers-in-unreal-engine
0.f means next frame (actually every frame, but callback returns EActiveTimerReturnType::Stop)
inline example (lambda)
mentioned approach is editor-only
What are prerequisites to capture data for Slate Frame View? Mine is always empty 
https://dev.epicgames.com/documentation/en-us/unreal-engine/slate-insights-in-unreal-engine#slateframeview
tried to use -trace=slate in Lyra project
Solved: I had to click to some bar (select frame), while previously I tried selection via ruler (2nd screenshot) 
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.
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).
Are you releasing the resouces in ReleaseSlateResources ?
How can I do this in blueprints?
@grave hatch to use this I should do "remove from parent"?
And when this should be called?
I asked there also
Are xxx (xyz) your project's widgets or default ones?
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.
Looks like it contains memory leaks.
According to engine sources, mentioned error occur as a result of simulation test which
- creates temp widget hierarchy
- "kills" root widget
- 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

screenshot 2
@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?
any strong references to child widgets e.g. TSharedRef(C++)
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
saves ref to provided param (shares ownership).
It is a 100% blueprint based framework, so no c++
@paper gale
The issued widget is Overlay (Engine site) or the Parent which is a widget from class Border (Engine)
How do you deduced that? 
are you C++ dev?
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
you can put breakpoint to line where error is printed and inspect stuff
to check what child is leaked
WidgetBlueprint.cpp ~830 line
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:
though it may lack info in non debug build
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)
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 have no time to dig into other bugs. If you want to investigate bug about memory leak, then follow mentioned advice
screenshot of mentioned lines for breakpoint
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
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?
yougottabeshittingme if that's true then instanced structs would be trash to me...
Are you hitting that early return?
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
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!
There's a "can customise" callback I'm sure.
And it'll check those callsbacks before using the default one.
I've done something quiet interesting 
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
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
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
Any idea where that might get called?
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.
Yeah I think its not possible without engine edits which is a massive bummer
virtual void RegisterCustomPropertyTypeLayout( FName PropertyTypeName, FOnGetPropertyTypeCustomizationInstance PropertyTypeLayoutDelegate, TSharedPtr<IPropertyTypeIdentifier> Identifier
It's that last parameter.
That's what I was going to try, but the roadblock I'm hitting is on the whole implementation of how i should overwrite it for instanced struct and how to set that all up and if that even actually works. I might try it out later but I sadly just don't have time and I can't find an example .
Thank you so much for the help though
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 💔
Every example in the engine just checks if the property being customisd has a meta tag 😂
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
Why not have individual settings?
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
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?
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.
Wild that there's no native USpliter
Going to have to port that over sometime
You mean there's no USplitter for umg?
rude, epic, rude
Very
Since Slate docs do not exists, nobody can discover such injustice 
It's the source code! 😂
wish there was an actual massive test suite that showed every widget instead of just a bunch of random common ones
Just need a good slate compendium.
idk if I've run across one.
widget reflector 
maybe it's just me, but i kinda feel like the widget reflector is almost useless for slate.
can't see / edit the values like you can for UMG widgets
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
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)
Then I'm doing it wrong.
are you referring to Starship suite as one that contains only common ones?
yeah
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.

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...
Was it actually something of importance?
Aaaaand this is what I get for cutting corners
https://gyazo.com/7302dcbf3fc601b41a1ab6997a632626.mp4
Fine slate you win I'll add another 400 lines of boilerplate
aren't those Google icons?
isnt it always?
that looks freaking awesome though, well worth giving in to the slate demons demands
yea
You're gonna have to apply for an epic mega grant at some point
that looks gorgeous
thanks (fishing for compliments is probably my primary source of motivation to keep going on this
)
fish away. I'm jelly (pun intended)
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
It will resize the entire column.
For me, it doesn't resize.. (video shows it)
does it mean I've constructed the widget incorrectly?
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.
Ohhh! Yes this is what I was missing, I was using STableRow instead of SMultiColumnTableRow..
I think that should solve this then!
Great!
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 😁
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
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.
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
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?
no way i bet i can do that in less than 2700 lines of code 
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
Nice ok. No scrolling needed, just 2 options. I also just discovered something called FMenuBuilder, could that help?
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
FMenuBuilder is the very old system.
You should investigate UToolMenus and UToolMenu.
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
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.
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
An actual level viewport? Or just a preview scene? (Like a static mesh preview)
i wanna make a level editor so i want a level viewport with a camera that i can fix to the right perspective and orientation
im making an RTS map editor and I want control over the view for a number of reasons. one i want a mirror tool, i want sort of a tilemap-esque system
suppose i could use the main level editor. but i'd still need a way to reference and control it
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.
can you use nomad tabs at runtime
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.
its an editor tool
Then why ask if yoiu can use nomad tabs at runtime?!
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
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.
Mm
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.
Yeah I'm aware of that. Phase 1 for me was to add constraints as to what CAN be done that was the thinking
You can do pretty much anything with the level editor.
There are hooks for everything if you know where to find them.
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
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.
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
All doable. You'll have to investigate the landscape editor yourself, though.
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
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!
Create an SLevelEditorViewport and see what happens.
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
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
"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.
beacause of im using widget blueprint in world canvas panel dont fit in viewport looks like in picture and cordinates are not matching
Make canvas to always fit viewport and calculate offset on your side instead.
how i will fit the canvas panel while its in the world
What are you expecting to see in that viewpoint?
The yellow box is the same size as the screen?
ah, it's world-based. project world to widget position is for ScreenSpace widgets iirc
How do you get initial point which you are trying to project to Canvas?
Camera-based direction for trace multiple can hit both you Canvas(or dummy collision box) and object behind it
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?
someone has mentioned once that you can get 3d widgets to always face camera via materials
anyone has the code for that?
i found this bit of code in the 4.27 docs
https://dev.epicgames.com/documentation/en-us/unreal-engine/stylized-rendering-materials?application_version=4.27
but it doesnt quite work in 5.4
Actually, it works, so...
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
probably only shows classes that are exposed to UE reflection or something
I'd expect that's the case.
Any idea why the SOverlays height and width is 0?
well, just looking at that... what do you think its width and height should be?
I would expect it to be the width and height of the parent, or at least the width and height of the items added into the TreeContainer.
... what do you think it's width and height should be?
Slate layouts are a nightmare.
overlays take in a VAlign/Halign arguments and one of the options is _fill
Yea sadly, I threw this layout away as of now.
but also in the example you provided you have an overlay inside an overlay, which might not help.
Yea might be true, I scratched it as of now. But what would you say overlay compared to a canvas?
what UI are you trying to make?
A skill tree
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.
But what I don't understand (and i tried setting both overlays to fill - it did not work). You are setting fill for the slot you add not the overlay itself so wouldn't then the slot take up the full width and height instead of the overlay itself.
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
)
VerticalBox and HorizontalBox is a good choice for most UI tasks
But if you want to freely align items on the x and y axis?
Maybe you need low level drawing i.e. OnPaint -> drawLine, drawBox etc but it depends on how complex your tree is
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
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 
Big brain maestro GPT to the rescue
https://chatgpt.com/share/67b0c059-7c38-8008-932e-2b1f4850214e
@toxic badger
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.
it takes a long time to get used to slate. in this case - the desired size of nothing will be nothing
if you wrap a thing in a container, that container can influence the size - SBox has width and height overrides for example
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
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
someone needs to take all those graph/panel widgets and sanitize them from editor only dependencies. one day.
Is there no UMG version for something like this? Someone asked me a while ago how to make a panning widget and I suggested just making it way large than the screen scale and doing movements on an image. Learning how to make something like this would be way better
I don't know 
Alright. That's too bad
Good find tho
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.
Could make the massive image allow drag and drop events too.
I've not rly looked into how those work
that's my zoomable/pannable piano roll; I also made a zoomable/pannable image viewer but it's in a different projet which I can't share.
This is cool
really you just use the ToPaintGeometry with the offsets and transforms
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
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.
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?
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'
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
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
this thing is proof that amirbk is a vampire. how many centuries have you been building this for
I'm just speechless honestly. Insane work
I actually completely lost motivation and haven't worked on it for 2-3 month, it makes me sad 😦
Also you're creating new segments I thought, but you're also populating it with the new notes that come into view
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.
Yeah that's what Einstein said
Get off your high horse and get on this moose
It's taller
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
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.
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.
Material labs is a huge help if you ever want to get into learning in that direction
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
At least you can schedule some action for next tick
though it takes infinity for settings page to open 
I guess you need some delegate
The real question is where would I find the proper way to force open the editor preferences and a certain category
well i've done the first one, and the second one, in two separate places for separate things
hang on
My hero!
widget reflector
Often doesn't tell me much unfortunately. Mostly just what kind of widget it is. Not rly where I can access it
this tiny little buttfaced plugin adds a button to the main editor top bar (sounds like roughly what you wanted for appearance) https://github.com/HomerJohnston/UE-EditorGCButton
it has link to Cpp file, sometimes it leads to useful spot, at least if Widget is unique enough
sometimes you have to look at the parent for unique one
recursively
Sometimes it just goes all the way up and says "this is Slate. Bet you didn't know that"
Lol
this code is how to make the editor open the project settings pane to a specific section
https://github.com/HomerJohnston/UE-Yap/blob/main/Source/YapEditor/Private/YapEditor/Globals/YapEditorFuncs.cpp#L23
SettingsModule->ShowViewer("Project", "Yap", FName(UYapDeveloperSettings::StaticClass()->GetName()))
That sounds perfect.
more info re. that function:
#cpp message
Thanks mate
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 
do you think i should have this button in my module interface class or my DeveloperSettings class?
and setting open func
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
(it's obviously not quite that bad but it's still pretty bad)
is it like pure static stuff?
yeah pretty much
it's just a global (globals usually bad, but for static fire-and-forgets, clean inside a namespace, meh)
ill just put it inside my module
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.
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
it's ok, it's merely a class that is inheriting from a template of itself 
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
it was created! it was created about 8 alphanumeric characters before the template is encountered 
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.
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?
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
why are you scoping these like this?
is there a reason or just because?
like the bracketing
i didn't write this code actually, epic did - but that extra scope looks useless here
ic
most of this was from one of the aforementioned new plugin templates
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.
wait let me fire up the old unreal to take a screenshot
like, is there a transform property that doesnt have them in the details panel?
So this default level editor 'gizmo' thingie right here -
In my custom editor mode it gets disabled -
oh ic. interesting
in modes that use the older FModeToolkit (or whatever) modes they're enabled -
i have no idea tbh. i dont even know where those are created
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.
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?
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
What's your approach to figure that out? First thing that came to my mind is to use "condition address-breakpoints" from widget reflector to check what determines enabled/disabled state of the button, then classic "Find Everywhere" or "Find usages" via IDE 
Haven't used address-breakpoints btw, just plain widget reflector navigation feature 
Thank you. So... do you know what is happening that makes it so those buttons are saved when created, but not when deleted?
As a quick check, I made a new random button just now. It persists across sessions with no code editing, but can't be deleted across sessions with no code editing.
Thanks, but these are all 'F' editor modes, not 'U' editor modes, when I try to override this method in my UEdMode it doesn't exist 😦
It's not a part of the UEdMode Interface

implement both, though I never used custom modes, so IDK what burden it gives you besides requirement to implement bool UsesTransformWidget() @pallid gyro
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
idk what that is
np, thanks anyway.
Seems super hard to google this issue
google is a blank slate when it comes to Slate
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.
@pallid gyro have you solved UEdMode challenge?
nope, the ILegacyEdMode interface has a ton of pure virtuals I'll need to implement first, decided it's not worth it right now
o3 Mini is actually kinda goated. it hasnt given me a single non functional result, or lied to me about things.
asking followups also leads to new answers instead of just going in complete circles.
still needs some work usually to find the right question, and then adapt the results to your needs, but its rly quite good.
Success!!!
This is 100% Epic's fault, an incomprehensible mess, really.
Don't extend UEdMode, instead extend UBaseLegacyWidgetEdMode
I was convinced this was intentional and that there was some way to 'enable' the gizmo from the tool.
I think there's an interface you extend from for the extra gizmo stuff?
The legacy one implements it.
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
Yes? Put an image on the button and use a slate brush.
images are one of the things that weren't rly changed from slate to UMG. UWidgets still use FSlateBrushes for everything
I meant FSlateIcon
does FSlateIcon use an FSlateBrush?
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
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
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
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
FSlateIcons resolve to an FSlateBrush with the GetIcon() method, it seems
Thanks, I will try that
For UI icons my absolute favorite l33t trick is to use one of them UI icon true type fonts. something like this - https://github.com/Semantic-Org/UI-Icon
not that anyone asked!
i dont rly get how this works. icons.ttf seems to be FontAwesome, which is what slate already has. idk what the .woff extension is and such.
how is this used
you apply the font to some text box and then just insert the unicode for the glyph you want as text
like for rich textblocks?
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
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)
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
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
SDF is a combination of letters that scares me.
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
you can convert fonts to multichannel sdf with a tool on github, its excellent because of quality and size
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
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?
ill see if i can figure out how to extract the graph position of the nodes. thats a possible idea
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.
i dont see it looking through the base class for that. it might be in a method or something. ill look more closely later
true
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.
YOOOO dude. thanks for telling me about this
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
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.
ill start diving into it tomorrow
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
APlayerController::HitResultTraceDistance
Is there some way to get a primitive convex render geometry of a text widget? Like a geometrical shape the text covers
I don't think there's something out-of-the-box but probably the 3d text renderer component might have some relevant starting points
The motion design 3d text actor has some improvements on that too.
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
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.
alright thanks, ill take a look at that.
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.
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.
ok i cant get these demos to work at all. idk, ill just go blind
The git repo uses large file storage. I'm guessing you downloaded the pointers to the files and not the files themselves.
Git lfs feels like something from some ancient past.
i downloaded the project and separately downloaded the content and put the actual plugin and Flakes into it
all from the same version
mmm. going blind isnt working well.
can you write a summary for how to properly use the demo project? if i do a clone of the repo instead of downloading the files, will that get everything properly?
Indeed
ok ill do that then
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
Do you have an ssh key tied to your github account?
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