Fix this file encoding bullshit hopefully once and for all and get a commit where the state machine asset can be opened without crashing the editor

This commit is contained in:
Kevin Poretti 2022-04-02 23:13:12 -04:00
parent 965322a4ae
commit 1627d08314
9 changed files with 139 additions and 139 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,91 +1,91 @@
#include "States/SNGStateMachineEditor.h"
#define LOCTEXT_NAMESPACE "SNGStateMachineEditor"
const FName SNGStateMachineEditorAppName = FName(TEXT("SNGStateMachineEditorAppName"));
void FSNGStateMachineEditor::RegisterTabSpawners(const TSharedRef<FTabManager>& InTabManager)
{
/*
WorkspaceMenuCategory = TabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_SNGStateMachineEditor", "SNG State Machine Editor"));
TSharedRef<FWorkspaceItem> WorkspaceMenuCatRef = WorkspaceMenuCategory.ToSharedRef();
FAssetEditorToolkit::RegisterTabSpawners(TabManager);
TabManager->RegisterTabSpawner(GraphCanvasTabId, )
.SetDisplayName(LOCTEXT("GraphCanvasTab", "Graph"))
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "GraphEditor.EventGraph_16x"));
TabManager->RegisterTabSpawner(PropertiesTabId, FOnSpawnTab::CreateSP(this, &FSoundSubmixEditor::SpawnTab_Properties))
.SetDisplayName(LOCTEXT("PropertiesTab", "Details"))
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Details"));\
*/
}
void FSNGStateMachineEditor::UnregisterTabSpawners(const TSharedRef<FTabManager>& InTabManager)
{
IStateMachineEditor::UnregisterTabSpawners(InTabManager);
}
FText FSNGStateMachineEditor::GetBaseToolkitName() const
{
return LOCTEXT("SNGStateMachineEditorAppLabel", "SNG State Machine Editor");
}
FText FSNGStateMachineEditor::GetToolkitName() const
{
const bool bDirtyState = StateMachineEdited->GetOutermost()->IsDirty();
/*
FFormatNamedArguments Args;
Args.Add(TEXT("StateMachineName", FText::FromString(StateMachineEdited->GetName())));
Args.Add(TEXT("DirtyState"), bDirtyState ? FText::FromString("*") : FText::GetEmpty());
return FText::Format(LOCTEXT("SNGStateMachineEditorToolkitName", "{StateMachineName}{DirtyState}"), Args);
*/
return FText::FromString(StateMachineEdited->GetName());
}
FText FSNGStateMachineEditor::GetToolkitToolTipText() const
{
return IStateMachineEditor::GetToolkitToolTipText();
}
FLinearColor FSNGStateMachineEditor::GetWorldCentricTabColorScale() const
{
return FLinearColor::Blue;
}
FString FSNGStateMachineEditor::GetWorldCentricTabPrefix() const
{
return FString("NOT IMPLEMENTED");
}
FString FSNGStateMachineEditor::GetDocumentationLink() const
{
return IStateMachineEditor::GetDocumentationLink();
}
void FSNGStateMachineEditor::SaveAsset_Execute()
{
FAssetEditorToolkit::SaveAsset_Execute();
}
void FSNGStateMachineEditor::SaveAssetAs_Execute()
{
IStateMachineEditor::SaveAssetAs_Execute();
}
void FSNGStateMachineEditor::FocusWindow(UObject* ObjectToFocusOn)
{
BringToolkitToFront();
//JumpToObject
}
void FSNGStateMachineEditor::InitStateMachineEditor(const EToolkitMode::Type Mode,
const TSharedPtr<IToolkitHost>& InitToolkitHost, USNGStateMachine* StateMachine)
{
StateMachineEdited = StateMachine;
//FAssetEditorToolkit::InitAssetEditor(Mode, InitToolkitHost, SNGStateMachineEditorAppName, , true, true, StateMachine);
}
#include "States/SNGStateMachineEditor.h"
#define LOCTEXT_NAMESPACE "SNGStateMachineEditor"
const FName SNGStateMachineEditorAppName = FName(TEXT("SNGStateMachineEditorAppName"));
void FSNGStateMachineEditor::RegisterTabSpawners(const TSharedRef<FTabManager>& InTabManager)
{
/*
WorkspaceMenuCategory = TabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_SNGStateMachineEditor", "SNG State Machine Editor"));
TSharedRef<FWorkspaceItem> WorkspaceMenuCatRef = WorkspaceMenuCategory.ToSharedRef();
FAssetEditorToolkit::RegisterTabSpawners(TabManager);
TabManager->RegisterTabSpawner(GraphCanvasTabId, )
.SetDisplayName(LOCTEXT("GraphCanvasTab", "Graph"))
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "GraphEditor.EventGraph_16x"));
TabManager->RegisterTabSpawner(PropertiesTabId, FOnSpawnTab::CreateSP(this, &FSoundSubmixEditor::SpawnTab_Properties))
.SetDisplayName(LOCTEXT("PropertiesTab", "Details"))
.SetGroup(WorkspaceMenuCategoryRef)
.SetIcon(FSlateIcon(FEditorStyle::GetStyleSetName(), "LevelEditor.Tabs.Details"));\
*/
}
void FSNGStateMachineEditor::UnregisterTabSpawners(const TSharedRef<FTabManager>& InTabManager)
{
IStateMachineEditor::UnregisterTabSpawners(InTabManager);
}
FText FSNGStateMachineEditor::GetBaseToolkitName() const
{
return LOCTEXT("SNGStateMachineEditorAppLabel", "SNG State Machine Editor");
}
FText FSNGStateMachineEditor::GetToolkitName() const
{
const bool bDirtyState = StateMachineEdited->GetOutermost()->IsDirty();
/*
FFormatNamedArguments Args;
Args.Add(TEXT("StateMachineName", FText::FromString(StateMachineEdited->GetName())));
Args.Add(TEXT("DirtyState"), bDirtyState ? FText::FromString("*") : FText::GetEmpty());
return FText::Format(LOCTEXT("SNGStateMachineEditorToolkitName", "{StateMachineName}{DirtyState}"), Args);
*/
return FText::FromString(StateMachineEdited->GetName());
}
FText FSNGStateMachineEditor::GetToolkitToolTipText() const
{
return IStateMachineEditor::GetToolkitToolTipText();
}
FLinearColor FSNGStateMachineEditor::GetWorldCentricTabColorScale() const
{
return FLinearColor::Blue;
}
FString FSNGStateMachineEditor::GetWorldCentricTabPrefix() const
{
return FString("NOT IMPLEMENTED");
}
FString FSNGStateMachineEditor::GetDocumentationLink() const
{
return IStateMachineEditor::GetDocumentationLink();
}
void FSNGStateMachineEditor::SaveAsset_Execute()
{
FAssetEditorToolkit::SaveAsset_Execute();
}
void FSNGStateMachineEditor::SaveAssetAs_Execute()
{
IStateMachineEditor::SaveAssetAs_Execute();
}
void FSNGStateMachineEditor::FocusWindow(UObject* ObjectToFocusOn)
{
BringToolkitToFront();
//JumpToObject
}
void FSNGStateMachineEditor::InitStateMachineEditor(const EToolkitMode::Type Mode,
const TSharedPtr<IToolkitHost>& InitToolkitHost, USNGStateMachine* StateMachine)
{
StateMachineEdited = StateMachine;
//FAssetEditorToolkit::InitAssetEditor(Mode, InitToolkitHost, SNGStateMachineEditorAppName, , true, true, StateMachine);
}

