• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ emit_signal函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中emit_signal函数的典型用法代码示例。如果您正苦于以下问题:C++ emit_signal函数的具体用法?C++ emit_signal怎么用?C++ emit_signal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了emit_signal函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: emit_signal

void CreateDialog::_update_favorite_list() {

	favorites->clear();
	TreeItem *root = favorites->create_item();
	for (int i = 0; i < favorite_list.size(); i++) {
		String l = favorite_list[i];
		String name = l.split(" ")[0];
		if (!(ClassDB::class_exists(name) || ScriptServer::is_global_class(name)))
			continue;
		TreeItem *ti = favorites->create_item(root);
		ti->set_text(0, l);
		ti->set_icon(0, EditorNode::get_singleton()->get_class_icon(l, base_type));
	}
	emit_signal("favorites_updated");
}
开发者ID:timoschwarzer,项目名称:godot,代码行数:15,代码来源:create_dialog.cpp


示例2: print_verbose

void FindInFiles::start() {
	if (_pattern == "") {
		print_verbose("Nothing to search, pattern is empty");
		emit_signal(SIGNAL_FINISHED);
		return;
	}
	if (_extension_filter.size() == 0) {
		print_verbose("Nothing to search, filter matches no files");
		emit_signal(SIGNAL_FINISHED);
		return;
	}

	// Init search
	_current_dir = "";
	PoolStringArray init_folder;
	init_folder.append(_root_dir);
	_folders_stack.clear();
	_folders_stack.push_back(init_folder);

	_initial_files_count = 0;

	_searching = true;
	set_process(true);
}
开发者ID:deliciousfudge,项目名称:godot,代码行数:24,代码来源:find_in_files.cpp


示例3: emit_signal

Error Object::emit_signal(const StringName &p_name, VARIANT_ARG_DECLARE) {

	VARIANT_ARGPTRS;

	int argc = 0;

	for (int i = 0; i < VARIANT_ARG_MAX; i++) {

		if (argptr[i]->get_type() == Variant::NIL)
			break;
		argc++;
	}

	return emit_signal(p_name, argptr, argc);
}
开发者ID:Bonfi96,项目名称:godot,代码行数:15,代码来源:object.cpp


示例4: ERR_FAIL_INDEX

void GeometryInstance::set_flag(Flags p_flag,bool p_value) {

	ERR_FAIL_INDEX(p_flag,FLAG_MAX);
	if (flags[p_flag]==p_value)
		return;

	flags[p_flag]=p_value;
	VS::get_singleton()->instance_geometry_set_flag(get_instance(),(VS::InstanceFlags)p_flag,p_value);
	if (p_flag==FLAG_VISIBLE) {
		_change_notify("geometry/visible");
		emit_signal(SceneStringNames::get_singleton()->visibility_changed);
	}


}
开发者ID:9cat,项目名称:godot,代码行数:15,代码来源:visual_instance.cpp


示例5: get_node

void SceneTreeEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {

	if (!can_drop_data_fw(p_point, p_data, p_from))
		return;

	TreeItem *item = tree->get_item_at_pos(p_point);
	if (!item)
		return;
	int section = tree->get_drop_section_at_pos(p_point);
	if (section < -1)
		return;

	NodePath np = item->get_metadata(0);
	Node *n = get_node(np);
	if (!n)
		return;

	Dictionary d = p_data;

	if (String(d["type"]) == "nodes") {
		Array nodes = d["nodes"];
		emit_signal("nodes_rearranged", nodes, np, section);
	}

	if (String(d["type"]) == "files") {

		Vector<String> files = d["files"];

		String ftype = EditorFileSystem::get_singleton()->get_file_type(files[0]);
		if (_is_script_type(ftype)) {
			emit_signal("script_dropped", files[0], np);
		} else {
			emit_signal("files_dropped", files, np, section);
		}
	}
}
开发者ID:MattUV,项目名称:godot,代码行数:36,代码来源:scene_tree_editor.cpp


示例6: emit_signal

void EditorSubScene::ok_pressed() {


	TreeItem *s = tree->get_selected();
	if (!s)
		return;
	Node *selnode = s->get_metadata(0);
	if (!selnode)
		return;
	emit_signal("subscene_selected");
	hide();
	clear();


}
开发者ID:0871087123,项目名称:godot,代码行数:15,代码来源:editor_sub_scene.cpp


示例7: get_constant

