Skip to content

Commit 236cdf9

Browse files
committed
Jenova Runtime Update v0.3.9.0 Hotfix
- JenovaSDK : Added `GetPackageRepositoryPath` API
1 parent 5468d12 commit 236cdf9

2 files changed

Lines changed: 14 additions & 0 deletions

File tree

Source/JenovaSDK.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ namespace jenova::sdk
208208
JENOVA_INTERNAL(double GetCheckpointTime(const godot::String& checkPointName));
209209
JENOVA_INTERNAL(void DeleteCheckpoint(const godot::String& checkPointName));
210210
JENOVA_INTERNAL(double GetCheckpointTimeAndDispose(const godot::String& checkPointName));
211+
JENOVA_INTERNAL(godot::String GetPackageRepositoryPath(bool globalize = false));
211212
JENOVA_INTERNAL(bool RegisterRuntimeCallback(RuntimeCallback callbackPtr));
212213
JENOVA_INTERNAL(bool UnregisterRuntimeCallback(RuntimeCallback callbackPtr));
213214

@@ -434,6 +435,11 @@ namespace jenova::sdk
434435
if (!JenovaSDK::ValidateInterface(bridge)) return 0.0;
435436
return bridge->GetCheckpointTimeAndDispose(checkPointName);
436437
}
438+
JENOVA_WRAPPER godot::String GetPackageRepositoryPath(bool globalize = false)
439+
{
440+
if (!JenovaSDK::ValidateInterface(bridge)) return godot::String();
441+
return bridge->GetPackageRepositoryPath(globalize);
442+
}
437443
JENOVA_WRAPPER bool RegisterRuntimeCallback(RuntimeCallback callbackPtr)
438444
{
439445
if (!JenovaSDK::ValidateInterface(bridge)) return false;

Source/jenovaSDK.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@ namespace jenova::sdk
375375
{
376376
return JenovaTinyProfiler::GetCheckpointTimeAndDispose(AS_STD_STRING(checkPointName));
377377
}
378+
godot::String JenovaSDK::GetPackageRepositoryPath(bool globalize)
379+
{
380+
godot::String path = godot::String(jenova::GetEditorSetting(jenova::JenovaSettings::PackageRepositoryPathConfigPath)).replace("\\", "/");
381+
if (path.contains("res://")) path = globalize ? ProjectSettings::get_singleton()->globalize_path(path) : path;
382+
if (!path.ends_with("/")) path += "/";
383+
return path;
384+
}
378385
bool JenovaSDK::RegisterRuntimeCallback(RuntimeCallback callbackPtr)
379386
{
380387
return jenova::RegisterRuntimeEventCallback((jenova::FunctionPointer)callbackPtr);
@@ -712,6 +719,7 @@ namespace jenova
712719
if (string(sdkFunctionName) == "GetCheckpointTime") return FunctionPtr(&GetCheckpointTime);
713720
if (string(sdkFunctionName) == "DeleteCheckpoint") return FunctionPtr(&DeleteCheckpoint);
714721
if (string(sdkFunctionName) == "GetCheckpointTimeAndDispose") return FunctionPtr(&GetCheckpointTimeAndDispose);
722+
if (string(sdkFunctionName) == "GetPackageRepositoryPath") return FunctionPtr(&GetPackageRepositoryPath);
715723
if (string(sdkFunctionName) == "RegisterRuntimeCallback") return FunctionPtr(&RegisterRuntimeCallback);
716724
if (string(sdkFunctionName) == "UnregisterRuntimeCallback") return FunctionPtr(&UnregisterRuntimeCallback);
717725

0 commit comments

Comments
 (0)