目录
Slate基础使用说明
1. 简单教程
2. 要点说明
2.1 TCommands以及TCommands基类
2.2 FUICommandInfo
2.3 FUICommandList
2.4 FUIAction
2.5 UICommand
3. 代码源码
4. 工具使用
4.1 Display Ul Extension Points
4. 参考文章
Slate基础使用说明
1. 简单教程
2. 要点说明
2.1 TCommands以及TCommands基类
/** A base class for a set of commands. Inherit from it to make a set of commands. See MainFrameActions for an example. */
template<typename CommandContextType>
class TCommands : public FBindingContext
/*** Represents a context in which input bindings are valid*/
class SLATE_API FBindingContext: public TSharedFromThis<FBindingContext>
2.2 FUICommandInfo
private:/** Input commands that executes this action */TArray<TSharedRef<FInputChord>> ActiveChords;/** Default display name of the command */FText Label;/** Localized help text for this command */FText Description;/** The default input chords for this command (can be invalid) */TArray<FInputChord> DefaultChords;/** Brush name for icon to use in tool bars and menu items to represent this command */FSlateIcon Icon;/** Brush name for icon to use in tool bars and menu items to represent this command in its toggled on (checked) state*/FName UIStyle;/** Name of the command */FName CommandName;/** The context in which this command is active */FName BindingContext;/** The bundle to group this command into. The bundle must have been added to the BindingContext first. */FName Bundle;/** The type of user interface to associated with this action */EUserInterfaceActionType UserInterfaceType;/** True if should we use long names for when getting text for input chords */bool bUseLongDisplayName;
2.3 FUICommandList
class SLATE_API FUICommandList: public TSharedFromThis<FUICommandList>
2.4 FUIAction
/*** Implements an UI action.*/
struct SLATE_API FUIAction
{/** Holds a delegate that is executed when this action is activated. */FExecuteAction ExecuteAction;/** Holds a delegate that is executed when determining whether this action can execute. */FCanExecuteAction CanExecuteAction;/** Holds a delegate that is executed when determining the check state of this action. */FGetActionCheckState GetActionCheckState;/** Holds a delegate that is executed when determining whether this action is visible. */FIsActionButtonVisible IsActionVisibleDelegate;/** Can this action can be repeated if the chord used to call it is held down? */EUIActionRepeatMode RepeatMode;
2.5 UICommand
#define UI_COMMAND( CommandId, FriendlyName, InDescription, CommandType, InDefaultChord, ... ) \
3. 代码源码
4. 工具使用
4.1 Display Ul Extension Points
4. 参考文章
https://docs.unrealengine.com/5.2/zh-CN/slate-editor-window-quickstart-guide-for-unreal-engine/
观察UE4的界面命令(UICommand)扩展编辑器界面的流程并实践_ue4 查看编辑器界面一些功能的函数流程_YakSue的博客-CSDN博客
(UE4 4.21 ) UE4给编辑器添加菜单栏(Menu),工具栏(TooBar),Tab窗口_ue4左侧工具栏怎么打开_带帯大师兄的博客-CSDN博客
TCommands用法 - 知乎
《调教UE5:编辑器拓展指南》Command 探索 - 知乎
UE4-注册UI菜单的套路以及尝试将工具类蓝图动态注册进UI - 知乎