void SplitContainer::_gui_input(const Ref<InputEvent> &p_event) {

	if (collapsed || !_getch(0) || !_getch(1) || dragger_visibility != DRAGGER_VISIBLE)
		return;

	Ref<InputEventMouseButton> mb = p_event;

	if (mb.is_valid()) {

		if (mb->get_button_index() == BUTTON_LEFT) {

			if (mb->is_pressed()) {

				int sep = get_constant("separation");

				if (vertical) {

					if (mb->get_position().y > middle_sep && mb->get_position().y < middle_sep + sep) {

						dragging = true;
						drag_from = mb->get_position().y;
						drag_ofs = expand_ofs;
					}
				} else {

					if (mb->get_position().x > middle_sep && mb->get_position().x < middle_sep + sep) {

						dragging = true;
						drag_from = mb->get_position().x;
						drag_ofs = expand_ofs;
					}
				}
			} else {

				dragging = false;
			}
		}
	}

	Ref<InputEventMouseMotion> mm = p_event;

	if (mm.is_valid() && dragging) {

		expand_ofs = drag_ofs + ((vertical ? mm->get_position().y : mm->get_position().x) - drag_from);
		queue_sort();
		emit_signal("dragged", get_split_offset());
	}
}
开发者ID:brakhane,项目名称:godot,代码行数:48,代码来源:split_container.cpp


示例8: while

void Node::_propagate_enter_tree() {
	// this needs to happen to all childs before any enter_tree

	if (data.parent) {
		data.tree=data.parent->data.tree;
		data.depth=data.parent->data.depth+1;
	} else {

		data.depth=1;
	}
	
	data.viewport = cast_to<Viewport>();
	if (!data.viewport)
		data.viewport = data.parent->data.viewport;

	data.inside_tree=true;

	const StringName *K=NULL;

	while ((K=data.grouped.next(K))) {

		data.tree->add_to_group(*K,this);
	}


	notification(NOTIFICATION_ENTER_TREE);

	if (get_script_instance()) {

		Variant::CallError err;
		get_script_instance()->call_multilevel_reversed(SceneStringNames::get_singleton()->_enter_tree,NULL,0);
	}

	emit_signal(SceneStringNames::get_singleton()->enter_tree);


	data.blocked++;
	//block while adding children

	for (int i=0;i<data.children.size();i++) {
		
		if (!data.children[i]->is_inside_tree()) // could have been added in enter_tree
			data.children[i]->_propagate_enter_tree();
	}	

	data.blocked--;
	// enter groups
}
开发者ID:Martho42,项目名称:godot,代码行数:48,代码来源:node.cpp


示例9: emit_signal

void Popup::popup() {

	emit_signal("about_to_show");
	show_modal(exclusive);


	_fix_size();

	Control *focusable = find_next_valid_focus();

	if (focusable)
		focusable->grab_focus();

	_post_popup();
	notification(NOTIFICATION_POST_POPUP);
}
开发者ID:0871087123,项目名称:godot,代码行数:16,代码来源:popup.cpp


示例10: set_color

void ColorPicker::_value_changed(double) {

	if (updating)
		return;

	for(int i=0;i<4;i++) {
		color.components[i] = scroll[i]->get_val()/(raw_mode_enabled?1.0:255.0);
	}

	set_color(color);

	_update_text_value();

	emit_signal("color_changed",color);

}
开发者ID:SPTelur,项目名称:godot,代码行数:16,代码来源:color_picker.cpp


示例11: emit_signal

void StreamPlayer::stop() {

	if (!is_inside_tree())
		return;
	if (playback.is_null())
		return;

	//_THREAD_SAFE_METHOD_
	AudioServer::get_singleton()->stream_set_active(stream_rid,false);
	stop_request=false;
	playback->stop();
	resampler.flush();
	emit_signal("finished");

	//set_idle_process(false);
}
开发者ID:hellaguy130,项目名称:godot,代码行数:16,代码来源:stream_player.cpp


示例12: pr

void EditorFileSystem::reimport_files(const Vector<String> &p_files) {

	importing = true;
	EditorProgress pr("reimport", TTR("(Re)Importing Assets"), p_files.size());
	for (int i = 0; i < p_files.size(); i++) {
		pr.step(p_files[i].get_file(), i);

		_reimport_file(p_files[i]);
	}

	_save_filesystem_cache();
	importing = false;
	if (!is_scanning()) {
		emit_signal("filesystem_changed");
	}
}
开发者ID:rrrfffrrr,项目名称:godot,代码行数:16,代码来源:editor_file_system.cpp


示例13: ERR_FAIL_COND

void ScriptTextEditor::set_edited_script(const Ref<Script>& p_script) {

	ERR_FAIL_COND(!script.is_null());

	script=p_script;


	_load_theme_settings();

	code_editor->get_text_edit()->set_text(script->get_source_code());
	code_editor->get_text_edit()->clear_undo_history();
	code_editor->get_text_edit()->tag_saved_version();

	emit_signal("name_changed");
	code_editor->update_line_and_column();
}
开发者ID:Blake-Hudson,项目名称:godot,代码行数:16,代码来源:script_text_editor.cpp


示例14: set_pick_color

