Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Plugins/Cog/Source/Cog/Private/CogWidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include "CogImguiHelper.h"
#include "CogImguiInputHelper.h"
#include "CogHelper.h"
#include "Editor.h"
#include "Components/PrimitiveComponent.h"
#include "EngineUtils.h"
#include "imgui.h"
Expand All @@ -17,6 +16,7 @@

#if WITH_EDITOR
#include "IAssetTools.h"
#include "Editor.h"
#include "Subsystems/AssetEditorSubsystem.h"
#endif

Expand Down Expand Up @@ -518,12 +518,13 @@ bool FCogWidgets::CheckBoxState(const char* Label, ECheckBoxState& State, bool S
//--------------------------------------------------------------------------------------------------------------------------
bool FCogWidgets::InputChord(const char* Label, FInputChord& InInputChord)
{
FString LabelStr = Label;
ImGui::PushID(Label);

ImGui::AlignTextToFramePadding();
ImGui::BeginDisabled();
ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15);
ImGui::InputText("##Shortcut", const_cast<char*>(Label), IM_ARRAYSIZE(Label));
ImGui::InputText("##Shortcut", const_cast<char*>(Label), IM_ARRAYSIZE(LabelStr));
ImGui::EndDisabled();

ImGui::SameLine();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ void FCogEngineWindow_Console::RenderCommandList()
const FString SelectedCommand = CommandList[SelectedCommandIndex];
const FString Help = GetConsoleCommandHelp(SelectedCommand);
const auto& HelpStr = StringCast<ANSICHAR>(*Help);
ImGui::TextWrapped(HelpStr.Get());
ImGui::TextWrapped("%s", HelpStr.Get());
}

ImGui::Unindent(Indent);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void FCogEngineWindow_Levels::RenderLevel(int32 InIndex, const FAssetData& InAss
}
}

ImGui::SetItemTooltip(StringCast<ANSICHAR>(*InAsset.PackageName.ToString()).Get());
ImGui::SetItemTooltip("%s", StringCast<ANSICHAR>(*InAsset.PackageName.ToString()).Get());

RenderLevelContextMenu(InIndex, InAsset);
}
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Cog/Source/ThirdParty/ImGui/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20677,7 +20677,7 @@ static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
{
return (INT_PTR)::ShellExecuteA(NULL, "open", path, NULL, NULL, SW_SHOWDEFAULT) > 32;
}
#else
#elif defined(__APPLE__) || defined(__linux__)
#include <sys/wait.h>
#include <unistd.h>
static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
Expand All @@ -20702,10 +20702,10 @@ static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char* path)
return WEXITSTATUS(status) == 0;
}
}
#endif
#else
static bool Platform_OpenInShellFn_DefaultImpl(ImGuiContext*, const char*) { return false; }
#endif // Default shell handlers
#endif

//-----------------------------------------------------------------------------

Expand Down
10 changes: 7 additions & 3 deletions Plugins/Cog/Source/ThirdParty/ImPlot/implot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -911,7 +911,7 @@ ImPlotTime MkGmtTime(struct tm *ptm) {
ImPlotTime t;
#ifdef _WIN32
t.S = _mkgmtime(ptm);
#else
#elif defined(__APPLE__) || defined(__linux__)
t.S = timegm(ptm);
#endif
if (t.S < 0)
Expand All @@ -926,8 +926,10 @@ tm* GetGmtTime(const ImPlotTime& t, tm* ptm)
return ptm;
else
return nullptr;
#else
#elif defined(__APPLE__) || defined(__linux__)
return gmtime_r(&t.S, ptm);
#else
return nullptr;
#endif
}

Expand All @@ -945,8 +947,10 @@ tm* GetLocTime(const ImPlotTime& t, tm* ptm) {
return ptm;
else
return nullptr;
#else
#elif defined(__APPLE__) || defined(__linux__)
return localtime_r(&t.S, ptm);
#else
return nullptr;
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions Plugins/CogAI/Source/CogAI/Private/CogAIWindow_Perception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ void FCogAIWindow_Perception::RenderContent()
}

const FString ActorName = FCogHelper::GetActorName(Actor);
auto ActorNameStr = COG_TCHAR_TO_CHAR(*ActorName);
auto ActorNameStr = StringCast<ANSICHAR>(*ActorName);

if (Filter.IsActive() && !Filter.PassFilter(ActorNameStr))
if (Filter.IsActive() && !Filter.PassFilter(ActorNameStr.Get()))
{
continue;
}
Expand Down Expand Up @@ -229,7 +229,7 @@ void FCogAIWindow_Perception::RenderContent()
ImGui::TableNextRow();
ImGui::TableNextColumn();
ImGui::PushStyleColor(ImGuiCol_Text, NameColor);
bool bOpenActor = ImGui::TreeNodeEx(ActorNameStr, ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_LabelSpanAllColumns);
bool bOpenActor = ImGui::TreeNodeEx(ActorNameStr.Get(), ImGuiTreeNodeFlags_SpanFullWidth | ImGuiTreeNodeFlags_SpanAllColumns | ImGuiTreeNodeFlags_LabelSpanAllColumns);
ImGui::PopStyleColor();


Expand Down