本文整理汇总了C++中EDITOR_DEF函数的典型用法代码示例。如果您正苦于以下问题:C++ EDITOR_DEF函数的具体用法?C++ EDITOR_DEF怎么用?C++ EDITOR_DEF使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EDITOR_DEF函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
开发者ID:elanifegnirf,项目名称:godot,代码行数:26,代码来源:code_editor.cpp
示例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);
}
开发者ID:Paulloz,项目名称:godot,代码行数:28,代码来源:export.cpp
示例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);
}
开发者ID:HariArika,项目名称:godot,代码行数:55,代码来源:shader_editor_plugin.cpp
示例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");
}
开发者ID:3miu,项目名称:godot,代码行数:54,代码来源:code_editor.cpp
示例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
}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:12,代码来源:editor_scene_importer_fbxconv.cpp
示例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","");
}
开发者ID:madmagi,项目名称:godot,代码行数:15,代码来源:script_editor_plugin.cpp
示例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();
}
开发者ID:Griefchief,项目名称:godot,代码行数:7,代码来源:tile_map_editor_plugin.cpp
示例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);
}
开发者ID:ErosOlmi,项目名称:godot,代码行数:27,代码来源:scene_tree_dock.cpp
示例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();
}
}
开发者ID:madmagi,项目名称:godot,代码行数:7,代码来源:script_editor_plugin.cpp
示例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");
}
开发者ID:tutosfaciles48,项目名称:godot,代码行数:46,代码来源:sample_editor_plugin.cpp
示例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()));
}
开发者ID:jejung,项目名称:godot,代码行数:18,代码来源:code_editor.cpp
示例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();
}
开发者ID:KelinciFX,项目名称:godot,代码行数:11,代码来源:godotsharp_editor.cpp
示例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");
}
开发者ID:AutonomicStudios,项目名称:godot,代码行数:41,代码来源:editor_scene_importer_fbxconv.cpp
示例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;
}
开发者ID:P-GLEZ,项目名称:godot,代码行数:53,代码来源:editor_help.cpp
示例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();
}
开发者ID:AwsomeGameEngine,项目名称:godot,代码行数:13,代码来源:cube_grid_theme_editor_plugin.cpp
示例16: ERR_FAIL_INDEX_V
String EditorData::get_scene_title(int p_idx) const {
ERR_FAIL_INDEX_V(p_idx, edited_scene.size(), String());
if (!edited_scene[p_idx].root)
return TTR("[empty]");
if (edited_scene[p_idx].root->get_filename() == "")
return TTR("[unsaved]");
bool show_ext = EDITOR_DEF("interface/scene_tabs/show_extension", false);
String name = edited_scene[p_idx].root->get_filename().get_file();
if (!show_ext) {
name = name.get_basename();
}
return name;
}
开发者ID:93i,项目名称:godot,代码行数:13,代码来源:editor_data.cpp
示例17: EDITOR_DEF
void CodeTextEditor::_update_font() {
// FONTS
String editor_font = EDITOR_DEF("text_editor/font", "");
bool font_overridden = false;
if (editor_font!="") {
Ref<Font> fnt = ResourceLoader::load(editor_font);
if (fnt.is_valid()) {
text_editor->add_font_override("font",fnt);
font_overridden = true;
}
}
if(!font_overridden)
text_editor->add_font_override("font",get_font("source","EditorFonts"));
}
开发者ID:Biliogadafr,项目名称:godot,代码行数:15,代码来源:code_editor.cpp
示例18: EDITOR_DEF
TileMapEditor::TileMapEditor(EditorNode *p_editor) {
node=NULL;
canvas_item_editor=NULL;
editor=p_editor;
undo_redo = editor->get_undo_redo();
int mw = EDITOR_DEF("tile_map/palette_min_width",80);
Control *ec = memnew( Control);
ec->set_custom_minimum_size(Size2(mw,0));
add_child(ec);
// Add tile palette
palette = memnew( Tree );
palette->set_v_size_flags(SIZE_EXPAND_FILL);
add_child(palette);
// Add menu items
canvas_item_editor_hb = memnew( HBoxContainer );
CanvasItemEditor::get_singleton()->add_control_to_menu_panel(canvas_item_editor_hb);
canvas_item_editor_hb->add_child( memnew( VSeparator ));
mirror_x = memnew( ToolButton );
mirror_x->set_toggle_mode(true);
mirror_x->set_tooltip("Mirror X (A)");
mirror_x->set_focus_mode(FOCUS_NONE);
canvas_item_editor_hb->add_child(mirror_x);
mirror_y = memnew( ToolButton );
mirror_y->set_toggle_mode(true);
mirror_y->set_tooltip("Mirror Y (S)");
mirror_y->set_focus_mode(FOCUS_NONE);
canvas_item_editor_hb->add_child(mirror_y);
canvas_item_editor_hb->hide();
tool=TOOL_NONE;
selection_active=false;
mouse_over=false;
}
开发者ID:ScyDev,项目名称:godot,代码行数:37,代码来源:tile_map_editor_plugin.cpp
示例19: EDITOR_DEF
PathSpatialGizmoPlugin::PathSpatialGizmoPlugin() {
Color path_color = EDITOR_DEF("editors/3d_gizmos/gizmo_colors/path", Color(0.5, 0.5, 1.0, 0.8));
Ref<SpatialMaterial> path_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
path_color.a = 0.8;
path_material->set_albedo(path_color);
path_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
path_material->set_line_width(3);
path_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
path_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
Ref<SpatialMaterial> path_thin_material = Ref<SpatialMaterial>(memnew(SpatialMaterial));
path_color.a = 0.4;
path_thin_material->set_albedo(path_color);
path_thin_material->set_feature(SpatialMaterial::FEATURE_TRANSPARENT, true);
path_thin_material->set_line_width(1);
path_thin_material->set_cull_mode(SpatialMaterial::CULL_DISABLED);
path_thin_material->set_flag(SpatialMaterial::FLAG_UNSHADED, true);
add_material("path_material", path_material);
add_material("path_thin_material", path_thin_material);
create_handle_material("handles");
}
开发者ID:KellyThomas,项目名称:godot,代码行数:24,代码来源:path_editor_plugin.cpp
示例20: switch
bool LightOccluder2DEditor::forward_input_event(const InputEvent& p_event) {
if (!node)
return false;
if (node->get_occluder_polygon().is_null()) {
if (p_event.type==InputEvent::MOUSE_BUTTON && p_event.mouse_button.button_index==1 && p_event.mouse_button.pressed) {
create_poly->set_text("No OccluderPolygon2D resource on this node.\nCreate and assign one?");
create_poly->popup_centered_minsize();
}
return false;
}
switch(p_event.type) {
case InputEvent::MOUSE_BUTTON: {
const InputEventMouseButton &mb=p_event.mouse_button;
Matrix32 xform = canvas_item_editor->get_canvas_transform() * node->get_global_transform();
Vector2 gpoint = Point2(mb.x,mb.y);
Vector2 cpoint = canvas_item_editor->get_canvas_transform().affine_inverse().xform(gpoint);
cpoint=snap_point(cpoint);
cpoint = node->get_global_transform().affine_inverse().xform(cpoint);
Vector<Vector2> poly = Variant(node->get_occluder_polygon()->get_polygon());
//first check if a point is to be added (segment split)
real_t grab_treshold=EDITOR_DEF("poly_editor/point_grab_radius",8);
switch(mode) {
case MODE_CREATE: {
if (mb.button_index==BUTTON_LEFT && mb.pressed) {
if (!wip_active) {
wip.clear();
wip.push_back( cpoint );
wip_active=true;
edited_point_pos=cpoint;
canvas_item_editor->get_viewport_control()->update();
edited_point=1;
return true;
} else {
if (wip.size()>1 && xform.xform(wip[0]).distance_to(gpoint)<grab_treshold) {
//wip closed
_wip_close(true);
return true;
} else if (wip.size()>1 && xform.xform(wip[wip.size()-1]).distance_to(gpoint)<grab_treshold) {
//wip closed
_wip_close(false);
return true;
} else {
wip.push_back( cpoint );
edited_point=wip.size();
canvas_item_editor->get_viewport_control()->update();
return true;
//add wip point
}
}
} else if (mb.button_index==BUTTON_RIGHT && mb.pressed && wip_active) {
_wip_close(true);
}
} break;
case MODE_EDIT: {
if (mb.button_index==BUTTON_LEFT) {
if (mb.pressed) {
if (mb.mod.control) {
if (poly.size() < 3) {
undo_redo->create_action("Edit Poly");
undo_redo->add_undo_method(node->get_occluder_polygon().ptr(),"set_polygon",poly);
poly.push_back(cpoint);
undo_redo->add_do_method(node->get_occluder_polygon().ptr(),"set_polygon",poly);
undo_redo->add_do_method(canvas_item_editor->get_viewport_control(),"update");
undo_redo->add_undo_method(canvas_item_editor->get_viewport_control(),"update");
undo_redo->commit_action();
return true;
}
//.........这里部分代码省略.........
开发者ID:blackwolf12333,项目名称:godot,代码行数:101,代码来源:light_occluder_2d_editor_plugin.cpp
注:本文中的EDITOR_DEF函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论