You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-24 15:26:15 +00:00
Rename pos to position in user facing methods and variables
Rename user facing methods and variables as well as the corresponding C++ methods according to the folloming changes: * pos -> position * rot -> rotation * loc -> location C++ variables are left as is.
This commit is contained in:
@@ -322,7 +322,7 @@ public:
|
||||
undo_redo->add_do_method(animation.ptr(), "track_remove_key", track, key);
|
||||
undo_redo->add_do_method(animation.ptr(), "track_insert_key", track, new_time, val, trans);
|
||||
undo_redo->add_do_method(this, "_key_ofs_changed", animation, key_ofs, new_time);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", track, new_time);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", track, new_time);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_insert_key", track, key_ofs, val, trans);
|
||||
undo_redo->add_undo_method(this, "_key_ofs_changed", animation, new_time, key_ofs);
|
||||
|
||||
@@ -563,8 +563,8 @@ public:
|
||||
|
||||
case Animation::TYPE_TRANSFORM: {
|
||||
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "loc"));
|
||||
p_list->push_back(PropertyInfo(Variant::QUAT, "rot"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "location"));
|
||||
p_list->push_back(PropertyInfo(Variant::QUAT, "rotation"));
|
||||
p_list->push_back(PropertyInfo(Variant::VECTOR3, "scale"));
|
||||
|
||||
} break;
|
||||
@@ -719,7 +719,7 @@ void AnimationKeyEditor::_anim_duplicate_keys(bool transpose) {
|
||||
int existing_idx = animation->track_find_key(dst_track, dst_time, true);
|
||||
|
||||
undo_redo->add_do_method(animation.ptr(), "track_insert_key", dst_track, dst_time, animation->track_get_key_value(E->key().track, E->key().key), animation->track_get_key_transition(E->key().track, E->key().key));
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", dst_track, dst_time);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", dst_track, dst_time);
|
||||
|
||||
Pair<int, float> p;
|
||||
p.first = dst_track;
|
||||
@@ -1016,7 +1016,7 @@ float AnimationKeyEditor::_get_zoom_scale() const {
|
||||
}
|
||||
}
|
||||
|
||||
void AnimationKeyEditor::_track_pos_draw() {
|
||||
void AnimationKeyEditor::_track_position_draw() {
|
||||
|
||||
if (!animation.is_valid()) {
|
||||
return;
|
||||
@@ -2301,8 +2301,8 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
|
||||
|
||||
if (tt == Animation::TYPE_TRANSFORM) {
|
||||
Dictionary d;
|
||||
d["loc"] = Vector3();
|
||||
d["rot"] = Quat();
|
||||
d["location"] = Vector3();
|
||||
d["rotation"] = Quat();
|
||||
d["scale"] = Vector3();
|
||||
newval = d;
|
||||
|
||||
@@ -2337,7 +2337,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
|
||||
undo_redo->create_action(TTR("Anim Add Key"));
|
||||
|
||||
undo_redo->add_do_method(animation.ptr(), "track_insert_key", idx, pos, newval, 1);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", idx, pos);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", idx, pos);
|
||||
|
||||
if (existing != -1) {
|
||||
Variant v = animation->track_get_key_value(idx, existing);
|
||||
@@ -2506,7 +2506,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
|
||||
if (selection.has(sk))
|
||||
continue; //already in selection, don't save
|
||||
|
||||
undo_redo->add_do_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newtime);
|
||||
undo_redo->add_do_method(animation.ptr(), "track_remove_key_at_position", E->key().track, newtime);
|
||||
_AnimMoveRestore amr;
|
||||
|
||||
amr.key = animation->track_get_key_value(E->key().track, idx);
|
||||
@@ -2536,7 +2536,7 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
|
||||
if (newpos<0)
|
||||
continue; //no remove what no inserted
|
||||
*/
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newpos);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", E->key().track, newpos);
|
||||
}
|
||||
|
||||
// 5-(undo) reinsert keys
|
||||
@@ -2753,10 +2753,10 @@ void AnimationKeyEditor::_track_editor_gui_input(const Ref<InputEvent> &p_input)
|
||||
case Animation::TYPE_TRANSFORM: {
|
||||
|
||||
Dictionary d = animation->track_get_key_value(idx, mouse_over.over_key);
|
||||
if (d.has("loc"))
|
||||
text += "loc: " + String(d["loc"]) + "\n";
|
||||
if (d.has("rot"))
|
||||
text += "rot: " + String(d["rot"]) + "\n";
|
||||
if (d.has("location"))
|
||||
text += "location: " + String(d["location"]) + "\n";
|
||||
if (d.has("rotation"))
|
||||
text += "rot: " + String(d["rotation"]) + "\n";
|
||||
if (d.has("scale"))
|
||||
text += "scale: " + String(d["scale"]) + "\n";
|
||||
} break;
|
||||
@@ -3359,9 +3359,9 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id, int p_last_track) {
|
||||
|
||||
Transform tr = p_id.value;
|
||||
Dictionary d;
|
||||
d["loc"] = tr.origin;
|
||||
d["location"] = tr.origin;
|
||||
d["scale"] = tr.basis.get_scale();
|
||||
d["rot"] = Quat(tr.basis); //.orthonormalized();
|
||||
d["rotation"] = Quat(tr.basis); //.orthonormalized();
|
||||
value = d;
|
||||
} break;
|
||||
default: {}
|
||||
@@ -3376,7 +3376,7 @@ int AnimationKeyEditor::_confirm_insert(InsertData p_id, int p_last_track) {
|
||||
p_last_track++;
|
||||
} else {
|
||||
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", p_id.track_idx, time);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", p_id.track_idx, time);
|
||||
int existing = animation->track_find_key(p_id.track_idx, time, true);
|
||||
if (existing != -1) {
|
||||
Variant v = animation->track_get_key_value(p_id.track_idx, existing);
|
||||
@@ -3451,7 +3451,7 @@ void AnimationKeyEditor::_create_value_item(int p_type) {
|
||||
Variant::CallError ce;
|
||||
Variant v = Variant::construct(Variant::Type(p_type), NULL, 0, ce);
|
||||
undo_redo->add_do_method(animation.ptr(), "track_insert_key", cvi_track, cvi_pos, v);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", cvi_track, cvi_pos);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", cvi_track, cvi_pos);
|
||||
|
||||
int existing = animation->track_find_key(cvi_track, cvi_pos, true);
|
||||
|
||||
@@ -3586,7 +3586,7 @@ void AnimationKeyEditor::_scale() {
|
||||
if (selection.has(sk))
|
||||
continue; //already in selection, don't save
|
||||
|
||||
undo_redo->add_do_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newtime);
|
||||
undo_redo->add_do_method(animation.ptr(), "track_remove_key_at_position", E->key().track, newtime);
|
||||
_AnimMoveRestore amr;
|
||||
|
||||
amr.key = animation->track_get_key_value(E->key().track, idx);
|
||||
@@ -3609,7 +3609,7 @@ void AnimationKeyEditor::_scale() {
|
||||
for (Map<SelectedKey, KeyInfo>::Element *E = selection.back(); E; E = E->prev()) {
|
||||
|
||||
float newpos = _NEW_POS(E->get().pos);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_pos", E->key().track, newpos);
|
||||
undo_redo->add_undo_method(animation.ptr(), "track_remove_key_at_position", E->key().track, newpos);
|
||||
}
|
||||
|
||||
// 5-(undo) reinsert keys
|
||||
@@ -3696,7 +3696,7 @@ void AnimationKeyEditor::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("_menu_track"), &AnimationKeyEditor::_menu_track);
|
||||
ClassDB::bind_method(D_METHOD("_clear_selection_for_anim"), &AnimationKeyEditor::_clear_selection_for_anim);
|
||||
ClassDB::bind_method(D_METHOD("_select_at_anim"), &AnimationKeyEditor::_select_at_anim);
|
||||
ClassDB::bind_method(D_METHOD("_track_pos_draw"), &AnimationKeyEditor::_track_pos_draw);
|
||||
ClassDB::bind_method(D_METHOD("_track_position_draw"), &AnimationKeyEditor::_track_position_draw);
|
||||
ClassDB::bind_method(D_METHOD("_insert_delay"), &AnimationKeyEditor::_insert_delay);
|
||||
ClassDB::bind_method(D_METHOD("_step_changed"), &AnimationKeyEditor::_step_changed);
|
||||
|
||||
@@ -3715,7 +3715,7 @@ void AnimationKeyEditor::_bind_methods() {
|
||||
|
||||
ADD_SIGNAL(MethodInfo("resource_selected", PropertyInfo(Variant::OBJECT, "res"), PropertyInfo(Variant::STRING, "prop")));
|
||||
ADD_SIGNAL(MethodInfo("keying_changed"));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "pos"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("timeline_changed", PropertyInfo(Variant::REAL, "position"), PropertyInfo(Variant::BOOL, "drag")));
|
||||
ADD_SIGNAL(MethodInfo("animation_len_changed", PropertyInfo(Variant::REAL, "len")));
|
||||
ADD_SIGNAL(MethodInfo("animation_step_changed", PropertyInfo(Variant::REAL, "step")));
|
||||
ADD_SIGNAL(MethodInfo("key_edited", PropertyInfo(Variant::INT, "track"), PropertyInfo(Variant::INT, "key")));
|
||||
@@ -3915,7 +3915,7 @@ AnimationKeyEditor::AnimationKeyEditor() {
|
||||
track_pos->set_area_as_parent_rect();
|
||||
track_pos->set_mouse_filter(MOUSE_FILTER_IGNORE);
|
||||
track_editor->add_child(track_pos);
|
||||
track_pos->connect("draw", this, "_track_pos_draw");
|
||||
track_pos->connect("draw", this, "_track_position_draw");
|
||||
|
||||
select_anim_warning = memnew(Label);
|
||||
track_editor->add_child(select_anim_warning);
|
||||
|
||||
Reference in New Issue
Block a user