mirror of
https://github.com/alicealys/t5-gsc-utils.git
synced 2026-07-28 10:40:36 +00:00
fs_homepath working dir
This commit is contained in:
+12
-4
@@ -13,12 +13,20 @@ namespace io
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void on_after_dvar_init([[maybe_unused]] plugin::plugin* plugin) override
|
||||
{
|
||||
const auto fs_homepath = game::Dvar_FindVar("fs_homepath");
|
||||
if (fs_homepath == nullptr)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::filesystem::current_path(fs_homepath->current.string);
|
||||
printf("working directory: %s", fs_homepath->current.string);
|
||||
}
|
||||
|
||||
void on_startup([[maybe_unused]] plugin::plugin* plugin) override
|
||||
{
|
||||
// TODO: fix this, or is it because pluto does it already?
|
||||
//const auto fs_basegame = game::Dvar_FindVar("fs_basegame");
|
||||
//std::filesystem::current_path(fs_basegame->current.string);
|
||||
|
||||
gsc::function::add_multiple([](const std::string& file, const std::string& data,
|
||||
const scripting::variadic_args& va)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user