Skip to content

Commit 5468d12

Browse files
committed
Jenova Runtime Update v0.3.9.0
- Codebase Improvements - Jenova Settings Improvements - Package Manager Improvements - Manual Editor Settings Parse Fallback Implemented. - Bug Fix : Tools & Addons Fail to Load from Custom Path. - Major Improvements
1 parent 99c6e7d commit 5468d12

3 files changed

Lines changed: 96 additions & 103 deletions

File tree

Source/Jenova.hpp

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020
#define APP_COMPANYNAME "MemarDesign™ LLC."
2121
#define APP_DESCRIPTION "Real-Time C++ Scripting System for Godot Engine, Developed By Hamid.Memar."
2222
#define APP_COPYRIGHT "Copyright MemarDesign™ LLC. (©) 2024-2025, All Rights Reserved."
23-
#define APP_VERSION "0.3.8.9"
23+
#define APP_VERSION "0.3.9.0"
2424
#define APP_VERSION_MIDDLEFIX " "
2525
#define APP_VERSION_POSTFIX "Beta"
2626
#define APP_VERSION_SINGLECHAR "b"
27-
#define APP_VERSION_DATA 0, 3, 8, 9
27+
#define APP_VERSION_DATA 0, 3, 9, 0
2828
#define APP_VERSION_BUILD "0"
2929
#define APP_VERSION_NAME "Halo"
3030

@@ -279,7 +279,8 @@
279279
#include <Parsers/json.hpp>
280280
#include <Base64/base64.hpp>
281281

282-
// Namespaces Import
282+
// Global Namespaces
283+
using namespace std;
283284
using namespace godot;
284285

285286
// Logging Macros
@@ -852,6 +853,36 @@ namespace jenova
852853
extern int TerminalDefaultFontSize;
853854
}
854855

