-Project/Editor settings now use new inspector
-Project/Editor settings now show tooltips properly -Settings thar require restart now will show a restart warning -Video driver is now visible all the time, can be changed easily -Added function to request current video driver
This commit is contained in:
1 parent
76bfe14e00
commit
c69de2ba46
47 files changed
+1055
-81
No files matched your search
@@ -342,7 +342,7 @@ MessageQueue::MessageQueue() {
|
||||
|
||||
buffer_end = 0;
|
||||
buffer_max_used = 0;
|
||||
buffer_size = GLOBAL_DEF("memory/limits/message_queue/max_size_kb", DEFAULT_QUEUE_SIZE_KB);
|
||||
buffer_size = GLOBAL_DEF_RST("memory/limits/message_queue/max_size_kb", DEFAULT_QUEUE_SIZE_KB);
|
||||
buffer_size *= 1024;
|
||||
buffer = memnew_arr(uint8_t, buffer_size);
|
||||
}
|
||||
|
||||
@@ -659,6 +659,18 @@ const char *OS::get_audio_driver_name(int p_driver) const {
|
||||
return AudioDriverManager::get_driver(p_driver)->get_name();
|
||||
}
|
||||
|
||||
void OS::set_restart_on_exit(bool p_restart, const List<String> &p_restart_arguments) {
|
||||
restart_on_exit = p_restart;
|
||||
restart_commandline = p_restart_arguments;
|
||||
}
|
||||
|
||||
bool OS::is_restart_on_exit_set() const {
|
||||
return restart_on_exit;
|
||||
}
|
||||
List<String> OS::get_restart_on_exit_argumens() const {
|
||||
return restart_commandline;
|
||||
}
|
||||
|
||||
OS::OS() {
|
||||
void *volatile stack_bottom;
|
||||
|
||||
|
||||
+9
-1
@@ -74,6 +74,9 @@ class OS {
|
||||
|
||||
CompositeLogger *_logger;
|
||||
|
||||
bool restart_on_exit;
|
||||
List<String> restart_commandline;
|
||||
|
||||
protected:
|
||||
void _set_logger(CompositeLogger *p_logger);
|
||||
|
||||
@@ -182,7 +185,7 @@ public:
|
||||
|
||||
virtual int get_video_driver_count() const;
|
||||
virtual const char *get_video_driver_name(int p_driver) const;
|
||||
|
||||
virtual int get_current_video_driver() const = 0;
|
||||
virtual int get_audio_driver_count() const;
|
||||
virtual const char *get_audio_driver_name(int p_driver) const;
|
||||
|
||||
@@ -496,6 +499,11 @@ public:
|
||||
|
||||
bool is_layered_allowed() const { return _allow_layered; }
|
||||
bool is_hidpi_allowed() const { return _allow_hidpi; }
|
||||
|
||||
void set_restart_on_exit(bool p_restart, const List<String> &p_restart_arguments);
|
||||
bool is_restart_on_exit_set() const;
|
||||
List<String> get_restart_on_exit_argumens() const;
|
||||
|
||||
OS();
|
||||
virtual ~OS();
|
||||
};
|
||||
|
||||
@@ -105,6 +105,11 @@ void ProjectSettings::set_initial_value(const String &p_name, const Variant &p_v
|
||||
ERR_FAIL_COND(!props.has(p_name));
|
||||
props[p_name].initial = p_value;
|
||||
}
|
||||
void ProjectSettings::set_restart_if_changed(const String &p_name, bool p_restart) {
|
||||
|
||||
ERR_FAIL_COND(!props.has(p_name));
|
||||
props[p_name].restart_if_changed = p_restart;
|
||||
}
|
||||
|
||||
String ProjectSettings::globalize_path(const String &p_path) const {
|
||||
|
||||
@@ -225,6 +230,9 @@ void ProjectSettings::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
else
|
||||
vc.flags = PROPERTY_USAGE_EDITOR | PROPERTY_USAGE_STORAGE;
|
||||
|
||||
if (v->restart_if_changed) {
|
||||
vc.flags |= PROPERTY_USAGE_RESTART_IF_CHANGED;
|
||||
}
|
||||
vclist.insert(vc);
|
||||
}
|
||||
|
||||
@@ -817,7 +825,7 @@ Error ProjectSettings::save_custom(const String &p_path, const CustomMap &p_cust
|
||||
return OK;
|
||||
}
|
||||
|
||||
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) {
|
||||
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default, bool p_restart_if_changed) {
|
||||
|
||||
Variant ret;
|
||||
if (!ProjectSettings::get_singleton()->has_setting(p_var)) {
|
||||
@@ -827,6 +835,7 @@ Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default) {
|
||||
|
||||
ProjectSettings::get_singleton()->set_initial_value(p_var, p_default);
|
||||
ProjectSettings::get_singleton()->set_builtin_order(p_var);
|
||||
ProjectSettings::get_singleton()->set_restart_if_changed(p_var, p_restart_if_changed);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1080,7 +1089,6 @@ ProjectSettings::ProjectSettings() {
|
||||
custom_prop_info["rendering/threads/thread_model"] = PropertyInfo(Variant::INT, "rendering/threads/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
|
||||
custom_prop_info["physics/2d/thread_model"] = PropertyInfo(Variant::INT, "physics/2d/thread_model", PROPERTY_HINT_ENUM, "Single-Unsafe,Single-Safe,Multi-Threaded");
|
||||
custom_prop_info["rendering/quality/intended_usage/framebuffer_allocation"] = PropertyInfo(Variant::INT, "rendering/quality/intended_usage/framebuffer_allocation", PROPERTY_HINT_ENUM, "2D,2D Without Sampling,3D,3D Without Effects");
|
||||
GLOBAL_DEF("rendering/quality/intended_usage/framebuffer_mode", 2);
|
||||
|
||||
GLOBAL_DEF("debug/settings/profiler/max_functions", 16384);
|
||||
|
||||
|
||||
@@ -59,11 +59,13 @@ protected:
|
||||
Variant initial;
|
||||
bool hide_from_editor;
|
||||
bool overridden;
|
||||
bool restart_if_changed;
|
||||
VariantContainer() :
|
||||
order(0),
|
||||
persist(false),
|
||||
hide_from_editor(false),
|
||||
overridden(false) {
|
||||
restart_if_changed = false;
|
||||
}
|
||||
VariantContainer(const Variant &p_variant, int p_order, bool p_persist = false) :
|
||||
order(p_order),
|
||||
@@ -71,6 +73,7 @@ protected:
|
||||
variant(p_variant),
|
||||
hide_from_editor(false),
|
||||
overridden(false) {
|
||||
restart_if_changed = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -120,6 +123,7 @@ public:
|
||||
String globalize_path(const String &p_path) const;
|
||||
|
||||
void set_initial_value(const String &p_name, const Variant &p_value);
|
||||
void set_restart_if_changed(const String &p_name, bool p_restart);
|
||||
bool property_can_revert(const String &p_name);
|
||||
Variant property_get_revert(const String &p_name);
|
||||
|
||||
@@ -158,8 +162,9 @@ public:
|
||||
};
|
||||
|
||||
//not a macro any longer
|
||||
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default);
|
||||
Variant _GLOBAL_DEF(const String &p_var, const Variant &p_default, bool p_restart_if_changed = false);
|
||||
#define GLOBAL_DEF(m_var, m_value) _GLOBAL_DEF(m_var, m_value)
|
||||
#define GLOBAL_DEF_RST(m_var, m_value) _GLOBAL_DEF(m_var, m_value, true)
|
||||
#define GLOBAL_GET(m_var) ProjectSettings::get_singleton()->get(m_var)
|
||||
|
||||
#endif
|
||||
@@ -191,7 +191,7 @@ void register_core_types() {
|
||||
|
||||
void register_core_settings() {
|
||||
//since in register core types, globals may not e present
|
||||
GLOBAL_DEF("network/limits/packet_peer_stream/max_buffer_po2", (16));
|
||||
GLOBAL_DEF_RST("network/limits/packet_peer_stream/max_buffer_po2", (16));
|
||||
}
|
||||
|
||||
void register_core_singletons() {
|
||||
|
||||
@@ -102,7 +102,7 @@ Error AudioDriverCoreAudio::init() {
|
||||
break;
|
||||
}
|
||||
|
||||
mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
mix_rate = GLOBAL_DEF_RST("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
|
||||
zeromem(&strdesc, sizeof(strdesc));
|
||||
strdesc.mFormatID = kAudioFormatLinearPCM;
|
||||
@@ -117,7 +117,7 @@ Error AudioDriverCoreAudio::init() {
|
||||
result = AudioUnitSetProperty(audio_unit, kAudioUnitProperty_StreamFormat, kAudioUnitScope_Input, kOutputBus, &strdesc, sizeof(strdesc));
|
||||
ERR_FAIL_COND_V(result != noErr, FAILED);
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
// Sample rate is independent of channels (ref: https://stackoverflow.com/questions/11048825/audio-sample-frequency-rely-on-channels)
|
||||
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
||||
|
||||
|
||||
@@ -1895,7 +1895,7 @@ void RasterizerCanvasGLES3::initialize() {
|
||||
}
|
||||
{
|
||||
|
||||
uint32_t poly_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_buffer_size_kb", 128);
|
||||
uint32_t poly_size = GLOBAL_DEF_RST("rendering/limits/buffers/canvas_polygon_buffer_size_kb", 128);
|
||||
poly_size *= 1024; //kb
|
||||
poly_size = MAX(poly_size, (2 + 2 + 4) * 4 * sizeof(float));
|
||||
glGenBuffers(1, &data.polygon_buffer);
|
||||
@@ -1942,7 +1942,7 @@ void RasterizerCanvasGLES3::initialize() {
|
||||
|
||||
glGenVertexArrays(1, &data.polygon_buffer_pointer_array);
|
||||
|
||||
uint32_t index_size = GLOBAL_DEF("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", 128);
|
||||
uint32_t index_size = GLOBAL_DEF_RST("rendering/limits/buffers/canvas_polygon_index_buffer_size_kb", 128);
|
||||
index_size *= 1024; //kb
|
||||
glGenBuffers(1, &data.polygon_index_buffer);
|
||||
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, data.polygon_index_buffer);
|
||||
|
||||
@@ -4866,7 +4866,7 @@ void RasterizerSceneGLES3::initialize() {
|
||||
glBufferData(GL_UNIFORM_BUFFER, sizeof(State::EnvironmentRadianceUBO), &state.env_radiance_ubo, GL_DYNAMIC_DRAW);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, 0);
|
||||
|
||||
render_list.max_elements = GLOBAL_DEF("rendering/limits/rendering/max_renderable_elements", (int)RenderList::DEFAULT_MAX_ELEMENTS);
|
||||
render_list.max_elements = GLOBAL_DEF_RST("rendering/limits/rendering/max_renderable_elements", (int)RenderList::DEFAULT_MAX_ELEMENTS);
|
||||
if (render_list.max_elements > 1000000)
|
||||
render_list.max_elements = 1000000;
|
||||
if (render_list.max_elements < 1024)
|
||||
|
||||
@@ -7463,7 +7463,7 @@ void RasterizerStorageGLES3::initialize() {
|
||||
|
||||
{
|
||||
//transform feedback buffers
|
||||
uint32_t xf_feedback_size = GLOBAL_DEF("rendering/limits/buffers/blend_shape_max_buffer_size_kb", 4096);
|
||||
uint32_t xf_feedback_size = GLOBAL_DEF_RST("rendering/limits/buffers/blend_shape_max_buffer_size_kb", 4096);
|
||||
for (int i = 0; i < 2; i++) {
|
||||
|
||||
glGenBuffers(1, &resources.transform_feedback_buffers[i]);
|
||||
|
||||
@@ -155,7 +155,7 @@ Error AudioDriverPulseAudio::init_device() {
|
||||
break;
|
||||
}
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
||||
pa_buffer_size = buffer_frames * pa_map.channels;
|
||||
|
||||
@@ -204,7 +204,7 @@ Error AudioDriverPulseAudio::init() {
|
||||
thread_exited = false;
|
||||
exit_thread = false;
|
||||
|
||||
mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
mix_rate = GLOBAL_DEF_RST("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
|
||||
pa_ml = pa_mainloop_new();
|
||||
ERR_FAIL_COND_V(pa_ml == NULL, ERR_CANT_OPEN);
|
||||
|
||||
@@ -88,7 +88,7 @@ Error AudioDriverRtAudio::init() {
|
||||
|
||||
// FIXME: Adapt to the OutputFormat -> SpeakerMode change
|
||||
/*
|
||||
String channels = GLOBAL_DEF("audio/output","stereo");
|
||||
String channels = GLOBAL_DEF_RST("audio/output","stereo");
|
||||
|
||||
if (channels=="5.1")
|
||||
output_format=OUTPUT_5_1;
|
||||
@@ -108,7 +108,7 @@ Error AudioDriverRtAudio::init() {
|
||||
options.numberOfBuffers = 4;
|
||||
|
||||
parameters.firstChannel = 0;
|
||||
mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
mix_rate = GLOBAL_DEF_RST("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
unsigned int buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
||||
|
||||
@@ -318,7 +318,7 @@ Error AudioDriverWASAPI::finish_device() {
|
||||
|
||||
Error AudioDriverWASAPI::init() {
|
||||
|
||||
mix_rate = GLOBAL_DEF("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
mix_rate = GLOBAL_DEF_RST("audio/mix_rate", DEFAULT_MIX_RATE);
|
||||
|
||||
Error err = init_device();
|
||||
if (err != OK) {
|
||||
|
||||
@@ -50,7 +50,7 @@ Error AudioDriverXAudio2::init() {
|
||||
speaker_mode = SPEAKER_MODE_STEREO;
|
||||
channels = 2;
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", 25);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", 25);
|
||||
buffer_size = closest_power_of_2(latency * mix_rate / 1000);
|
||||
|
||||
samples_in = memnew_arr(int32_t, buffer_size * channels);
|
||||
|
||||
@@ -1507,12 +1507,19 @@ void EditorInspector::update_tree() {
|
||||
checked = p.usage & PROPERTY_USAGE_CHECKED;
|
||||
}
|
||||
|
||||
if (p.usage & PROPERTY_USAGE_RESTART_IF_CHANGED) {
|
||||
restart_request_props.insert(p.name);
|
||||
}
|
||||
|
||||
String doc_hint;
|
||||
|
||||
if (use_doc_hints) {
|
||||
|
||||
StringName classname = object->get_class_name();
|
||||
StringName propname = p.name;
|
||||
if (object_class != String()) {
|
||||
classname = object_class;
|
||||
}
|
||||
StringName propname = property_prefix + p.name;
|
||||
String descr;
|
||||
bool found = false;
|
||||
|
||||
@@ -1580,9 +1587,9 @@ void EditorInspector::update_tree() {
|
||||
ep->connect("resource_selected", this, "_resource_selected", varray(), CONNECT_DEFERRED);
|
||||
ep->connect("object_id_selected", this, "_object_id_selected", varray(), CONNECT_DEFERRED);
|
||||
if (doc_hint != String()) {
|
||||
ep->set_tooltip(TTR("Property: ") + p.name + "\n\n" + doc_hint);
|
||||
ep->set_tooltip(TTR("Property: ") + property_prefix + p.name + "\n\n" + doc_hint);
|
||||
} else {
|
||||
ep->set_tooltip(TTR("Property: ") + p.name);
|
||||
ep->set_tooltip(TTR("Property: ") + property_prefix + p.name);
|
||||
}
|
||||
ep->set_draw_red(draw_red);
|
||||
ep->set_use_folding(use_folding);
|
||||
@@ -1659,6 +1666,7 @@ void EditorInspector::_clear() {
|
||||
editor_property_map.clear();
|
||||
sections.clear();
|
||||
pending.clear();
|
||||
restart_request_props.clear();
|
||||
}
|
||||
|
||||
void EditorInspector::refresh() {
|
||||
@@ -1902,6 +1910,10 @@ void EditorInspector::_property_changed(const String &p_path, const Variant &p_v
|
||||
|
||||
if (changing)
|
||||
this->changing--;
|
||||
|
||||
if (restart_request_props.has(p_path)) {
|
||||
emit_signal("restart_requested");
|
||||
}
|
||||
}
|
||||
|
||||
void EditorInspector::_property_changed_update_all(const String &p_path, const Variant &p_value) {
|
||||
@@ -1921,6 +1933,9 @@ void EditorInspector::_multiple_properties_changed(Vector<String> p_paths, Array
|
||||
undo_redo->create_action(TTR("Set Multiple:") + " " + names, UndoRedo::MERGE_ENDS);
|
||||
for (int i = 0; i < p_paths.size(); i++) {
|
||||
_edit_set(p_paths[i], p_values[i], false, "");
|
||||
if (restart_request_props.has(p_paths[i])) {
|
||||
emit_signal("restart_requested");
|
||||
}
|
||||
}
|
||||
changing++;
|
||||
undo_redo->commit_action();
|
||||
@@ -1993,6 +2008,8 @@ void EditorInspector::_property_selected(const String &p_path, int p_focusable)
|
||||
E->get()->deselect();
|
||||
}
|
||||
}
|
||||
|
||||
emit_signal("property_selected", p_path);
|
||||
}
|
||||
|
||||
void EditorInspector::_object_id_selected(const String &p_path, ObjectID p_id) {
|
||||
@@ -2090,6 +2107,21 @@ void EditorInspector::_vscroll_changed(double p_offset) {
|
||||
scroll_cache[object->get_instance_id()] = p_offset;
|
||||
}
|
||||
}
|
||||
void EditorInspector::set_property_prefix(const String &p_prefix) {
|
||||
property_prefix = p_prefix;
|
||||
}
|
||||
|
||||
String EditorInspector::get_property_prefix() const {
|
||||
return property_prefix;
|
||||
}
|
||||
|
||||
void EditorInspector::set_object_class(const String &p_class) {
|
||||
object_class = p_class;
|
||||
}
|
||||
|
||||
String EditorInspector::get_object_class() const {
|
||||
return object_class;
|
||||
}
|
||||
|
||||
void EditorInspector::_bind_methods() {
|
||||
|
||||
@@ -2110,9 +2142,12 @@ void EditorInspector::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("refresh", &EditorInspector::refresh);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("property_selected", PropertyInfo(Variant::STRING, "property")));
|
||||
ADD_SIGNAL(MethodInfo("property_keyed", PropertyInfo(Variant::STRING, "property")));
|
||||
ADD_SIGNAL(MethodInfo("resource_selected", PropertyInfo(Variant::OBJECT, "res"), PropertyInfo(Variant::STRING, "prop")));
|
||||
ADD_SIGNAL(MethodInfo("object_id_selected", PropertyInfo(Variant::INT, "id")));
|
||||
ADD_SIGNAL(MethodInfo("property_edited", PropertyInfo(Variant::STRING, "property")));
|
||||
ADD_SIGNAL(MethodInfo("restart_requested"));
|
||||
}
|
||||
|
||||
EditorInspector::EditorInspector() {
|
||||
|
||||
@@ -267,9 +267,13 @@ class EditorInspector : public ScrollContainer {
|
||||
|
||||
Map<StringName, Map<StringName, String> > descr_cache;
|
||||
Map<StringName, String> class_descr_cache;
|
||||
Set<StringName> restart_request_props;
|
||||
|
||||
Map<ObjectID, int> scroll_cache;
|
||||
|
||||
String property_prefix; //used for sectioned inspector
|
||||
String object_class;
|
||||
|
||||
void _edit_set(const String &p_name, const Variant &p_value, bool p_refresh_all, const String &p_changed_field);
|
||||
|
||||
void _property_changed(const String &p_path, const Variant &p_value, bool changing = false);
|
||||
@@ -343,6 +347,12 @@ public:
|
||||
void set_scroll_offset(int p_offset);
|
||||
int get_scroll_offset() const;
|
||||
|
||||
void set_property_prefix(const String &p_prefix);
|
||||
String get_property_prefix() const;
|
||||
|
||||
void set_object_class(const String &p_class);
|
||||
String get_object_class() const;
|
||||
|
||||
void set_use_sub_inspector_bg(bool p_enable);
|
||||
|
||||
EditorInspector();
|
||||
|
||||
+89
-8
@@ -1068,6 +1068,32 @@ void EditorNode::_save_scene(String p_file, int idx) {
|
||||
}
|
||||
}
|
||||
|
||||
void EditorNode::save_all_scenes_and_restart() {
|
||||
|
||||
_menu_option_confirm(RUN_STOP, true);
|
||||
exiting = true;
|
||||
|
||||
_save_all_scenes();
|
||||
|
||||
String to_reopen;
|
||||
if (get_tree()->get_edited_scene_root()) {
|
||||
to_reopen = get_tree()->get_edited_scene_root()->get_filename();
|
||||
}
|
||||
|
||||
get_tree()->quit();
|
||||
String exec = OS::get_singleton()->get_executable_path();
|
||||
|
||||
List<String> args;
|
||||
args.push_back("--path");
|
||||
args.push_back(ProjectSettings::get_singleton()->get_resource_path());
|
||||
args.push_back("-e");
|
||||
if (to_reopen != String()) {
|
||||
args.push_back(to_reopen);
|
||||
}
|
||||
|
||||
OS::get_singleton()->set_restart_on_exit(true, args);
|
||||
}
|
||||
|
||||
void EditorNode::_save_all_scenes() {
|
||||
|
||||
for (int i = 0; i < editor_data.get_edited_scene_count(); i++) {
|
||||
@@ -2204,6 +2230,13 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
|
||||
about->popup_centered_minsize(Size2(780, 500) * EDSCALE);
|
||||
} break;
|
||||
|
||||
case SET_VIDEO_DRIVER_SAVE_AND_RESTART: {
|
||||
|
||||
ProjectSettings::get_singleton()->set("rendering/quality/driver/driver_name", video_driver_request);
|
||||
ProjectSettings::get_singleton()->save();
|
||||
|
||||
save_all_scenes_and_restart();
|
||||
} break;
|
||||
default: {
|
||||
if (p_option >= IMPORT_PLUGIN_BASE) {
|
||||
}
|
||||
@@ -4390,6 +4423,21 @@ void EditorNode::_bottom_panel_raise_toggled(bool p_pressed) {
|
||||
}
|
||||
}
|
||||
|
||||
void EditorNode::_video_driver_selected(int p_which) {
|
||||
|
||||
String driver = video_driver->get_item_metadata(p_which);
|
||||
|
||||
String current = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
|
||||
|
||||
if (driver == current) {
|
||||
return;
|
||||
}
|
||||
|
||||
video_driver_request = driver;
|
||||
video_restart_dialog->popup_centered_minsize();
|
||||
video_driver->select(video_driver_current);
|
||||
}
|
||||
|
||||
void EditorNode::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_menu_option", &EditorNode::_menu_option);
|
||||
@@ -4460,6 +4508,8 @@ void EditorNode::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_resources_reimported"), &EditorNode::_resources_reimported);
|
||||
ClassDB::bind_method(D_METHOD("_bottom_panel_raise_toggled"), &EditorNode::_bottom_panel_raise_toggled);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_video_driver_selected"), &EditorNode::_video_driver_selected);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("play_pressed"));
|
||||
ADD_SIGNAL(MethodInfo("pause_pressed"));
|
||||
ADD_SIGNAL(MethodInfo("stop_pressed"));
|
||||
@@ -4656,19 +4706,19 @@ EditorNode::EditorNode() {
|
||||
ClassDB::set_class_enabled("RootMotionView", true);
|
||||
|
||||
//defs here, use EDITOR_GET in logic
|
||||
EDITOR_DEF("interface/scene_tabs/always_show_close_button", false);
|
||||
EDITOR_DEF("interface/scene_tabs/resize_if_many_tabs", true);
|
||||
EDITOR_DEF("interface/scene_tabs/minimum_width", 50);
|
||||
EDITOR_DEF_RST("interface/scene_tabs/always_show_close_button", false);
|
||||
EDITOR_DEF_RST("interface/scene_tabs/resize_if_many_tabs", true);
|
||||
EDITOR_DEF_RST("interface/scene_tabs/minimum_width", 50);
|
||||
EDITOR_DEF("run/output/always_clear_output_on_play", true);
|
||||
EDITOR_DEF("run/output/always_open_output_on_play", true);
|
||||
EDITOR_DEF("run/output/always_close_output_on_stop", true);
|
||||
EDITOR_DEF("run/auto_save/save_before_running", true);
|
||||
EDITOR_DEF("interface/editor/save_each_scene_on_quit", true);
|
||||
EDITOR_DEF_RST("interface/editor/save_each_scene_on_quit", true);
|
||||
EDITOR_DEF("interface/editor/quit_confirmation", true);
|
||||
EDITOR_DEF("interface/scene_tabs/restore_scenes_on_load", false);
|
||||
EDITOR_DEF("interface/scene_tabs/show_thumbnail_on_hover", true);
|
||||
EDITOR_DEF("interface/inspector/capitalize_properties", true);
|
||||
EDITOR_DEF("interface/inspector/disable_folding", false);
|
||||
EDITOR_DEF_RST("interface/scene_tabs/restore_scenes_on_load", false);
|
||||
EDITOR_DEF_RST("interface/scene_tabs/show_thumbnail_on_hover", true);
|
||||
EDITOR_DEF_RST("interface/inspector/capitalize_properties", true);
|
||||
EDITOR_DEF_RST("interface/inspector/disable_folding", false);
|
||||
EDITOR_DEF("interface/inspector/open_resources_in_current_inspector", true);
|
||||
EDITOR_DEF("interface/inspector/resources_types_to_open_in_new_inspector", "SpatialMaterial");
|
||||
EDITOR_DEF("run/auto_save/save_before_running", true);
|
||||
@@ -5191,6 +5241,37 @@ EditorNode::EditorNode() {
|
||||
play_custom_scene_button->set_shortcut(ED_SHORTCUT("editor/play_custom_scene", TTR("Play Custom Scene"), KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_F5));
|
||||
#endif
|
||||
|
||||
video_driver = memnew(OptionButton);
|
||||
video_driver->set_flat(true);
|
||||
video_driver->set_focus_mode(Control::FOCUS_NONE);
|
||||
video_driver->set_v_size_flags(Control::SIZE_SHRINK_CENTER);
|
||||
String video_drivers = ProjectSettings::get_singleton()->get_custom_property_info()["rendering/quality/driver/driver_name"].hint_string;
|
||||
String current_video_driver = OS::get_singleton()->get_video_driver_name(OS::get_singleton()->get_current_video_driver());
|
||||
menu_hb->add_child(video_driver);
|
||||
video_driver_current = 0;
|
||||
for (int i = 0; i < video_drivers.get_slice_count(","); i++) {
|
||||
String driver = video_drivers.get_slice(",", i);
|
||||
if (gui_base->has_icon(driver, "EditorIcons")) {
|
||||
video_driver->add_icon_item(gui_base->get_icon(driver, "EditorIcons"), "");
|
||||
} else {
|
||||
video_driver->add_item(driver);
|
||||
}
|
||||
|
||||
video_driver->set_item_metadata(i, driver);
|
||||
|
||||
if (current_video_driver == driver) {
|
||||
video_driver->select(i);
|
||||
video_driver_current = i;
|
||||
}
|
||||
}
|
||||
|
||||
video_driver->connect("item_selected", this, "_video_driver_selected");
|
||||
video_restart_dialog = memnew(ConfirmationDialog);
|
||||
video_restart_dialog->set_text(TTR("Changing the video driver requires restarting the editor."));
|
||||
video_restart_dialog->get_ok()->set_text(TTR("Save & Restart"));
|
||||
video_restart_dialog->connect("confirmed", this, "_menu_option", varray(SET_VIDEO_DRIVER_SAVE_AND_RESTART));
|
||||
add_child(video_restart_dialog);
|
||||
|
||||
progress_hb = memnew(BackgroundProgress);
|
||||
|
||||
HBoxContainer *right_menu_hb = memnew(HBoxContainer);
|
||||
|
||||
@@ -182,6 +182,8 @@ private:
|
||||
HELP_COMMUNITY,
|
||||
HELP_ABOUT,
|
||||
|
||||
SET_VIDEO_DRIVER_SAVE_AND_RESTART,
|
||||
|
||||
IMPORT_PLUGIN_BASE = 100,
|
||||
|
||||
TOOL_MENU_BASE = 1000
|
||||
@@ -194,6 +196,13 @@ private:
|
||||
Control *gui_base;
|
||||
VBoxContainer *main_vbox;
|
||||
PanelContainer *play_button_panel;
|
||||
OptionButton *video_driver;
|
||||
|
||||
ConfirmationDialog *video_restart_dialog;
|
||||
|
||||
int video_driver_current;
|
||||
String video_driver_request;
|
||||
void _video_driver_selected(int);
|
||||
|
||||
//split
|
||||
|
||||
@@ -745,6 +754,8 @@ public:
|
||||
void add_tool_submenu_item(const String &p_name, PopupMenu *p_submenu);
|
||||
void remove_tool_menu_item(const String &p_name);
|
||||
|
||||
void save_all_scenes_and_restart();
|
||||
|
||||
void dim_editor(bool p_dimming);
|
||||
|
||||
void edit_current() { _edit_current(); };
|
||||
|
||||
@@ -0,0 +1,306 @@
|
||||
#include "editor_sectioned_inspector.h"
|
||||
#include "editor_scale.h"
|
||||
class SectionedInspectorFilter : public Object {
|
||||
|
||||
GDCLASS(SectionedInspectorFilter, Object);
|
||||
|
||||
Object *edited;
|
||||
String section;
|
||||
bool allow_sub;
|
||||
|
||||
bool _set(const StringName &p_name, const Variant &p_value) {
|
||||
|
||||
if (!edited)
|
||||
return false;
|
||||
|
||||
String name = p_name;
|
||||
if (section != "") {
|
||||
name = section + "/" + name;
|
||||
}
|
||||
|
||||
bool valid;
|
||||
edited->set(name, p_value, &valid);
|
||||
return valid;
|
||||
}
|
||||
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const {
|
||||
|
||||
if (!edited)
|
||||
return false;
|
||||
|
||||
String name = p_name;
|
||||
if (section != "") {
|
||||
name = section + "/" + name;
|
||||
}
|
||||
|
||||
bool valid = false;
|
||||
|
||||
r_ret = edited->get(name, &valid);
|
||||
return valid;
|
||||
}
|
||||
void _get_property_list(List<PropertyInfo> *p_list) const {
|
||||
|
||||
if (!edited)
|
||||
return;
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
edited->get_property_list(&pinfo);
|
||||
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
|
||||
|
||||
PropertyInfo pi = E->get();
|
||||
int sp = pi.name.find("/");
|
||||
|
||||
if (pi.name == "resource_path" || pi.name == "resource_name" || pi.name == "resource_local_to_scene" || pi.name.begins_with("script/")) //skip resource stuff
|
||||
continue;
|
||||
|
||||
if (sp == -1) {
|
||||
pi.name = "global/" + pi.name;
|
||||
}
|
||||
|
||||
if (pi.name.begins_with(section + "/")) {
|
||||
pi.name = pi.name.replace_first(section + "/", "");
|
||||
if (!allow_sub && pi.name.find("/") != -1)
|
||||
continue;
|
||||
p_list->push_back(pi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool property_can_revert(const String &p_name) {
|
||||
|
||||
return edited->call("property_can_revert", section + "/" + p_name);
|
||||
}
|
||||
|
||||
Variant property_get_revert(const String &p_name) {
|
||||
|
||||
return edited->call("property_get_revert", section + "/" + p_name);
|
||||
}
|
||||
|
||||
protected:
|
||||
static void _bind_methods() {
|
||||
|
||||
ClassDB::bind_method("property_can_revert", &SectionedInspectorFilter::property_can_revert);
|
||||
ClassDB::bind_method("property_get_revert", &SectionedInspectorFilter::property_get_revert);
|
||||
}
|
||||
|
||||
public:
|
||||
void set_section(const String &p_section, bool p_allow_sub) {
|
||||
|
||||
section = p_section;
|
||||
allow_sub = p_allow_sub;
|
||||
_change_notify();
|
||||
}
|
||||
|
||||
void set_edited(Object *p_edited) {
|
||||
edited = p_edited;
|
||||
_change_notify();
|
||||
}
|
||||
|
||||
SectionedInspectorFilter() {
|
||||
edited = NULL;
|
||||
}
|
||||
};
|
||||
|
||||
void SectionedInspector::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method("_section_selected", &SectionedInspector::_section_selected);
|
||||
ClassDB::bind_method("_search_changed", &SectionedInspector::_search_changed);
|
||||
|
||||
ClassDB::bind_method("update_category_list", &SectionedInspector::update_category_list);
|
||||
}
|
||||
|
||||
void SectionedInspector::_section_selected() {
|
||||
|
||||
if (!sections->get_selected())
|
||||
return;
|
||||
|
||||
filter->set_section(sections->get_selected()->get_metadata(0), sections->get_selected()->get_children() == NULL);
|
||||
inspector->set_property_prefix(String(sections->get_selected()->get_metadata(0)) + "/");
|
||||
}
|
||||
|
||||
void SectionedInspector::set_current_section(const String &p_section) {
|
||||
|
||||
if (section_map.has(p_section)) {
|
||||
section_map[p_section]->select(0);
|
||||
}
|
||||
}
|
||||
|
||||
String SectionedInspector::get_current_section() const {
|
||||
|
||||
if (sections->get_selected())
|
||||
return sections->get_selected()->get_metadata(0);
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
String SectionedInspector::get_full_item_path(const String &p_item) {
|
||||
|
||||
String base = get_current_section();
|
||||
|
||||
if (base != "")
|
||||
return base + "/" + p_item;
|
||||
else
|
||||
return p_item;
|
||||
}
|
||||
|
||||
void SectionedInspector::edit(Object *p_object) {
|
||||
|
||||
if (!p_object) {
|
||||
obj = -1;
|
||||
sections->clear();
|
||||
|
||||
filter->set_edited(NULL);
|
||||
inspector->edit(NULL);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
ObjectID id = p_object->get_instance_id();
|
||||
|
||||
inspector->set_object_class(p_object->get_class());
|
||||
|
||||
if (obj != id) {
|
||||
|
||||
obj = id;
|
||||
update_category_list();
|
||||
|
||||
filter->set_edited(p_object);
|
||||
inspector->edit(filter);
|
||||
|
||||
if (sections->get_root()->get_children()) {
|
||||
sections->get_root()->get_children()->select(0);
|
||||
}
|
||||
} else {
|
||||
|
||||
update_category_list();
|
||||
}
|
||||
}
|
||||
|
||||
void SectionedInspector::update_category_list() {
|
||||
|
||||
String selected_category = get_current_section();
|
||||
sections->clear();
|
||||
|
||||
Object *o = ObjectDB::get_instance(obj);
|
||||
|
||||
if (!o)
|
||||
return;
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
o->get_property_list(&pinfo);
|
||||
|
||||
section_map.clear();
|
||||
|
||||
TreeItem *root = sections->create_item();
|
||||
section_map[""] = root;
|
||||
|
||||
for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
|
||||
|
||||
PropertyInfo pi = E->get();
|
||||
|
||||
if (pi.usage & PROPERTY_USAGE_CATEGORY)
|
||||
continue;
|
||||
else if (!(pi.usage & PROPERTY_USAGE_EDITOR))
|
||||
continue;
|
||||
|
||||
if (pi.name.find(":") != -1 || pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene")
|
||||
continue;
|
||||
|
||||
if (search_box && search_box->get_text() != String() && pi.name.findn(search_box->get_text()) == -1)
|
||||
continue;
|
||||
|
||||
int sp = pi.name.find("/");
|
||||
if (sp == -1)
|
||||
pi.name = "Global/" + pi.name;
|
||||
|
||||
Vector<String> sectionarr = pi.name.split("/");
|
||||
String metasection;
|
||||
|
||||
int sc = MIN(2, sectionarr.size() - 1);
|
||||
|
||||
for (int i = 0; i < sc; i++) {
|
||||
|
||||
TreeItem *parent = section_map[metasection];
|
||||
parent->set_custom_bg_color(0, get_color("prop_subsection", "Editor"));
|
||||
|
||||
if (i > 0) {
|
||||
metasection += "/" + sectionarr[i];
|
||||
} else {
|
||||
metasection = sectionarr[i];
|
||||
}
|
||||
|
||||
if (!section_map.has(metasection)) {
|
||||
TreeItem *ms = sections->create_item(parent);
|
||||
section_map[metasection] = ms;
|
||||
ms->set_text(0, sectionarr[i].capitalize());
|
||||
ms->set_metadata(0, metasection);
|
||||
ms->set_selectable(0, false);
|
||||
}
|
||||
|
||||
if (i == sc - 1) {
|
||||
//if it has children, make selectable
|
||||
section_map[metasection]->set_selectable(0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (section_map.has(selected_category)) {
|
||||
section_map[selected_category]->select(0);
|
||||
}
|
||||
|
||||
inspector->update_tree();
|
||||
}
|
||||
|
||||
void SectionedInspector::register_search_box(LineEdit *p_box) {
|
||||
|
||||
search_box = p_box;
|
||||
inspector->register_text_enter(p_box);
|
||||
search_box->connect("text_changed", this, "_search_changed");
|
||||
}
|
||||
|
||||
void SectionedInspector::_search_changed(const String &p_what) {
|
||||
|
||||
update_category_list();
|
||||
}
|
||||
|
||||
EditorInspector *SectionedInspector::get_inspector() {
|
||||
|
||||
return inspector;
|
||||
}
|
||||
|
||||
SectionedInspector::SectionedInspector() {
|
||||
|
||||
obj = -1;
|
||||
|
||||
search_box = NULL;
|
||||
|
||||
add_constant_override("autohide", 1); // Fixes the dragger always showing up
|
||||
|
||||
VBoxContainer *left_vb = memnew(VBoxContainer);
|
||||
left_vb->set_custom_minimum_size(Size2(170, 0) * EDSCALE);
|
||||
add_child(left_vb);
|
||||
|
||||
sections = memnew(Tree);
|
||||
sections->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
sections->set_hide_root(true);
|
||||
|
||||
left_vb->add_child(sections, true);
|
||||
|
||||
VBoxContainer *right_vb = memnew(VBoxContainer);
|
||||
right_vb->set_custom_minimum_size(Size2(300, 0) * EDSCALE);
|
||||
right_vb->set_h_size_flags(SIZE_EXPAND_FILL);
|
||||
add_child(right_vb);
|
||||
|
||||
filter = memnew(SectionedInspectorFilter);
|
||||
inspector = memnew(EditorInspector);
|
||||
inspector->set_v_size_flags(SIZE_EXPAND_FILL);
|
||||
right_vb->add_child(inspector, true);
|
||||
inspector->set_use_doc_hints(true);
|
||||
|
||||
sections->connect("cell_selected", this, "_section_selected");
|
||||
}
|
||||
|
||||
SectionedInspector::~SectionedInspector() {
|
||||
|
||||
memdelete(filter);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef EDITOR_SECTIONED_INSPECTOR_H
|
||||
#define EDITOR_SECTIONED_INSPECTOR_H
|
||||
|
||||
#include "editor/editor_inspector.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/tree.h"
|
||||
|
||||
class SectionedInspectorFilter;
|
||||
|
||||
class SectionedInspector : public HSplitContainer {
|
||||
|
||||
GDCLASS(SectionedInspector, HSplitContainer);
|
||||
|
||||
ObjectID obj;
|
||||
|
||||
Tree *sections;
|
||||
SectionedInspectorFilter *filter;
|
||||
|
||||
Map<String, TreeItem *> section_map;
|
||||
EditorInspector *inspector;
|
||||
LineEdit *search_box;
|
||||
|
||||
static void _bind_methods();
|
||||
void _section_selected();
|
||||
|
||||
void _search_changed(const String &p_what);
|
||||
|
||||
public:
|
||||
void register_search_box(LineEdit *p_box);
|
||||
EditorInspector *get_inspector();
|
||||
void edit(Object *p_object);
|
||||
String get_full_item_path(const String &p_item);
|
||||
|
||||
void set_current_section(const String &p_section);
|
||||
String get_current_section() const;
|
||||
|
||||
void update_category_list();
|
||||
|
||||
SectionedInspector();
|
||||
~SectionedInspector();
|
||||
};
|
||||
#endif // EDITOR_SECTIONED_INSPECTOR_H
|
||||
@@ -165,6 +165,7 @@ struct _EVCSort {
|
||||
Variant::Type type;
|
||||
int order;
|
||||
bool save;
|
||||
bool restart_if_changed;
|
||||
|
||||
bool operator<(const _EVCSort &p_vcs) const { return order < p_vcs.order; }
|
||||
};
|
||||
@@ -188,6 +189,7 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
vc.order = v->order;
|
||||
vc.type = v->variant.get_type();
|
||||
vc.save = v->save;
|
||||
vc.restart_if_changed = v->restart_if_changed;
|
||||
|
||||
vclist.insert(vc);
|
||||
}
|
||||
@@ -210,6 +212,10 @@ void EditorSettings::_get_property_list(List<PropertyInfo> *p_list) const {
|
||||
if (hints.has(E->get().name))
|
||||
pi = hints[E->get().name];
|
||||
|
||||
if (E->get().restart_if_changed) {
|
||||
pi.usage |= PROPERTY_USAGE_RESTART_IF_CHANGED;
|
||||
}
|
||||
|
||||
p_list->push_back(pi);
|
||||
}
|
||||
|
||||
@@ -280,6 +286,7 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
|
||||
}
|
||||
|
||||
_initial_set("interface/editor/editor_language", best);
|
||||
set_restart_if_changed("interface/editor/editor_language", true);
|
||||
hints["interface/editor/editor_language"] = PropertyInfo(Variant::STRING, "interface/editor/editor_language", PROPERTY_HINT_ENUM, lang_hint, PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_RESTART_IF_CHANGED);
|
||||
}
|
||||
|
||||
@@ -1017,6 +1024,14 @@ void EditorSettings::raise_order(const String &p_setting) {
|
||||
props[p_setting].order = ++last_order;
|
||||
}
|
||||
|
||||
void EditorSettings::set_restart_if_changed(const StringName &p_setting, bool p_restart) {
|
||||
_THREAD_SAFE_METHOD_
|
||||
|
||||
if (!props.has(p_setting))
|
||||
return;
|
||||
props[p_setting].restart_if_changed = p_restart;
|
||||
}
|
||||
|
||||
void EditorSettings::set_initial_value(const StringName &p_setting, const Variant &p_value, bool p_update_current) {
|
||||
|
||||
_THREAD_SAFE_METHOD_
|
||||
@@ -1030,16 +1045,19 @@ void EditorSettings::set_initial_value(const StringName &p_setting, const Varian
|
||||
}
|
||||
}
|
||||
|
||||
Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default) {
|
||||
Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_restart_if_changed) {
|
||||
|
||||
Variant ret = p_default;
|
||||
if (EditorSettings::get_singleton()->has_setting(p_setting))
|
||||
if (EditorSettings::get_singleton()->has_setting(p_setting)) {
|
||||
ret = EditorSettings::get_singleton()->get(p_setting);
|
||||
else
|
||||
} else {
|
||||
EditorSettings::get_singleton()->set_manually(p_setting, p_default);
|
||||
EditorSettings::get_singleton()->set_restart_if_changed(p_setting, p_restart_if_changed);
|
||||
}
|
||||
|
||||
if (!EditorSettings::get_singleton()->has_default_value(p_setting))
|
||||
if (!EditorSettings::get_singleton()->has_default_value(p_setting)) {
|
||||
EditorSettings::get_singleton()->set_initial_value(p_setting, p_default);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,7 @@ private:
|
||||
bool has_default_value;
|
||||
bool hide_from_editor;
|
||||
bool save;
|
||||
bool restart_if_changed;
|
||||
VariantContainer() {
|
||||
variant = Variant();
|
||||
initial = Variant();
|
||||
@@ -77,6 +78,7 @@ private:
|
||||
hide_from_editor = false;
|
||||
has_default_value = false;
|
||||
save = false;
|
||||
restart_if_changed = false;
|
||||
}
|
||||
VariantContainer(const Variant &p_variant, int p_order) {
|
||||
variant = p_variant;
|
||||
@@ -85,6 +87,7 @@ private:
|
||||
hide_from_editor = false;
|
||||
has_default_value = false;
|
||||
save = false;
|
||||
restart_if_changed = false;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -145,6 +148,7 @@ public:
|
||||
void erase(const String &p_setting);
|
||||
void raise_order(const String &p_setting);
|
||||
void set_initial_value(const StringName &p_setting, const Variant &p_value, bool p_update_current = false);
|
||||
void set_restart_if_changed(const StringName &p_setting, bool p_restart);
|
||||
void set_manually(const StringName &p_setting, const Variant &p_value, bool p_emit_signal = false) {
|
||||
if (p_emit_signal)
|
||||
_set(p_setting, p_value);
|
||||
@@ -200,7 +204,8 @@ public:
|
||||
//not a macro any longer
|
||||
|
||||
#define EDITOR_DEF(m_var, m_val) _EDITOR_DEF(m_var, Variant(m_val))
|
||||
Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default);
|
||||
#define EDITOR_DEF_RST(m_var, m_val) _EDITOR_DEF(m_var, Variant(m_val), true)
|
||||
Variant _EDITOR_DEF(const String &p_setting, const Variant &p_default, bool p_restart_if_changed = false);
|
||||
|
||||
#define EDITOR_GET(m_var) _EDITOR_GET(m_var)
|
||||
Variant _EDITOR_GET(const String &p_setting);
|
||||
|
||||
@@ -268,7 +268,8 @@ void EditorSpinSlider::_notification(int p_what) {
|
||||
update();
|
||||
}
|
||||
if (p_what == NOTIFICATION_FOCUS_ENTER) {
|
||||
/* Sorry, I dont like this, it makes navigating the different fields with arrows more difficult
|
||||
/* Sorry, I dont like this, it makes navigating the different fields with arrows more difficult.
|
||||
* Just press enter to edit.
|
||||
* if (!Input::get_singleton()->is_mouse_button_pressed(BUTTON_LEFT) && !value_input_just_closed) {
|
||||
_focus_entered();
|
||||
}*/
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="48"
|
||||
height="16"
|
||||
viewBox="0 0 47.999999 16"
|
||||
sodipodi:docname="icon_g_l_e_s_2.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)">
|
||||
<metadata
|
||||
id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1484"
|
||||
inkscape:window-height="697"
|
||||
id="namedview4"
|
||||
showgrid="false"
|
||||
inkscape:zoom="13.520979"
|
||||
inkscape:cx="20.549976"
|
||||
inkscape:cy="7.9399684"
|
||||
inkscape:window-x="67"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
id="path835"
|
||||
d="m 19.839879,15.499154 c -0.0652,-0.0268 -0.141743,-0.1098 -0.170113,-0.184417 -0.03304,-0.08688 -0.05158,-0.95731 -0.05158,-5.912028 V 3.1830459 l 0.108486,-0.1379162 c 0.150269,-0.1910365 0.41814,-0.1907342 0.568677,6.436e-4 l 0.10899,0.1385579 -0.01358,6.2990785 c -0.01194,6.8660953 -0.0921,5.3381383 -0.0921,5.9327083 -0.106573,0.104434 -0.315006,0.142158 -0.458762,0.08303 z M 5.3808767,14.575188 C 4.5309456,14.518738 3.6260357,14.196602 2.9750499,13.718734 2.5767564,13.42636 2.0035795,12.787236 1.747789,12.350269 1.2385669,11.480363 1.0170768,10.580508 1.0213778,9.399057 1.0293972,7.2009406 1.9726797,5.5285643 3.6891526,4.6693537 4.7813316,4.1226444 6.2246017,4.0371807 7.4330177,4.4476602 8.1309525,4.6847376 8.4685433,4.8972607 9.0207129,5.4471587 9.4063328,5.8311907 9.5338898,6.0004852 9.7108978,6.3631718 9.8335428,6.6144683 9.9681328,6.9987435 10.020175,7.2461971 10.145759,7.8433551 10.170431,7.8289765 9.0218356,7.828057 8.5307356,7.8276009 8.0769363,7.8134035 8.0133918,7.7963663 7.9392662,7.7764919 7.8757344,7.6970176 7.8361313,7.5746239 7.5012661,6.5397183 6.6297764,6.0267536 5.4889128,6.193037 4.244092,6.3744711 3.4980921,7.3344965 3.343357,8.9541432 3.2260083,10.182472 3.5434132,11.329338 4.1781352,11.97041 c 0.46237,0.466997 0.9869175,0.673904 1.7084683,0.673904 1.2025378,0 1.9439704,-0.533034 2.1862936,-1.57178 0.055989,-0.240028 0.059178,-0.324448 0.012859,-0.341503 -0.033838,-0.01246 -0.5090516,-0.02871 -1.0560342,-0.03612 L 6.0352096,10.681458 V 9.8178001 8.9541431 l 1.9890278,-0.014575 c 1.0939663,-0.00802 2.0422396,-0.00163 2.1072756,0.014201 l 0.118246,0.028779 -0.01356,2.6814549 -0.01356,2.681455 -0.7170922,0.01455 c -0.8295927,0.01682 -0.7753286,0.05076 -0.8815155,-0.55106 -0.036825,-0.208719 -0.077853,-0.379487 -0.091164,-0.379487 -0.013311,0 -0.16916,0.135437 -0.3463303,0.300972 -0.3894417,0.363866 -0.8188673,0.600316 -1.3418506,0.738852 -0.4725114,0.125166 -0.8081647,0.149449 -1.4638111,0.10591 z M 32.49721,14.469781 c -0.928547,-0.194854 -1.630354,-0.56605 -2.174913,-1.150343 -0.515384,-0.552992 -0.832054,-1.344249 -0.800629,-2.000518 l 0.01549,-0.323408 1.060826,-0.01418 1.060825,-0.01418 0.05146,0.135352 c 0.0283,0.07444 0.0517,0.198593 0.05197,0.275887 8.54e-4,0.230559 0.229434,0.649361 0.479979,0.879354 0.347226,0.318744 0.735307,0.44853 1.431019,0.478576 1.267096,0.05472 2.007349,-0.393206 1.947849,-1.178652 -0.0456,-0.601928 -0.471503,-0.860841 -2.12876,-1.294103 C 32.881626,10.103917 32.242852,9.9264243 32.07283,9.8691486 30.95902,9.4939337 30.283515,8.9537559 29.97948,8.195172 29.836139,7.8375288 29.784025,7.0484225 29.874852,6.6109088 30.100606,5.5234588 31.071976,4.6456053 32.416011,4.314394 33.01697,4.1662997 34.128873,4.156633 34.77144,4.293917 c 1.67335,0.3575071 2.584333,1.270761 2.774448,2.7813655 0.0543,0.4314615 0.0347,0.4394334 -1.080484,0.4394334 -0.521251,0 -0.9851,-0.023133 -1.038665,-0.051802 C 35.367672,7.4313026 35.307808,7.3078793 35.273143,7.1462409 35.195527,6.7843357 35.099156,6.6147944 34.849667,6.4012402 34.543832,6.1394568 34.14764,6.029069 33.515213,6.0294329 c -0.428465,2.111e-4 -0.570793,0.021517 -0.784491,0.1172346 -0.47592,0.2131691 -0.654939,0.4628549 -0.654939,0.9134748 0,0.5904894 0.225799,0.7059322 2.58195,1.3200619 1.350552,0.3520209 1.903346,0.598685 2.415601,1.0778741 0.591219,0.5530567 0.852295,1.2543747 0.796412,2.1393787 -0.07929,1.255762 -0.891416,2.255747 -2.192274,2.699402 -0.885807,0.302103 -2.21918,0.374602 -3.180262,0.172924 z M 11.476954,14.306572 c -0.0138,-0.03619 -0.019,-2.268126 -0.01158,-4.9598581 l 0.0135,-4.8940567 1.066335,-0.01419 c 0.742348,-0.00988 1.088249,0.00399 1.138458,0.045665 0.06009,0.049873 0.07211,0.7135739 0.07211,3.9791612 v 3.9193056 h 2.293081 c 1.756352,0 2.314103,0.01538 2.382892,0.06567 0.07993,0.05845 0.08822,0.166396 0.07543,0.981428 l -0.01437,0.915757 -3.495384,0.01345 c -2.768549,0.0107 -3.500605,-1.69e-4 -3.520473,-0.05234 z m 10.193414,0.0026 c -0.04842,-0.04842 -0.06297,-1.193838 -0.06236,-4.9074882 4.61e-4,-2.6643823 0.01959,-4.8739347 0.04256,-4.9101166 0.03301,-0.05201 0.813774,-0.062971 3.728627,-0.052342 l 3.686862,0.013441 V 5.3948518 6.337024 l -2.5648,0.026171 -2.5648,0.026172 v 0.9421438 0.9421716 l 2.313597,0.026171 c 1.548367,0.017515 2.332217,0.044804 2.36989,0.082507 0.03673,0.036745 0.05127,0.3461819 0.04183,0.889829 l -0.01446,0.8334926 -2.355428,0.02617 -2.355429,0.02617 v 1.0992 1.099199 l 2.617143,0.0274 c 1.439428,0.01507 2.623562,0.03274 2.63141,0.03926 0.0078,0.0065 0.0078,0.441727 0,0.967118 l -0.01427,0.955257 -3.718613,0.01343 c -2.848812,0.01027 -3.733388,-0.0013 -3.781773,-0.04973 z m 17.753791,-0.378679 c -0.04061,-0.105824 0.0759,-0.828141 0.198829,-1.232689 0.288088,-0.948035 0.88431,-1.590368 2.319422,-2.498804 1.100465,-0.6965999 1.86374,-1.2293374 2.17747,-1.5198007 0.515251,-0.477031 0.731074,-1.0868265 0.620161,-1.7522036 -0.126353,-0.7579473 -0.607483,-1.1395723 -1.436711,-1.1395723 -0.930964,0 -1.401324,0.4507271 -1.481617,1.4197789 l -0.03634,0.4383927Line truncated
|
||||
style="fill:#5586a4;fill-opacity:1;stroke-width:0.05234285"
|
||||
sodipodi:nodetypes="ccscccccccccsscsscccccscccsccsccccccccccssscccccccccccccccscsccsccccsssscscccccccscscscccccccscccccccscccccccscccccccccccscccccsssccccccccscscc" />
|
||||
<path
|
||||
style="fill:#000000;stroke-width:1.06666672"
|
||||
d=""
|
||||
id="path819"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#000000;stroke-width:1.06666672"
|
||||
d=""
|
||||
id="path817"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.8 KiB |
@@ -0,0 +1,67 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="48"
|
||||
height="16"
|
||||
viewBox="0 0 47.999999 16"
|
||||
sodipodi:docname="icon_g_l_e_s_3.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)">
|
||||
<metadata
|
||||
id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1484"
|
||||
inkscape:window-height="697"
|
||||
id="namedview4"
|
||||
showgrid="false"
|
||||
inkscape:zoom="13.520979"
|
||||
inkscape:cx="20.549976"
|
||||
inkscape:cy="7.9399684"
|
||||
inkscape:window-x="67"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg2" />
|
||||
<path
|
||||
style="fill:#6aa455;fill-opacity:1;stroke-width:0.05234285"
|
||||
d="M 20.011719 2.9023438 C 19.90715 2.9022255 19.801697 2.9494036 19.726562 3.0449219 L 19.619141 3.1835938 L 19.619141 9.4023438 C 19.619141 14.357062 19.636882 15.227573 19.669922 15.314453 C 19.698292 15.38907 19.774644 15.4732 19.839844 15.5 C 19.9836 15.559128 20.192255 15.52045 20.298828 15.416016 C 20.298828 14.821446 20.378685 16.35047 20.390625 9.484375 L 20.404297 3.1835938 L 20.294922 3.0449219 C 20.219653 2.949233 20.116287 2.902462 20.011719 2.9023438 z M 33.578125 4.1972656 C 33.144709 4.2010336 32.716495 4.240406 32.416016 4.3144531 C 31.071981 4.6456644 30.100754 5.5238781 29.875 6.6113281 C 29.784173 7.0488418 29.835175 7.8376693 29.978516 8.1953125 C 30.282551 8.9538964 30.958456 9.4939257 32.072266 9.8691406 C 32.242288 9.9264163 32.881487 10.104023 33.492188 10.263672 C 35.149445 10.696934 35.575494 10.956666 35.621094 11.558594 C 35.680594 12.34404 34.940924 12.791048 33.673828 12.736328 C 32.978116 12.706282 32.589413 12.576557 32.242188 12.257812 C 31.991643 12.02782 31.762573 11.609465 31.761719 11.378906 C 31.761449 11.301612 31.739238 11.176002 31.710938 11.101562 L 31.658203 10.966797 L 30.597656 10.980469 L 29.537109 10.996094 L 29.521484 11.318359 C 29.490059 11.974628 29.806882 12.767321 30.322266 13.320312 C 30.866825 13.904606 31.5695 14.275849 32.498047 14.470703 C 33.459129 14.672381 34.791927 14.598978 35.677734 14.296875 C 36.978592 13.85322 37.789851 12.853418 37.869141 11.597656 C 37.925024 10.712652 37.665438 10.012041 37.074219 9.4589844 C 36.561964 8.9797953 36.008755 8.7328803 34.658203 8.3808594 C 32.302052 7.7667297 32.076172 7.6510363 32.076172 7.0605469 C 32.076172 6.609927 32.254549 6.3596535 32.730469 6.1464844 C 32.944167 6.0507668 33.08716 6.029508 33.515625 6.0292969 C 34.148052 6.028933 34.543774 6.1386072 34.849609 6.4003906 C 35.099098 6.6139448 35.195822 6.7845792 35.273438 7.1464844 C 35.308103 7.3081228 35.366714 7.4312793 35.425781 7.4628906 C 35.479346 7.4915596 35.943593 7.515625 36.464844 7.515625 C 37.580028 7.515625 37.599222 7.5076334 37.544922 7.0761719 C 37.354807 5.5655674 36.444834 4.6504759 34.771484 4.2929688 C 34.450201 4.2243268 34.011541 4.1934977 33.578125 4.1972656 z M 5.5175781 4.1992188 C 4.8691862 4.2376134 4.2355426 4.3965672 3.6894531 4.6699219 C 1.9729802 5.5291325 1.0295038 7.2003211 1.0214844 9.3984375 C 1.0171834 10.579889 1.2388248 11.479703 1.7480469 12.349609 C 2.0038374 12.786576 2.5763159 13.426376 2.9746094 13.71875 C 3.6255952 14.196618 4.5309283 14.517769 5.3808594 14.574219 C 6.0365058 14.617758 6.3712386 14.593916 6.84375 14.46875 C 7.3667333 14.330214 7.7980583 14.094335 8.1875 13.730469 C 8.3646703 13.564934 8.5198921 13.429688 8.5332031 13.429688 C 8.5465141 13.429688 8.588175 13.599875 8.625 13.808594 C 8.7311869 14.410414 8.6762667 14.376195 9.5058594 14.359375 L 10.222656 14.345703 L 10.236328 11.664062 L 10.25 8.9824219 L 10.130859 8.953125 C 10.065823 8.937294 9.1174038 8.9314331 8.0234375 8.9394531 L 6.0351562 8.9550781 L 6.0351562 9.8183594 L 6.0351562 10.681641 L 7.0292969 10.695312 C 7.5762795 10.702722 8.0520995 10.718009 8.0859375 10.730469 C 8.1322565 10.747524 8.1282546 10.832238 8.0722656 11.072266 C 7.8299424 12.111012 7.0892565 12.644531 5.8867188 12.644531 C 5.1651679 12.644531 4.6401044 12.4377 4.1777344 11.970703 C 3.5430124 11.329631 3.2264013 10.183407 3.34375 8.9550781 C 3.4984851 7.3354314 4.2434605 6.3747935 5.4882812 6.1933594 C 6.6291449 6.027076 7.5010723 6.5393131 7.8359375 7.5742188 C 7.8755406 7.6966124 7.9395463 7.7770006 8.0136719 7.796875 C 8.0772164 7.8139122 8.5303844 7.8276689 9.0214844 7.828125 C 10.17008 7.8290445 10.145115 7.8432518 10.019531 7.2460938 C 9.967489 6.9986401 9.8335825 6.6145778 9.7109375 6.3632812 C 9.5339295 6.0005947 9.4071043 5.8312976 9.0214844 5.4472656 C 8.4693148 4.8973676 8.1315285 4.684343 7.4335938 4.4472656 C 6.8293858 4.2420259 6.16597 4.1608241 5.5175781 4.1992188 z M 42.03125 4.2617188 L 41.537109 4.4335938 C 40.933232 4.6433398 40.657695 4.8014669 40.300781 5.1386719 C 39.969225 5.4519119 39.761404 5.8046136 39.621094 6.2910156 C 39.502474 6.7023596 39.433137 7.3494687 39.498047 7.4492188 C 39.531044 7.4999487 39.783863 7.5127831 40.576172 7.5019531 L 41.611328 7.4863281 L 41.691406 7.0703125 C 41.808812 6.4678105 41.927622 6.2685471 42.265625 6.0957031 C 42.510424 5.9705181 42.604184 5.953125 43.019531 5.953125 C 43.426321 5.953125 43.533311 5.9721266 43.765625 6.0878906 C 44.253715 6.3311276 44.455638 6.904517 44.273438 7.53125 C 44.105442 8.109131 43.697334 8.363965 42.791016 8.453125 C 42.521874 8.479605 42.288464 8.51424 42.271484 8.53125 C 42.225224 8.577174 42.232777 9.7874244 42.279297 9.8339844 C 42.301291 9.8559744 42.598053 9.8907794 42.939453 9.9121094 C 43.836652 9.9681724 44.239534 10.166191 44.525391 10.691406 C 44.916028 11.409137 44.561069 12.318315 43.787109 12.582031 C 43.476088 12.688024 42.767292 12.688624 42.470703 12.583984 C 42.00204 12.418633 41.795632 12.174325 41.642578 11.597656 L 41.560547 11.285156 L 40.46875Line truncated
|
||||
id="path3424" />
|
||||
<path
|
||||
style="fill:#000000;stroke-width:1.06666672"
|
||||
d=""
|
||||
id="path819"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#000000;stroke-width:1.06666672"
|
||||
d=""
|
||||
id="path817"
|
||||
inkscape:connector-curvature="0" />
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.9 KiB |
@@ -0,0 +1,127 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
version="1.1"
|
||||
id="svg2"
|
||||
width="48"
|
||||
height="16"
|
||||
viewBox="0 0 47.999999 16"
|
||||
sodipodi:docname="icon_vulkan.svg"
|
||||
inkscape:version="0.92.3 (2405546, 2018-03-11)">
|
||||
<metadata
|
||||
id="metadata8">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs6" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1853"
|
||||
inkscape:window-height="1016"
|
||||
id="namedview4"
|
||||
showgrid="false"
|
||||
inkscape:zoom="10.24"
|
||||
inkscape:cx="9.4970674"
|
||||
inkscape:cy="11.192118"
|
||||
inkscape:window-x="67"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="g8" />
|
||||
<path
|
||||
style="fill:#000000;stroke-width:1.06666672"
|
||||
d=""
|
||||
id="path819"
|
||||
inkscape:connector-curvature="0" />
|
||||
<path
|
||||
style="fill:#000000;stroke-width:1.06666672"
|
||||
d=""
|
||||
id="path817"
|
||||
inkscape:connector-curvature="0" />
|
||||
<g
|
||||
transform="matrix(0.04333868,0,0,0.04333868,-4.0493236,-3.7704963)"
|
||||
id="g8">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 724.1,432.41989 h -40.6 c 0,0 0,-99 0,-129.7 13,7.2 30.1,20.5 40.6,33.3 z"
|
||||
id="path10"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
<g
|
||||
id="g12"
|
||||
style="fill:#e6555a;fill-opacity:1"
|
||||
transform="translate(0,47.319882)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 381.8,385.1 h -50.6 l -66,-204 h 46 l 45.4,143.5 h 0.6 l 46,-143.5 h 46.3 z"
|
||||
id="path14"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="M 585.5,385.1 H 546.9 V 364.5 H 546 c -5.1,8.6 -11.8,14.8 -20,18.6 -8.2,3.8 -16.6,5.7 -25.1,5.7 -10.9,0 -19.8,-1.4 -26.7,-4.3 -7,-2.9 -12.4,-6.9 -16.4,-12.1 -4,-5.2 -6.8,-11.6 -8.4,-19.1 -1.6,-7.5 -2.4,-15.9 -2.4,-25 v -90.9 h 40.6 v 83.4 c 0,12.2 1.9,21.3 5.7,27.3 3.8,6 10.6,9 20.3,9 11,0 19.1,-3.3 24,-9.9 5,-6.6 7.4,-17.4 7.4,-32.4 v -77.4 h 40.6 v 147.7 z"
|
||||
id="path16"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
</g>
|
||||
<polygon
|
||||
points="730.8,296.2 730.7,290.5 781.9,237.3 829.9,237.3 774.2,291.6 836.2,385.1 787,385.1 "
|
||||
id="polygon18"
|
||||
style="fill:#e6555a;fill-opacity:1"
|
||||
transform="translate(0,47.319882)" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 843.6,330.11989 c 0.6,-9.5 3,-17.4 7.2,-23.7 4.2,-6.3 9.5,-11.3 16,-15.1 6.5,-3.8 13.8,-6.5 21.9,-8.1 8.1,-1.6 16.2,-2.4 24.4,-2.4 7.4,0 15,0.5 22.6,1.6 7.6,1.1 14.6,3.1 20.9,6.1 6.3,3.1 11.4,7.3 15.4,12.7 4,5.4 6,12.6 6,21.6 v 76.9 c 0,6.7 0.4,13.1 1.1,19.1 0.8,6.1 2.1,10.7 4,13.7 h -41.2 c -0.8,-2.3 -1.4,-4.6 -1.9,-7 -0.5,-2.4 -0.8,-4.8 -1,-7.3 -6.5,6.7 -14.1,11.3 -22.9,14 -8.8,2.7 -17.7,4 -26.9,4 -7,0 -13.6,-0.9 -19.7,-2.6 -6.1,-1.7 -11.4,-4.4 -16,-8 -4.6,-3.6 -8.2,-8.2 -10.7,-13.7 -2.6,-5.5 -3.9,-12.1 -3.9,-19.7 0,-8.4 1.5,-15.3 4.4,-20.7 3,-5.4 6.8,-9.8 11.4,-13 4.7,-3.2 10,-5.7 16,-7.3 6,-1.6 12,-2.9 18.1,-3.9 6.1,-0.9 12.1,-1.7 18,-2.3 5.9,-0.6 11.1,-1.4 15.7,-2.6 4.6,-1.1 8.2,-2.8 10.9,-5 2.7,-2.2 3.9,-5.4 3.7,-9.6 0,-4.4 -0.7,-7.9 -2.2,-10.4 -1.4,-2.6 -3.3,-4.6 -5.7,-6 -2.4,-1.4 -5.1,-2.4 -8.3,-2.9 -3.1,-0.5 -6.5,-0.7 -10.1,-0.7 -8,0 -14.3,1.7 -18.9,5.1 -4.6,3.4 -7.2,9.1 -8,17.1 h -40.3 z m 93.8,30 c -1.7,1.5 -3.9,2.7 -6.4,3.6 -2.6,0.9 -5.3,1.6 -8.3,2.2 -2.9,0.6 -6,1 -9.3,1.4 -3.2,0.4 -6.5,0.9 -9.7,1.4 -3,0.6 -6,1.3 -9,2.3 -3,1 -5.5,2.2 -7.7,3.9 -2.2,1.6 -4,3.7 -5.3,6.1 -1.3,2.5 -2,5.6 -2,9.4 0,3.6 0.7,6.7 2,9.1 1.3,2.5 3.1,4.4 5.4,5.9 2.3,1.4 5,2.4 8,3 3.1,0.6 6.2,0.9 9.4,0.9 8,0 14.2,-1.3 18.6,-4 4.4,-2.7 7.6,-5.9 9.7,-9.6 2.1,-3.7 3.4,-7.5 3.9,-11.3 0.5,-3.8 0.7,-6.9 0.7,-9.1 z"
|
||||
id="path20"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 1004.2,284.61989 h 38.6 v 20.6 h 0.9 c 5.1,-8.6 11.8,-14.8 20,-18.7 8.2,-3.9 16.6,-5.9 25.1,-5.9 10.9,0 19.8,1.5 26.7,4.4 7,3 12.4,7.1 16.4,12.3 4,5.2 6.8,11.6 8.4,19.1 1.6,7.5 2.4,15.9 2.4,25 v 90.9 h -40.6 v -83.4 c 0,-12.2 -1.9,-21.3 -5.7,-27.3 -3.8,-6 -10.6,-9 -20.3,-9 -11,0 -19,3.3 -24,9.9 -5,6.6 -7.4,17.4 -7.4,32.4 v 77.4 h -40.6 v -147.7 z"
|
||||
id="path22"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
<g
|
||||
id="g24"
|
||||
style="fill:#e6555a;fill-opacity:1"
|
||||
transform="translate(0,47.319882)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="M 612.4,211.8 V 385 H 653 V 234.2 c -13.1,-8 -26.6,-15.5 -40.6,-22.4 z"
|
||||
id="path26"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
</g>
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="m 198.4,266.51989 c 23.5,-68.9 164.2,-94.2 314.1,-56.4 90,22.6 163.5,66.5 211.5,109.9 -21.7,-57.6 -127.3,-139.6 -272.8,-167.7 -164.5,-31.8 -326.7,-3.9 -346.8,69.1 -14.5,52.7 49.2,114.5 147.7,156.7 -44.3,-35.8 -65.8,-76 -53.7,-111.6 z"
|
||||
id="path28"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
<g
|
||||
id="g30"
|
||||
style="fill:#e6555a;fill-opacity:1"
|
||||
transform="translate(0,47.319882)">
|
||||
<path
|
||||
inkscape:connector-curvature="0"
|
||||
d="M 724.2,247.6 V 181 h -40.6 v 20.2 c 17.3,15.5 31,31.2 40.6,46.4 z"
|
||||
id="path32"
|
||||
style="fill:#e6555a;fill-opacity:1" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 5.9 KiB |
@@ -106,6 +106,12 @@ void ProjectSettingsEditor::_notification(int p_what) {
|
||||
translation_res_file_open->add_filter("*." + E->get());
|
||||
translation_res_option_file_open->add_filter("*." + E->get());
|
||||
}
|
||||
|
||||
restart_close_button->set_icon(get_icon("Close", "EditorIcons"));
|
||||
restart_container->add_style_override("panel", get_stylebox("bg", "Tree"));
|
||||
restart_icon->set_texture(get_icon("StatusWarning", "EditorIcons"));
|
||||
restart_label->add_color_override("font_color", get_color("error_color", "Editor"));
|
||||
|
||||
} break;
|
||||
case NOTIFICATION_POPUP_HIDE: {
|
||||
EditorSettings::get_singleton()->set("interface/dialogs/project_settings_bounds", get_rect());
|
||||
@@ -800,15 +806,13 @@ void ProjectSettingsEditor::popup_project_settings() {
|
||||
plugin_settings->update_plugins();
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_item_selected() {
|
||||
void ProjectSettingsEditor::_item_selected(const String &p_path) {
|
||||
|
||||
TreeItem *ti = globals_editor->get_property_editor()->get_property_tree()->get_selected();
|
||||
if (!ti)
|
||||
return;
|
||||
if (!ti->get_parent())
|
||||
String selected_path = p_path;
|
||||
if (selected_path == String())
|
||||
return;
|
||||
category->set_text(globals_editor->get_current_section());
|
||||
property->set_text(ti->get_text(0));
|
||||
property->set_text(selected_path);
|
||||
popup_copy_to_feature->set_disabled(false);
|
||||
}
|
||||
|
||||
@@ -865,7 +869,7 @@ void ProjectSettingsEditor::_item_add() {
|
||||
|
||||
void ProjectSettingsEditor::_item_del() {
|
||||
|
||||
String path = globals_editor->get_property_editor()->get_selected_path();
|
||||
String path = globals_editor->get_inspector()->get_selected_path();
|
||||
if (path == String()) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Select a setting item first!"));
|
||||
return;
|
||||
@@ -1043,7 +1047,7 @@ void ProjectSettingsEditor::_copy_to_platform_about_to_show() {
|
||||
|
||||
void ProjectSettingsEditor::_copy_to_platform(int p_which) {
|
||||
|
||||
String path = globals_editor->get_property_editor()->get_selected_path();
|
||||
String path = globals_editor->get_inspector()->get_selected_path();
|
||||
if (path == String()) {
|
||||
EditorNode::get_singleton()->show_warning(TTR("Select a setting item first!"));
|
||||
return;
|
||||
@@ -1572,7 +1576,7 @@ void ProjectSettingsEditor::_update_translations() {
|
||||
|
||||
void ProjectSettingsEditor::_toggle_search_bar(bool p_pressed) {
|
||||
|
||||
globals_editor->get_property_editor()->set_use_filter(p_pressed);
|
||||
globals_editor->get_inspector()->set_use_filter(p_pressed);
|
||||
|
||||
if (p_pressed) {
|
||||
|
||||
@@ -1593,7 +1597,7 @@ void ProjectSettingsEditor::_clear_search_box() {
|
||||
return;
|
||||
|
||||
search_box->clear();
|
||||
globals_editor->get_property_editor()->update_tree();
|
||||
globals_editor->get_inspector()->update_tree();
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::set_plugins_page() {
|
||||
@@ -1606,6 +1610,18 @@ TabContainer *ProjectSettingsEditor::get_tabs() {
|
||||
return tab_container;
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_editor_restart() {
|
||||
EditorNode::get_singleton()->save_all_scenes_and_restart();
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_editor_restart_request() {
|
||||
restart_container->show();
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_editor_restart_close() {
|
||||
restart_container->hide();
|
||||
}
|
||||
|
||||
void ProjectSettingsEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_item_selected"), &ProjectSettingsEditor::_item_selected);
|
||||
@@ -1651,6 +1667,10 @@ void ProjectSettingsEditor::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_copy_to_platform_about_to_show"), &ProjectSettingsEditor::_copy_to_platform_about_to_show);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart_request"), &ProjectSettingsEditor::_editor_restart_request);
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart"), &ProjectSettingsEditor::_editor_restart);
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart_close"), &ProjectSettingsEditor::_editor_restart_close);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_tabs"), &ProjectSettingsEditor::get_tabs);
|
||||
}
|
||||
|
||||
@@ -1737,16 +1757,17 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
|
||||
search_bar->add_child(clear_button);
|
||||
clear_button->connect("pressed", this, "_clear_search_box");
|
||||
|
||||
globals_editor = memnew(SectionedPropertyEditor);
|
||||
globals_editor = memnew(SectionedInspector);
|
||||
props_base->add_child(globals_editor);
|
||||
globals_editor->get_property_editor()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
|
||||
globals_editor->get_property_editor()->set_property_selectable(true);
|
||||
globals_editor->get_inspector()->set_undo_redo(EditorNode::get_singleton()->get_undo_redo());
|
||||
globals_editor->get_inspector()->set_property_selectable(true);
|
||||
//globals_editor->hide_top_label();
|
||||
globals_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
globals_editor->register_search_box(search_box);
|
||||
globals_editor->get_property_editor()->get_property_tree()->connect("cell_selected", this, "_item_selected");
|
||||
globals_editor->get_property_editor()->connect("property_toggled", this, "_item_checked", varray(), CONNECT_DEFERRED);
|
||||
globals_editor->get_property_editor()->connect("property_edited", this, "_settings_prop_edited");
|
||||
globals_editor->get_inspector()->connect("property_selected", this, "_item_selected");
|
||||
//globals_editor->get_inspector()->connect("property_toggled", this, "_item_checked", varray(), CONNECT_DEFERRED);
|
||||
globals_editor->get_inspector()->connect("property_edited", this, "_settings_prop_edited");
|
||||
globals_editor->get_inspector()->connect("restart_requested", this, "_editor_restart_request");
|
||||
|
||||
Button *del = memnew(Button);
|
||||
hbc->add_child(del);
|
||||
@@ -1766,6 +1787,26 @@ ProjectSettingsEditor::ProjectSettingsEditor(EditorData *p_data) {
|
||||
get_ok()->set_text(TTR("Close"));
|
||||
set_hide_on_ok(true);
|
||||
|
||||
restart_container = memnew(PanelContainer);
|
||||
props_base->add_child(restart_container);
|
||||
HBoxContainer *restart_hb = memnew(HBoxContainer);
|
||||
restart_container->add_child(restart_hb);
|
||||
restart_icon = memnew(TextureRect);
|
||||
restart_icon->set_v_size_flags(SIZE_SHRINK_CENTER);
|
||||
restart_hb->add_child(restart_icon);
|
||||
restart_label = memnew(Label);
|
||||
restart_label->set_text(TTR("Editor must be restarted for changes to take effect"));
|
||||
restart_hb->add_child(restart_label);
|
||||
restart_hb->add_spacer();
|
||||
Button *restart_button = memnew(Button);
|
||||
restart_button->connect("pressed", this, "_editor_restart");
|
||||
restart_hb->add_child(restart_button);
|
||||
restart_button->set_text(TTR("Save & Restart"));
|
||||
restart_close_button = memnew(ToolButton);
|
||||
restart_close_button->connect("pressed", this, "_editor_restart_close");
|
||||
restart_hb->add_child(restart_close_button);
|
||||
restart_container->hide();
|
||||
|
||||
message = memnew(AcceptDialog);
|
||||
add_child(message);
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#include "editor/editor_autoload_settings.h"
|
||||
#include "editor/editor_data.h"
|
||||
#include "editor/editor_plugin_settings.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "editor/editor_sectioned_inspector.h"
|
||||
#include "scene/gui/dialogs.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
|
||||
@@ -64,7 +64,7 @@ class ProjectSettingsEditor : public AcceptDialog {
|
||||
|
||||
EditorData *data;
|
||||
UndoRedo *undo_redo;
|
||||
SectionedPropertyEditor *globals_editor;
|
||||
SectionedInspector *globals_editor;
|
||||
|
||||
HBoxContainer *search_bar;
|
||||
Button *search_button;
|
||||
@@ -112,7 +112,7 @@ class ProjectSettingsEditor : public AcceptDialog {
|
||||
|
||||
EditorPluginSettings *plugin_settings;
|
||||
|
||||
void _item_selected();
|
||||
void _item_selected(const String &);
|
||||
void _item_adds(String);
|
||||
void _item_add();
|
||||
void _item_del();
|
||||
@@ -166,6 +166,15 @@ class ProjectSettingsEditor : public AcceptDialog {
|
||||
|
||||
static ProjectSettingsEditor *singleton;
|
||||
|
||||
Label *restart_label;
|
||||
TextureRect *restart_icon;
|
||||
PanelContainer *restart_container;
|
||||
ToolButton *restart_close_button;
|
||||
|
||||
void _editor_restart_request();
|
||||
void _editor_restart();
|
||||
void _editor_restart_close();
|
||||
|
||||
protected:
|
||||
void _notification(int p_what);
|
||||
static void _bind_methods();
|
||||
|
||||
@@ -54,12 +54,12 @@ void EditorSettingsDialog::_settings_changed() {
|
||||
|
||||
void EditorSettingsDialog::_settings_property_edited(const String &p_name) {
|
||||
|
||||
String full_name = property_editor->get_full_item_path(p_name);
|
||||
String full_name = inspector->get_full_item_path(p_name);
|
||||
|
||||
// Small usability workaround to update the text color settings when the
|
||||
// color theme is changed
|
||||
if (full_name == "text_editor/theme/color_theme") {
|
||||
property_editor->get_property_editor()->update_tree();
|
||||
inspector->get_inspector()->update_tree();
|
||||
} else if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast") {
|
||||
EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom"); // set preset to Custom
|
||||
} else if (full_name.begins_with("text_editor/highlighting")) {
|
||||
@@ -88,8 +88,8 @@ void EditorSettingsDialog::popup_edit_settings() {
|
||||
|
||||
EditorSettings::get_singleton()->list_text_editor_themes(); // make sure we have an up to date list of themes
|
||||
|
||||
property_editor->edit(EditorSettings::get_singleton());
|
||||
property_editor->get_property_editor()->update_tree();
|
||||
inspector->edit(EditorSettings::get_singleton());
|
||||
inspector->get_inspector()->update_tree();
|
||||
|
||||
search_box->select_all();
|
||||
search_box->grab_focus();
|
||||
@@ -120,7 +120,7 @@ void EditorSettingsDialog::_clear_search_box() {
|
||||
return;
|
||||
|
||||
search_box->clear();
|
||||
property_editor->get_property_editor()->update_tree();
|
||||
inspector->get_inspector()->update_tree();
|
||||
}
|
||||
|
||||
void EditorSettingsDialog::_clear_shortcut_search_box() {
|
||||
@@ -158,7 +158,7 @@ void EditorSettingsDialog::_notification(int p_what) {
|
||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
||||
_update_icons();
|
||||
// Update theme colors.
|
||||
property_editor->update_category_list();
|
||||
inspector->update_category_list();
|
||||
_update_shortcuts();
|
||||
} break;
|
||||
}
|
||||
@@ -202,6 +202,11 @@ void EditorSettingsDialog::_update_icons() {
|
||||
shortcut_search_box->add_icon_override("right_icon", get_icon("Search", "EditorIcons"));
|
||||
clear_button->set_icon(get_icon("Close", "EditorIcons"));
|
||||
shortcut_clear_button->set_icon(get_icon("Close", "EditorIcons"));
|
||||
|
||||
restart_close_button->set_icon(get_icon("Close", "EditorIcons"));
|
||||
restart_container->add_style_override("panel", get_stylebox("bg", "Tree"));
|
||||
restart_icon->set_texture(get_icon("StatusWarning", "EditorIcons"));
|
||||
restart_label->add_color_override("font_color", get_color("error_color", "Editor"));
|
||||
}
|
||||
|
||||
void EditorSettingsDialog::_update_shortcuts() {
|
||||
@@ -388,6 +393,18 @@ void EditorSettingsDialog::_focus_current_search_box() {
|
||||
}
|
||||
}
|
||||
|
||||
void EditorSettingsDialog::_editor_restart() {
|
||||
EditorNode::get_singleton()->save_all_scenes_and_restart();
|
||||
}
|
||||
|
||||
void EditorSettingsDialog::_editor_restart_request() {
|
||||
restart_container->show();
|
||||
}
|
||||
|
||||
void EditorSettingsDialog::_editor_restart_close() {
|
||||
restart_container->hide();
|
||||
}
|
||||
|
||||
void EditorSettingsDialog::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_unhandled_input"), &EditorSettingsDialog::_unhandled_input);
|
||||
@@ -402,6 +419,10 @@ void EditorSettingsDialog::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_press_a_key_confirm"), &EditorSettingsDialog::_press_a_key_confirm);
|
||||
ClassDB::bind_method(D_METHOD("_wait_for_key"), &EditorSettingsDialog::_wait_for_key);
|
||||
ClassDB::bind_method(D_METHOD("_tabs_tab_changed"), &EditorSettingsDialog::_tabs_tab_changed);
|
||||
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart_request"), &EditorSettingsDialog::_editor_restart_request);
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart"), &EditorSettingsDialog::_editor_restart);
|
||||
ClassDB::bind_method(D_METHOD("_editor_restart_close"), &EditorSettingsDialog::_editor_restart_close);
|
||||
}
|
||||
|
||||
EditorSettingsDialog::EditorSettingsDialog() {
|
||||
@@ -434,14 +455,35 @@ EditorSettingsDialog::EditorSettingsDialog() {
|
||||
hbc->add_child(clear_button);
|
||||
clear_button->connect("pressed", this, "_clear_search_box");
|
||||
|
||||
property_editor = memnew(SectionedPropertyEditor);
|
||||
//property_editor->hide_top_label();
|
||||
property_editor->get_property_editor()->set_use_filter(true);
|
||||
property_editor->register_search_box(search_box);
|
||||
property_editor->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
property_editor->get_property_editor()->set_undo_redo(undo_redo);
|
||||
tab_general->add_child(property_editor);
|
||||
property_editor->get_property_editor()->connect("property_edited", this, "_settings_property_edited");
|
||||
inspector = memnew(SectionedInspector);
|
||||
//inspector->hide_top_label();
|
||||
inspector->get_inspector()->set_use_filter(true);
|
||||
inspector->register_search_box(search_box);
|
||||
inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL);
|
||||
inspector->get_inspector()->set_undo_redo(undo_redo);
|
||||
tab_general->add_child(inspector);
|
||||
inspector->get_inspector()->connect("property_edited", this, "_settings_property_edited");
|
||||
inspector->get_inspector()->connect("restart_requested", this, "_editor_restart_request");
|
||||
|
||||
restart_container = memnew(PanelContainer);
|
||||
tab_general->add_child(restart_container);
|
||||
HBoxContainer *restart_hb = memnew(HBoxContainer);
|
||||
restart_container->add_child(restart_hb);
|
||||
restart_icon = memnew(TextureRect);
|
||||
restart_icon->set_v_size_flags(SIZE_SHRINK_CENTER);
|
||||
restart_hb->add_child(restart_icon);
|
||||
restart_label = memnew(Label);
|
||||
restart_label->set_text(TTR("Editor must be restarted for changes to take effect"));
|
||||
restart_hb->add_child(restart_label);
|
||||
restart_hb->add_spacer();
|
||||
Button *restart_button = memnew(Button);
|
||||
restart_button->connect("pressed", this, "_editor_restart");
|
||||
restart_hb->add_child(restart_button);
|
||||
restart_button->set_text(TTR("Save & Restart"));
|
||||
restart_close_button = memnew(ToolButton);
|
||||
restart_close_button->connect("pressed", this, "_editor_restart_close");
|
||||
restart_hb->add_child(restart_close_button);
|
||||
restart_container->hide();
|
||||
|
||||
// Shortcuts Tab
|
||||
|
||||
|
||||
@@ -31,9 +31,14 @@
|
||||
#ifndef SETTINGS_CONFIG_DIALOG_H
|
||||
#define SETTINGS_CONFIG_DIALOG_H
|
||||
|
||||
#include "property_editor.h"
|
||||
#include "editor/editor_sectioned_inspector.h"
|
||||
#include "editor_inspector.h"
|
||||
#include "scene/gui/dialogs.h"
|
||||
#include "scene/gui/panel_container.h"
|
||||
#include "scene/gui/rich_text_label.h"
|
||||
#include "scene/gui/tab_container.h"
|
||||
#include "scene/gui/texture_rect.h"
|
||||
#include "scene/gui/tool_button.h"
|
||||
|
||||
class EditorSettingsDialog : public AcceptDialog {
|
||||
|
||||
@@ -49,7 +54,7 @@ class EditorSettingsDialog : public AcceptDialog {
|
||||
LineEdit *shortcut_search_box;
|
||||
ToolButton *clear_button;
|
||||
ToolButton *shortcut_clear_button;
|
||||
SectionedPropertyEditor *property_editor;
|
||||
SectionedInspector *inspector;
|
||||
|
||||
Timer *timer;
|
||||
|
||||
@@ -89,6 +94,15 @@ class EditorSettingsDialog : public AcceptDialog {
|
||||
|
||||
static void _undo_redo_callback(void *p_self, const String &p_name);
|
||||
|
||||
Label *restart_label;
|
||||
TextureRect *restart_icon;
|
||||
PanelContainer *restart_container;
|
||||
ToolButton *restart_close_button;
|
||||
|
||||
void _editor_restart_request();
|
||||
void _editor_restart();
|
||||
void _editor_restart_close();
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
|
||||
+11
-2
@@ -825,7 +825,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
OS::get_singleton()->set_cmdline(execpath, main_args);
|
||||
|
||||
GLOBAL_DEF("rendering/quality/driver/driver_name", "GLES3");
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_name", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_name", PROPERTY_HINT_ENUM, "GLES3,GLES2"));
|
||||
ProjectSettings::get_singleton()->set_custom_property_info("rendering/quality/driver/driver_name", PropertyInfo(Variant::STRING, "rendering/quality/driver/driver_name", PROPERTY_HINT_ENUM, "GLES2,GLES3"));
|
||||
if (video_driver == "") {
|
||||
video_driver = GLOBAL_GET("rendering/quality/driver/driver_name");
|
||||
}
|
||||
@@ -914,7 +914,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||
}
|
||||
|
||||
if (audio_driver == "") { // specified in project.godot
|
||||
audio_driver = GLOBAL_DEF("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
|
||||
audio_driver = GLOBAL_DEF_RST("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
|
||||
}
|
||||
|
||||
for (int i = 0; i < OS::get_singleton()->get_audio_driver_count(); i++) {
|
||||
@@ -1957,6 +1957,15 @@ void Main::cleanup() {
|
||||
if (engine)
|
||||
memdelete(engine);
|
||||
|
||||
if (OS::get_singleton()->is_restart_on_exit_set()) {
|
||||
//attempt to restart with arguments
|
||||
String exec = OS::get_singleton()->get_executable_path();
|
||||
List<String> args = OS::get_singleton()->get_restart_on_exit_argumens();
|
||||
OS::ProcessID pid = 0;
|
||||
OS::get_singleton()->execute(exec, args, false, &pid);
|
||||
OS::get_singleton()->set_restart_on_exit(false, List<String>()); //clear list (uses memory)
|
||||
}
|
||||
|
||||
unregister_core_driver_types();
|
||||
unregister_core_types();
|
||||
|
||||
|
||||
@@ -78,9 +78,9 @@ Error AudioDriverAndroid::init() {
|
||||
// __android_log_print(ANDROID_LOG_VERBOSE, "SDL", "SDL audio: opening device");
|
||||
|
||||
JNIEnv *env = ThreadAndroid::get_env();
|
||||
int mix_rate = GLOBAL_DEF("audio/mix_rate", 44100);
|
||||
int mix_rate = GLOBAL_DEF_RST("audio/mix_rate", 44100);
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", 25);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", 25);
|
||||
unsigned int buffer_size = next_power_of_2(latency * mix_rate / 1000);
|
||||
if (OS::get_singleton()->is_stdout_verbose()) {
|
||||
print_line("audio buffer size: " + itos(buffer_size));
|
||||
|
||||
@@ -123,6 +123,9 @@ void OS_Android::set_opengl_extensions(const char *p_gl_extensions) {
|
||||
ERR_FAIL_COND(!p_gl_extensions);
|
||||
gl_extensions = p_gl_extensions;
|
||||
}
|
||||
int OS_Android::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
|
||||
Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||
|
||||
@@ -136,9 +139,11 @@ Error OS_Android::initialize(const VideoMode &p_desired, int p_video_driver, int
|
||||
if (use_gl2) {
|
||||
RasterizerGLES2::register_config();
|
||||
RasterizerGLES2::make_current();
|
||||
video_driver_index = VIDEO_DRIVER_GLES2;
|
||||
} else {
|
||||
RasterizerGLES3::register_config();
|
||||
RasterizerGLES3::make_current();
|
||||
video_driver_index = VIDEO_DRIVER_GLES3;
|
||||
}
|
||||
|
||||
visual_server = memnew(VisualServerRaster);
|
||||
|
||||
@@ -137,6 +137,7 @@ private:
|
||||
AlertFunc alert_func;
|
||||
|
||||
//power_android *power_manager;
|
||||
int video_driver_index;
|
||||
|
||||
public:
|
||||
// functions used by main to initialize/deintialize the OS
|
||||
@@ -146,6 +147,8 @@ public:
|
||||
virtual int get_audio_driver_count() const;
|
||||
virtual const char *get_audio_driver_name(int p_driver) const;
|
||||
|
||||
virtual int get_current_video_driver() const;
|
||||
|
||||
virtual void initialize_core();
|
||||
virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ Error AudioDriverMediaKit::init() {
|
||||
speaker_mode = SPEAKER_MODE_STEREO;
|
||||
channels = 2;
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", 25);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", 25);
|
||||
buffer_size = next_power_of_2(latency * mix_rate / 1000);
|
||||
samples_in = memnew_arr(int32_t, buffer_size * channels);
|
||||
|
||||
|
||||
@@ -93,8 +93,14 @@ void OSIPhone::initialize_core() {
|
||||
set_data_dir(data_dir);
|
||||
};
|
||||
|
||||
int OSIPhone::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
|
||||
Error OSIPhone::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||
|
||||
video_driver = p_video_driver; //this may be misleading
|
||||
|
||||
RasterizerGLES3::register_config();
|
||||
RasterizerGLES3::make_current();
|
||||
|
||||
|
||||
@@ -77,6 +77,8 @@ private:
|
||||
virtual int get_video_driver_count() const;
|
||||
virtual const char *get_video_driver_name(int p_driver) const;
|
||||
|
||||
virtual int get_current_video_driver() const;
|
||||
|
||||
virtual void initialize_core();
|
||||
virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
|
||||
|
||||
@@ -112,6 +114,8 @@ private:
|
||||
|
||||
int virtual_keyboard_height;
|
||||
|
||||
int video_driver_index;
|
||||
|
||||
public:
|
||||
bool iterate();
|
||||
|
||||
|
||||
@@ -643,6 +643,9 @@ const char *OS_JavaScript::get_audio_driver_name(int p_driver) const {
|
||||
}
|
||||
|
||||
// Lifecycle
|
||||
int OS_JavaScript::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
|
||||
void OS_JavaScript::initialize_core() {
|
||||
|
||||
@@ -669,6 +672,8 @@ Error OS_JavaScript::initialize(const VideoMode &p_desired, int p_video_driver,
|
||||
RasterizerGLES2::make_current();
|
||||
break;
|
||||
}
|
||||
|
||||
video_driver_index = p_video_driver;
|
||||
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE ctx = emscripten_webgl_create_context(NULL, &attributes);
|
||||
ERR_EXPLAIN("WebGL " + itos(attributes.majorVersion) + ".0 not available");
|
||||
ERR_FAIL_COND_V(emscripten_webgl_make_context_current(ctx) != EMSCRIPTEN_RESULT_SUCCESS, ERR_UNAVAILABLE);
|
||||
|
||||
@@ -81,7 +81,11 @@ class OS_JavaScript : public OS_Unix {
|
||||
|
||||
static void file_access_close_callback(const String &p_file, int p_flags);
|
||||
|
||||
int video_driver_index;
|
||||
|
||||
protected:
|
||||
virtual int get_current_video_driver() const;
|
||||
|
||||
virtual void initialize_core();
|
||||
virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
|
||||
|
||||
|
||||
@@ -137,6 +137,9 @@ public:
|
||||
|
||||
void _update_window();
|
||||
|
||||
int video_driver_index;
|
||||
virtual int get_current_video_driver() const;
|
||||
|
||||
protected:
|
||||
virtual void initialize_core();
|
||||
virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
|
||||
|
||||
@@ -1176,6 +1176,10 @@ static void displays_arrangement_changed(CGDirectDisplayID display_id, CGDisplay
|
||||
displays_arrangement_dirty = true;
|
||||
}
|
||||
|
||||
int OS_OSX::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
|
||||
Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||
|
||||
/*** OSX INITIALIZATION ***/
|
||||
@@ -1272,6 +1276,8 @@ Error OS_OSX::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
||||
ADD_ATTR2(NSOpenGLPFAOpenGLProfile, NSOpenGLProfileVersion3_2Core);
|
||||
}
|
||||
|
||||
video_driver_index = p_video_driver;
|
||||
|
||||
ADD_ATTR2(NSOpenGLPFAColorSize, colorBits);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1012,6 +1012,10 @@ typedef enum _SHC_PROCESS_DPI_AWARENESS {
|
||||
SHC_PROCESS_PER_MONITOR_DPI_AWARE = 2
|
||||
} SHC_PROCESS_DPI_AWARENESS;
|
||||
|
||||
int OS_Windows::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
|
||||
Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||
|
||||
main_loop = NULL;
|
||||
@@ -1181,6 +1185,8 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
|
||||
RasterizerGLES3::make_current();
|
||||
}
|
||||
|
||||
video_driver_index = p_video_driver; // FIXME TODO - FIX IF DRIVER DETECTION HAPPENS AND GLES2 MUST BE USED
|
||||
|
||||
gl_context->set_use_vsync(video_mode.use_vsync);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ class OS_Windows : public OS {
|
||||
|
||||
PowerWindows *power_manager;
|
||||
|
||||
int video_driver_index;
|
||||
#ifdef WASAPI_ENABLED
|
||||
AudioDriverWASAPI driver_wasapi;
|
||||
#endif
|
||||
@@ -153,6 +154,8 @@ class OS_Windows : public OS {
|
||||
|
||||
// functions used by main to initialize/deintialize the OS
|
||||
protected:
|
||||
virtual int get_current_video_driver() const;
|
||||
|
||||
virtual void initialize_core();
|
||||
virtual Error initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver);
|
||||
|
||||
|
||||
@@ -84,6 +84,10 @@ void OS_X11::initialize_core() {
|
||||
OS_Unix::initialize_core();
|
||||
}
|
||||
|
||||
int OS_X11::get_current_video_driver() const {
|
||||
return video_driver_index;
|
||||
}
|
||||
|
||||
Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
|
||||
|
||||
long im_event_mask = 0;
|
||||
@@ -285,6 +289,8 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
|
||||
} break;
|
||||
}
|
||||
|
||||
video_driver_index = p_video_driver; // FIXME TODO - FIX IF DRIVER DETECTION HAPPENS AND GLES2 MUST BE USED
|
||||
|
||||
context_gl->set_use_vsync(current_videomode.use_vsync);
|
||||
|
||||
#endif
|
||||
@@ -1825,8 +1831,8 @@ void OS_X11::process_xevents() {
|
||||
GrabModeAsync, GrabModeAsync, x11_window, None, CurrentTime);
|
||||
}
|
||||
#ifdef TOUCH_ENABLED
|
||||
// Grab touch devices to avoid OS gesture interference
|
||||
/*for (int i = 0; i < touch.devices.size(); ++i) {
|
||||
// Grab touch devices to avoid OS gesture interference
|
||||
/*for (int i = 0; i < touch.devices.size(); ++i) {
|
||||
XIGrabDevice(x11_display, touch.devices[i], x11_window, CurrentTime, None, XIGrabModeAsync, XIGrabModeAsync, False, &touch.event_mask);
|
||||
}*/
|
||||
#endif
|
||||
|
||||
@@ -180,6 +180,7 @@ class OS_X11 : public OS_Unix {
|
||||
|
||||
CrashHandler crash_handler;
|
||||
|
||||
int video_driver_index;
|
||||
int audio_driver_index;
|
||||
unsigned int capture_idle;
|
||||
bool maximized;
|
||||
@@ -206,6 +207,8 @@ protected:
|
||||
bool is_window_maximize_allowed();
|
||||
|
||||
public:
|
||||
virtual int get_current_video_driver() const;
|
||||
|
||||
virtual String get_name();
|
||||
|
||||
virtual void set_cursor_shape(CursorShape p_shape);
|
||||
|
||||
@@ -44,7 +44,7 @@ Error AudioDriverDummy::init() {
|
||||
speaker_mode = SPEAKER_MODE_STEREO;
|
||||
channels = 2;
|
||||
|
||||
int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
int latency = GLOBAL_DEF_RST("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
|
||||
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
|
||||
|
||||
samples_in = memnew_arr(int32_t, buffer_frames * channels);
|
||||
|
||||
@@ -903,8 +903,8 @@ void AudioServer::init_channels_and_buffers() {
|
||||
|
||||
void AudioServer::init() {
|
||||
|
||||
channel_disable_threshold_db = GLOBAL_DEF("audio/channel_disable_threshold_db", -60.0);
|
||||
channel_disable_frames = float(GLOBAL_DEF("audio/channel_disable_time", 2.0)) * get_mix_rate();
|
||||
channel_disable_threshold_db = GLOBAL_DEF_RST("audio/channel_disable_threshold_db", -60.0);
|
||||
channel_disable_frames = float(GLOBAL_DEF_RST("audio/channel_disable_time", 2.0)) * get_mix_rate();
|
||||
buffer_size = 1024; //hardcoded for now
|
||||
|
||||
init_channels_and_buffers();
|
||||
@@ -920,7 +920,7 @@ void AudioServer::init() {
|
||||
set_edited(false); //avoid editors from thinking this was edited
|
||||
#endif
|
||||
|
||||
GLOBAL_DEF("audio/video_delay_compensation_ms", 0);
|
||||
GLOBAL_DEF_RST("audio/video_delay_compensation_ms", 0);
|
||||
}
|
||||
|
||||
void AudioServer::update() {
|
||||
|
||||
Reference in new issue
Block a user