diff --git a/Mods/DebugMod/Src/DebugMod.cpp b/Mods/DebugMod/Src/DebugMod.cpp index e016c8f..a7e03ee 100644 --- a/Mods/DebugMod/Src/DebugMod.cpp +++ b/Mods/DebugMod/Src/DebugMod.cpp @@ -84,13 +84,10 @@ void DebugMod::OnDrawMenu() { m_DebugMenuActive = !m_DebugMenuActive; } - if (ImGui::Button("POSITIONS MENU")) { - m_PositionsMenuActive = !m_PositionsMenuActive; - } - - if (ImGui::Button("ENTITY MENU")) { - m_EntityMenuActive = !m_EntityMenuActive; - } + // Disabled due to it freezing the game. + //if (ImGui::Button("POSITIONS MENU")) { + // m_PositionsMenuActive = !m_PositionsMenuActive; + //} if (ImGui::Button("PLAYER MENU")) { m_PlayerMenuActive = !m_PlayerMenuActive; @@ -107,10 +104,6 @@ void DebugMod::OnDrawMenu() { if (ImGui::Button("NPCs MENU")) { m_NPCsMenuActive = !m_NPCsMenuActive; } - - if (ImGui::Button("SCENE MENU")) { - m_SceneMenuActive = !m_SceneMenuActive; - } } void DebugMod::OnDrawUI(bool p_HasFocus) { @@ -121,8 +114,7 @@ void DebugMod::OnDrawUI(bool p_HasFocus) { DrawItemsBox(p_HasFocus); DrawNPCsBox(p_HasFocus); DrawPlayerBox(p_HasFocus); - DrawPositionBox(p_HasFocus); - DrawSceneBox(p_HasFocus); + //DrawPositionBox(p_HasFocus); auto& s_ImgGuiIO = ImGui::GetIO(); @@ -589,9 +581,17 @@ void DebugMod::LoadRepositoryProps() { if (s_Key == "Title") { std::string s_Title = ConvertDynamicObjectValueTString(s_Entries->at(i).value); - m_RepositoryProps.insert(std::make_pair(s_Title, ZRepositoryID(s_Id.c_str()))); + if (!s_Title.empty() && !m_RepositoryProps.contains(s_Id)) { + m_RepositoryProps.insert(std::make_pair(s_Id, s_Title)); + } + } - break; + if (s_Key == "CommonName") { + std::string s_CommonName = ConvertDynamicObjectValueTString(s_Entries->at(i).value); + + if (!s_CommonName.empty() && !m_RepositoryProps.contains(s_Id)) { + m_RepositoryProps.insert(std::make_pair(s_Id, s_CommonName)); + } } } } diff --git a/Mods/DebugMod/Src/DebugMod.h b/Mods/DebugMod/Src/DebugMod.h index 176f87c..6340a3f 100644 --- a/Mods/DebugMod/Src/DebugMod.h +++ b/Mods/DebugMod/Src/DebugMod.h @@ -60,7 +60,6 @@ class DebugMod : public IPluginInterface { void DrawItemsBox(bool p_HasFocus); void DrawAssetsBox(bool p_HasFocus); void DrawNPCsBox(bool p_HasFocus); - void DrawSceneBox(bool p_HasFocus); static void EquipOutfit( const TEntityRef& p_GlobalOutfitKit, uint8_t n_CurrentCharSetIndex, @@ -104,12 +103,10 @@ class DebugMod : public IPluginInterface { private: bool m_DebugMenuActive = false; bool m_PositionsMenuActive = false; - bool m_EntityMenuActive = false; bool m_PlayerMenuActive = false; bool m_ItemsMenuActive = false; bool m_AssetsMenuActive = false; bool m_NPCsMenuActive = false; - bool m_SceneMenuActive = false; bool m_RenderNpcBoxes = false; bool m_RenderNpcNames = false; bool m_RenderNpcRepoIds = false; @@ -148,7 +145,7 @@ class DebugMod : public IPluginInterface { int m_Height = 0; TResourcePtr m_RepositoryResource; std::vector m_TextureResourceData; - std::multimap m_RepositoryProps; + std::multimap m_RepositoryProps; // RepoId -> Title/Common Name const std::vector m_CharSetCharacterTypes = {"Actor", "Nude", "HeroA"}; bool bActorSelectedByCamera = false; diff --git a/Mods/DebugMod/Src/UI/AssetsBox.cpp b/Mods/DebugMod/Src/UI/AssetsBox.cpp index e7d94c2..645bace 100644 --- a/Mods/DebugMod/Src/UI/AssetsBox.cpp +++ b/Mods/DebugMod/Src/UI/AssetsBox.cpp @@ -53,7 +53,7 @@ void DebugMod::DrawAssetsBox(bool p_HasFocus) { ImGuiWindowFlags_ChildWindow )) { for (auto it = m_RepositoryProps.begin(); it != m_RepositoryProps.end(); ++it) { - const std::string s_PropTitle = it->first.c_str(); + const std::string s_PropTitle = it->second.c_str(); if (s_PropTitle.empty()) { continue; @@ -63,12 +63,14 @@ void DebugMod::DrawAssetsBox(bool p_HasFocus) { continue; } - if (ImGui::Selectable(s_PropTitle.c_str())) { + std::string s_ButtonId = std::format("{}###{}", it->second, it->first); + + if (ImGui::Selectable(s_ButtonId.c_str())) { ImGui::ClearActiveID(); strcpy_s(s_PropTitle_SubString, s_PropTitle.c_str()); for (size_t i = 0; i < s_NumberOfPropsToSpawn_Repo; ++i) { - SpawnRepositoryProp(it->second, s_WorldInventoryButton == 1); + SpawnRepositoryProp(ZRepositoryID(it->first.c_str()), s_WorldInventoryButton == 1); } } } diff --git a/Mods/DebugMod/Src/UI/ItemsBox.cpp b/Mods/DebugMod/Src/UI/ItemsBox.cpp index 4be3c1a..bd6aebe 100644 --- a/Mods/DebugMod/Src/UI/ItemsBox.cpp +++ b/Mods/DebugMod/Src/UI/ItemsBox.cpp @@ -59,7 +59,7 @@ void DebugMod::DrawItemsBox(bool p_HasFocus) { for (size_t i = 0; i < s_Actions.size(); i++) { const ZHM5Action* s_Action = s_Actions[i]; const ZHM5Item* s_Item = s_Action->m_Object.QueryInterface(); - std::string s_Title = std::format("{} {}", s_Item->m_pItemConfigDescriptor->m_sTitle.c_str(), i + 1); + std::string s_Title = std::format("{}###{}", s_Item->m_pItemConfigDescriptor->m_sTitle.c_str(), i + 1); if (ImGui::Selectable(s_Title.c_str(), s_Selected == i)) { s_Selected = i; diff --git a/Mods/DebugMod/Src/UI/NPCsBox.cpp b/Mods/DebugMod/Src/UI/NPCsBox.cpp index 07a994d..3f1c4f6 100644 --- a/Mods/DebugMod/Src/UI/NPCsBox.cpp +++ b/Mods/DebugMod/Src/UI/NPCsBox.cpp @@ -12,7 +12,6 @@ #include "imgui_internal.h" void DebugMod::DrawNPCsBox(const bool p_HasFocus) { - static std::string s_currentlySelectActor_Name; static size_t s_SelectedID = -1; if (!p_HasFocus || !m_NPCsMenuActive) { @@ -51,14 +50,15 @@ void DebugMod::DrawNPCsBox(const bool p_HasFocus) { continue; } + std::string s_ButtonId = std::format("{}###{}", s_NPCName, i); + if (!s_CurrentlySelectedActor) { s_SelectedID = -1; } - if (ImGui::Selectable(s_NPCName.c_str(), s_SelectedID == i) || s_CurrentlySelectedActor == s_Actor) { - if (s_currentlySelectActor_Name != s_NPCName) // Stop it setting it all the time + if (ImGui::Selectable(s_ButtonId.c_str(), s_SelectedID == i) || s_CurrentlySelectedActor == s_Actor) { + if (s_SelectedID != i) // Stop it setting it all the time { - s_currentlySelectActor_Name = s_NPCName; s_CurrentlySelectedActor = s_Actor; s_SelectedID = i; m_SelectedEntity = s_CurrentlySelectedActor->m_rCharacter.m_ref; diff --git a/Mods/DebugMod/Src/UI/SceneBox.cpp b/Mods/DebugMod/Src/UI/SceneBox.cpp deleted file mode 100644 index ba28853..0000000 --- a/Mods/DebugMod/Src/UI/SceneBox.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "DebugMod.h" - -#include - -void DebugMod::DrawSceneBox(bool p_HasFocus) { - if (!p_HasFocus || !m_SceneMenuActive) { - return; - } - - ImGui::PushFont(SDK()->GetImGuiBlackFont()); - const auto s_Showing = ImGui::Begin("SCENE", &m_SceneMenuActive); - ImGui::PushFont(SDK()->GetImGuiRegularFont()); - - if (s_Showing) { - static size_t s_Selected = 0; - const ZEntitySceneContext* s_EntitySceneContext = Globals::Hitman5Module->m_pEntitySceneContext; - const std::string s_EntityTemplate = m_RuntimeResourceIDsToResourceIDs[s_EntitySceneContext->m_SceneConfig. - m_ridSceneFactory.GetID()]; - const std::string s_EntityBlueprint = std::format( - "{}.pc_entityblueprint", s_EntityTemplate.substr(0, s_EntityTemplate.find_last_of('.')) - ); - - ImGui::Text("Scene name: %s", s_EntitySceneContext->m_sceneData.m_sceneName.c_str()); - ImGui::Text("Type: %s", s_EntitySceneContext->m_sceneData.m_type.c_str()); - ImGui::Text("Code Name Hint: %s", s_EntitySceneContext->m_sceneData.m_codeNameHint.c_str()); - ImGui::Text("Entity Template: %s", s_EntityTemplate); - ImGui::Text("Entity Blueprint: %s", s_EntityBlueprint); - - ImGui::BeginChild("left pane", ImVec2(300, 0), true, ImGuiWindowFlags_HorizontalScrollbar); - - for (size_t i = 0; i < s_EntitySceneContext->m_aLoadedBricks.size(); ++i) { - ZRuntimeResourceID s_RuntimeResourceId = s_EntitySceneContext->m_aLoadedBricks[i].runtimeResourceID; - std::string s_ResourceId = m_RuntimeResourceIDsToResourceIDs[s_RuntimeResourceId.GetID()]; - - if (s_ResourceId.empty()) { - continue; - } - - if (ImGui::Selectable(s_ResourceId.c_str(), s_Selected == i)) { - s_Selected = i; - } - } - - ImGui::EndChild(); - ImGui::SameLine(); - - ImGui::BeginGroup(); - ImGui::BeginChild("item view", ImVec2(0, -ImGui::GetFrameHeightWithSpacing())); - - ImGui::Text("TEXT"); - - ImGui::EndChild(); - ImGui::EndGroup(); - } - - ImGui::PopFont(); - ImGui::End(); - ImGui::PopFont(); -} diff --git a/Mods/DiscordRichPresence/Src/DiscordRichPresence.cpp b/Mods/DiscordRichPresence/Src/DiscordRichPresence.cpp index 5f54ad9..fcc739a 100644 --- a/Mods/DiscordRichPresence/Src/DiscordRichPresence.cpp +++ b/Mods/DiscordRichPresence/Src/DiscordRichPresence.cpp @@ -109,6 +109,7 @@ void DiscordRichPresence::PopulateGameModes() { {"campaign", "Mission"}, {"escalation", "Escalation"}, {"elusive", "Elusive Target"}, + {"arcade", "Elusive Target Arcade"}, {"evergreen", "Freelancer"}, };