本文整理匯總了C++中EDITOR_DEF函數的典型用法代碼示例。如果您正苦於以下問題:C++ EDITOR_DEF函數的具體用法?C++ EDITOR_DEF怎麽用?C++ EDITOR_DEF使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EDITOR_DEF函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: EDITOR_DEF
void CodeTextEditor::_on_settings_change() {
// FONTS
String editor_font = EDITOR_DEF("text_editor/font", "");
bool font_overrode = false;
if (editor_font!="") {
Ref<Font> fnt = ResourceLoader::load(editor_font);
if (fnt.is_valid()) {
text_editor->add_font_override("font",fnt);
font_overrode = true;
}
}
if(!font_overrode)
text_editor->add_font_override("font",get_font("source","Fonts"));
// AUTO BRACE COMPLETION
text_editor->set_auto_brace_completion(
EDITOR_DEF("text_editor/auto_brace_complete", true)
);
code_complete_timer->set_wait_time(
EDITOR_DEF("text_editor/code_complete_delay",.3f)
);
enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true);
}
示例2: register_windows_exporter
void register_windows_exporter() {
EDITOR_DEF("export/windows/rcedit", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/rcedit", PROPERTY_HINT_GLOBAL_FILE, "*.exe"));
#ifndef WINDOWS_ENABLED
// On non-Windows we need WINE to run rcedit
EDITOR_DEF("export/windows/wine", "");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING, "export/windows/wine", PROPERTY_HINT_GLOBAL_FILE));
#endif
Ref<EditorExportPlatformWindows> platform;
platform.instance();
Ref<Image> img = memnew(Image(_windows_logo));
Ref<ImageTexture> logo;
logo.instance();
logo->create_from_image(img);
platform->set_logo(logo);
platform->set_name("Windows Desktop");
platform->set_extension("exe");
platform->set_release_32("windows_32_release.exe");
platform->set_debug_32("windows_32_debug.exe");
platform->set_release_64("windows_64_release.exe");
platform->set_debug_64("windows_64_debug.exe");
platform->set_os_name("Windows");
EditorExport::get_singleton()->add_export_platform(platform);
}
示例3: get_text_edit
void ShaderTextEditor::_load_theme_settings() {
get_text_edit()->clear_colors();
/* keyword color */
get_text_edit()->set_custom_bg_color(EDITOR_DEF("text_editor/background_color",Color(0,0,0,0)));
get_text_edit()->add_color_override("font_color",EDITOR_DEF("text_editor/text_color",Color(0,0,0)));
get_text_edit()->add_color_override("font_selected_color",EDITOR_DEF("text_editor/text_selected_color",Color(1,1,1)));
get_text_edit()->add_color_override("selection_color",EDITOR_DEF("text_editor/selection_color",Color(0.2,0.2,1)));
get_text_edit()->add_color_override("brace_mismatch_color",EDITOR_DEF("text_editor/brace_mismatch_color",Color(1,0.2,0.2)));
get_text_edit()->add_color_override("current_line_color",EDITOR_DEF("text_editor/current_line_color",Color(0.3,0.5,0.8,0.15)));
Color keyword_color= EDITOR_DEF("text_editor/keyword_color",Color(0.5,0.0,0.2));
get_text_edit()->set_syntax_coloring(true);
List<String> keywords;
ShaderLanguage::get_keyword_list(type,&keywords);
for(List<String>::Element *E=keywords.front();E;E=E->next()) {
get_text_edit()->add_keyword_color(E->get(),keyword_color);
}
//colorize core types
// Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0));
//colorize comments
Color comment_color = EDITOR_DEF("text_editor/comment_color",Color::hex(0x797e7eff));
get_text_edit()->add_color_region("/*","*/",comment_color,false);
get_text_edit()->add_color_region("//","",comment_color,false);
//colorize strings
Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff));
/*
List<String> strings;
shader->get_shader_mode()->get_string_delimiters(&strings);
for (List<String>::Element *E=strings.front();E;E=E->next()) {
String string = E->get();
String beg = string.get_slice(" ",0);
String end = string.get_slice_count(" ")>1?string.get_slice(" ",1):String();
get_text_edit()->add_color_region(beg,end,string_color,end=="");
}*/
//colorize symbols
Color symbol_color= EDITOR_DEF("text_editor/symbol_color",Color::hex(0x005291ff));
get_text_edit()->set_symbol_color(symbol_color);
}
示例4: memnew
CodeTextEditor::CodeTextEditor() {
text_editor = memnew( TextEdit );
add_child(text_editor);
text_editor->set_area_as_parent_rect();
text_editor->set_margin(MARGIN_BOTTOM,20);
text_editor->add_font_override("font",get_font("source","Fonts"));
text_editor->set_show_line_numbers(true);
text_editor->set_brace_matching(true);
line_col = memnew( Label );
add_child(line_col);
line_col->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_END,135);
line_col->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,20);
line_col->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,1);
line_col->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5);
//line_col->set_align(Label::ALIGN_RIGHT);
idle = memnew( Timer );
add_child(idle);
idle->set_one_shot(true);
idle->set_wait_time(EDITOR_DEF("text_editor/idle_parse_delay",2));
code_complete_timer = memnew(Timer);
add_child(code_complete_timer);
code_complete_timer->set_one_shot(true);
enable_complete_timer = EDITOR_DEF("text_editor/enable_code_completion_delay",true);
code_complete_timer->set_wait_time(EDITOR_DEF("text_editor/code_complete_delay",.3f));
error = memnew( Label );
add_child(error);
error->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5);
error->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,20);
error->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,1);
error->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,130);
error->hide();
error->add_color_override("font_color",Color(1,0.7,0.6,0.9));
text_editor->connect("cursor_changed", this,"_line_col_changed");
text_editor->connect("text_changed", this,"_text_changed");
text_editor->connect("request_completion", this,"_complete_request");
Vector<String> cs;
cs.push_back(".");
cs.push_back(",");
cs.push_back("(");
text_editor->set_completion(true,cs);
idle->connect("timeout", this,"_text_changed_idle_timeout");
code_complete_timer->connect("timeout", this,"_code_complete_timer_timeout");
EditorSettings::get_singleton()->connect("settings_changed",this,"_on_settings_change");
}
示例5: EDITOR_DEF
EditorSceneImporterFBXConv::EditorSceneImporterFBXConv() {
EDITOR_DEF("fbxconv/path","");
#ifndef WINDOWS_ENABLED
EDITOR_DEF("fbxconv/use_wine","");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"fbxconv/use_wine",PROPERTY_HINT_GLOBAL_FILE));
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"fbxconv/path",PROPERTY_HINT_GLOBAL_FILE));
#else
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"fbxconv/path",PROPERTY_HINT_GLOBAL_FILE,"exe"));
#endif
}
示例6: memnew
ScriptEditorPlugin::ScriptEditorPlugin(EditorNode *p_node) {
editor=p_node;
script_editor = memnew( ScriptEditor(p_node) );
editor->get_viewport()->add_child(script_editor);
script_editor->set_area_as_parent_rect();
script_editor->hide();
EDITOR_DEF("external_editor/use_external_editor",false);
EDITOR_DEF("external_editor/exec_path","");
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::STRING,"external_editor/exec_path",PROPERTY_HINT_GLOBAL_FILE));
EDITOR_DEF("external_editor/exec_flags","");
}
示例7: EDITOR_DEF
TileMapEditorPlugin::TileMapEditorPlugin(EditorNode *p_node) {
EDITOR_DEF("tile_map/preview_size",64);
tile_map_editor = memnew( TileMapEditor(p_node) );
add_control_to_container(CONTAINER_CANVAS_EDITOR_SIDE, tile_map_editor);
tile_map_editor->hide();
}
示例8: fill_path_renames
void SceneTreeDock::fill_path_renames(Node* p_node, Node *p_new_parent, List<Pair<NodePath,NodePath> > *p_renames) {
if (!bool(EDITOR_DEF("animation/autorename_animation_tracks",true)))
return;
Vector<StringName> base_path;
Node *n = p_node->get_parent();
while(n) {
base_path.push_back(n->get_name());
n=n->get_parent();
}
base_path.invert();
Vector<StringName> new_base_path;
if (p_new_parent) {
n = p_new_parent;
while(n) {
new_base_path.push_back(n->get_name());
n=n->get_parent();
}
new_base_path.invert();
}
_fill_path_renames(base_path,new_base_path,p_node,p_renames);
}
示例9: save_global_state
void ScriptEditorPlugin::save_global_state() {
if (bool(EDITOR_DEF("text_editor/restore_scripts_on_load",true))) {
script_editor->_save_files_state();
}
}
示例10: memnew
SampleEditor::SampleEditor() {
player = memnew(SamplePlayer);
add_child(player);
add_style_override("panel", get_stylebox("panel","Panel"));
library = Ref<SampleLibrary>(memnew(SampleLibrary));
player->set_sample_library(library);
sample_texframe = memnew( TextureFrame );
add_child(sample_texframe);
sample_texframe->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_BEGIN,5);
sample_texframe->set_anchor_and_margin(MARGIN_RIGHT,ANCHOR_END,5);
sample_texframe->set_anchor_and_margin(MARGIN_TOP,ANCHOR_BEGIN,30);
sample_texframe->set_anchor_and_margin(MARGIN_BOTTOM,ANCHOR_END,5);
info_label = memnew( Label );
sample_texframe->add_child(info_label);
info_label->set_area_as_parent_rect();
info_label->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,15);
info_label->set_margin(MARGIN_BOTTOM,4);
info_label->set_margin(MARGIN_RIGHT,4);
info_label->set_align(Label::ALIGN_RIGHT);
play = memnew( Button );
play->set_pos(Point2( 5, 5 ));
play->set_size( Size2(1,1 ) );
play->set_toggle_mode(true);
add_child(play);
stop = memnew( Button );
stop->set_pos(Point2( 35, 5 ));
stop->set_size( Size2(1,1 ) );
stop->set_toggle_mode(true);
add_child(stop);
peakdisplay=Ref<ImageTexture>( memnew( ImageTexture) );
peakdisplay->create( EDITOR_DEF("audio/sample_editor_preview_width",512),EDITOR_DEF("audio/sample_editor_preview_height",128),Image::FORMAT_RGB);
sample_texframe->set_expand(true);
sample_texframe->set_texture(peakdisplay);
play->connect("pressed", this,"_play_pressed");
stop->connect("pressed", this,"_stop_pressed");
}
示例11: _update_font
void CodeTextEditor::_on_settings_change() {
_update_font();
// AUTO BRACE COMPLETION
text_editor->set_auto_brace_completion(
EDITOR_DEF("text_editor/completion/auto_brace_complete", true));
code_complete_timer->set_wait_time(
EDITOR_DEF("text_editor/completion/code_complete_delay", .3f));
enable_complete_timer = EDITOR_DEF("text_editor/completion/enable_code_completion_delay", true);
// call hint settings
text_editor->set_callhint_settings(
EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true),
EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2()));
}
示例12: memnew
MonoReloadNode::MonoReloadNode() {
singleton = this;
reload_timer = memnew(Timer);
add_child(reload_timer);
reload_timer->set_one_shot(false);
reload_timer->set_wait_time(EDITOR_DEF("mono/assembly_watch_interval_sec", 0.5));
reload_timer->connect("timeout", this, "_reload_timer_timeout");
reload_timer->start();
}
示例13: _parse_json
Error EditorSceneImporterFBXConv::_parse_fbx(State& state,const String& p_path) {
state.base_path=p_path.get_base_dir();
if (p_path.to_lower().ends_with("g3dj")) {
return _parse_json(state,p_path.basename()+".g3dj");
}
String tool = EDITOR_DEF("fbxconv/path","");
ERR_FAIL_COND_V( !FileAccess::exists(tool),ERR_UNCONFIGURED);
String wine = EDITOR_DEF("fbxconv/use_wine","");
List<String> args;
String path=p_path;
if (wine!="") {
List<String> wpargs;
wpargs.push_back("-w");
wpargs.push_back(p_path);
String pipe; //winepath to convert to windows path
int wpres;
Error wperr = OS::get_singleton()->execute(wine+"path",wpargs,true,NULL,&pipe,&wpres);
ERR_FAIL_COND_V(wperr!=OK,ERR_CANT_CREATE);
ERR_FAIL_COND_V(wpres!=0,ERR_CANT_CREATE);
path=pipe.strip_edges();
args.push_back(tool);
tool=wine;
}
args.push_back("-o");
args.push_back(TTR("G3DJ"));
args.push_back(path);
int res;
Error err = OS::get_singleton()->execute(tool,args,true,NULL,NULL,&res);
ERR_FAIL_COND_V(err!=OK,ERR_CANT_CREATE);
ERR_FAIL_COND_V(res!=0,ERR_CANT_CREATE);
return _parse_json(state,p_path.basename()+".g3dj");
}
示例14: EDITOR_DEF
EditorHelp::EditorHelp() {
editor=EditorNode::get_singleton();
VBoxContainer *vbc = this;
EDITOR_DEF("help/sort_functions_alphabetically",true);
//class_list->connect("meta_clicked",this,"_class_list_select");
//class_list->set_selection_enabled(true);
{
Panel *pc = memnew( Panel );
Ref<StyleBoxFlat> style( memnew( StyleBoxFlat ) );
style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") );
pc->set_v_size_flags(SIZE_EXPAND_FILL);
pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit"));
vbc->add_child(pc);
class_desc = memnew( RichTextLabel );
pc->add_child(class_desc);
class_desc->set_area_as_parent_rect(8);
class_desc->connect("meta_clicked",this,"_class_desc_select");
class_desc->connect("input_event",this,"_class_desc_input");
}
class_desc->get_v_scroll()->connect("value_changed",this,"_scroll_changed");
class_desc->set_selection_enabled(true);
scroll_locked=false;
select_locked=false;
set_process_unhandled_key_input(true);
class_desc->hide();
search_dialog = memnew( ConfirmationDialog );
add_child(search_dialog);
VBoxContainer *search_vb = memnew( VBoxContainer );
search_dialog->add_child(search_vb);
search_dialog->set_child_rect(search_vb);
search = memnew( LineEdit );
search_dialog->register_text_enter(search);
search_vb->add_margin_child(TTR("Search Text"),search);
search_dialog->get_ok()->set_text(TTR("Find"));
search_dialog->connect("confirmed",this,"_search_cbk");
search_dialog->set_hide_on_ok(false);
search_dialog->set_self_opacity(0.8);
/*class_search = memnew( EditorHelpSearch(editor) );
editor->get_gui_base()->add_child(class_search);
class_search->connect("go_to_help",this,"_help_callback");*/
// prev_search_page=-1;
}
示例15: EDITOR_DEF
MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
EDITOR_DEF("grid_map/preview_size",64);
theme_editor = memnew( MeshLibraryEditor(p_node) );
p_node->get_viewport()->add_child(theme_editor);
theme_editor->set_area_as_parent_rect();
theme_editor->set_anchor( MARGIN_RIGHT, Control::ANCHOR_END );
theme_editor->set_anchor( MARGIN_BOTTOM, Control::ANCHOR_BEGIN );
theme_editor->set_end( Point2(0,22) );
theme_editor->hide();
}