本文整理汇总了C++中OptionButton::get_selected方法的典型用法代码示例。如果您正苦于以下问题:C++ OptionButton::get_selected方法的具体用法?C++ OptionButton::get_selected怎么用?C++ OptionButton::get_selected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OptionButton
的用法示例。
在下文中一共展示了OptionButton::get_selected方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _import
void EditorSceneImportDialog::_import(bool p_and_open) {
wip_open=p_and_open;
//' ImportMonitorBlock imb;
if (import_path->get_text()=="") {
error_dialog->set_text("Source path is empty.");
error_dialog->popup_centered(Size2(200,100));
return;
}
if (save_path->get_text()=="") {
error_dialog->set_text("Target path is empty.");
error_dialog->popup_centered(Size2(200,100));
return;
}
String dst_path;
if (texture_action->get_selected()==0)
dst_path=save_path->get_text();//.get_base_dir();
else
dst_path=Globals::get_singleton()->get("import/shared_textures");
uint32_t flags=0;
for(int i=0;i<scene_flags.size();i++) {
if (scene_flags[i]->is_checked(0)) {
int md = scene_flags[i]->get_metadata(0);
flags|=md;
}
}
Ref<EditorScenePostImport> pi;
if (script_path->get_text()!="") {
Ref<Script> scr = ResourceLoader::load(script_path->get_text());
if (!scr.is_valid()) {
error_dialog->set_text("Couldn't load Post-Import Script.");
error_dialog->popup_centered(Size2(200,100));
return;
}
pi = Ref<EditorScenePostImport>( memnew( EditorScenePostImport ) );
pi->set_script(scr.get_ref_ptr());
if (!pi->get_script_instance()) {
error_dialog->set_text("Invalid/Broken Script for Post-Import.");
error_dialog->popup_centered(Size2(200,100));
return;
}
}
String save_file = save_path->get_text().plus_file(import_path->get_text().get_file().basename()+".scn");
print_line("Saving to: "+save_file);
Node *scene=NULL;
Ref<ResourceImportMetadata> rim = memnew( ResourceImportMetadata );
rim->add_source(EditorImportPlugin::validate_source_path(import_path->get_text()));
rim->set_option("flags",flags);
rim->set_option("texture_flags",texture_options->get_flags());
rim->set_option("texture_format",texture_options->get_format());
rim->set_option("texture_quality",texture_options->get_quality());
rim->set_option("animation_flags",animation_options->get_flags());
rim->set_option("post_import_script",script_path->get_text()!=String()?EditorImportPlugin::validate_source_path(script_path->get_text()):String());
rim->set_option("reimport",true);
List<String> missing;
Error err = plugin->import1(rim,&scene,&missing);
if (err) {
error_dialog->set_text("Error importing scene.");
error_dialog->popup_centered(Size2(200,100));
return;
}
if (missing.size()) {
missing_files->clear();
for(List<String>::Element *E=missing.front();E;E=E->next()) {
missing_files->add_text(E->get());
missing_files->add_newline();
}
wip_import=scene;
wip_rimd=rim;
wip_save_file=save_file;
confirm_import->popup_centered_ratio();
return;
//.........这里部分代码省略.........