From 1627d083144bf5eb139b2707347a6add23e95308 Mon Sep 17 00:00:00 2001 From: Kevin Poretti Date: Sat, 2 Apr 2022 23:13:12 -0400 Subject: [PATCH] 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 --- .../Protagonist/BP_NewProtag.uasset | 3 - .../Protagonist/BP_Protagonist.uasset | 3 + .../Core/GameModes/BP_TestGameMode.uasset | 4 +- .../Private/States/SNGStateMachineEditor.cpp | 182 +++++++++--------- .../Private/States/SNGStateMachineFactory.cpp | Bin 1366 -> 665 bytes .../States/SNGStateMachineTypeActions.cpp | Bin 2658 -> 1294 bytes .../Public/States/SNGStateMachineEditor.h | 86 ++++----- .../Public/States/SNGStateMachineFactory.h | Bin 1154 -> 553 bytes .../States/SNGStateMachineTypeActions.h | Bin 1526 -> 1530 bytes 9 files changed, 139 insertions(+), 139 deletions(-) delete mode 100644 SwordNGun/Content/Characters/Protagonist/BP_NewProtag.uasset create mode 100644 SwordNGun/Content/Characters/Protagonist/BP_Protagonist.uasset diff --git a/SwordNGun/Content/Characters/Protagonist/BP_NewProtag.uasset b/SwordNGun/Content/Characters/Protagonist/BP_NewProtag.uasset deleted file mode 100644 index 996d2a0..0000000 --- a/SwordNGun/Content/Characters/Protagonist/BP_NewProtag.uasset +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:2c94c2b19a500d64a8cd53a60e8035a54dd0d9c431c2fd9f381527c342cdf787 -size 181878 diff --git a/SwordNGun/Content/Characters/Protagonist/BP_Protagonist.uasset b/SwordNGun/Content/Characters/Protagonist/BP_Protagonist.uasset new file mode 100644 index 0000000..a3ff0b0 --- /dev/null +++ b/SwordNGun/Content/Characters/Protagonist/BP_Protagonist.uasset @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:99d29dfd5a4e6243b43f5e9ce5135aaad50b7d4afcef18be4794cee2a7bbbba9 +size 173797 diff --git a/SwordNGun/Content/Core/GameModes/BP_TestGameMode.uasset b/SwordNGun/Content/Core/GameModes/BP_TestGameMode.uasset index 7652b31..f327d43 100644 --- a/SwordNGun/Content/Core/GameModes/BP_TestGameMode.uasset +++ b/SwordNGun/Content/Core/GameModes/BP_TestGameMode.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f8271a597c08b1f383e260f699ac637e759a2edfb0802a06874c5ab1140fe154 -size 18459 +oid sha256:d55866ffecf2601a39117b8f6681b8eb864790ce041870ef2eefec5d4b16d453 +size 18463 diff --git a/SwordNGun/Source/SwordNGunEditor/Private/States/SNGStateMachineEditor.cpp b/SwordNGun/Source/SwordNGunEditor/Private/States/SNGStateMachineEditor.cpp index 057461d..2e51ef5 100644 --- a/SwordNGun/Source/SwordNGunEditor/Private/States/SNGStateMachineEditor.cpp +++ b/SwordNGun/Source/SwordNGunEditor/Private/States/SNGStateMachineEditor.cpp @@ -1,91 +1,91 @@ -#include "States/SNGStateMachineEditor.h" - -#define LOCTEXT_NAMESPACE "SNGStateMachineEditor" - -const FName SNGStateMachineEditorAppName = FName(TEXT("SNGStateMachineEditorAppName")); - -void FSNGStateMachineEditor::RegisterTabSpawners(const TSharedRef& InTabManager) -{ - /* - WorkspaceMenuCategory = TabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_SNGStateMachineEditor", "SNG State Machine Editor")); - TSharedRef 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& 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& 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& InTabManager) +{ + /* + WorkspaceMenuCategory = TabManager->AddLocalWorkspaceMenuCategory(LOCTEXT("WorkspaceMenu_SNGStateMachineEditor", "SNG State Machine Editor")); + TSharedRef 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& 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& InitToolkitHost, USNGStateMachine* StateMachine) +{ + StateMachineEdited = StateMachine; + //FAssetEditorToolkit::InitAssetEditor(Mode, InitToolkitHost, SNGStateMachineEditorAppName, , true, true, StateMachine); +} + + diff --git a/SwordNGun/Source/SwordNGunEditor/Private/States/SNGStateMachineFactory.cpp b/SwordNGun/Source/SwordNGunEditor/Private/States/SNGStateMachineFactory.cpp index ea6d91739424f0cd4f6a38eca9bc631c47192d7a..d3f5bf836797736e92420a9b50feff129d53327e 100644 GIT binary patch literal 665 zcmb7C+fKqj5PfF9VuA^2Nh8W*Q4`ZpLX1eP#7DEVBdpe4GM$Qe`5=G8FLT>sjes%k z!|r6}%$zeP+v&iV%pJxI(b7-?Eg0k)0<&0=n#~zL-l2QYJ%lrSR2s&HkXZ?_r*xd= z2|_bs$(VJb(V&dZWjt3JLm9K7)&9KsC$zwb$?ksN|E1u>MrRD+#k9~q)QXi%)iY8H zwoj_BxgtMMKq=Xpz6>air$>_Iq^4`>m^<3Yb72~#=C zpu9Z+|35WPU^L@XK@%b-QyJf{Gi|t*q+M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void UnregisterTabSpawners(const TSharedRef& 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& InitToolkitHost, USNGStateMachine* StateMachine); - -private: - /** State machien being edited */ - USNGStateMachine* StateMachineEdited; - - /** Graph Editor */ - TSharedPtr 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& InTabManager) override; + virtual void UnregisterTabSpawners(const TSharedRef& 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& InitToolkitHost, USNGStateMachine* StateMachine); + +private: + /** State machien being edited */ + USNGStateMachine* StateMachineEdited; + + /** Graph Editor */ + TSharedPtr GraphEditorView; + + +}; diff --git a/SwordNGun/Source/SwordNGunEditor/Public/States/SNGStateMachineFactory.h b/SwordNGun/Source/SwordNGunEditor/Public/States/SNGStateMachineFactory.h index f52547015bd150bab53c1d49d944ab14d663544d..99ff57ac31410bdfae9af4d7fb5d66a3978a26d3 100644 GIT binary patch literal 553 zcmZ`#(N4lJ6n$R5;sz74EyO905Fc=CNR&aGi}A^n?q*a=OS%H0@q_#gzszpK2vHx} z-h1vj=ic5RfSFcL$PA=grE_S*Xe}XBtDWY>!ocSTbkDlyaE%)-VWu=1!wETAX<95P zD9O-fTr#oF5n7qlNJW&NE?Ng@Xk`;F`I3s`LQI)anqwI>(eAjMCZp6)gA>XYT;eyU zK#AJIbr%x&J^>%>2}l;+4ARuS;yH$vP}JTR?sQ)L(DMirv@9X}+ZTGUTF(V%knKB> zH{y(F~kz2x&+?;t=N_CzmN%8i<>|W62Gtg1@3}!!O9|S4JDI&6*0x znz|4B2|~M0g9&ckEUaetVJz#Q^FtlW8PzCF2jYY-(K4#1LmVe+++snC66*Uv7Ak4* drBcO+`JA%nJ>tVX)zSmCL9Oj3`{cb(z5u#Xx2ymF literal 1154 zcmb7@TTk0S6oltBNc;y2q>5CiY5NG`p$!Q|v=9*@#1nFY70ks&4wnMz58_X@e6ulO zqf`o&wf64Wb7tmT{P#~o4JGQR)K8r$(?HjpySn3C>V*9})|PHm@NHtf(mgl1hB^(t zPuM@}BkL2p9WZXWwRb0AWO!X;S=2&U%OI3WiNEBX;8VbwMfZ*#=mO3Y?1`4t!&0(O zv9_>&fP1MzoAtIzd;bVJ^1yR3C#DUyb9ZD;?1;L=w);8pUF}k(E(j^h+{QZ%3bGlb zAsz+Gb+C7wk?YjZdmir+zR6_Q2)iDA_^vOob+w{zaJWv*3T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