diff options
Diffstat (limited to 'tools/editor')
26 files changed, 484 insertions, 348 deletions
diff --git a/tools/editor/animation_editor.cpp b/tools/editor/animation_editor.cpp index 2f385f2ba5..89b24f2fd4 100644 --- a/tools/editor/animation_editor.cpp +++ b/tools/editor/animation_editor.cpp @@ -1040,7 +1040,7 @@ void AnimationKeyEditor::_animation_optimize() { - animation->optimize(optimize_linear_error->get_val(),optimize_angular_error->get_val(),optimize_max_angle->get_val()); + animation->optimize(optimize_linear_error->get_value(),optimize_angular_error->get_value(),optimize_max_angle->get_value()); track_editor->update(); undo_redo->clear_history(); @@ -1049,7 +1049,7 @@ void AnimationKeyEditor::_animation_optimize() { float AnimationKeyEditor::_get_zoom_scale() const { - float zv = zoom->get_val(); + float zv = zoom->get_value(); if (zv<1) { zv = 1.0-zv; return Math::pow(1.0+zv,8.0)*100; @@ -1072,7 +1072,7 @@ void AnimationKeyEditor::_track_pos_draw() { int settings_limit = size.width - right_data_size_cache; int name_limit = settings_limit * name_column_ratio; - float keys_from= h_scroll->get_val(); + float keys_from= h_scroll->get_value(); float zoom_scale = _get_zoom_scale(); float keys_to=keys_from+(settings_limit-name_limit) / zoom_scale; @@ -1081,7 +1081,7 @@ void AnimationKeyEditor::_track_pos_draw() { //will move to separate control! (for speedup) if (timeline_pos >= keys_from && timeline_pos<keys_to) { //draw position - int pixel = (timeline_pos - h_scroll->get_val()) * zoom_scale; + int pixel = (timeline_pos - h_scroll->get_value()) * zoom_scale; pixel+=name_limit; track_pos->draw_line(ofs+Point2(pixel,0),ofs+Point2(pixel,size.height),Color(1,0.3,0.3,0.8)); @@ -1227,8 +1227,8 @@ void AnimationKeyEditor::_track_editor_draw() { if (l<=0) l=0.001; //avoid crashor - int end_px = (l - h_scroll->get_val()) * scale; - int begin_px = -h_scroll->get_val() * scale; + int end_px = (l - h_scroll->get_value()) * scale; + int begin_px = -h_scroll->get_value() * scale; Color notimecol; notimecol.r=timecolor.gray(); notimecol.g=notimecol.r; @@ -1254,7 +1254,7 @@ void AnimationKeyEditor::_track_editor_draw() { - keys_from= h_scroll->get_val(); + keys_from= h_scroll->get_value(); keys_to=keys_from+zoomw / scale; { @@ -1331,8 +1331,8 @@ void AnimationKeyEditor::_track_editor_draw() { for(int i=0;i<zoomw;i++) { - float pos = h_scroll->get_val() + double(i)/scale; - float prev = h_scroll->get_val() + (double(i)-1.0)/scale; + float pos = h_scroll->get_value() + double(i)/scale; + float prev = h_scroll->get_value() + (double(i)-1.0)/scale; int sc = int(Math::floor(pos*SC_ADJ)); @@ -1356,7 +1356,7 @@ void AnimationKeyEditor::_track_editor_draw() { //this code sucks, i always forget how it works - int idx = v_scroll->get_val() + i; + int idx = v_scroll->get_value() + i; if (idx>=animation->get_track_count()) break; int y = h+i*h+sep; @@ -1552,14 +1552,14 @@ void AnimationKeyEditor::_track_editor_draw() { } float motion = from_t+(click.to.x - click.at.x)/zoom_scale; - if (step->get_val()) - motion = Math::stepify(motion,step->get_val()); + if (step->get_value()) + motion = Math::stepify(motion,step->get_value()); for(Map<SelectedKey,KeyInfo>::Element *E=selection.front();E;E=E->next()) { int idx = E->key().track; - int i = idx-v_scroll->get_val(); + int i = idx-v_scroll->get_value(); if (i<0 || i>=fit) continue; int y = h+i*h+sep; @@ -1896,8 +1896,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (v_scroll->is_visible()) { - if (v_scroll->get_val() > selected_track) - v_scroll->set_val(selected_track); + if (v_scroll->get_value() > selected_track) + v_scroll->set_value(selected_track); } @@ -1916,8 +1916,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (selected_track >= animation->get_track_count()) selected_track=animation->get_track_count()-1; - if (v_scroll->is_visible() && v_scroll->get_page()+v_scroll->get_val() < selected_track+1) { - v_scroll->set_val(selected_track-v_scroll->get_page()+1); + if (v_scroll->is_visible() && v_scroll->get_page()+v_scroll->get_value() < selected_track+1) { + v_scroll->set_value(selected_track-v_scroll->get_page()+1); } track_editor->update(); @@ -1934,18 +1934,18 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { if (mb.mod.command) { - zoom->set_val(zoom->get_val() + zoom->get_step()); + zoom->set_value(zoom->get_value() + zoom->get_step()); } else { - v_scroll->set_val( v_scroll->get_val() - v_scroll->get_page() / 8 ); + v_scroll->set_value( v_scroll->get_value() - v_scroll->get_page() / 8 ); } } if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { if (mb.mod.command) { - zoom->set_val(zoom->get_val() - zoom->get_step()); + zoom->set_value(zoom->get_value() - zoom->get_step()); } else { - v_scroll->set_val( v_scroll->get_val() + v_scroll->get_page() / 8 ); + v_scroll->set_value( v_scroll->get_value() + v_scroll->get_page() / 8 ); } } @@ -1966,7 +1966,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { mpos.y -= h; int idx = mpos.y / h; - idx+=v_scroll->get_val(); + idx+=v_scroll->get_value(); if (idx <0 || idx>=animation->get_track_count()) break; @@ -1974,7 +1974,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { } else if (mpos.x < settings_limit) { float pos = mpos.x - name_limit; pos/=_get_zoom_scale(); - pos+=h_scroll->get_val(); + pos+=h_scroll->get_value(); float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0; int kidx = animation->track_find_key(idx,pos); @@ -2083,7 +2083,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { //seek //int zoomw = settings_limit-name_limit; float scale = _get_zoom_scale(); - float pos = h_scroll->get_val() + (mpos.x-name_limit) / scale; + float pos = h_scroll->get_value() + (mpos.x-name_limit) / scale; if (animation->get_step()) pos=Math::stepify(pos,animation->get_step()); @@ -2105,7 +2105,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { mpos.y -= h; int idx = mpos.y / h; - idx+=v_scroll->get_val(); + idx+=v_scroll->get_value(); if (idx <0) break; @@ -2146,7 +2146,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { float pos = mpos.x - name_limit; pos/=_get_zoom_scale(); - pos+=h_scroll->get_val(); + pos+=h_scroll->get_value(); float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0; int kidx = animation->track_find_key(idx,pos); @@ -2403,7 +2403,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { float zoom_scale=_get_zoom_scale(); - float keys_from = h_scroll->get_val(); + float keys_from = h_scroll->get_value(); float keys_to = keys_from + (settings_limit-name_limit) / zoom_scale; float from_time = keys_from + ( click.at.x - (name_limit+ofs.x)) / zoom_scale; @@ -2423,8 +2423,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { to_time = keys_to; - int from_track = int(click.at.y-ofs.y-h-sep) / h + v_scroll->get_val(); - int to_track = int(click.to.y-ofs.y-h-sep) / h + v_scroll->get_val(); + int from_track = int(click.at.y-ofs.y-h-sep) / h + v_scroll->get_value(); + int to_track = int(click.to.y-ofs.y-h-sep) / h + v_scroll->get_value(); int from_mod = int(click.at.y-ofs.y-sep) % h; int to_mod = int(click.to.y-ofs.y-sep) % h; @@ -2452,8 +2452,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { break; } - int tracks_from = v_scroll->get_val(); - int tracks_to = v_scroll->get_val()+fit-1; + int tracks_from = v_scroll->get_value(); + int tracks_to = v_scroll->get_value()+fit-1; if (tracks_to>=animation->get_track_count()) tracks_to=animation->get_track_count()-1; @@ -2536,8 +2536,8 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { } float motion = from_t+(click.to.x - click.at.x)/_get_zoom_scale(); - if (step->get_val()) - motion = Math::stepify(motion,step->get_val()); + if (step->get_value()) + motion = Math::stepify(motion,step->get_value()); @@ -2700,7 +2700,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { //int zoomw = settings_limit-name_limit; float scale = _get_zoom_scale(); - float pos = h_scroll->get_val() + (mpos.x-name_limit) / scale; + float pos = h_scroll->get_value() + (mpos.x-name_limit) / scale; if (animation->get_step()) { pos=Math::stepify(pos,animation->get_step()); @@ -2710,10 +2710,10 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { if (pos>=animation->get_length()) pos=animation->get_length(); - if (pos < h_scroll->get_val()) { - h_scroll->set_val(pos); - } else if (pos > h_scroll->get_val() + (settings_limit - name_limit) / scale) { - h_scroll->set_val( pos - (settings_limit - name_limit) / scale ); + if (pos < h_scroll->get_value()) { + h_scroll->set_value(pos); + } else if (pos > h_scroll->get_value() + (settings_limit - name_limit) / scale) { + h_scroll->set_value( pos - (settings_limit - name_limit) / scale ); } timeline_pos=pos; @@ -2727,18 +2727,18 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { click.to=Point2(mb.x,mb.y); if (click.to.y<h && click.at.y>h && mb.relative_y<0) { - float prev = v_scroll->get_val(); - v_scroll->set_val( v_scroll->get_val() -1 ); - if (prev!=v_scroll->get_val()) + float prev = v_scroll->get_value(); + v_scroll->set_value( v_scroll->get_value() -1 ); + if (prev!=v_scroll->get_value()) click.at.y+=h; } if (click.to.y>size.height && click.at.y<size.height && mb.relative_y>0) { - float prev = v_scroll->get_val(); - v_scroll->set_val( v_scroll->get_val() +1 ); - if (prev!=v_scroll->get_val()) + float prev = v_scroll->get_value(); + v_scroll->set_value( v_scroll->get_value() +1 ); + if (prev!=v_scroll->get_value()) click.at.y-=h; } @@ -2755,7 +2755,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { int rel = mb.relative_x; float relf = rel / _get_zoom_scale(); - h_scroll->set_val( h_scroll->get_val() - relf ); + h_scroll->set_value( h_scroll->get_value() - relf ); } if (mb.button_mask==0) { @@ -2781,7 +2781,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { mpos.y -= h; int idx = mpos.y / h; - idx+=v_scroll->get_val(); + idx+=v_scroll->get_value(); if (idx <0 || idx>=animation->get_track_count()) break; @@ -2797,7 +2797,7 @@ void AnimationKeyEditor::_track_editor_input_event(const InputEvent& p_input) { float pos = mpos.x - name_limit; pos/=_get_zoom_scale(); - pos+=h_scroll->get_val(); + pos+=h_scroll->get_value(); float w_time = (type_icon[0]->get_width() / _get_zoom_scale())/2.0; int kidx = animation->track_find_key(idx,pos); @@ -3112,8 +3112,8 @@ void AnimationKeyEditor::_update_paths() { //timeline->set_max(animation->get_length()); //timeline->set_step(0.01); track_editor->update(); - length->set_val(animation->get_length()); - step->set_val(animation->get_step()); + length->set_value(animation->get_length()); + step->set_value(animation->get_step()); } } @@ -3130,9 +3130,9 @@ void AnimationKeyEditor::_update_menu() { if (animation.is_valid()) { - length->set_val(animation->get_length()); + length->set_value(animation->get_length()); loop->set_pressed(animation->has_loop()); - step->set_val(animation->get_step()); + step->set_value(animation->get_step()); } track_editor->update(); @@ -3710,7 +3710,7 @@ void AnimationKeyEditor::_scale() { } - float s = scale->get_val(); + float s = scale->get_value(); if (s==0) { ERR_PRINT("Can't scale to 0"); } @@ -3914,7 +3914,7 @@ AnimationKeyEditor::AnimationKeyEditor() { h_scroll = memnew( HScrollBar ); h_scroll->connect("value_changed",this,"_scroll_changed"); add_child(h_scroll); - h_scroll->set_val(0); + h_scroll->set_value(0); HBoxContainer *hb = memnew( HBoxContainer ); @@ -3936,7 +3936,7 @@ AnimationKeyEditor::AnimationKeyEditor() { zoom->set_step(0.01); zoom->set_min(0.0); zoom->set_max(2.0); - zoom->set_val(1.0); + zoom->set_value(1.0); zoom->set_h_size_flags(SIZE_EXPAND_FILL); zoom->set_stretch_ratio(2); hb->add_child(zoom); @@ -3968,7 +3968,7 @@ AnimationKeyEditor::AnimationKeyEditor() { step->set_min(0.00); step->set_max(128); step->set_step(0.01); - step->set_val(0.0); + step->set_value(0.0); step->set_h_size_flags(SIZE_EXPAND_FILL); step->set_stretch_ratio(1); step->set_tooltip(TTR("Cursor step snap (in seconds).")); @@ -4035,13 +4035,13 @@ AnimationKeyEditor::AnimationKeyEditor() { optimize_linear_error->set_max(1.0); optimize_linear_error->set_min(0.001); optimize_linear_error->set_step(0.001); - optimize_linear_error->set_val(0.05); + optimize_linear_error->set_value(0.05); optimize_vb->add_margin_child(TTR("Max. Linear Error:"),optimize_linear_error); optimize_angular_error = memnew( SpinBox ); optimize_angular_error->set_max(1.0); optimize_angular_error->set_min(0.001); optimize_angular_error->set_step(0.001); - optimize_angular_error->set_val(0.01); + optimize_angular_error->set_value(0.01); optimize_vb->add_margin_child(TTR("Max. Angular Error:"),optimize_angular_error); optimize_max_angle = memnew( SpinBox ); @@ -4049,7 +4049,7 @@ AnimationKeyEditor::AnimationKeyEditor() { optimize_max_angle->set_max(360.0); optimize_max_angle->set_min(0.0); optimize_max_angle->set_step(0.1); - optimize_max_angle->set_val(22); + optimize_max_angle->set_value(22); optimize_dialog->get_ok()->set_text(TTR("Optimize")); @@ -4107,7 +4107,7 @@ AnimationKeyEditor::AnimationKeyEditor() { v_scroll = memnew( VScrollBar ); hb->add_child(v_scroll); v_scroll->connect("value_changed",this,"_scroll_changed"); - v_scroll->set_val(0); + v_scroll->set_value(0); key_editor_tab = memnew(TabContainer); hb->add_child(key_editor_tab); diff --git a/tools/editor/asset_library_editor_plugin.cpp b/tools/editor/asset_library_editor_plugin.cpp index 27455ad7cd..11eef69638 100644 --- a/tools/editor/asset_library_editor_plugin.cpp +++ b/tools/editor/asset_library_editor_plugin.cpp @@ -379,12 +379,12 @@ void EditorAssetLibraryItemDownload::_http_download_completed(int p_status, int } progress->set_max( download->get_body_size() ); - progress->set_val(download->get_downloaded_bytes()); + progress->set_value(download->get_downloaded_bytes()); print_line("max: "+itos(download->get_body_size())+" bytes: "+itos(download->get_downloaded_bytes())); install->set_disabled(false); - progress->set_val(download->get_downloaded_bytes()); + progress->set_value(download->get_downloaded_bytes()); status->set_text("Success! ("+String::humanize_size(download->get_downloaded_bytes())+")"); set_process(false); @@ -411,7 +411,7 @@ void EditorAssetLibraryItemDownload::_notification(int p_what) { if (p_what==NOTIFICATION_PROCESS) { progress->set_max( download->get_body_size() ); - progress->set_val(download->get_downloaded_bytes()); + progress->set_value(download->get_downloaded_bytes()); int cstatus = download->get_http_client_status(); @@ -582,16 +582,16 @@ void EditorAssetLibrary::_notification(int p_what) { switch(s) { case HTTPClient::STATUS_RESOLVING: { - load_status->set_val(0.1); + load_status->set_value(0.1); } break; case HTTPClient::STATUS_CONNECTING: { - load_status->set_val(0.2); + load_status->set_value(0.2); } break; case HTTPClient::STATUS_REQUESTING: { - load_status->set_val(0.3); + load_status->set_value(0.3); } break; case HTTPClient::STATUS_BODY: { - load_status->set_val(0.4); + load_status->set_value(0.4); } break; default: {} diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp index 82be76d13a..a276eefbdf 100644 --- a/tools/editor/editor_help.cpp +++ b/tools/editor/editor_help.cpp @@ -814,14 +814,109 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); } + Set<String> skip_methods; + bool property_descr=false; + + if (cd.properties.size()) { + + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_font(doc_title_font); + class_desc->add_text(TTR("Members:")); + class_desc->pop(); + class_desc->pop(); +// class_desc->add_newline(); + + class_desc->push_indent(1); + class_desc->push_table(2); + class_desc->set_table_column_expand(1,1); + + for(int i=0;i<cd.properties.size();i++) { + property_line[cd.properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description + + class_desc->push_cell(); + class_desc->push_align(RichTextLabel::ALIGN_RIGHT); + class_desc->push_font(doc_code_font); + _add_type(cd.properties[i].type); + class_desc->add_text(" "); + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); + + bool describe=false; + + if (cd.properties[i].setter!="") { + skip_methods.insert(cd.properties[i].setter); + describe=true; + + } + if (cd.properties[i].getter!="") { + skip_methods.insert(cd.properties[i].getter); + describe=true; + } + + if (cd.properties[i].description!="") { + describe=true; + + } + class_desc->push_cell(); + if (describe) { + class_desc->push_meta("@"+cd.properties[i].name); + } + + class_desc->push_font(doc_code_font); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + _add_text(cd.properties[i].name); + + if (describe) { + class_desc->pop(); + } + + + if (cd.properties[i].brief_description!="") { + class_desc->push_font(doc_font); + class_desc->add_text(" "); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color")); + _add_text(cd.properties[i].description); + class_desc->pop(); + class_desc->pop(); + + } + + if (describe) { + property_descr=true; + } + + + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); + + } + + + class_desc->pop(); //table + class_desc->pop(); + class_desc->add_newline(); + class_desc->add_newline(); + } + + bool method_descr=false; bool sort_methods = EditorSettings::get_singleton()->get("help/sort_functions_alphabetically"); + Vector<DocData::MethodDoc> methods; - if (cd.methods.size()) { + for(int i=0;i<cd.methods.size();i++) { + if (skip_methods.has(cd.methods[i].name)) + continue; + methods.push_back(cd.methods[i]); + } + + if (methods.size()) { if (sort_methods) - cd.methods.sort(); + methods.sort(); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); class_desc->push_font(doc_title_font); @@ -836,15 +931,15 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_table(2); class_desc->set_table_column_expand(1,1); - for(int i=0;i<cd.methods.size();i++) { + for(int i=0;i<methods.size();i++) { class_desc->push_cell(); - method_line[cd.methods[i].name]=class_desc->get_line_count()-2; //gets overriden if description + method_line[methods[i].name]=class_desc->get_line_count()-2; //gets overriden if description class_desc->push_align(RichTextLabel::ALIGN_RIGHT); class_desc->push_font(doc_code_font); - _add_type(cd.methods[i].return_type); + _add_type(methods[i].return_type); //class_desc->add_text(" "); class_desc->pop(); //align class_desc->pop(); //font @@ -852,37 +947,37 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_cell(); class_desc->push_font(doc_code_font); - if (cd.methods[i].description!="") { + if (methods[i].description!="") { method_descr=true; - class_desc->push_meta("@"+cd.methods[i].name); + class_desc->push_meta("@"+methods[i].name); } class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); - _add_text(cd.methods[i].name); + _add_text(methods[i].name); class_desc->pop(); - if (cd.methods[i].description!="") + if (methods[i].description!="") class_desc->pop(); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?"( ":"("); + class_desc->add_text(methods[i].arguments.size()?"( ":"("); class_desc->pop(); - for(int j=0;j<cd.methods[i].arguments.size();j++) { + for(int j=0;j<methods[i].arguments.size();j++) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); if (j>0) class_desc->add_text(", "); - _add_type(cd.methods[i].arguments[j].type); + _add_type(methods[i].arguments[j].type); class_desc->add_text(" "); - _add_text(cd.methods[i].arguments[j].name); - if (cd.methods[i].arguments[j].default_value!="") { + _add_text(methods[i].arguments[j].name); + if (methods[i].arguments[j].default_value!="") { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); class_desc->add_text("="); class_desc->pop(); - _add_text(cd.methods[i].arguments[j].default_value); + _add_text(methods[i].arguments[j].default_value); } class_desc->pop(); } - if (cd.methods[i].qualifiers.find("vararg")!=-1) { + if (methods[i].qualifiers.find("vararg")!=-1) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); class_desc->add_text(","); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); @@ -892,13 +987,13 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { } class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?" )":")"); + class_desc->add_text(methods[i].arguments.size()?" )":")"); class_desc->pop(); - if (cd.methods[i].qualifiers!="") { + if (methods[i].qualifiers!="") { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); class_desc->add_text(" "); - _add_text(cd.methods[i].qualifiers); + _add_text(methods[i].qualifiers); class_desc->pop(); } @@ -914,48 +1009,6 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { } - if (cd.properties.size()) { - - - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); - class_desc->push_font(doc_title_font); - class_desc->add_text(TTR("Members:")); - class_desc->pop(); - class_desc->pop(); - class_desc->add_newline(); - - class_desc->push_indent(1); - - //class_desc->add_newline(); - - for(int i=0;i<cd.properties.size();i++) { - - property_line[cd.properties[i].name]=class_desc->get_line_count()-2; //gets overriden if description - class_desc->push_font(doc_code_font); - _add_type(cd.properties[i].type); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); - class_desc->add_text(" "); - _add_text(cd.properties[i].name); - class_desc->pop(); - class_desc->pop(); - - if (cd.properties[i].description!="") { - class_desc->push_font(doc_font); - class_desc->add_text(" "); - class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/comment_color")); - _add_text(cd.properties[i].description); - class_desc->pop(); - class_desc->pop(); - - } - - class_desc->add_newline(); - } - - - class_desc->pop(); - class_desc->add_newline(); - } if (cd.theme_properties.size()) { @@ -1133,6 +1186,89 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); } + if (property_descr) { + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->push_font(doc_title_font); + class_desc->add_text(TTR("Property Description:")); + class_desc->pop(); + class_desc->pop(); + + class_desc->add_newline(); + class_desc->add_newline(); + + + for(int i=0;i<cd.properties.size();i++) { + + method_line[cd.properties[i].name]=class_desc->get_line_count()-2; + + class_desc->push_font(doc_code_font); + _add_type(cd.properties[i].type); + + class_desc->add_text(" "); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + _add_text(cd.properties[i].name); + class_desc->pop(); //color + + class_desc->add_text(" "); + + class_desc->pop(); //font + + if (cd.properties[i].setter!="") { + + class_desc->push_font( doc_font ); + + class_desc->push_indent(2); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->add_text("Setter: "); + class_desc->pop(); + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->add_text(cd.properties[i].setter+"(value)"); + class_desc->pop(); //color + + class_desc->pop(); //indent + + class_desc->pop(); //font + + } + + if (cd.properties[i].getter!="") { + + class_desc->push_font( doc_font ); + + class_desc->push_indent(2); + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); + class_desc->add_text("Getter: "); + class_desc->pop(); + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->add_text(cd.properties[i].getter+"()"); + class_desc->pop(); //color + + class_desc->pop(); //indent + + class_desc->pop(); //font + + } + + class_desc->add_newline(); + + class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); + class_desc->push_font( doc_font ); + class_desc->push_indent(1); + _add_text(cd.properties[i].description); + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); + class_desc->add_newline(); + class_desc->add_newline(); + class_desc->add_newline(); + + } + + } + if (method_descr) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); @@ -1145,46 +1281,46 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->add_newline(); - for(int i=0;i<cd.methods.size();i++) { + for(int i=0;i<methods.size();i++) { - method_line[cd.methods[i].name]=class_desc->get_line_count()-2; + method_line[methods[i].name]=class_desc->get_line_count()-2; class_desc->push_font(doc_code_font); - _add_type(cd.methods[i].return_type); + _add_type(methods[i].return_type); class_desc->add_text(" "); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); - _add_text(cd.methods[i].name); + _add_text(methods[i].name); class_desc->pop(); class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?"( ":"("); + class_desc->add_text(methods[i].arguments.size()?"( ":"("); class_desc->pop(); - for(int j=0;j<cd.methods[i].arguments.size();j++) { + for(int j=0;j<methods[i].arguments.size();j++) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); if (j>0) class_desc->add_text(", "); - _add_type(cd.methods[i].arguments[j].type); + _add_type(methods[i].arguments[j].type); class_desc->add_text(" "); - _add_text(cd.methods[i].arguments[j].name); - if (cd.methods[i].arguments[j].default_value!="") { + _add_text(methods[i].arguments[j].name); + if (methods[i].arguments[j].default_value!="") { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); class_desc->add_text("="); class_desc->pop(); - _add_text(cd.methods[i].arguments[j].default_value); + _add_text(methods[i].arguments[j].default_value); } class_desc->pop(); } class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/symbol_color")); - class_desc->add_text(cd.methods[i].arguments.size()?" )":")"); + class_desc->add_text(methods[i].arguments.size()?" )":")"); class_desc->pop(); - if (cd.methods[i].qualifiers!="") { + if (methods[i].qualifiers!="") { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/keyword_color")); class_desc->add_text(" "); - _add_text(cd.methods[i].qualifiers); + _add_text(methods[i].qualifiers); class_desc->pop(); } @@ -1195,7 +1331,7 @@ Error EditorHelp::_goto_desc(const String& p_class,int p_vscr) { class_desc->push_color(EditorSettings::get_singleton()->get("text_editor/text_color")); class_desc->push_font( doc_font ); class_desc->push_indent(1); - _add_text(cd.methods[i].description); + _add_text(methods[i].description); class_desc->pop(); class_desc->pop(); class_desc->pop(); @@ -1640,12 +1776,12 @@ void EditorHelp::search_again() { int EditorHelp::get_scroll() const { - return class_desc->get_v_scroll()->get_val(); + return class_desc->get_v_scroll()->get_value(); } void EditorHelp::set_scroll(int p_scroll) { - class_desc->get_v_scroll()->set_val(p_scroll); + class_desc->get_v_scroll()->set_value(p_scroll); } diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp index 83ddc76907..cac8195a24 100644 --- a/tools/editor/editor_node.cpp +++ b/tools/editor/editor_node.cpp @@ -285,16 +285,16 @@ void EditorNode::_notification(int p_what) { if (peak<-80) peak=-80; - float vu = audio_vu->get_val(); + float vu = audio_vu->get_value(); if (peak > vu) { - audio_vu->set_val(peak); + audio_vu->set_value(peak); } else { float new_vu = vu - get_process_delta_time()*70.0; if (new_vu<-80) new_vu=-80; if (new_vu !=-80 && vu !=-80) - audio_vu->set_val(new_vu); + audio_vu->set_value(new_vu); } } @@ -3468,8 +3468,8 @@ Dictionary EditorNode::_get_main_scene_state() { Dictionary state; state["main_tab"]=_get_current_main_editor(); - state["scene_tree_offset"]=scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->get_val(); - state["property_edit_offset"]=get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_val(); + state["scene_tree_offset"]=scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->get_value(); + state["property_edit_offset"]=get_property_editor()->get_scene_tree()->get_vscroll_bar()->get_value(); state["saved_version"]=saved_version; state["node_filter"]=scene_tree_dock->get_filter(); //print_line(" getting main tab: "+itos(state["main_tab"])); @@ -3535,9 +3535,9 @@ void EditorNode::_set_main_scene_state(Dictionary p_state,Node* p_for_scene) { if (p_state.has("scene_tree_offset")) - scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->set_val(p_state["scene_tree_offset"]); + scene_tree_dock->get_tree_editor()->get_scene_tree()->get_vscroll_bar()->set_value(p_state["scene_tree_offset"]); if (p_state.has("property_edit_offset")) - get_property_editor()->get_scene_tree()->get_vscroll_bar()->set_val(p_state["property_edit_offset"]); + get_property_editor()->get_scene_tree()->get_vscroll_bar()->set_value(p_state["property_edit_offset"]); if (p_state.has("node_filter")) scene_tree_dock->set_filter(p_state["node_filter"]); @@ -6026,7 +6026,7 @@ EditorNode::EditorNode() { audio_vu->set_max(24); audio_vu->set_min(-80); audio_vu->set_step(0.01); - audio_vu->set_val(0); + audio_vu->set_value(0); { Control *sp = memnew( Control ); diff --git a/tools/editor/editor_profiler.cpp b/tools/editor/editor_profiler.cpp index 417b1615cf..5c7b7407b4 100644 --- a/tools/editor/editor_profiler.cpp +++ b/tools/editor/editor_profiler.cpp @@ -28,7 +28,7 @@ void EditorProfiler::add_frame_metric(const Metric& p_metric,bool p_final) { if (!seeking) { - cursor_metric_edit->set_val(frame_metrics[last_metric].frame_number); + cursor_metric_edit->set_value(frame_metrics[last_metric].frame_number); if (hover_metric!=-1) { hover_metric++; if (hover_metric>=frame_metrics.size()) { @@ -70,7 +70,7 @@ void EditorProfiler::clear() { updating_frame=true; cursor_metric_edit->set_min(0); cursor_metric_edit->set_max(0); - cursor_metric_edit->set_val(0); + cursor_metric_edit->set_value(0); updating_frame=false; hover_metric=-1; seeking=false; @@ -453,7 +453,7 @@ void EditorProfiler::_graph_tex_draw() { if (seeking) { int max_frames = frame_metrics.size(); - int frame = cursor_metric_edit->get_val() - (frame_metrics[last_metric].frame_number-max_frames+1); + int frame = cursor_metric_edit->get_value() - (frame_metrics[last_metric].frame_number-max_frames+1); if (frame<0) frame=0; @@ -559,7 +559,7 @@ void EditorProfiler::_graph_tex_input(const InputEvent& p_ev){ } if (valid) - cursor_metric_edit->set_val(frame_metrics[metric].frame_number); + cursor_metric_edit->set_value(frame_metrics[metric].frame_number); updating_frame=false; @@ -590,7 +590,7 @@ int EditorProfiler::_get_cursor_index() const { if (!frame_metrics[last_metric].valid) return 0; - int diff = (frame_metrics[last_metric].frame_number-cursor_metric_edit->get_val()); + int diff = (frame_metrics[last_metric].frame_number-cursor_metric_edit->get_value()); int idx = last_metric - diff; while (idx<0) { diff --git a/tools/editor/filesystem_dock.cpp b/tools/editor/filesystem_dock.cpp index d985f07b3d..2b117812fb 100644 --- a/tools/editor/filesystem_dock.cpp +++ b/tools/editor/filesystem_dock.cpp @@ -174,7 +174,7 @@ void FileSystemDock::_notification(int p_what) { } break; case NOTIFICATION_PROCESS: { if (EditorFileSystem::get_singleton()->is_scanning()) { - scanning_progress->set_val(EditorFileSystem::get_singleton()->get_scanning_progress()*100); + scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress()*100); } } break; case NOTIFICATION_EXIT_TREE: { @@ -668,9 +668,9 @@ void FileSystemDock::_set_scannig_mode() { scanning_vb->show(); set_process(true); if (EditorFileSystem::get_singleton()->is_scanning()) { - scanning_progress->set_val(EditorFileSystem::get_singleton()->get_scanning_progress()*100); + scanning_progress->set_value(EditorFileSystem::get_singleton()->get_scanning_progress()*100); } else { - scanning_progress->set_val(0); + scanning_progress->set_value(0); } } diff --git a/tools/editor/io_plugins/editor_font_import_plugin.cpp b/tools/editor/io_plugins/editor_font_import_plugin.cpp index 02990e9ed0..2bc29039ea 100644 --- a/tools/editor/io_plugins/editor_font_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_font_import_plugin.cpp @@ -418,7 +418,7 @@ class EditorFontImportDialog : public ConfirmationDialog { //print_line("pre src path "+source->get_line_edit()->get_text()); //print_line("src path "+src_path); imd->add_source(src_path); - imd->set_option("font/size",font_size->get_val()); + imd->set_option("font/size",font_size->get_value()); return imd; @@ -619,7 +619,7 @@ public: } source->get_line_edit()->set_text(src); - font_size->set_val(rimd->get_option("font/size")); + font_size->set_value(rimd->get_option("font/size")); } } @@ -658,7 +658,7 @@ public: vbl->add_margin_child(TTR("Source Font Size:"),font_size); font_size->set_min(3); font_size->set_max(256); - font_size->set_val(16); + font_size->set_value(16); font_size->connect("value_changed",this,"_font_size_changed"); dest = memnew( EditorLineEditFileChooser ); // diff --git a/tools/editor/io_plugins/editor_texture_import_plugin.cpp b/tools/editor/io_plugins/editor_texture_import_plugin.cpp index 99ba208226..bab11d7a93 100644 --- a/tools/editor/io_plugins/editor_texture_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_texture_import_plugin.cpp @@ -106,12 +106,12 @@ void EditorImportTextureOptions::set_flags(uint32_t p_flags){ void EditorImportTextureOptions::set_quality(float p_quality) { - quality->set_val(p_quality); + quality->set_value(p_quality); } float EditorImportTextureOptions::get_quality() const { - return quality->get_val(); + return quality->get_value(); } @@ -200,7 +200,7 @@ EditorImportTextureOptions::EditorImportTextureOptions() { hs->set_min(0); hs->set_max(1.0); hs->set_step(0.01); - hs->set_val(0.7); + hs->set_value(0.7); quality=hs; quality_vb->add_margin_child(TTR("Texture Compression Quality (WebP):"),quality_hb); @@ -396,7 +396,7 @@ void EditorTextureImportDialog::_import() { imd->set_option("flags",texture_options->get_flags()); imd->set_option("quality",texture_options->get_quality()); imd->set_option("atlas",true); - imd->set_option("atlas_size",int(size->get_val())); + imd->set_option("atlas_size",int(size->get_value())); imd->set_option("large",false); imd->set_option("crop",crop_source->is_pressed()); imd->set_option("mode",mode); @@ -430,7 +430,7 @@ void EditorTextureImportDialog::_import() { imd->set_option("quality",texture_options->get_quality()); imd->set_option("atlas",false); imd->set_option("large",true); - imd->set_option("large_cell_size",int(size->get_val())); + imd->set_option("large_cell_size",int(size->get_value())); imd->set_option("crop",crop_source->is_pressed()); imd->set_option("mode",mode); @@ -569,7 +569,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) { if (p_mode==EditorTextureImportPlugin::MODE_ATLAS) { size_label->set_text(TTR("Max Texture Size:")); - size->set_val(2048); + size->set_value(2048); crop_source->show(); size_label->show(); size->show(); @@ -587,7 +587,7 @@ void EditorTextureImportDialog::_mode_changed(int p_mode) { if (p_mode==EditorTextureImportPlugin::MODE_LARGE) { size_label->set_text(TTR("Cell Size:")); - size->set_val(256); + size->set_value(256); size_label->show(); size->show(); @@ -727,7 +727,7 @@ EditorTextureImportDialog::EditorTextureImportDialog(EditorTextureImportPlugin* size->set_max(16384); - size->set_val(256); + size->set_value(256); size_mc=vbc->add_margin_child(TTR("Cell Size:"),size); size_label=vbc->get_child(size_mc->get_index()-1)->cast_to<Label>(); diff --git a/tools/editor/output_strings.cpp b/tools/editor/output_strings.cpp index 57d4887492..9ba97451c0 100644 --- a/tools/editor/output_strings.cpp +++ b/tools/editor/output_strings.cpp @@ -68,7 +68,7 @@ void OutputStrings::_notification(int p_what) { if (following) { updating=true; - v_scroll->set_val( v_scroll->get_max() - v_scroll->get_page() ); + v_scroll->set_value( v_scroll->get_max() - v_scroll->get_page() ); updating=false; } @@ -85,8 +85,8 @@ void OutputStrings::_notification(int p_what) { // int lines = (size_height-(int)margin.y) / font_height; Point2 ofs=tree_st->get_offset(); - LineMap::Element *E = line_map.find(v_scroll->get_val()); - float h_ofs = (int)h_scroll->get_val(); + LineMap::Element *E = line_map.find(v_scroll->get_value()); + float h_ofs = (int)h_scroll->get_value(); Point2 icon_ofs=Point2(0,(font_height-(int)icon_error->get_height())/2); while( E && ofs.y < (size_height-(int)margin.y) ) { diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp index ae12ad2a67..17ed3842b2 100644 --- a/tools/editor/plugins/animation_player_editor_plugin.cpp +++ b/tools/editor/plugins/animation_player_editor_plugin.cpp @@ -77,14 +77,14 @@ void AnimationPlayerEditor::_notification(int p_what) { } } } - frame->set_val(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_pos()); key_editor->set_anim_pos(player->get_current_animation_pos()); EditorNode::get_singleton()->get_property_editor()->refresh(); } else if (last_active) { //need the last frame after it stopped - frame->set_val(player->get_current_animation_pos()); + frame->set_value(player->get_current_animation_pos()); } last_active=player->is_playing(); @@ -1108,7 +1108,7 @@ void AnimationPlayerEditor::_animation_key_editor_seek(float p_pos,bool p_drag) return; updating=true; - frame->set_val(p_pos); + frame->set_value(p_pos); updating=false; _seek_value_changed(p_pos,!p_drag); diff --git a/tools/editor/plugins/animation_tree_editor_plugin.cpp b/tools/editor/plugins/animation_tree_editor_plugin.cpp index 18753b6383..d1933d3286 100644 --- a/tools/editor/plugins/animation_tree_editor_plugin.cpp +++ b/tools/editor/plugins/animation_tree_editor_plugin.cpp @@ -183,20 +183,20 @@ void AnimationTreeEditor::_edit_dialog_changed() { case AnimationTreePlayer::NODE_MIX: - anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->mix_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND2: - anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->blend2_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND3: - anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_val()); + anim_tree->blend3_node_set_amount(edited_node,edit_scroll[0]->get_value()); break; case AnimationTreePlayer::NODE_BLEND4: - anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_val(),edit_scroll[1]->get_val())); + anim_tree->blend4_node_set_amount(edited_node,Point2(edit_scroll[0]->get_value(),edit_scroll[1]->get_value())); break; @@ -265,7 +265,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { filter_button->hide(); edit_check->hide();; - Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_val(),v_scroll->get_val()); + Point2 pos = anim_tree->node_get_pos(edited_node)-Point2(h_scroll->get_value(),v_scroll->get_value()); Ref<StyleBox> style = get_stylebox("panel","PopupMenu"); Size2 size = get_node_size(edited_node); Point2 popup_pos( pos.x+style->get_margin(MARGIN_LEFT), pos.y+size.y-style->get_margin(MARGIN_BOTTOM)); @@ -380,7 +380,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->mix_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->mix_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_dialog->set_size(Size2(150,50)); @@ -392,7 +392,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend2_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->blend2_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); filter_button->set_begin(Point2(10,47)); @@ -407,7 +407,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(-1); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend3_node_get_amount(edited_node)); + edit_scroll[0]->set_value(anim_tree->blend3_node_get_amount(edited_node)); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_dialog->set_size(Size2(150,50)); @@ -420,7 +420,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[0]->show(); edit_scroll[0]->set_min(0); edit_scroll[0]->set_max(1); - edit_scroll[0]->set_val(anim_tree->blend4_node_get_amount(edited_node).x); + edit_scroll[0]->set_value(anim_tree->blend4_node_get_amount(edited_node).x); edit_scroll[0]->set_begin(Point2(15,25)); edit_scroll[0]->show(); edit_label[1]->set_text(TTR("Blend 1:")); @@ -428,7 +428,7 @@ void AnimationTreeEditor::_popup_edit_dialog() { edit_label[1]->show(); edit_scroll[1]->set_min(0); edit_scroll[1]->set_max(1); - edit_scroll[1]->set_val(anim_tree->blend4_node_get_amount(edited_node).y); + edit_scroll[1]->set_value(anim_tree->blend4_node_get_amount(edited_node).y); edit_scroll[1]->set_begin(Point2(15,75)); edit_scroll[1]->show(); edit_dialog->set_size(Size2(150,100)); @@ -500,7 +500,7 @@ void AnimationTreeEditor::_draw_node(const StringName& p_node) { } - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); style->draw(ci,Rect2(pos,size)); @@ -644,7 +644,7 @@ AnimationTreeEditor::ClickType AnimationTreeEditor::_locate_click(const Point2& Point2 pos = anim_tree->node_get_pos(node); Size2 size = get_node_size(node); - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); if (!Rect2(pos,size).has_point(p_click)) continue; @@ -709,7 +709,7 @@ Point2 AnimationTreeEditor::_get_slot_pos(const StringName& p_node,bool p_input, } - pos-=Point2(h_scroll->get_val(),v_scroll->get_val()); + pos-=Point2(h_scroll->get_value(),v_scroll->get_value()); float w = size.width-style->get_minimum_size().width; @@ -892,8 +892,8 @@ void AnimationTreeEditor::_input_event(InputEvent p_event) { } if ((p_event.mouse_motion.button_mask&4 || Input::get_singleton()->is_key_pressed(KEY_SPACE))) { - h_scroll->set_val( h_scroll->get_val() - p_event.mouse_motion.relative_x ); - v_scroll->set_val( v_scroll->get_val() - p_event.mouse_motion.relative_y ); + h_scroll->set_value( h_scroll->get_value() - p_event.mouse_motion.relative_x ); + v_scroll->set_value( v_scroll->get_value() - p_event.mouse_motion.relative_y ); update(); } @@ -1026,7 +1026,7 @@ void AnimationTreeEditor::_update_scrollbars() { v_scroll->show(); v_scroll->set_max(min.height); v_scroll->set_page(size.height - hmin.height); - offset.y=v_scroll->get_val(); + offset.y=v_scroll->get_value(); } if (min.width < size.width - vmin.width) { @@ -1038,14 +1038,14 @@ void AnimationTreeEditor::_update_scrollbars() { h_scroll->show(); h_scroll->set_max(min.width); h_scroll->set_page(size.width - vmin.width); - offset.x=h_scroll->get_val(); + offset.x=h_scroll->get_value(); } } void AnimationTreeEditor::_scroll_moved(float) { - offset.x=h_scroll->get_val(); - offset.y=v_scroll->get_val(); + offset.x=h_scroll->get_value(); + offset.y=v_scroll->get_value(); update(); } diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp index dda7fedf76..ef43992c3a 100644 --- a/tools/editor/plugins/canvas_item_editor_plugin.cpp +++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp @@ -149,21 +149,21 @@ public: } void set_fields(const Point2 p_grid_offset, const Size2 p_grid_step, const float p_rotation_offset, const float p_rotation_step) { - grid_offset_x->set_val(p_grid_offset.x); - grid_offset_y->set_val(p_grid_offset.y); - grid_step_x->set_val(p_grid_step.x); - grid_step_y->set_val(p_grid_step.y); - rotation_offset->set_val(p_rotation_offset * (180 / Math_PI)); - rotation_step->set_val(p_rotation_step * (180 / Math_PI)); + grid_offset_x->set_value(p_grid_offset.x); + grid_offset_y->set_value(p_grid_offset.y); + grid_step_x->set_value(p_grid_step.x); + grid_step_y->set_value(p_grid_step.y); + rotation_offset->set_value(p_rotation_offset * (180 / Math_PI)); + rotation_step->set_value(p_rotation_step * (180 / Math_PI)); } void get_fields(Point2 &p_grid_offset, Size2 &p_grid_step, float &p_rotation_offset, float &p_rotation_step) { - p_grid_offset.x = grid_offset_x->get_val(); - p_grid_offset.y = grid_offset_y->get_val(); - p_grid_step.x = grid_step_x->get_val(); - p_grid_step.y = grid_step_y->get_val(); - p_rotation_offset = rotation_offset->get_val() / (180 / Math_PI); - p_rotation_step = rotation_step->get_val() / (180 / Math_PI); + p_grid_offset.x = grid_offset_x->get_value(); + p_grid_offset.y = grid_offset_y->get_value(); + p_grid_step.x = grid_step_x->get_value(); + p_grid_step.y = grid_step_y->get_value(); + p_rotation_offset = rotation_offset->get_value() / (180 / Math_PI); + p_rotation_step = rotation_step->get_value() / (180 / Math_PI); } }; @@ -179,7 +179,7 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { if (n2d && n2d->edit_has_pivot()) { Vector2 offset = n2d->edit_get_pivot(); - Vector2 gpos = n2d->get_global_pos(); + Vector2 gpos = n2d->get_global_position(); Vector2 local_mouse_pos = n2d->get_canvas_transform().affine_inverse().xform(mouse_pos); @@ -194,8 +194,8 @@ void CanvasItemEditor::_edit_set_pivot(const Vector2& mouse_pos) { if (!n2dc) continue; - undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_pos()); - undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_pos()); + undo_redo->add_do_method(n2dc,"set_global_pos",n2dc->get_global_position()); + undo_redo->add_undo_method(n2dc,"set_global_pos",n2dc->get_global_position()); } @@ -286,7 +286,7 @@ Dictionary CanvasItemEditor::get_state() const { Dictionary state; state["zoom"]=zoom; - state["ofs"]=Point2(h_scroll->get_val(),v_scroll->get_val()); + state["ofs"]=Point2(h_scroll->get_value(),v_scroll->get_value()); // state["ofs"]=-transform.get_origin(); state["snap_offset"]=snap_offset; state["snap_step"]=snap_step; @@ -310,8 +310,8 @@ void CanvasItemEditor::set_state(const Dictionary& p_state){ if (state.has("ofs")) { _update_scrollbars(); // i wonder how safe is calling this here.. Point2 ofs=p_state["ofs"]; - h_scroll->set_val(ofs.x); - v_scroll->set_val(ofs.y); + h_scroll->set_value(ofs.x); + v_scroll->set_value(ofs.y); } if (state.has("snap_step")) { @@ -709,10 +709,10 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE if (p_move_mode == MOVE_LOCAL_WITH_ROT) { Matrix32 m; - m.rotate( node_2d->get_rot() ); + m.rotate( node_2d->get_rotation() ); drag = m.xform(drag); } - node_2d->set_pos(node_2d->get_pos() + drag); + node_2d->set_position(node_2d->get_position() + drag); } else if (Control *control = canvas_item->cast_to<Control>()) { @@ -961,7 +961,7 @@ void CanvasItemEditor::_dialog_value_changed(double) { case ZOOM_SET: { - zoom=dialog_val->get_val()/100.0; + zoom=dialog_val->get_value()/100.0; _update_scroll(0); viewport->update(); @@ -1096,8 +1096,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { Point2 ofs(b.x,b.y); ofs = ofs/prev_zoom - ofs/zoom; - h_scroll->set_val( h_scroll->get_val() + ofs.x ); - v_scroll->set_val( v_scroll->get_val() + ofs.y ); + h_scroll->set_value( h_scroll->get_value() + ofs.x ); + v_scroll->set_value( v_scroll->get_value() + ofs.y ); } _update_scroll(0); viewport->update(); @@ -1114,8 +1114,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { { Point2 ofs(b.x,b.y); ofs = ofs/prev_zoom - ofs/zoom; - h_scroll->set_val( h_scroll->get_val() + ofs.x ); - v_scroll->set_val( v_scroll->get_val() + ofs.y ); + h_scroll->set_value( h_scroll->get_value() + ofs.x ); + v_scroll->set_value( v_scroll->get_value() + ofs.y ); } _update_scroll(0); @@ -1355,7 +1355,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (!pi) break; - float len=pi->get_global_transform().get_origin().distance_to(b->get_global_pos()); + float len=pi->get_global_transform().get_origin().distance_to(b->get_global_position()); b=pi->cast_to<Node2D>(); if (!b) break; @@ -1554,8 +1554,8 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if ( (m.button_mask&BUTTON_MASK_LEFT && tool == TOOL_PAN) || m.button_mask&BUTTON_MASK_MIDDLE || (m.button_mask&BUTTON_MASK_LEFT && Input::get_singleton()->is_key_pressed(KEY_SPACE))) { - h_scroll->set_val( h_scroll->get_val() - m.relative_x/zoom); - v_scroll->set_val( v_scroll->get_val() - m.relative_y/zoom); + h_scroll->set_value( h_scroll->get_value() - m.relative_x/zoom); + v_scroll->set_value( v_scroll->get_value() - m.relative_y/zoom); } return; @@ -1604,7 +1604,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { Matrix32 rot; rot.elements[1] = (dfrom - center).normalized(); rot.elements[0] = rot.elements[1].tangent(); - node->set_rot(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rot(), node->get_rot())); + node->set_rotation(snap_angle(rot.xform_inv(dto-center).angle() + node->get_rotation(), node->get_rotation())); display_rotate_to = dto; display_rotate_from = center; viewport->update(); @@ -1854,11 +1854,11 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) { if (!E->prev()) { //last goes to what it was - final_xform.set_origin(n->get_global_pos()); + final_xform.set_origin(n->get_global_position()); n->set_global_transform(final_xform); } else { - Vector2 rel = (E->prev()->get().node->get_global_pos() - n->get_global_pos()).normalized(); + Vector2 rel = (E->prev()->get().node->get_global_position() - n->get_global_position()).normalized(); Vector2 rel2 = (E->prev()->get().pos - E->get().pos).normalized(); float rot = rel.angle_to(rel2); if (n->get_global_transform().basis_determinant()<0) { @@ -2147,8 +2147,8 @@ void CanvasItemEditor::_viewport_draw() { if (!pn2d) continue; - Vector2 from = transform.xform(pn2d->get_global_pos()); - Vector2 to = transform.xform(n2d->get_global_pos()); + Vector2 from = transform.xform(pn2d->get_global_position()); + Vector2 to = transform.xform(n2d->get_global_position()); E->get().from=from; E->get().to=to; @@ -2456,13 +2456,13 @@ void CanvasItemEditor::_update_scrollbars() { v_scroll->set_page(local_rect.size.y/zoom); if (first_update) { //so 0,0 is visible - v_scroll->set_val(-10); - h_scroll->set_val(-10); + v_scroll->set_value(-10); + h_scroll->set_value(-10); first_update=false; } - ofs.y=v_scroll->get_val(); + ofs.y=v_scroll->get_value(); } if (canvas_item_rect.size.width <= (local_rect.size.x/zoom)) { @@ -2475,7 +2475,7 @@ void CanvasItemEditor::_update_scrollbars() { h_scroll->set_min(canvas_item_rect.pos.x); h_scroll->set_max(canvas_item_rect.pos.x+canvas_item_rect.size.x); h_scroll->set_page(local_rect.size.x/zoom); - ofs.x=h_scroll->get_val(); + ofs.x=h_scroll->get_value(); } // transform=Matrix32(); @@ -2497,8 +2497,8 @@ void CanvasItemEditor::_update_scroll(float) { return; Point2 ofs; - ofs.x=h_scroll->get_val(); - ofs.y=v_scroll->get_val(); + ofs.x=h_scroll->get_value(); + ofs.y=v_scroll->get_value(); // current_window->set_scroll(-ofs); @@ -2611,7 +2611,7 @@ void CanvasItemEditor::_popup_callback(int p_op) { dialog_val->set_min(0.1); dialog_val->set_step(0.1); dialog_val->set_max(800); - dialog_val->set_val(zoom*100); + dialog_val->set_value(zoom*100); value_dialog->popup_centered(Size2(200,85)); updating_value_dialog=false; @@ -2833,9 +2833,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/pos",n2d->get_position(),existing); if (key_rot) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/rot",Math::rad2deg(n2d->get_rotation()),existing); if (key_scale) AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(n2d,"transform/scale",n2d->get_scale(),existing); @@ -2865,9 +2865,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { for(List<Node2D*>::Element *F=ik_chain.front();F;F=F->next()) { if (key_pos) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_pos(),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/pos",F->get()->get_position(),existing); if (key_rot) - AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rot()),existing); + AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/rot",Math::rad2deg(F->get()->get_rotation()),existing); if (key_scale) AnimationPlayerEditor::singleton->get_key_editor()->insert_node_value_key(F->get(),"transform/scale",F->get()->get_scale(),existing); @@ -2947,8 +2947,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); PoseClipboard pc; - pc.pos=n2d->get_pos(); - pc.rot=n2d->get_rot(); + pc.pos=n2d->get_position(); + pc.rot=n2d->get_rotation(); pc.scale=n2d->get_scale(); pc.id=n2d->get_instance_ID(); pose_clipboard.push_back(pc); @@ -2974,8 +2974,8 @@ void CanvasItemEditor::_popup_callback(int p_op) { undo_redo->add_do_method(n2d,"set_pos",E->get().pos); undo_redo->add_do_method(n2d,"set_rot",E->get().rot); undo_redo->add_do_method(n2d,"set_scale",E->get().scale); - undo_redo->add_undo_method(n2d,"set_pos",n2d->get_pos()); - undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rot()); + undo_redo->add_undo_method(n2d,"set_pos",n2d->get_position()); + undo_redo->add_undo_method(n2d,"set_rot",n2d->get_rotation()); undo_redo->add_undo_method(n2d,"set_scale",n2d->get_scale()); } undo_redo->commit_action(); @@ -2998,9 +2998,9 @@ void CanvasItemEditor::_popup_callback(int p_op) { Node2D *n2d = canvas_item->cast_to<Node2D>(); if (key_pos) - n2d->set_pos(Vector2()); + n2d->set_position(Vector2()); if (key_rot) - n2d->set_rot(0); + n2d->set_rotation(0); if (key_scale) n2d->set_scale(Vector2(1,1)); } else if (canvas_item->cast_to<Control>()) { @@ -3180,8 +3180,8 @@ void CanvasItemEditor::_focus_selection(int p_op) { center = rect.pos + rect.size/2; Vector2 offset = viewport->get_size()/2 - editor->get_scene_root()->get_global_canvas_transform().xform(center); - h_scroll->set_val(h_scroll->get_val() - offset.x/zoom); - v_scroll->set_val(v_scroll->get_val() - offset.y/zoom); + h_scroll->set_value(h_scroll->get_value() - offset.x/zoom); + v_scroll->set_value(v_scroll->get_value() - offset.y/zoom); } else { // VIEW_FRAME_TO_SELECTION @@ -3825,7 +3825,7 @@ bool CanvasItemEditorViewport::_create_instance(Node* parent, String& path, cons Point2 pos; Node2D* parent_node2d=parent->cast_to<Node2D>(); if (parent_node2d) { - pos=parent_node2d->get_global_pos(); + pos=parent_node2d->get_global_position(); } else { Control* parent_control=parent->cast_to<Control>(); if (parent_control) { @@ -3913,7 +3913,7 @@ bool CanvasItemEditorViewport::can_drop_data(const Point2& p_point,const Variant _create_preview(files); } Matrix32 trans=canvas->get_canvas_transform(); - preview->set_pos((p_point-trans.get_origin())/trans.get_scale().x); + preview->set_position((p_point-trans.get_origin())/trans.get_scale().x); label->set_text(vformat(TTR("Adding %s..."),default_type)); } return can_instance; diff --git a/tools/editor/plugins/mesh_instance_editor_plugin.cpp b/tools/editor/plugins/mesh_instance_editor_plugin.cpp index acf1a3c96a..037dcf22fd 100644 --- a/tools/editor/plugins/mesh_instance_editor_plugin.cpp +++ b/tools/editor/plugins/mesh_instance_editor_plugin.cpp @@ -189,7 +189,7 @@ void MeshInstanceEditor::_create_outline_mesh() { return; } - Ref<Mesh> mesho = mesh->create_outline(outline_size->get_val()); + Ref<Mesh> mesho = mesh->create_outline(outline_size->get_value()); if (mesho.is_null()) { err_dialog->set_text(TTR("Could not create outline!")); @@ -255,7 +255,7 @@ MeshInstanceEditor::MeshInstanceEditor() { outline_size->set_min(0.001); outline_size->set_max(1024); outline_size->set_step(0.001); - outline_size->set_val(0.05); + outline_size->set_value(0.05); outline_dialog_vbc->add_margin_child(TTR("Outline Size:"),outline_size); add_child(outline_dialog); diff --git a/tools/editor/plugins/multimesh_editor_plugin.cpp b/tools/editor/plugins/multimesh_editor_plugin.cpp index 22981a2877..e038c83ac8 100644 --- a/tools/editor/plugins/multimesh_editor_plugin.cpp +++ b/tools/editor/plugins/multimesh_editor_plugin.cpp @@ -193,16 +193,16 @@ void MultiMeshEditor::_populate() { Ref<MultiMesh> multimesh = memnew( MultiMesh ); multimesh->set_mesh(mesh); - int instance_count=populate_amount->get_val(); + int instance_count=populate_amount->get_value(); multimesh->set_transform_format(MultiMesh::TRANSFORM_3D); multimesh->set_color_format(MultiMesh::COLOR_NONE); multimesh->set_instance_count(instance_count); - float _tilt_random = populate_tilt_random->get_val(); - float _rotate_random = populate_rotate_random->get_val(); - float _scale_random = populate_scale_random->get_val(); - float _scale = populate_scale->get_val(); + float _tilt_random = populate_tilt_random->get_value(); + float _rotate_random = populate_rotate_random->get_value(); + float _scale_random = populate_scale_random->get_value(); + float _scale = populate_scale->get_value(); int axis = populate_axis->get_selected(); Transform axis_xform; @@ -283,11 +283,11 @@ void MultiMeshEditor::_menu_option(int p_option) { surface_source->set_text(".."); mesh_source->set_text(".."); populate_axis->select(1); - populate_rotate_random->set_val(0); - populate_tilt_random->set_val(0); - populate_scale_random->set_val(0); - populate_scale->set_val(1); - populate_amount->set_val(128); + populate_rotate_random->set_value(0); + populate_tilt_random->set_value(0); + populate_scale_random->set_value(0); + populate_scale->set_value(1); + populate_amount->set_value(128); _last_pp_node=node; } @@ -387,7 +387,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_scale_random = memnew( SpinBox ); populate_scale_random->set_min(0); populate_scale_random->set_max(1); - populate_scale_random->set_val(0); + populate_scale_random->set_value(0); populate_scale_random->set_step(0.01); vbc->add_margin_child(TTR("Random Scale:"),populate_scale_random); @@ -395,7 +395,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_scale = memnew( SpinBox ); populate_scale->set_min(0.001); populate_scale->set_max(4096); - populate_scale->set_val(1); + populate_scale->set_value(1); populate_scale->set_step(0.01); vbc->add_margin_child(TTR("Scale:"),populate_scale); @@ -407,7 +407,7 @@ MultiMeshEditor::MultiMeshEditor() { populate_amount->set_end( Point2(5,237)); populate_amount->set_min(1); populate_amount->set_max(65536); - populate_amount->set_val(128); + populate_amount->set_value(128); vbc->add_margin_child(TTR("Amount:"),populate_amount); populate_dialog->get_ok()->set_text(TTR("Populate")); diff --git a/tools/editor/plugins/particles_2d_editor_plugin.cpp b/tools/editor/plugins/particles_2d_editor_plugin.cpp index 9a6c3d4458..0eda9d3c1a 100644 --- a/tools/editor/plugins/particles_2d_editor_plugin.cpp +++ b/tools/editor/plugins/particles_2d_editor_plugin.cpp @@ -62,7 +62,7 @@ void Particles2DEditorPlugin::_file_selected(const String& p_file) { print_line("file: "+p_file); - int epc=epoints->get_val(); + int epc=epoints->get_value(); Image img; Error err = ImageLoader::load_image(p_file,&img); @@ -189,7 +189,7 @@ Particles2DEditorPlugin::Particles2DEditorPlugin(EditorNode *p_node) { epoints->set_min(1); epoints->set_max(8192); epoints->set_step(1); - epoints->set_val(512); + epoints->set_value(512); file->get_vbox()->add_margin_child(TTR("Generated Point Count:"),epoints); } diff --git a/tools/editor/plugins/polygon_2d_editor_plugin.cpp b/tools/editor/plugins/polygon_2d_editor_plugin.cpp index deb3944ad6..4ab827017a 100644 --- a/tools/editor/plugins/polygon_2d_editor_plugin.cpp +++ b/tools/editor/plugins/polygon_2d_editor_plugin.cpp @@ -567,10 +567,10 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { } else if (mb.button_index==BUTTON_WHEEL_UP && mb.pressed) { - uv_zoom->set_val( uv_zoom->get_val()/0.9 ); + uv_zoom->set_value( uv_zoom->get_value()/0.9 ); } else if (mb.button_index==BUTTON_WHEEL_DOWN && mb.pressed) { - uv_zoom->set_val( uv_zoom->get_val()*0.9); + uv_zoom->set_value( uv_zoom->get_value()*0.9); } } else if (p_input.type==InputEvent::MOUSE_MOTION) { @@ -580,8 +580,8 @@ void Polygon2DEditor::_uv_input(const InputEvent& p_input) { if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 drag(mm.relative_x,mm.relative_y); - uv_hscroll->set_val( uv_hscroll->get_val()-drag.x ); - uv_vscroll->set_val( uv_vscroll->get_val()-drag.y ); + uv_hscroll->set_value( uv_hscroll->get_value()-drag.x ); + uv_vscroll->set_value( uv_vscroll->get_value()-drag.y ); } else if (uv_drag) { @@ -668,9 +668,9 @@ void Polygon2DEditor::_uv_scroll_changed(float) { if (updating_uv_scroll) return; - uv_draw_ofs.x=uv_hscroll->get_val(); - uv_draw_ofs.y=uv_vscroll->get_val(); - uv_draw_zoom=uv_zoom->get_val(); + uv_draw_ofs.x=uv_hscroll->get_value(); + uv_draw_ofs.y=uv_vscroll->get_value(); + uv_draw_zoom=uv_zoom->get_value(); uv_edit_draw->update(); } @@ -735,13 +735,13 @@ void Polygon2DEditor::_uv_draw() { uv_hscroll->set_min(rect.pos.x); uv_hscroll->set_max(rect.pos.x+rect.size.x); uv_hscroll->set_page(uv_edit_draw->get_size().x); - uv_hscroll->set_val(uv_draw_ofs.x); + uv_hscroll->set_value(uv_draw_ofs.x); uv_hscroll->set_step(0.001); uv_vscroll->set_min(rect.pos.y); uv_vscroll->set_max(rect.pos.y+rect.size.y); uv_vscroll->set_page(uv_edit_draw->get_size().y); - uv_vscroll->set_val(uv_draw_ofs.y); + uv_vscroll->set_value(uv_draw_ofs.y); uv_vscroll->set_step(0.001); updating_uv_scroll=false; @@ -914,7 +914,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); - sb_off_x->set_val(snap_offset.x); + sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); sb_off_x->connect("value_changed", this, "_set_snap_off_x"); uv_mode_hb->add_child(sb_off_x); @@ -923,7 +923,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); - sb_off_y->set_val(snap_offset.y); + sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); sb_off_y->connect("value_changed", this, "_set_snap_off_y"); uv_mode_hb->add_child(sb_off_y); @@ -935,7 +935,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); - sb_step_x->set_val(snap_step.x); + sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); sb_step_x->connect("value_changed", this, "_set_snap_step_x"); uv_mode_hb->add_child(sb_step_x); @@ -944,7 +944,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); - sb_step_y->set_val(snap_step.y); + sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); sb_step_y->connect("value_changed", this, "_set_snap_step_y"); uv_mode_hb->add_child(sb_step_y); @@ -955,7 +955,7 @@ Polygon2DEditor::Polygon2DEditor(EditorNode *p_editor) { uv_zoom = memnew( HSlider ); uv_zoom->set_min(0.01); uv_zoom->set_max(4); - uv_zoom->set_val(1); + uv_zoom->set_value(1); uv_zoom->set_step(0.01); uv_mode_hb->add_child(uv_zoom); uv_zoom->set_custom_minimum_size(Size2(200,0)); diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp index 44d3b63335..5b5de0608b 100644 --- a/tools/editor/plugins/spatial_editor_plugin.cpp +++ b/tools/editor/plugins/spatial_editor_plugin.cpp @@ -2116,7 +2116,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { move_gizmo_instance[i]=VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(move_gizmo_instance[i],spatial_editor->get_move_gizmo(i)->get_rid()); VS::get_singleton()->instance_set_scenario(move_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VS::get_singleton()->instance_set_visible(move_gizmo_instance[i],false); //VS::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(move_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(move_gizmo_instance[i],layer); @@ -2124,7 +2124,7 @@ void SpatialEditorViewport::_init_gizmo_instance(int p_idx) { rotate_gizmo_instance[i]=VS::get_singleton()->instance_create(); VS::get_singleton()->instance_set_base(rotate_gizmo_instance[i],spatial_editor->get_rotate_gizmo(i)->get_rid()); VS::get_singleton()->instance_set_scenario(rotate_gizmo_instance[i],get_tree()->get_root()->get_world()->get_scenario()); - VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VS::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],false); //VS::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_DEPH_SCALE,true); VS::get_singleton()->instance_geometry_set_cast_shadows_setting(rotate_gizmo_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(rotate_gizmo_instance[i],layer); @@ -2233,9 +2233,9 @@ void SpatialEditorViewport::update_transform_gizmo_view() { for(int i=0;i<3;i++) { VisualServer::get_singleton()->instance_set_transform(move_gizmo_instance[i], xform ); - VisualServer::get_singleton()->instance_geometry_set_flag(move_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) ); + VisualServer::get_singleton()->instance_set_visible(move_gizmo_instance[i],spatial_editor->is_gizmo_visible()&& (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_MOVE) ); VisualServer::get_singleton()->instance_set_transform(rotate_gizmo_instance[i], xform ); - VisualServer::get_singleton()->instance_geometry_set_flag(rotate_gizmo_instance[i],VS::INSTANCE_FLAG_VISIBLE,spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) ); + VisualServer::get_singleton()->instance_set_visible(rotate_gizmo_instance[i],spatial_editor->is_gizmo_visible() && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT || spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_ROTATE) ); } } @@ -2691,11 +2691,11 @@ void SpatialEditor::set_state(const Dictionary& p_state) { } if (d.has("zfar")) - settings_zfar->set_val(float(d["zfar"])); + settings_zfar->set_value(float(d["zfar"])); if (d.has("znear")) - settings_znear->set_val(float(d["znear"])); + settings_znear->set_value(float(d["znear"])); if (d.has("fov")) - settings_fov->set_val(float(d["fov"])); + settings_fov->set_value(float(d["fov"])); if (d.has("default_light")) { bool use = d["default_light"]; @@ -2738,7 +2738,7 @@ void SpatialEditor::set_state(const Dictionary& p_state) { if (use!=view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN))) { view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), use ); - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,use); + VisualServer::get_singleton()->instance_set_visible(origin_instance,use); } } @@ -3121,7 +3121,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { bool is_checked = view_menu->get_popup()->is_item_checked( view_menu->get_popup()->get_item_index(p_option) ); is_checked=!is_checked; - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,is_checked); + VisualServer::get_singleton()->instance_set_visible(origin_instance,is_checked); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(p_option), is_checked); } break; @@ -3133,7 +3133,7 @@ void SpatialEditor::_menu_item_pressed(int p_option) { for(int i=0;i<3;++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,grid_enabled); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],grid_enabled); grid_visible[i]=grid_enabled; } } @@ -3225,7 +3225,7 @@ void SpatialEditor::_init_indicators() { grid_visible[i]=false; grid_enable[i]=false; - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,false); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],false); VisualServer::get_singleton()->instance_geometry_set_cast_shadows_setting(grid_instance[i], VS::SHADOW_CASTING_SETTING_OFF); VS::get_singleton()->instance_set_layer_mask(grid_instance[i], 1 << SpatialEditorViewport::GIZMO_GRID_LAYER); @@ -3252,7 +3252,7 @@ void SpatialEditor::_init_indicators() { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[1],VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(grid_instance[1],true); grid_enable[1]=true; grid_visible[1]=true; grid_enabled=true; @@ -3721,9 +3721,9 @@ void SpatialEditor::_bind_methods() { void SpatialEditor::clear() { - settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); - settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); - settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500.0)); + settings_fov->set_value(EDITOR_DEF("3d_editor/default_fov",60.0)); + settings_znear->set_value(EDITOR_DEF("3d_editor/default_z_near",0.1)); + settings_zfar->set_value(EDITOR_DEF("3d_editor/default_z_far",1500.0)); for(int i=0;i<4;i++) { viewports[i]->reset(); @@ -3733,11 +3733,11 @@ void SpatialEditor::clear() { _menu_item_pressed(MENU_VIEW_DISPLAY_NORMAL); - VisualServer::get_singleton()->instance_geometry_set_flag(origin_instance,VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(origin_instance,true); view_menu->get_popup()->set_item_checked( view_menu->get_popup()->get_item_index(MENU_VIEW_ORIGIN), true); for(int i=0;i<3;++i) { if (grid_enable[i]) { - VisualServer::get_singleton()->instance_geometry_set_flag(grid_instance[i],VS::INSTANCE_FLAG_VISIBLE,true); + VisualServer::get_singleton()->instance_set_visible(grid_instance[i],true); grid_visible[i]=true; } } @@ -4045,21 +4045,21 @@ SpatialEditor::SpatialEditor(EditorNode *p_editor) { settings_fov->set_max(179); settings_fov->set_min(1); settings_fov->set_step(0.01); - settings_fov->set_val(EDITOR_DEF("3d_editor/default_fov",60.0)); + settings_fov->set_value(EDITOR_DEF("3d_editor/default_fov",60.0)); settings_vbc->add_margin_child(TTR("Perspective FOV (deg.):"),settings_fov); settings_znear = memnew( SpinBox ); settings_znear->set_max(10000); settings_znear->set_min(0.1); settings_znear->set_step(0.01); - settings_znear->set_val(EDITOR_DEF("3d_editor/default_z_near",0.1)); + settings_znear->set_value(EDITOR_DEF("3d_editor/default_z_near",0.1)); settings_vbc->add_margin_child(TTR("View Z-Near:"),settings_znear); settings_zfar = memnew( SpinBox ); settings_zfar->set_max(10000); settings_zfar->set_min(0.1); settings_zfar->set_step(0.01); - settings_zfar->set_val(EDITOR_DEF("3d_editor/default_z_far",1500)); + settings_zfar->set_value(EDITOR_DEF("3d_editor/default_z_far",1500)); settings_vbc->add_margin_child(TTR("View Z-Far:"),settings_zfar); //settings_dialog->get_cancel()->hide(); diff --git a/tools/editor/plugins/spatial_editor_plugin.h b/tools/editor/plugins/spatial_editor_plugin.h index 9ccc6008cb..f177dcab45 100644 --- a/tools/editor/plugins/spatial_editor_plugin.h +++ b/tools/editor/plugins/spatial_editor_plugin.h @@ -491,9 +491,9 @@ public: static SpatialEditor *get_singleton() { return singleton; } void snap_cursor_to_plane(const Plane& p_plane); - float get_znear() const { return settings_znear->get_val(); } - float get_zfar() const { return settings_zfar->get_val(); } - float get_fov() const { return settings_fov->get_val(); } + float get_znear() const { return settings_znear->get_value(); } + float get_zfar() const { return settings_zfar->get_value(); } + float get_fov() const { return settings_fov->get_value(); } Transform get_gizmo_transform() const { return gizmo.transform; } bool is_gizmo_visible() const { return gizmo.visible; } diff --git a/tools/editor/plugins/sprite_frames_editor_plugin.cpp b/tools/editor/plugins/sprite_frames_editor_plugin.cpp index f5ff635959..7c6e2f6532 100644 --- a/tools/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/tools/editor/plugins/sprite_frames_editor_plugin.cpp @@ -605,7 +605,7 @@ void SpriteFramesEditor::_update_library(bool p_skip_selector) { tree->select(tree->get_item_count()-1); } - anim_speed->set_val(frames->get_animation_speed(edited_anim)); + anim_speed->set_value(frames->get_animation_speed(edited_anim)); anim_loop->set_pressed(frames->get_animation_loop(edited_anim)); updating=false; diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp index 5c2d5ccaa4..4a25e636aa 100644 --- a/tools/editor/plugins/texture_region_editor_plugin.cpp +++ b/tools/editor/plugins/texture_region_editor_plugin.cpp @@ -166,13 +166,13 @@ void TextureRegionEditor::_region_draw() hscroll->set_min(scroll_rect.pos.x); hscroll->set_max(scroll_rect.pos.x+scroll_rect.size.x); hscroll->set_page(edit_draw->get_size().x); - hscroll->set_val(draw_ofs.x); + hscroll->set_value(draw_ofs.x); hscroll->set_step(0.001); vscroll->set_min(scroll_rect.pos.y); vscroll->set_max(scroll_rect.pos.y+scroll_rect.size.y); vscroll->set_page(edit_draw->get_size().y); - vscroll->set_val(draw_ofs.y); + vscroll->set_value(draw_ofs.y); vscroll->set_step(0.001); updating_scroll=false; @@ -400,8 +400,8 @@ void TextureRegionEditor::_region_input(const InputEvent& p_input) if (mm.button_mask&BUTTON_MASK_MIDDLE || Input::get_singleton()->is_key_pressed(KEY_SPACE)) { Vector2 draged(mm.relative_x,mm.relative_y); - hscroll->set_val( hscroll->get_val()-draged.x ); - vscroll->set_val( vscroll->get_val()-draged.y ); + hscroll->set_value( hscroll->get_value()-draged.x ); + vscroll->set_value( vscroll->get_value()-draged.y ); } else if (drag) { @@ -500,8 +500,8 @@ void TextureRegionEditor::_scroll_changed(float) if (updating_scroll) return; - draw_ofs.x=hscroll->get_val(); - draw_ofs.y=vscroll->get_val(); + draw_ofs.x=hscroll->get_value(); + draw_ofs.y=vscroll->get_value(); edit_draw->update(); } @@ -829,7 +829,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_off_x->set_min(-256); sb_off_x->set_max(256); sb_off_x->set_step(1); - sb_off_x->set_val(snap_offset.x); + sb_off_x->set_value(snap_offset.x); sb_off_x->set_suffix("px"); sb_off_x->connect("value_changed", this, "_set_snap_off_x"); hb_grid->add_child(sb_off_x); @@ -838,7 +838,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_off_y->set_min(-256); sb_off_y->set_max(256); sb_off_y->set_step(1); - sb_off_y->set_val(snap_offset.y); + sb_off_y->set_value(snap_offset.y); sb_off_y->set_suffix("px"); sb_off_y->connect("value_changed", this, "_set_snap_off_y"); hb_grid->add_child(sb_off_y); @@ -850,7 +850,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_step_x->set_min(-256); sb_step_x->set_max(256); sb_step_x->set_step(1); - sb_step_x->set_val(snap_step.x); + sb_step_x->set_value(snap_step.x); sb_step_x->set_suffix("px"); sb_step_x->connect("value_changed", this, "_set_snap_step_x"); hb_grid->add_child(sb_step_x); @@ -859,7 +859,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_step_y->set_min(-256); sb_step_y->set_max(256); sb_step_y->set_step(1); - sb_step_y->set_val(snap_step.y); + sb_step_y->set_value(snap_step.y); sb_step_y->set_suffix("px"); sb_step_y->connect("value_changed", this, "_set_snap_step_y"); hb_grid->add_child(sb_step_y); @@ -871,7 +871,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_sep_x->set_min(0); sb_sep_x->set_max(256); sb_sep_x->set_step(1); - sb_sep_x->set_val(snap_separation.x); + sb_sep_x->set_value(snap_separation.x); sb_sep_x->set_suffix("px"); sb_sep_x->connect("value_changed", this, "_set_snap_sep_x"); hb_grid->add_child(sb_sep_x); @@ -880,7 +880,7 @@ TextureRegionEditor::TextureRegionEditor(EditorNode* p_editor) sb_sep_y->set_min(0); sb_sep_y->set_max(256); sb_sep_y->set_step(1); - sb_sep_y->set_val(snap_separation.y); + sb_sep_y->set_value(snap_separation.y); sb_sep_y->set_suffix("px"); sb_sep_y->connect("value_changed", this, "_set_snap_sep_y"); hb_grid->add_child(sb_sep_y); @@ -971,22 +971,22 @@ void TextureRegionEditorPlugin::set_state(const Dictionary& p_state){ if (state.has("snap_step")) { Vector2 s = state["snap_step"]; - region_editor->sb_step_x->set_val(s.x); - region_editor->sb_step_y->set_val(s.y); + region_editor->sb_step_x->set_value(s.x); + region_editor->sb_step_y->set_value(s.y); region_editor->snap_step = s; } if (state.has("snap_offset")) { Vector2 ofs = state["snap_offset"]; - region_editor->sb_off_x->set_val(ofs.x); - region_editor->sb_off_y->set_val(ofs.y); + region_editor->sb_off_x->set_value(ofs.x); + region_editor->sb_off_y->set_value(ofs.y); region_editor->snap_offset = ofs; } if (state.has("snap_separation")) { Vector2 sep = state["snap_separation"]; - region_editor->sb_sep_x->set_val(sep.x); - region_editor->sb_sep_y->set_val(sep.y); + region_editor->sb_sep_x->set_value(sep.x); + region_editor->sb_sep_y->set_value(sep.y); region_editor->snap_separation = sep; } diff --git a/tools/editor/plugins/theme_editor_plugin.cpp b/tools/editor/plugins/theme_editor_plugin.cpp index fdd3b6156b..2950a3485f 100644 --- a/tools/editor/plugins/theme_editor_plugin.cpp +++ b/tools/editor/plugins/theme_editor_plugin.cpp @@ -750,7 +750,7 @@ ThemeEditor::ThemeEditor() { first_vb->add_child( memnew( HScrollBar )); first_vb->add_child( memnew( SpinBox )); ProgressBar *pb=memnew( ProgressBar ); - pb->set_val(50); + pb->set_value(50); first_vb->add_child( pb); Panel *pn=memnew( Panel ); pn->set_custom_minimum_size(Size2(40,40)*EDSCALE); diff --git a/tools/editor/plugins/tile_map_editor_plugin.cpp b/tools/editor/plugins/tile_map_editor_plugin.cpp index 8904739f08..9bdf80c314 100644 --- a/tools/editor/plugins/tile_map_editor_plugin.cpp +++ b/tools/editor/plugins/tile_map_editor_plugin.cpp @@ -221,7 +221,7 @@ void TileMapEditor::_update_palette() { palette->add_constant_override("vseparation", 8*EDSCALE); palette->set_fixed_icon_size(Size2(min_size, min_size)); - palette->set_fixed_column_width(min_size * MAX(size_slider->get_val(), 1)); + palette->set_fixed_column_width(min_size * MAX(size_slider->get_value(), 1)); String filter = search_box->get_text().strip_edges(); @@ -1449,7 +1449,7 @@ TileMapEditor::TileMapEditor(EditorNode *p_editor) { size_slider->set_min(0.1f); size_slider->set_max(4.0f); size_slider->set_step(0.1f); - size_slider->set_val(1.0f); + size_slider->set_value(1.0f); size_slider->connect("value_changed", this, "_icon_size_changed"); add_child(size_slider); diff --git a/tools/editor/progress_dialog.cpp b/tools/editor/progress_dialog.cpp index 5c667564fe..03303b8c48 100644 --- a/tools/editor/progress_dialog.cpp +++ b/tools/editor/progress_dialog.cpp @@ -42,7 +42,7 @@ void BackgroundProgress::_add_task(const String& p_task,const String& p_label, i t.hb->add_child(l); t.progress = memnew( ProgressBar ); t.progress->set_max(p_steps); - t.progress->set_val(p_steps); + t.progress->set_value(p_steps); Control *ec = memnew( Control ); ec->set_h_size_flags(SIZE_EXPAND_FILL); ec->set_v_size_flags(SIZE_EXPAND_FILL); @@ -83,9 +83,9 @@ void BackgroundProgress::_task_step(const String& p_task, int p_step){ Task &t=tasks[p_task]; if (p_step<0) - t.progress->set_val(t.progress->get_val()+1); + t.progress->set_value(t.progress->get_value()+1); else - t.progress->set_val(p_step); + t.progress->set_value(p_step); } void BackgroundProgress::_end_task(const String& p_task){ @@ -182,7 +182,7 @@ void ProgressDialog::add_task(const String& p_task,const String& p_label,int p_s t.vb->add_margin_child(p_label,vb2); t.progress = memnew( ProgressBar ); t.progress->set_max(p_steps); - t.progress->set_val(p_steps); + t.progress->set_value(p_steps); vb2->add_child(t.progress); t.state=memnew( Label ); t.state->set_clip_text(true); @@ -206,9 +206,9 @@ void ProgressDialog::task_step(const String& p_task, const String& p_state, int Task &t=tasks[p_task]; if (p_step<0) - t.progress->set_val(t.progress->get_val()+1); + t.progress->set_value(t.progress->get_value()+1); else - t.progress->set_val(p_step); + t.progress->set_value(p_step); t.state->set_text(p_state); last_progress_tick=OS::get_singleton()->get_ticks_usec(); diff --git a/tools/editor/project_export.cpp b/tools/editor/project_export.cpp index 60fbcce65b..3ee480c083 100644 --- a/tools/editor/project_export.cpp +++ b/tools/editor/project_export.cpp @@ -274,7 +274,7 @@ void ProjectExportDialog::_script_edited(Variant v) { void ProjectExportDialog::_sample_convert_edited(int what) { EditorImportExport::get_singleton()->sample_set_action( EditorImportExport::SampleAction(sample_mode->get_selected())); - EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_val() ); + EditorImportExport::get_singleton()->sample_set_max_hz( sample_max_hz->get_value() ); EditorImportExport::get_singleton()->sample_set_trim( sample_trim->is_pressed() ); _save_export_cfg(); @@ -325,8 +325,8 @@ void ProjectExportDialog::_notification(int p_what) { tree_vb->show(); image_action->select(EditorImportExport::get_singleton()->get_export_image_action()); - image_quality->set_val(EditorImportExport::get_singleton()->get_export_image_quality()); - image_shrink->set_val(EditorImportExport::get_singleton()->get_export_image_shrink()); + image_quality->set_value(EditorImportExport::get_singleton()->get_export_image_quality()); + image_shrink->set_value(EditorImportExport::get_singleton()->get_export_image_shrink()); _update_script(); @@ -350,7 +350,7 @@ void ProjectExportDialog::_notification(int p_what) { _update_group_tree(); sample_mode->select( EditorImportExport::get_singleton()->sample_get_action() ); - sample_max_hz->set_val( EditorImportExport::get_singleton()->sample_get_max_hz() ); + sample_max_hz->set_value( EditorImportExport::get_singleton()->sample_get_max_hz() ); sample_trim->set_pressed( EditorImportExport::get_singleton()->sample_get_trim() ); sample_mode->connect("item_selected",this,"_sample_convert_edited"); @@ -886,8 +886,8 @@ void ProjectExportDialog::_update_group() { StringName name = _get_selected_group(); group_image_action->select(EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); group_atlas->set_pressed(EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); - group_shrink->set_val(EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); - group_lossy_quality->set_val(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); + group_shrink->set_value(EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); + group_lossy_quality->set_value(EditorImportExport::get_singleton()->image_export_group_get_lossy_quality(name)); if (group_atlas->is_pressed()) atlas_preview->show(); else @@ -1009,8 +1009,8 @@ void ProjectExportDialog::_group_changed(Variant v) { EditorNode::get_undo_redo()->create_action(TTR("Change Image Group")); EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,group_image_action->get_selected()); EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,group_atlas->is_pressed()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_val()); - EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_val()); + EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,group_shrink->get_value()); + EditorNode::get_undo_redo()->add_do_method(EditorImportExport::get_singleton(),"image_export_group_set_lossy_quality",name,group_lossy_quality->get_value()); EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_image_action",name,EditorImportExport::get_singleton()->image_export_group_get_image_action(name)); EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_make_atlas",name,EditorImportExport::get_singleton()->image_export_group_get_make_atlas(name)); EditorNode::get_undo_redo()->add_undo_method(EditorImportExport::get_singleton(),"image_export_group_set_shrink",name,EditorImportExport::get_singleton()->image_export_group_get_shrink(name)); @@ -1516,7 +1516,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { group_lossy_quality->set_min(0.1); group_lossy_quality->set_max(1.0); group_lossy_quality->set_step(0.01); - group_lossy_quality->set_val(0.7); + group_lossy_quality->set_value(0.7); group_lossy_quality->connect("value_changed",this,"_quality_edited"); HBoxContainer *gqhb = memnew( HBoxContainer ); @@ -1535,7 +1535,7 @@ ProjectExportDialog::ProjectExportDialog(EditorNode *p_editor) { group_shrink = memnew(SpinBox); group_shrink->set_min(1); group_shrink->set_max(8); - group_shrink->set_val(1); + group_shrink->set_value(1); group_shrink->set_step(0.001); group_options->add_margin_child(TTR("Shrink By:"),group_shrink); group_shrink->connect("value_changed",this,"_group_changed"); diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 382b39592d..be070019ed 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -181,7 +181,7 @@ void ProjectSettings::_device_input_add() { String name=add_at; Variant old_val = Globals::get_singleton()->get(name); Array arr=old_val; - ie.device=device_id->get_val(); + ie.device=device_id->get_value(); ie.type=add_type; @@ -352,7 +352,7 @@ void ProjectSettings::_add_item(int p_item){ } break; case InputEvent::MOUSE_BUTTON: { - device_id->set_val(0); + device_id->set_value(0); device_index_label->set_text(TTR("Mouse Button Index:")); device_index->clear(); device_index->add_item(TTR("Left Button")); @@ -368,7 +368,7 @@ void ProjectSettings::_add_item(int p_item){ } break; case InputEvent::JOYSTICK_MOTION: { - device_id->set_val(0); + device_id->set_value(0); device_index_label->set_text(TTR("Joystick Axis Index:")); device_index->clear(); for(int i=0;i<JOY_AXIS_MAX*2;i++) { @@ -381,7 +381,7 @@ void ProjectSettings::_add_item(int p_item){ } break; case InputEvent::JOYSTICK_BUTTON: { - device_id->set_val(3); + device_id->set_value(3); device_index_label->set_text(TTR("Joystick Button Index:")); device_index->clear(); @@ -1472,7 +1472,7 @@ ProjectSettings::ProjectSettings(EditorData *p_data) { vbc_left->add_child(l); device_id = memnew( SpinBox ); - device_id->set_val(0); + device_id->set_value(0); vbc_left->add_child(device_id); VBoxContainer *vbc_right = memnew( VBoxContainer ); diff --git a/tools/editor/property_editor.cpp b/tools/editor/property_editor.cpp index f76fdd3d1d..959e564b8e 100644 --- a/tools/editor/property_editor.cpp +++ b/tools/editor/property_editor.cpp @@ -341,14 +341,14 @@ bool CustomPropertyEditor::edit(Object* p_owner,const String& p_name,Variant::Ty slider->set_min(min); slider->set_max(max); slider->set_step(step); - slider->set_val(v); + slider->set_value(v); slider->show(); set_size(Size2(110,30)*EDSCALE); } else { spinbox->set_min(min); spinbox->set_max(max); spinbox->set_step(step); - spinbox->set_val(v); + spinbox->set_value(v); spinbox->show(); set_size(Size2(70,35)*EDSCALE); } |