本文整理汇总了C++中GetEditorMode函数的典型用法代码示例。如果您正苦于以下问题:C++ GetEditorMode函数的具体用法?C++ GetEditorMode怎么用?C++ GetEditorMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetEditorMode函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GetEditorMode
void FLandscapeToolKit::Init(const TSharedPtr<IToolkitHost>& InitToolkitHost)
{
auto NameToCommandMap = FLandscapeEditorCommands::Get().NameToCommandMap;
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
TSharedRef<FUICommandList> CommandList = LandscapeEdMode->GetUICommandList();
#define MAP_MODE(ModeName) CommandList->MapAction(NameToCommandMap.FindChecked(ModeName), FUIAction(FExecuteAction::CreateSP(this, &FLandscapeToolKit::OnChangeMode, FName(ModeName)), FCanExecuteAction::CreateSP(this, &FLandscapeToolKit::IsModeEnabled, FName(ModeName)), FIsActionChecked::CreateSP(this, &FLandscapeToolKit::IsModeActive, FName(ModeName))));
MAP_MODE("ToolMode_Manage");
MAP_MODE("ToolMode_Sculpt");
MAP_MODE("ToolMode_Paint");
#undef MAP_MODE
#define MAP_TOOL(ToolName) CommandList->MapAction(NameToCommandMap.FindChecked("Tool_" ToolName), FUIAction(FExecuteAction::CreateSP(this, &FLandscapeToolKit::OnChangeTool, FName(ToolName)), FCanExecuteAction::CreateSP(this, &FLandscapeToolKit::IsToolEnabled, FName(ToolName)), FIsActionChecked::CreateSP(this, &FLandscapeToolKit::IsToolActive, FName(ToolName))));
MAP_TOOL("NewLandscape");
MAP_TOOL("ResizeLandscape");
MAP_TOOL("Sculpt");
MAP_TOOL("Paint");
MAP_TOOL("Smooth");
MAP_TOOL("Flatten");
MAP_TOOL("Ramp");
MAP_TOOL("Erosion");
MAP_TOOL("HydraErosion");
MAP_TOOL("Noise");
MAP_TOOL("Retopologize");
MAP_TOOL("Visibility");
MAP_TOOL("Select");
MAP_TOOL("AddComponent");
MAP_TOOL("DeleteComponent");
MAP_TOOL("MoveToLevel");
MAP_TOOL("Mask");
MAP_TOOL("CopyPaste");
MAP_TOOL("Mirror");
MAP_TOOL("Splines");
#undef MAP_TOOL
#define MAP_BRUSH_SET(BrushSetName) CommandList->MapAction(NameToCommandMap.FindChecked(BrushSetName), FUIAction(FExecuteAction::CreateSP(this, &FLandscapeToolKit::OnChangeBrushSet, FName(BrushSetName)), FCanExecuteAction::CreateSP(this, &FLandscapeToolKit::IsBrushSetEnabled, FName(BrushSetName)), FIsActionChecked::CreateSP(this, &FLandscapeToolKit::IsBrushSetActive, FName(BrushSetName))));
MAP_BRUSH_SET("BrushSet_Circle");
MAP_BRUSH_SET("BrushSet_Alpha");
MAP_BRUSH_SET("BrushSet_Pattern");
MAP_BRUSH_SET("BrushSet_Component");
MAP_BRUSH_SET("BrushSet_Gizmo");
#undef MAP_BRUSH_SET
#define MAP_BRUSH(BrushName) CommandList->MapAction(NameToCommandMap.FindChecked(BrushName), FUIAction(FExecuteAction::CreateSP(this, &FLandscapeToolKit::OnChangeBrush, FName(BrushName)), FCanExecuteAction(), FIsActionChecked::CreateSP(this, &FLandscapeToolKit::IsBrushActive, FName(BrushName))));
MAP_BRUSH("Circle_Smooth");
MAP_BRUSH("Circle_Linear");
MAP_BRUSH("Circle_Spherical");
MAP_BRUSH("Circle_Tip");
#undef MAP_BRUSH
LandscapeEditorWidgets = SNew(SLandscapeEditor, SharedThis(this));
FModeToolkit::Init(InitToolkitHost);
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:59,代码来源:SLandscapeEditor.cpp
示例2: GetEditorMode
void FLandscapeEditorDetails::OnChangeTool(FName ToolSetName)
{
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
if (LandscapeEdMode != NULL)
{
LandscapeEdMode->SetCurrentTool(ToolSetName);
}
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:8,代码来源:LandscapeEditorDetails.cpp
示例3: GetEditorMode
void FLandscapeEditorDetailCustomization_MiscTools::OnbUseAutoRotateControlPointChanged(ECheckBoxState NewState)
{
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
if (LandscapeEdMode)
{
LandscapeEdMode->SetbUseAutoRotateOnJoin(NewState == ECheckBoxState::Checked);
}
}
开发者ID:JustDo1989,项目名称:UnrealEngine4.11-HairWorks,代码行数:8,代码来源:LandscapeEditorDetailCustomization_MiscTools.cpp
示例4: GetEditorMode
FReply FLandscapeEditorDetailCustomization_CopyPaste::OnGizmoImportButtonClicked()
{
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
if (LandscapeEdMode != NULL)
{
ALandscapeGizmoActiveActor* Gizmo = LandscapeEdMode->CurrentGizmoActor.Get();
if (Gizmo)
{
TArray<uint8> Data;
FFileHelper::LoadFileToArray(Data, *LandscapeEdMode->UISettings->GizmoHeightmapFilenameString);
if (Data.Num() <= 0
|| Data.Num() != (LandscapeEdMode->UISettings->GizmoImportSize.X * LandscapeEdMode->UISettings->GizmoImportSize.Y * 2))
{
FMessageDialog::Open(EAppMsgType::Ok, NSLOCTEXT("UnrealEd", "LandscapeImport_BadHeightmapSize", "File size does not match"));
return FReply::Handled();
}
TArray<ULandscapeLayerInfoObject*> LayerInfos;
TArray<TArray<uint8> > LayerDataArrays;
TArray<uint8*> LayerDataPtrs;
for (int32 LayerIndex = 0; LayerIndex < LandscapeEdMode->UISettings->GizmoImportLayers.Num(); LayerIndex++)
{
const FGizmoImportLayer& Layer = LandscapeEdMode->UISettings->GizmoImportLayers[LayerIndex];
FString LayerName = Layer.LayerName.Replace(TEXT(" "), TEXT(""));
if (LayerName == TEXT(""))
{
FMessageDialog::Open(EAppMsgType::Ok,
FText::Format( NSLOCTEXT("UnrealEd", "LandscapeImport_BadLayerName", "You must enter a name for the layer being imported from {0}."), FText::FromString(Layer.LayerFilename) ));
return FReply::Handled();
}
if (Layer.LayerFilename != TEXT("") && !Layer.bNoImport)
{
TArray<uint8>* LayerData = new(LayerDataArrays)(TArray<uint8>);
FFileHelper::LoadFileToArray(*LayerData, *Layer.LayerFilename);
if (LayerData->Num() != (LandscapeEdMode->UISettings->GizmoImportSize.X * LandscapeEdMode->UISettings->GizmoImportSize.Y))
{
FMessageDialog::Open(EAppMsgType::Ok,
FText::Format( NSLOCTEXT("UnrealEd", "LandscapeImport_BadLayerSize", "Layer {0} file size does not match the heightmap resolution."), FText::FromString(Layer.LayerFilename) ));
return FReply::Handled();
}
LayerInfos.Add(LandscapeEdMode->CurrentToolTarget.LandscapeInfo->GetLayerInfoByName(FName(*LayerName)));
LayerDataPtrs.Add(&(*LayerData)[0]);
}
}
Gizmo->Import(LandscapeEdMode->UISettings->GizmoImportSize.X, LandscapeEdMode->UISettings->GizmoImportSize.Y, (uint16*)Data.GetTypedData(), LayerInfos, LayerDataPtrs.Num() ? LayerDataPtrs.GetTypedData() : NULL);
}
}
return FReply::Handled();
}
开发者ID:Tigrouzen,项目名称:UnrealEngine-4,代码行数:57,代码来源:LandscapeEditorDetailCustomization_CopyPaste.cpp
示例5: GetEditorMode
FReply FLandscapeSplineDetails::OnMoveToCurrentLevelButtonClicked()
{
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
if (LandscapeEdMode && LandscapeEdMode->CurrentToolTarget.LandscapeInfo.IsValid() && LandscapeEdMode->CurrentToolTarget.LandscapeInfo->GetCurrentLevelLandscapeProxy(true))
{
LandscapeEdMode->SplineMoveToCurrentLevel();
}
return FReply::Handled();
}
开发者ID:PopCap,项目名称:GameIdea,代码行数:10,代码来源:LandscapeSplineDetails.cpp
示例6: OnEventMouseEditor
bool Control::OnEventMouseEditor(Event event,WPARAM wparam,LPARAM lparam)
{
if(!GetEditorMode())
return false;
//
// TODO Implement control resizing/repositioning code
//
return false;
}
开发者ID:m1h4,项目名称:AudioAnalyzer,代码行数:11,代码来源:Control.cpp
示例7: GetEditorMode
FText FLandscapeEditorDetails::GetCurrentToolName() const
{
FEdModeLandscape* LandscapeEdMode = GetEditorMode();
if (LandscapeEdMode != NULL && LandscapeEdMode->CurrentTool != NULL)
{
const TCHAR* CurrentToolName = LandscapeEdMode->CurrentTool->GetToolName();
return GetLocalizedName(FString("ToolSet_") + CurrentToolName);
}
return LOCTEXT("Unknown", "Unknown");
}
开发者ID:PopCap,项目名称:GameIdea,代码行数:11,代码来源:LandscapeEditorDetails.cpp
注:本文中的GetEditorMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论