From 5c006de23eb414c83e0496889432cce70684656d Mon Sep 17 00:00:00 2001 From: Renee Koecher Date: Fri, 30 Dec 2022 18:25:10 +0100 Subject: [PATCH] Ashita: v4 deprecate add/remove in favor of the graphical UI --- XIPivot.Ashita_v4/polplugin/AshitaInterface.h | 2 +- XIPivot.Ashita_v4/polplugin/UserInterface.cpp | 46 +------------------ .../resources/docs/pivot/README.md | 7 ++- 3 files changed, 5 insertions(+), 50 deletions(-) diff --git a/XIPivot.Ashita_v4/polplugin/AshitaInterface.h b/XIPivot.Ashita_v4/polplugin/AshitaInterface.h index 68a10d1..71cdaf2 100644 --- a/XIPivot.Ashita_v4/polplugin/AshitaInterface.h +++ b/XIPivot.Ashita_v4/polplugin/AshitaInterface.h @@ -40,7 +40,7 @@ namespace XiPivot { static constexpr auto PluginName = "pivot"; static constexpr auto PluginAuthor = "Heals"; - static constexpr auto PluginVersion = 4.1402; + static constexpr auto PluginVersion = 4.1403; static constexpr auto PluginUrl = "https://github.com/Shirk/XIPivot"; static constexpr auto PluginDescr = "Runtime DAT, sfx and bgm replacement manager."; static constexpr auto PluginCommand = "pivot"; diff --git a/XIPivot.Ashita_v4/polplugin/UserInterface.cpp b/XIPivot.Ashita_v4/polplugin/UserInterface.cpp index 9cde095..cd1b1e2 100644 --- a/XIPivot.Ashita_v4/polplugin/UserInterface.cpp +++ b/XIPivot.Ashita_v4/polplugin/UserInterface.cpp @@ -103,7 +103,7 @@ namespace XiPivot IS_PARAM(args.at(0), "d", "dump") { std::ostringstream msg; - std::string dumpPath = std::string(core->GetInstallPath()) + "\\logs\\pivot-dump.txt"; + std::string dumpPath = (std::filesystem::path(core->GetInstallPath()) / "logs" / "pivot-dump.txt").string(); std::fstream dumpFile; dumpFile.open(dumpPath, std::ios_base::out | std::ios_base::trunc); @@ -157,38 +157,6 @@ namespace XiPivot } break; - case 2: - IS_PARAM(args.at(0), "a", "add") - { - if (Core::Redirector::instance().addOverlay(args.at(1)) == false) - { - std::ostringstream msg; - msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Error("Failed to load overlay"); - - chat->AddChatMessage(1, false, msg.str().c_str()); - } - else - { - std::ostringstream msg; - msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Message("Overlay registered"); - - chat->AddChatMessage(1, false, msg.str().c_str()); - m_guiState.state.applyCLIChanges = true; - } - } - - IS_PARAM(args.at(0), "r", "remove") - { - std::ostringstream msg; - msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Message("Overlay removed"); - - chat->AddChatMessage(1, false, msg.str().c_str()); - - Core::Redirector::instance().removeOverlay(args.at(1)); - m_guiState.state.applyCLIChanges = true; - } - break; - default: PrintHelp(chat); break; @@ -374,18 +342,6 @@ namespace XiPivot msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Color1(0x6, PluginName) << " v" << Ashita::Chat::Color1(0x6, "%.3f") << " by " << Ashita::Chat::Color1(0x6, PluginAuthor); chat->Writef(1, false, msg.str().c_str(), PluginVersion); - msg.str(""); - msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Color1(0x3, "a") << "dd overlay_name - add 'overlay_name' to the list of active overlays."; - chat->AddChatMessage(1, false, msg.str().c_str()); - - msg.str(""); - msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Color1(0x3, "r") << "emove overlay_name - remove 'overlay_name' from the list of active overlays."; - chat->AddChatMessage(1, false, msg.str().c_str()); - - msg.str(""); - msg << Ashita::Chat::Header(PluginCommand) << " - "; - chat->AddChatMessage(1, false, msg.str().c_str()); - msg.str(""); msg << Ashita::Chat::Header(PluginCommand) << Ashita::Chat::Color1(0x3, "c") << "ache - open the cache stats overlay."; chat->AddChatMessage(1, false, msg.str().c_str()); diff --git a/XIPivot.Ashita_v4/resources/docs/pivot/README.md b/XIPivot.Ashita_v4/resources/docs/pivot/README.md index b8c8d2b..190c016 100644 --- a/XIPivot.Ashita_v4/resources/docs/pivot/README.md +++ b/XIPivot.Ashita_v4/resources/docs/pivot/README.md @@ -118,13 +118,12 @@ If the command `/pivot` is used without parameters it will open an in-game GUI f The following parameters are supported: -- a/add overlay_path -- will load 'overlay_name' as last entry to the overlay list -- r/remove overlay_path -- will unload 'overlay_name' and remove it from the overlay list - c/cache -- will display a mini overlay with cache statistics +- d/dump -- write the current overlay list and cache settungs to (`\logs\pivot-dump.txt`) - h/help -- print this text -These commands all support a short first letter version (a/r/c/h). -Changes made with add / remove will be reflected in `pivot.ini`. +These commands all support a short first letter version (c/h). +Changes made through the configuration UI will be reflected in `pivot.ini` automatically. Please note that adding and removing overlays way after the game launches can have side effects.