856+
// Jenova Settings
857+
namespace JenovaSettings
858+
{
859+
constexpr char* RemoveSourcesFromBuildEditorConfigPath = "jenova/remove_source_codes_from_build";
860+
constexpr char* CompilerModelConfigPath = "jenova/compiler_model";
861+
constexpr char* MultiThreadedCompilationConfigPath = "jenova/multi_threaded_compilation";
862+
constexpr char* GenerateDebugInformationConfigPath = "jenova/generate_debug_information";
863+
constexpr char* InterpreterBackendConfigPath = "jenova/interpreter_backend";
864+
constexpr char* ProfilingModeConfigPath = "jenova/profiling_mode";
865+
constexpr char* BuildAndRunModeConfigPath = "jenova/build_and_run_mode";
866+
constexpr char* PreprocessorDefinitionsConfigPath = "jenova/preprocessor_definitions";
867+
constexpr char* AdditionalIncludeDirectoriesConfigPath = "jenova/additional_include_directories";
868+
constexpr char* AdditionalLibraryDirectoriesConfigPath = "jenova/additional_library_directories";
869+
constexpr char* AdditionalDependenciesConfigPath = "jenova/additional_dependencies";
870+
constexpr char* CustomCompilerCommandsConfigPath = "jenova/custom_compiler_commands";
871+
constexpr char* CustomLinkerCommandsConfigPath = "jenova/custom_linker_commands";
872+
constexpr char* ExternalChangesTriggerModeConfigPath = "jenova/external_changes_trigger_mode";
873+
constexpr char* UseHotReloadAtRuntimeConfigPath = "jenova/use_hot_reload_at_runtime";
874+
constexpr char* EditorVerboseOutputConfigPath = "jenova/editor_verbose_output";
875+
constexpr char* UseMonospaceFontForTerminalConfigPath = "jenova/use_monospace_font_for_terminal";
876+
constexpr char* TerminalDefaultFontSizeConfigPath = "jenova/terminal_default_font_size";
877+
constexpr char* CompilerPackageConfigPath = "jenova/compiler_package";
878+
constexpr char* GodotKitPackageConfigPath = "jenova/godot_kit_package";
879+
constexpr char* ManagedSafeExecutionConfigPath = "jenova/managed_safe_execution";
880+
constexpr char* UseBuiltinSDKConfigPath = "jenova/use_builtin_jenova_sdk";
881+
constexpr char* RefreshTreeAfterBuildConfigPath = "jenova/refresh_scene_tree_after_build";
882+
constexpr char* PackageRepositoryPathConfigPath = "jenova/package_repository_path";
883+
constexpr char* BuildToolButtonEditorConfigPath = "jenova/build_tool_button_placement";
884+
}
885+
855886
// Error Codes
856887
namespace ErrorCode
857888
{
@@ -948,7 +979,8 @@ namespace jenova
948979
MemoryBuffer DecompressBuffer(void* bufferPtr, size_t bufferSize);
949980
float CalculateCompressionRatio(size_t baseSize, size_t compressedSize);
950981
Ref<Texture2D> GetEditorIcon(const String& iconName);
951-
Variant GetEditorSetting(const String& settingKey);
982+
bool GetEditorSetting(const String& settingPath, Variant& value);
983+
Variant GetEditorSetting(const String& settingPath);
952984
bool DumpThemeColors(const Ref<Theme> theme);
953985
ArgumentsArray ProcessDeployerArguments(const std::string& cmdLine);
954986
bool WriteStringToFile(const String& filePath, const String& str);

Source/jenova.cpp

Lines changed: 51 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@
3434
#include <Parsers/argparse.hpp>
3535
#include <Zlib/zlib.h>
3636

37-
// Namespaces
38-
using namespace std;
39-
4037
// Windows Routine
4138
#ifdef TARGET_PLATFORM_WINDOWS
4239

@@ -88,6 +85,9 @@ using namespace std;
8885
// Jenova Core Implementations
8986
namespace jenova
9087
{
88+
// Import Namespaces
89+
using namespace JenovaSettings;
90+
9191
// Plugin Implementation
9292
namespace plugin
9393
{
@@ -107,31 +107,6 @@ namespace jenova
107107
private:
108108
String JenovaEditorPluginName = "J.E.N.O.V.A";
109109
String JenovaEditorSettingsCategory = "JenovaSettings";
110-
String RemoveSourcesFromBuildEditorConfigPath = "jenova/remove_source_codes_from_build";
111-
String CompilerModelConfigPath = "jenova/compiler_model";
112-
String MultiThreadedCompilationConfigPath = "jenova/multi_threaded_compilation";
113-
String GenerateDebugInformationConfigPath = "jenova/generate_debug_information";
114-
String InterpreterBackendConfigPath = "jenova/interpreter_backend";
115-
String ProfilingModeConfigPath = "jenova/profiling_mode";
116-
String BuildAndRunModeConfigPath = "jenova/build_and_run_mode";
117-
String PreprocessorDefinitionsConfigPath = "jenova/preprocessor_definitions";
118-
String AdditionalIncludeDirectoriesConfigPath = "jenova/additional_include_directories";
119-
String AdditionalLibraryDirectoriesConfigPath = "jenova/additional_library_directories";
120-
String AdditionalDependenciesConfigPath = "jenova/additional_dependencies";
121-
String CustomCompilerCommandsConfigPath = "jenova/custom_compiler_commands";
122-
String CustomLinkerCommandsConfigPath = "jenova/custom_linker_commands";
123-
String ExternalChangesTriggerModeConfigPath = "jenova/external_changes_trigger_mode";
124-
String UseHotReloadAtRuntimeConfigPath = "jenova/use_hot_reload_at_runtime";
125-
String EditorVerboseOutputConfigPath = "jenova/editor_verbose_output";
126-
String UseMonospaceFontForTerminalConfigPath = "jenova/use_monospace_font_for_terminal";
127-
String TerminalDefaultFontSizeConfigPath = "jenova/terminal_default_font_size";
128-
String CompilerPackageConfigPath = "jenova/compiler_package";
129-
String GodotKitPackageConfigPath = "jenova/godot_kit_package";
130-
String ManagedSafeExecutionConfigPath = "jenova/managed_safe_execution";
131-
String UseBuiltinSDKConfigPath = "jenova/use_builtin_jenova_sdk";
132-
String RefreshTreeAfterBuildConfigPath = "jenova/refresh_scene_tree_after_build";
133-
String PackageRepositoryPathConfigPath = "jenova/package_repository_path";
134-
String BuildToolButtonEditorConfigPath = "jenova/build_tool_button_placement";
135110

136111
private:
137112
// Default Settings
@@ -660,27 +635,6 @@ namespace jenova
660635
// Failed
661636
return false;
662637
}
663-
bool GetEditorSetting(const String& setting_name, Variant& value)
664-
{
665-
EditorInterface* editor_interface = EditorInterface::get_singleton();
666-
if (editor_interface)
667-
{
668-
Ref<EditorSettings> editor_settings = editor_interface->get_editor_settings();
669-
if (!editor_settings.is_null())
670-
{
671-
// Check if the setting exists
672-
if (editor_settings->has_setting(setting_name))
673-
{
674-
// Get the setting value
675-
value = editor_settings->get_setting(setting_name);
676-
677-
// All Good
678-
return true;
679-
}
680-
}
681-
}
682-
return false;
683-
}
684638
bool UpdateStorageConfigurations()
685639
{
686640
// Update Jenova Cache Directory
@@ -2619,35 +2573,6 @@ namespace jenova
26192573
// All Good
26202574
return true;
26212575
}
2622-
String GetEditorSettingStringPath(const std::string& setting_key)
2623-
{
2624-
if (setting_key == std::string("remove_source_codes_from_build")) return RemoveSourcesFromBuildEditorConfigPath;
2625-
if (setting_key == std::string("compiler_model")) return CompilerModelConfigPath;
2626-
if (setting_key == std::string("multi_threaded_compilation")) return MultiThreadedCompilationConfigPath;
2627-
if (setting_key == std::string("generate_debug_information")) return GenerateDebugInformationConfigPath;
2628-
if (setting_key == std::string("interpreter_backend")) return InterpreterBackendConfigPath;
2629-
if (setting_key == std::string("profiling_mode")) return ProfilingModeConfigPath;
2630-
if (setting_key == std::string("build_and_run_mode")) return BuildAndRunModeConfigPath;
2631-
if (setting_key == std::string("preprocessor_definitions")) return PreprocessorDefinitionsConfigPath;
2632-
if (setting_key == std::string("additional_include_directories")) return AdditionalIncludeDirectoriesConfigPath;
2633-
if (setting_key == std::string("additional_library_directories")) return AdditionalLibraryDirectoriesConfigPath;
2634-
if (setting_key == std::string("additional_dependencies")) return AdditionalDependenciesConfigPath;
2635-
if (setting_key == std::string("custom_compiler_commands")) return CustomCompilerCommandsConfigPath;
2636-
if (setting_key == std::string("custom_linker_commands")) return CustomLinkerCommandsConfigPath;
2637-
if (setting_key == std::string("external_changes_trigger_mode")) return ExternalChangesTriggerModeConfigPath;
2638-
if (setting_key == std::string("use_hot_reload_at_runtime")) return UseHotReloadAtRuntimeConfigPath;
2639-
if (setting_key == std::string("editor_verbose_output")) return EditorVerboseOutputConfigPath;
2640-
if (setting_key == std::string("use_monospace_font_for_terminal")) return UseMonospaceFontForTerminalConfigPath;
2641-
if (setting_key == std::string("terminal_default_font_size")) return TerminalDefaultFontSizeConfigPath;
2642-
if (setting_key == std::string("compiler_package")) return CompilerPackageConfigPath;
2643-
if (setting_key == std::string("godot_kit_package")) return GodotKitPackageConfigPath;
2644-
if (setting_key == std::string("managed_safe_execution")) return ManagedSafeExecutionConfigPath;
2645-
if (setting_key == std::string("use_builtin_jenova_sdk")) return UseBuiltinSDKConfigPath;
2646-
if (setting_key == std::string("refresh_scene_tree_after_build")) return RefreshTreeAfterBuildConfigPath;
2647-
if (setting_key == std::string("package_repository_path")) return PackageRepositoryPathConfigPath;
2648-
if (setting_key == std::string("build_toolbutton_placement")) return BuildToolButtonEditorConfigPath;
2649-
return String("jenova/unknown");
2650-
}
26512576

26522577
// Visual Studio Integration
26532578
void OpenVisualStudioSelectorWindow()
@@ -3803,12 +3728,12 @@ namespace jenova
38033728
if (!compilerSelector->is_disabled())
38043729
{
38053730
String selectedCompiler = compilerSelector->get_item_text(compilerSelector->get_selected_id()).replace(" ", "");
3806-
EditorInterface::get_singleton()->get_editor_settings()->set_setting(pluginInstance->GetEditorSettingStringPath("compiler_package"), selectedCompiler);
3731+
EditorInterface::get_singleton()->get_editor_settings()->set_setting(JenovaSettings::CompilerPackageConfigPath, selectedCompiler);
38073732
}
38083733
if (!godotKitSelector->is_disabled())
38093734
{
38103735
String selectedGodotKit = godotKitSelector->get_item_text(godotKitSelector->get_selected_id()).replace(" ", "");
3811-
EditorInterface::get_singleton()->get_editor_settings()->set_setting(pluginInstance->GetEditorSettingStringPath("godot_kit_package"), selectedGodotKit);
3736+
EditorInterface::get_singleton()->get_editor_settings()->set_setting(JenovaSettings::GodotKitPackageConfigPath, selectedGodotKit);
38123737
}
38133738
jenova::OutputColored("#2ebc78", "Project Build Configuration Updated Successfully!");
38143739
}
@@ -4274,7 +4199,7 @@ namespace jenova
42744199

42754200
// Check for Source Remove from Build Option
42764201
Variant RemoveSourcesFromBuild;
4277-
if (!jenovaEditorPlugin->GetEditorSetting(jenovaEditorPlugin->GetEditorSettingStringPath("remove_source_codes_from_build"), RemoveSourcesFromBuild)) RemoveSourcesFromBuild = true;
4202+
if (!jenova::GetEditorSetting(JenovaSettings::RemoveSourcesFromBuildEditorConfigPath, RemoveSourcesFromBuild)) RemoveSourcesFromBuild = true;
42784203
ExcludeSourcesFromBuild = RemoveSourcesFromBuild;
42794204

42804205
// Generate & Add Configuration File
@@ -4798,7 +4723,7 @@ namespace jenova
47984723
// Rise Editor Boot Callback
47994724
if (QUERY_ENGINE_MODE(Editor)) OnEditorBoot();
48004725

4801-
// Register Editor Sub Plugins (Seems like this is not required in gdmodule)
4726+
// Register Editor Sub Plugins
48024727
GDREGISTER_INTERNAL_CLASS(JenovaExportPlugin);
48034728
GDREGISTER_INTERNAL_CLASS(JenovaDebuggerPlugin);
48044729

@@ -4810,13 +4735,13 @@ namespace jenova
48104735
JenovaPackageManager::init();
48114736
JenovaTemplateManager::init();
48124737

4813-
// Load Module At Initialization [Editor]
4738+
// Load Module At Initialization
48144739
if (QUERY_ENGINE_MODE(Editor))
48154740
{
48164741
if (jenova::GlobalSettings::DefaultModuleLoadStage == ModuleLoadStage::LoadModuleAtInitialization) JenovaInterpreter::BootInterpreter();
48174742
}
48184743

4819-
// Load Tool Packages [Editor]
4744+
// Load Tool Packages
48204745
if (QUERY_ENGINE_MODE(Editor) && jenova::GlobalSettings::LoadAndUnloadToolPackages)
48214746
{
48224747
if (!jenova::LoadToolPackages()) jenova::Warning("Jenova Tool System", "One or More Jenova Tool Module Failed to Initialize.");
@@ -4898,7 +4823,7 @@ namespace jenova
48984823
JenovaPackageManager::deinit();
48994824
JenovaTemplateManager::deinit();
49004825

4901-
// Unload Tool Packages [Editor]
4826+
// Unload Tool Packages
49024827
if (QUERY_ENGINE_MODE(Editor) && jenova::GlobalSettings::LoadAndUnloadToolPackages)
49034828
{
49044829
if (!jenova::UnloadToolPackages()) jenova::Warning("Jenova Tool System", "One or More Jenova Tool Module Failed to Uninitialize.");
@@ -7128,12 +7053,49 @@ namespace jenova
71287053
{
71297054
return EditorInterface::get_singleton()->get_editor_theme()->get_icon(iconName, "EditorIcons");
71307055
}
7131-
Variant GetEditorSetting(const String& settingKey)
7056+
bool GetEditorSetting(const String& settingPath, Variant& value)
7057+
{
7058+
EditorInterface* editorInterface = EditorInterface::get_singleton();
7059+
if (editorInterface)
7060+
{
7061+
Ref<EditorSettings> editorSettings = editorInterface->get_editor_settings();
7062+
if (!editorSettings.is_null())
7063+
{
7064+
if (editorSettings->has_setting(settingPath))
7065+
{
7066+
value = editorSettings->get_setting(settingPath);
7067+
return true;
7068+
}
7069+
}
7070+
else
7071+
{
7072+
EditorPaths* editorPaths = editorInterface->get_editor_paths();
7073+
if (editorPaths)
7074+
{
7075+
String editorDataDirectory = editorPaths->get_data_dir();
7076+
Dictionary versionInfo = Engine::get_singleton()->get_version_info();
7077+
String shortVersion = String::num_int64(versionInfo["major"]) + "." + String::num_int64(versionInfo["minor"]);
7078+
String settingsFile = "editor_settings-" + shortVersion + ".tres";
7079+
String settingsPath = editorDataDirectory.path_join(settingsFile);
7080+
editorSettings = ResourceLoader::get_singleton()->load(settingsPath);
7081+
if (!editorSettings.is_null())
7082+
{
7083+
if (editorSettings->has_setting(settingPath))
7084+
{
7085+
value = editorSettings->get_setting(settingPath);
7086+
editorSettings.unref();
7087+
return true;
7088+
}
7089+
}
7090+
}
7091+
}
7092+
}
7093+
return false;
7094+
}
7095+
Variant GetEditorSetting(const String& settingPath)
71327096
{
7133-
if (!jenova::plugin::JenovaEditorPlugin::get_singleton()) return false;
71347097
Variant settingValue;
7135-
String settingName = jenova::plugin::JenovaEditorPlugin::get_singleton()->GetEditorSettingStringPath(AS_STD_STRING(settingKey));
7136-
if (!jenova::plugin::JenovaEditorPlugin::get_singleton()->GetEditorSetting(settingName, settingValue)) return Variant::NIL;
7098+
if (!GetEditorSetting(settingPath, settingValue)) return Variant::NIL;
71377099
return settingValue;
71387100
}
71397101
bool DumpThemeColors(const Ref<Theme> theme)

Source/package_manager.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
// Utilities
3434
static String GetPackageRepositoryPath(bool globalize = false)
3535
{
36-
String path = String(jenova::GetEditorSetting("package_repository_path")).replace("\\", "/");
36+
String path = String(jenova::GetEditorSetting(jenova::JenovaSettings::PackageRepositoryPathConfigPath)).replace("\\", "/");
3737
if (path.contains("res://")) path = globalize ? ProjectSettings::get_singleton()->globalize_path(path) : path;
3838
if (!path.ends_with("/")) path += "/";
3939
return path;
@@ -53,10 +53,7 @@ static String GetPackageDatabasePath()
5353
{
5454
return jenova::GetJenovaProjectDirectory() + "Jenova/" + jenova::GlobalSettings::JenovaInstalledPackagesFile;
5555
}
56-
else
57-
{
58-
return GetPackageRepositoryPath(true) + jenova::GlobalSettings::JenovaInstalledPackagesFile;
59-
}
56+
return GetPackageRepositoryPath(true) + jenova::GlobalSettings::JenovaInstalledPackagesFile;
6057
}
6158

6259
// Configuration
@@ -695,8 +692,7 @@ bool JenovaPackageManager::ObtainInstalledPackages()
695692
// Clear Current List
696693
installedPackages.clear();
697694

698-
// Create Installed Package File Path
699-
String projectPath = jenova::GetJenovaProjectDirectory();
695+
// Get Installed Package File Path
700696
String installedPackageFile = GetPackageDatabasePath();
701697

702698
// Validate Package Database File
@@ -749,8 +745,7 @@ bool JenovaPackageManager::ObtainInstalledPackages()
749745
}
750746
bool JenovaPackageManager::CacheInstalledPackages()
751747
{
752-
// Create Installed Package File Path
753-
String projectPath = jenova::GetJenovaProjectDirectory();
748+
// Get Installed Package File Path
754749
String installedPackageFile = GetPackageDatabasePath();
755750

756751
// Serialize Package Database
@@ -781,7 +776,11 @@ bool JenovaPackageManager::CacheInstalledPackages()
781776
}
782777

783778
// Write Package Database On Disk
784-
if (!jenova::WriteStdStringToFile(AS_STD_STRING(installedPackageFile), packageDatabase.dump(2))) return false;
779+
if (!jenova::WriteStdStringToFile(AS_STD_STRING(installedPackageFile), packageDatabase.dump(2)))
780+
{
781+
jenova::Error("Jenova Package Manager", "Failed to Cache Package Database.");
782+
return false;
783+
}
785784

786785
// All Good
787786
return true;

0 commit comments

Comments
 (0)