Skip to content

Commit

Permalink
Ashita: v4 deprecate add/remove in favor of the graphical UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Renee Koecher committed Dec 30, 2022
1 parent dd48de2 commit 5c006de
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 50 deletions.
2 changes: 1 addition & 1 deletion XIPivot.Ashita_v4/polplugin/AshitaInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
46 changes: 1 addition & 45 deletions XIPivot.Ashita_v4/polplugin/UserInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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());
Expand Down
7 changes: 3 additions & 4 deletions XIPivot.Ashita_v4/resources/docs/pivot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 (`<Ashita>\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.
Expand Down

0 comments on commit 5c006de

Please sign in to comment.