mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 06:11:29 +03:00
-Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
This commit is contained in:
@@ -61,6 +61,7 @@ public:
|
||||
virtual bool get_option_visibility(const String &p_option, const Map<StringName, Variant> &p_options) const;
|
||||
|
||||
virtual String get_name() const;
|
||||
virtual String get_os_name() const;
|
||||
virtual Ref<Texture> get_logo() const;
|
||||
|
||||
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const;
|
||||
@@ -74,6 +75,12 @@ public:
|
||||
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags);
|
||||
virtual Ref<Texture> get_run_icon() const;
|
||||
|
||||
virtual void get_platform_features(List<String> *r_features) {
|
||||
|
||||
r_features->push_back("web");
|
||||
r_features->push_back("JavaScript");
|
||||
}
|
||||
|
||||
EditorExportPlatformJavaScript();
|
||||
};
|
||||
|
||||
@@ -167,6 +174,11 @@ String EditorExportPlatformJavaScript::get_name() const {
|
||||
return "HTML5";
|
||||
}
|
||||
|
||||
String EditorExportPlatformJavaScript::get_os_name() const {
|
||||
|
||||
return "JavaScript";
|
||||
}
|
||||
|
||||
Ref<Texture> EditorExportPlatformJavaScript::get_logo() const {
|
||||
|
||||
return logo;
|
||||
|
||||
@@ -29,8 +29,8 @@
|
||||
/*************************************************************************/
|
||||
#include "os_javascript.h"
|
||||
|
||||
#include "core/global_config.h"
|
||||
#include "core/io/file_access_buffered_fa.h"
|
||||
#include "core/project_settings.h"
|
||||
#include "dom_keys.h"
|
||||
#include "drivers/gles3/rasterizer_gles3.h"
|
||||
#include "drivers/unix/dir_access_unix.h"
|
||||
@@ -487,7 +487,7 @@ void OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver, i
|
||||
|
||||
#ifdef JAVASCRIPT_EVAL_ENABLED
|
||||
javascript_eval = memnew(JavaScript);
|
||||
GlobalConfig::get_singleton()->add_singleton(GlobalConfig::Singleton("JavaScript", javascript_eval));
|
||||
ProjectSettings::get_singleton()->add_singleton(ProjectSettings::Singleton("JavaScript", javascript_eval));
|
||||
#endif
|
||||
|
||||
visual_server->init();
|
||||
@@ -828,7 +828,7 @@ String OS_JavaScript::get_data_dir() const {
|
||||
return get_data_dir_func();
|
||||
*/
|
||||
return "/userfs";
|
||||
//return GlobalConfig::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
|
||||
//return ProjectSettings::get_singleton()->get_singleton_object("GodotOS")->call("get_data_dir");
|
||||
};
|
||||
|
||||
String OS_JavaScript::get_executable_path() const {
|
||||
@@ -911,6 +911,11 @@ int OS_JavaScript::get_power_percent_left() {
|
||||
return power_manager->get_power_percent_left();
|
||||
}
|
||||
|
||||
bool OS_JavaScript::_check_internal_feature_support(const String &p_feature) {
|
||||
|
||||
return p_feature == "web" || p_feature == "s3tc"; // TODO check for these features really being available
|
||||
}
|
||||
|
||||
OS_JavaScript::OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func) {
|
||||
set_cmdline(p_execpath, get_cmdline_args());
|
||||
main_loop = NULL;
|
||||
|
||||
@@ -164,6 +164,8 @@ public:
|
||||
virtual int get_power_seconds_left();
|
||||
virtual int get_power_percent_left();
|
||||
|
||||
virtual bool _check_internal_feature_support(const String &p_feature);
|
||||
|
||||
OS_JavaScript(const char *p_execpath, GetDataDirFunc p_get_data_dir_func);
|
||||
~OS_JavaScript();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user