Skip to content

Commit

Permalink
idk
Browse files Browse the repository at this point in the history
  • Loading branch information
TobyAdd committed Jan 6, 2025
1 parent 397b7d8 commit 4e61c34
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,24 @@ std::string utilsH::GetKeyName(int key) {


void utilsH::getFolder() {
auto result = geode::utils::file::pick(geode::utils::file::PickMode::OpenFolder, {std::nullopt, {}});
if (result.isFinished() && !result.getFinishedValue()->isErr()) {
std::filesystem::path path = result.getFinishedValue()->unwrap();
geode::utils::file::pick(geode::utils::file::PickMode::OpenFolder, {std::nullopt, {}}).listen(
[](geode::Result<std::filesystem::path>* path) {
if (!path->isErr()) {
auto path_final = path->unwrap();
geode::log::debug("{}", path_final);
std::ofstream outFile(path_final / "replay_engine.txt");

std::ofstream outFile(path / "replay_engine.txt");
if (outFile.is_open()) {
outFile << "Hello, this is a text file saved by C++!" << std::endl;
outFile.close();

if (outFile.is_open()) {
outFile << "Hello, this is a text file saved by C++!" << std::endl;
outFile.close();

FLAlertLayer::create("Info", fmt::format("Saved as {}", path / "replay_engine.txt"), "OK")->show();
} else {
FLAlertLayer::create("Info", fmt::format("Error openning file"), "OK")->show();
}
}
else {
FLAlertLayer::create("Info", fmt::format("not openned??"), "OK")->show();
}
FLAlertLayer::create("Info", fmt::format("Saved as {}", path_final / "replay_engine.txt"), "OK")->show();
} else {
FLAlertLayer::create("Info", fmt::format("Error openning file"), "OK")->show();
}
}
else {
FLAlertLayer::create("info", "goddamn??", "OK")->show();
}
});
}

0 comments on commit 4e61c34

Please sign in to comment.