From abca961ff0874dfa22faae5bed18ef0b39a1c72a Mon Sep 17 00:00:00 2001 From: Arnaud Jamin Date: Fri, 13 Oct 2023 10:48:10 -0400 Subject: [PATCH] remove generated files --- .../CogWindow_Settings.cpp | 102 ---------- .../CogWindow.cpp | 174 ------------------ 2 files changed, 276 deletions(-) delete mode 100644 enc_temp_folder/429ace6029d82fe59d8569151e8ccf24/CogWindow_Settings.cpp delete mode 100644 enc_temp_folder/82d8d8399af843a93de4bae55a9b0/CogWindow.cpp diff --git a/enc_temp_folder/429ace6029d82fe59d8569151e8ccf24/CogWindow_Settings.cpp b/enc_temp_folder/429ace6029d82fe59d8569151e8ccf24/CogWindow_Settings.cpp deleted file mode 100644 index 1aa9990..0000000 --- a/enc_temp_folder/429ace6029d82fe59d8569151e8ccf24/CogWindow_Settings.cpp +++ /dev/null @@ -1,102 +0,0 @@ -#include "CogWindow_Settings.h" - -#include "CogImguiModule.h" -#include "InputCoreTypes.h" - -//-------------------------------------------------------------------------------------------------------------------------- -UCogWindow_Settings::UCogWindow_Settings() -{ - bHasMenu = false; - ToggleInputKey.Key = EKeys::Tab; -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow_Settings::PostInitProperties() -{ - Super::PostInitProperties(); - - if (ToggleInputKey.Key != EKeys::Invalid) - { - FCogImguiModule::Get().SetToggleInputKey(ToggleInputKey); - } -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow_Settings::RenderContent() -{ - ImGui::Checkbox("Compact Mode", &GetOwner()->bCompactMode); - - ImGui::Checkbox("Show Windows In Main Menu", &GetOwner()->bShowWindowsInMainMenu); - - ImGui::Checkbox("Show Window Help", &GetOwner()->bShowHelp); - - FCogWindowWidgets::SetNextItemToShortWidth(); - ImGui::SliderFloat("DPI Scale", &GetOwner()->DPIScale, 0.5f, 2.0f, "%.1f"); - if (ImGui::IsItemDeactivatedAfterEdit()) - { - GetOwner()->bRefreshDPIScale = true; - } - - if (ImGui::IsItemHovered()) - { - ImGui::BeginTooltip(); - ImGui::TextUnformatted("Change DPi Scale [Mouse Wheel]"); - ImGui::TextUnformatted("Reset DPi Scale [Middle Mouse]"); - ImGui::EndTooltip(); - } - - ImGui::Separator(); - - ImGui::Text("Toggle Input Key"); - - TArray Keys; - EKeys::GetAllKeys(Keys); - - bool HasKeyChanged = false; - FCogWindowWidgets::SetNextItemToShortWidth(); - if (ImGui::BeginCombo("Key", TCHAR_TO_ANSI(*ToggleInputKey.Key.ToString()))) - { - for (int32 i = 0; i < Keys.Num(); ++i) - { - const FKey Key = Keys[i]; - if (Key.IsDigital() == false || Key.IsDeprecated()) - { - continue; - } - - bool IsSelected = ToggleInputKey.Key == Key; - if (ImGui::Selectable(TCHAR_TO_ANSI(*Key.ToString()), IsSelected)) - { - ToggleInputKey.Key = Key; - HasKeyChanged = true; - } - } - ImGui::EndCombo(); - } - - FCogWindowWidgets::SetNextItemToShortWidth(); - HasKeyChanged |= FCogWindowWidgets::ComboboxEnum("Ctrl", ToggleInputKey.Ctrl); - - FCogWindowWidgets::SetNextItemToShortWidth(); - HasKeyChanged |= FCogWindowWidgets::ComboboxEnum("Shift", ToggleInputKey.Shift); - - FCogWindowWidgets::SetNextItemToShortWidth(); - HasKeyChanged |= FCogWindowWidgets::ComboboxEnum("Alt", ToggleInputKey.Alt); - - FCogWindowWidgets::SetNextItemToShortWidth(); - HasKeyChanged |= FCogWindowWidgets::ComboboxEnum("Cmd", ToggleInputKey.Cmd); - - if (HasKeyChanged) - { - FCogImguiModule::Get().SetToggleInputKey(ToggleInputKey); - } - - ImGui::Separator(); - - ImGui::Spacing(); - ImGui::Spacing(); - if (ImGui::Button("Reset All Windows Config")) - { - GetOwner()->ResetAllWindowsConfig(); - } -} diff --git a/enc_temp_folder/82d8d8399af843a93de4bae55a9b0/CogWindow.cpp b/enc_temp_folder/82d8d8399af843a93de4bae55a9b0/CogWindow.cpp deleted file mode 100644 index 89f5441..0000000 --- a/enc_temp_folder/82d8d8399af843a93de4bae55a9b0/CogWindow.cpp +++ /dev/null @@ -1,174 +0,0 @@ -#include "CogWindow.h" - -#include "CogDebugDraw.h" -#include "CogDebugSettings.h" -#include "CogWindowManager.h" -#include "CogWindowWidgets.h" -#include "Engine/World.h" -#include "imgui_internal.h" - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow::SetFullName(const FString& InFullName) -{ - FullName = InFullName; - - TArray Path; - int CharIndex = 0; - if (FullName.FindLastChar(TEXT('.'), CharIndex)) - { - Name = FullName.RightChop(CharIndex + 1); - } - else - { - Name = FullName; - } - - ID = ImHashStr(TCHAR_TO_ANSI(*FullName)); -} - -//-------------------------------------------------------------------------------------------------------------------------- -bool UCogWindow::CheckEditorVisibility() -{ - const UWorld* World = GetWorld(); - if (World == nullptr) - { - return false; - } - - if (World->WorldType != EWorldType::Game) - { - return false; - } - - if (World->WorldType == EWorldType::PIE) - { - return false; - } - - return true; -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow::Render(float DeltaTime) -{ - ImGuiWindowFlags WindowFlags = 0; - PreRender(WindowFlags); - - const FString WindowTitle = GetTitle() + "##" + Name; - - if (bHasMenu && bHideMenu == false) - { - WindowFlags |= ImGuiWindowFlags_MenuBar; - } - - if (ImGui::Begin(TCHAR_TO_ANSI(*WindowTitle), &bIsVisible, WindowFlags)) - { - if (Owner->GetShowHelp()) - { - if (ImGui::IsItemHovered()) - { - ImGui::PushStyleColor(ImGuiCol_PopupBg, IM_COL32(29, 42, 62, 240)); - const float HelpWidth = FCogWindowWidgets::GetFontWidth() * 80; - ImGui::SetNextWindowSizeConstraints(ImVec2(HelpWidth / 2.0f, 0.0f), - ImVec2(HelpWidth, FLT_MAX)); - if (ImGui::BeginTooltip()) - { - ImGui::PushTextWrapPos(HelpWidth - 1 * FCogWindowWidgets::GetFontWidth()); - RenderHelp(); - ImGui::PopTextWrapPos(); - ImGui::EndTooltip(); - } - ImGui::PopStyleColor(); - } - } - - if (ImGui::BeginPopupContextWindow()) - { - if (bHasMenu) - { - ImGui::Checkbox("Hide Menu", &bHideMenu); - - if (ImGui::Button("Reset")) - { - ResetConfig(); - } - } - ImGui::EndPopup(); - } - - RenderContent(); - ImGui::End(); - } - - PostRender(); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow::RenderHelp() -{ - ImGui::Text("No help available."); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow::RenderTick(float DeltaTime) -{ - SetSelection(FCogDebugSettings::GetSelection()); -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow::GameTick(float DeltaTime) -{ -} - -//-------------------------------------------------------------------------------------------------------------------------- -void UCogWindow::SetSelection(AActor* NewSelection) -{ - if (CurrentSelection == NewSelection) - { - return; - } - - AActor* OldActor = CurrentSelection.Get(); - - CurrentSelection = NewSelection; - OnSelectionChanged(OldActor, NewSelection); -} - -//-------------------------------------------------------------------------------------------------------------------------- -APawn* UCogWindow::GetLocalPlayerPawn() -{ - APlayerController* LocalPlayerController = GetLocalPlayerController(); - - if (LocalPlayerController == nullptr) - { - return nullptr; - } - - APawn* Pawn = LocalPlayerController->GetPawn(); - - return Pawn; -} - -//-------------------------------------------------------------------------------------------------------------------------- -APlayerController* UCogWindow::GetLocalPlayerController() -{ - ULocalPlayer* LocalPlayer = GetLocalPlayer(); - if (LocalPlayer == nullptr) - { - return nullptr; - } - - return LocalPlayer->PlayerController; -} - -//-------------------------------------------------------------------------------------------------------------------------- -ULocalPlayer* UCogWindow::GetLocalPlayer() -{ - const UWorld* World = GetWorld(); - if (World == nullptr) - { - return nullptr; - } - - return World->GetFirstLocalPlayerFromController(); -}