View File

@ -1,43 +1,43 @@
// Project Sword & Gun Copyright © 2021 Kevin Poretti
#pragma once
#include "CoreMinimal.h"
#include "IStateMachineEditor.h"
#include "States/SNGStateMachine.h"
#include "Toolkits/SimpleAssetEditor.h"
class FSNGStateMachineEditor : public IStateMachineEditor
{
public:
/** IToolkit Interface */
virtual void RegisterTabSpawners(const TSharedRef<FTabManager>& InTabManager) override;
virtual void UnregisterTabSpawners(const TSharedRef<FTabManager>& InTabManager) override;
virtual FText GetBaseToolkitName() const override;
virtual FText GetToolkitName() const override;
virtual FName GetToolkitFName() const override { return FName(TEXT("SNGStateMachineEditor")); }
virtual FText GetToolkitToolTipText() const override;
virtual FLinearColor GetWorldCentricTabColorScale() const override;
virtual FString GetWorldCentricTabPrefix() const override;
/** FAssetEditorToolkit interface */
virtual FString GetDocumentationLink() const override;
virtual bool CanSaveAsset() const override { return true; }
virtual bool CanSaveAssetAs() const override { return true; }
virtual void SaveAsset_Execute() override;
virtual void SaveAssetAs_Execute() override;
/** IAssetEditorInstance interface */
virtual void FocusWindow(UObject* ObjectToFocusOn = nullptr) override;
void InitStateMachineEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost>& InitToolkitHost, USNGStateMachine* StateMachine);
private:
/** State machien being edited */
USNGStateMachine* StateMachineEdited;
/** Graph Editor */
TSharedPtr<SGraphEditor> GraphEditorView;
};
// Project Sword & Gun Copyright © 2021 Kevin Poretti
#pragma once
#include "CoreMinimal.h"
#include "IStateMachineEditor.h"
#include "States/SNGStateMachine.h"
#include "Toolkits/SimpleAssetEditor.h"
class FSNGStateMachineEditor : public IStateMachineEditor
{
public:
/** IToolkit Interface */
virtual void RegisterTabSpawners(const TSharedRef<FTabManager>& InTabManager) override;
virtual void UnregisterTabSpawners(const TSharedRef<FTabManager>& InTabManager) override;
virtual FText GetBaseToolkitName() const override;
virtual FText GetToolkitName() const override;
virtual FName GetToolkitFName() const override { return FName(TEXT("SNGStateMachineEditor")); }
virtual FText GetToolkitToolTipText() const override;
virtual FLinearColor GetWorldCentricTabColorScale() const override;
virtual FString GetWorldCentricTabPrefix() const override;
/** FAssetEditorToolkit interface */
virtual FString GetDocumentationLink() const override;
virtual bool CanSaveAsset() const override { return true; }
virtual bool CanSaveAssetAs() const override { return true; }
virtual void SaveAsset_Execute() override;
virtual void SaveAssetAs_Execute() override;
/** IAssetEditorInstance interface */
virtual void FocusWindow(UObject* ObjectToFocusOn = nullptr) override;
void InitStateMachineEditor(const EToolkitMode::Type Mode, const TSharedPtr<IToolkitHost>& InitToolkitHost, USNGStateMachine* StateMachine);
private:
/** State machien being edited */
USNGStateMachine* StateMachineEdited;
/** Graph Editor */
TSharedPtr<SGraphEditor> GraphEditorView;
};