void ColorPicker::_html_entered(const String &p_html) {

	if (updating)
		return;

	float last_alpha = color.a;
	color = Color::html(p_html);
	if (!is_editing_alpha())
		color.a = last_alpha;

	if (!is_inside_tree())
		return;

	set_pick_color(color);
	emit_signal("color_changed", color);
}
开发者ID:ialex32x,项目名称:godot,代码行数:16,代码来源:color_picker.cpp


示例15: ERR_FAIL_COND

void ARVRServer::add_interface(const Ref<ARVRInterface> &p_interface) {
	ERR_FAIL_COND(p_interface.is_null());

	for (int i = 0; i < interfaces.size(); i++) {

		if (interfaces[i] == p_interface) {
			ERR_PRINT("Interface was already added");
			return;
		};
	};

	print_line("ARVR: Registered interface: " + p_interface->get_name());

	interfaces.push_back(p_interface);
	emit_signal("interface_added", p_interface->get_name());
};
开发者ID:d-stewart,项目名称:godot,代码行数:16,代码来源:arvr_server.cpp


示例16: accept_event

void EditorAudioBus::_gui_input(const Ref<InputEvent> &p_event) {

	Ref<InputEventKey> k = p_event;
	if (k.is_valid() && k->is_pressed() && k->get_scancode() == KEY_DELETE && !k->is_echo()) {
		accept_event();
		emit_signal("delete_request");
	}

	Ref<InputEventMouseButton> mb = p_event;
	if (mb.is_valid() && mb->get_button_index() == 2 && mb->is_pressed()) {

		Vector2 pos = Vector2(mb->get_position().x, mb->get_position().y);
		bus_popup->set_position(get_global_position() + pos);
		bus_popup->popup();
	}
}
开发者ID:louisVottero,项目名称:godot,代码行数:16,代码来源:editor_audio_buses.cpp


示例17: set_process

void ScriptEditorDebugger::stop(){


	set_process(false);

	server->stop();

	ppeer->set_stream_peer(Ref<StreamPeer>());

	if (connection.is_valid()) {
		EditorNode::get_log()->add_message("** Debug Process Stopped **");
		connection.unref();
	}

	pending_in_queue=0;
	message.clear();

	if (log_forced_visible) {
		//EditorNode::get_singleton()->make_bottom_panel_item_visible(this);
		if (EditorNode::get_log()->is_visible())
			EditorNode::get_singleton()->hide_bottom_panel();
		log_forced_visible=false;
	}

	node_path_cache.clear();
	res_path_cache.clear();
	profiler_signature.clear();
	le_clear->set_disabled(false);
	le_set->set_disabled(true);
	profiler->set_enabled(true);

	inspect_properties->edit(NULL);
	inspect_scene_tree->clear();

	EditorNode::get_singleton()->get_pause_button()->set_pressed(false);
	EditorNode::get_singleton()->get_pause_button()->set_disabled(true);



	if (hide_on_stop) {
		if (is_visible())
			EditorNode::get_singleton()->hide_bottom_panel();
		emit_signal("show_debugger",false);
	}

}
开发者ID:Brickcaster,项目名称:godot,代码行数:46,代码来源:script_editor_debugger.cpp


示例18: ERR_FAIL_COND

void SceneTreeEditor::_selected_changed() {

	TreeItem *s = tree->get_selected();
	ERR_FAIL_COND(!s);
	NodePath np = s->get_metadata(0);

	Node *n = get_node(np);

	if (n == selected)
		return;

	selected = get_node(np);

	blocked++;
	emit_signal("node_selected");
	blocked--;
}
开发者ID:deliciousfudge,项目名称:godot,代码行数:17,代码来源:scene_tree_editor.cpp


示例19: ERR_FAIL_INDEX

void Tabs::remove_tab(int p_idx) {

	ERR_FAIL_INDEX(p_idx,tabs.size());
	tabs.remove(p_idx);
	if (current>=p_idx)
		current--;
	update();
	minimum_size_changed();

	if (current<0)
		current=0;
	if (current>=tabs.size())
		current=tabs.size()-1;

	emit_signal("tab_changed",current);

}
开发者ID:3miu,项目名称:godot,代码行数:17,代码来源:tabs.cpp


示例20: _clear_quadrants

void TileMap::set_tileset(const Ref<TileSet>& p_tileset) {

	if (tile_set.is_valid())
		tile_set->disconnect("changed",this,"_recreate_quadrants");

	_clear_quadrants();
	tile_set=p_tileset;

	if (tile_set.is_valid())
		tile_set->connect("changed",this,"_recreate_quadrants");
	else
		clear();

	_recreate_quadrants();
	emit_signal("settings_changed");

}
开发者ID:FEDE0D,项目名称:godot,代码行数:17,代码来源:tile_map.cpp



注:本文中的emit_signal函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ emitir函数代码示例发布时间:2022-05-30
下一篇:
C++ emit_op2函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap