Hi,
My first post here and wanted to get feedback on how to proceed on modding the SlateViewer, later I would integrate into a real project these styles and layout.
I have looked at the ShooterGame & StrategyGame content they contain very useful information, but haven’t been able to achieve my goal.
Using the mentioned content, I have tried to change the style for the SpinBoxes as a starting point.
I created a new Style widget in the editor (not sure which path to use to store it because it is not a game, instead I want the resource to be used by an stand alone application, this might be changed later np).
For the STestSuite.cpp class I made this changes
void SRenderTransformManipulatorWidgetImpl::Construct(const FArguments& InArgs)
{
...
const FSpinBoxStyle* SpinBoxStyle = &FCoreStyle::Get().GetWidgetStyle<FSpinBoxStyle>("MySpinBoxWidgetStyleAsset");
...
SNew(SSpinBox<float>)
.MinValue(0.0f)
.MaxValue(360.0f)
.Style(Style)
.OnValueChanged_Static(](float val) { RotDeg = val; Rot = FQuat2D(FMath::DegreesToRadians(val)); })
.Value_Static(] { return RotDeg; })
But I think there is a missing step for the new style to be recognized, should probably create and register the new style (following the ShooterStyle.cpp example):
TSharedRef<FSlateGameResources> StyleRef = FSlateGameResources::New(FGameMenuBuilderStyle::GetStyleSetName(), "/Game/Items/UI");
FSlateStyleSet& Style = StyleRef.Get();
FSlateStyleRegistry::RegisterSlateStyle( *Style );
Then another header will need to be included
#include "SlateGameResources.h:"
This inclusion throws a compiling error, I guess from the SlateViewer application this header seems to be not accessible.
Is this one correct way to proceed with it?
How and where to store the new style widgets for applications like this?
Appreciate any help.