Style: Fix issues that went past CI
This commit is contained in:
parent
a319d72071
commit
404ee1a56b
13 changed files with 92 additions and 143 deletions
|
|
@ -4,11 +4,10 @@
|
|||
#include "scene/animation/animation_blend_tree.h"
|
||||
|
||||
StringName AnimationNodeBlendSpace1DEditor::get_blend_position_path() const {
|
||||
StringName path = AnimationTreeEditor::get_singleton()->get_base_path()+"blend_position";
|
||||
StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + "blend_position";
|
||||
return path;
|
||||
}
|
||||
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEvent> &p_event) {
|
||||
Ref<InputEventKey> k = p_event;
|
||||
|
||||
|
|
@ -55,7 +54,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
continue;
|
||||
|
||||
int idx = menu->get_item_count();
|
||||
menu->add_item(vformat("Add %s", name),idx);
|
||||
menu->add_item(vformat("Add %s", name), idx);
|
||||
menu->set_item_metadata(idx, E->get());
|
||||
}
|
||||
|
||||
|
|
@ -136,7 +135,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
blend_pos *= blend_space->get_max_space() - blend_space->get_min_space();
|
||||
blend_pos += blend_space->get_min_space();
|
||||
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(),blend_pos);
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(), blend_pos);
|
||||
blend_space_draw->update();
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +158,7 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
blend_pos *= blend_space->get_max_space() - blend_space->get_min_space();
|
||||
blend_pos += blend_space->get_min_space();
|
||||
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(),blend_pos);
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(), blend_pos);
|
||||
|
||||
blend_space_draw->update();
|
||||
}
|
||||
|
|
@ -258,7 +257,6 @@ void AnimationNodeBlendSpace1DEditor::_blend_space_draw() {
|
|||
|
||||
float point = AnimationTreeEditor::get_singleton()->get_tree()->get(get_blend_position_path());
|
||||
|
||||
|
||||
point = (point - blend_space->get_min_space()) / (blend_space->get_max_space() - blend_space->get_min_space());
|
||||
point *= s.width;
|
||||
|
||||
|
|
@ -501,8 +499,6 @@ void AnimationNodeBlendSpace1DEditor::_open_editor() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE || p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
error_panel->add_style_override("panel", get_stylebox("bg", "Tree"));
|
||||
|
|
@ -514,7 +510,6 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
|
|||
tool_erase->set_icon(get_icon("Remove", "EditorIcons"));
|
||||
snap->set_icon(get_icon("SnapGrid", "EditorIcons"));
|
||||
open_editor->set_icon(get_icon("Edit", "EditorIcons"));
|
||||
|
||||
}
|
||||
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
|
@ -536,7 +531,7 @@ void AnimationNodeBlendSpace1DEditor::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
|
||||
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
set_process(is_visible_in_tree());
|
||||
}
|
||||
}
|
||||
|
|
@ -561,22 +556,17 @@ void AnimationNodeBlendSpace1DEditor::_bind_methods() {
|
|||
ClassDB::bind_method("_open_editor", &AnimationNodeBlendSpace1DEditor::_open_editor);
|
||||
|
||||
ClassDB::bind_method("_file_opened", &AnimationNodeBlendSpace1DEditor::_file_opened);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool AnimationNodeBlendSpace1DEditor::can_edit(const Ref<AnimationNode> &p_node) {
|
||||
|
||||
Ref<AnimationNodeBlendSpace1D> b1d=p_node;
|
||||
Ref<AnimationNodeBlendSpace1D> b1d = p_node;
|
||||
return b1d.is_valid();
|
||||
}
|
||||
|
||||
void AnimationNodeBlendSpace1DEditor::edit(const Ref<AnimationNode> &p_node) {
|
||||
|
||||
|
||||
|
||||
blend_space=p_node;
|
||||
blend_space = p_node;
|
||||
|
||||
if (!blend_space.is_null()) {
|
||||
_update_space();
|
||||
|
|
@ -595,7 +585,6 @@ AnimationNodeBlendSpace1DEditor::AnimationNodeBlendSpace1DEditor() {
|
|||
Ref<ButtonGroup> bg;
|
||||
bg.instance();
|
||||
|
||||
|
||||
tool_blend = memnew(ToolButton);
|
||||
tool_blend->set_toggle_mode(true);
|
||||
tool_blend->set_button_group(bg);
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_plugin.h"
|
||||
#include "editor/plugins/animation_tree_editor_plugin.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "scene/animation/animation_blend_space_1d.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/graph_edit.h"
|
||||
#include "scene/gui/popup.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "editor/plugins/animation_tree_editor_plugin.h"
|
||||
|
||||
class AnimationNodeBlendSpace1DEditor : public AnimationTreeNodeEditorPlugin {
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
bool AnimationNodeBlendSpace2DEditor::can_edit(const Ref<AnimationNode> &p_node) {
|
||||
|
||||
Ref<AnimationNodeBlendSpace2D> bs2d=p_node;
|
||||
Ref<AnimationNodeBlendSpace2D> bs2d = p_node;
|
||||
return bs2d.is_valid();
|
||||
}
|
||||
|
||||
|
|
@ -27,7 +27,7 @@ void AnimationNodeBlendSpace2DEditor::edit(const Ref<AnimationNode> &p_node) {
|
|||
}
|
||||
|
||||
StringName AnimationNodeBlendSpace2DEditor::get_blend_position_path() const {
|
||||
StringName path = AnimationTreeEditor::get_singleton()->get_base_path()+"blend_position";
|
||||
StringName path = AnimationTreeEditor::get_singleton()->get_base_path() + "blend_position";
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
@ -73,7 +73,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
if (name == "Animation")
|
||||
continue; // nope
|
||||
int idx = menu->get_item_count();
|
||||
menu->add_item(vformat("Add %s", name),idx);
|
||||
menu->add_item(vformat("Add %s", name), idx);
|
||||
menu->set_item_metadata(idx, E->get());
|
||||
}
|
||||
|
||||
|
|
@ -85,7 +85,6 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
menu->add_separator();
|
||||
menu->add_item(TTR("Load.."), MENU_LOAD_FILE);
|
||||
|
||||
|
||||
menu->set_global_position(blend_space_draw->get_global_transform().xform(mb->get_position()));
|
||||
menu->popup();
|
||||
add_point_pos = (mb->get_position() / blend_space_draw->get_size());
|
||||
|
|
@ -211,7 +210,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
blend_pos *= (blend_space->get_max_space() - blend_space->get_min_space());
|
||||
blend_pos += blend_space->get_min_space();
|
||||
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(),blend_pos);
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(), blend_pos);
|
||||
|
||||
blend_space_draw->update();
|
||||
}
|
||||
|
|
@ -246,7 +245,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_gui_input(const Ref<InputEven
|
|||
blend_pos *= (blend_space->get_max_space() - blend_space->get_min_space());
|
||||
blend_pos += blend_space->get_min_space();
|
||||
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(),blend_pos);
|
||||
AnimationTreeEditor::get_singleton()->get_tree()->set(get_blend_position_path(), blend_pos);
|
||||
|
||||
blend_space_draw->update();
|
||||
}
|
||||
|
|
@ -750,12 +749,11 @@ void AnimationNodeBlendSpace2DEditor::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
|
||||
if (p_what==NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {
|
||||
set_process(is_visible_in_tree());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void AnimationNodeBlendSpace2DEditor::_open_editor() {
|
||||
|
||||
if (selected_point >= 0 && selected_point < blend_space->get_blend_point_count()) {
|
||||
|
|
@ -804,7 +802,6 @@ void AnimationNodeBlendSpace2DEditor::_bind_methods() {
|
|||
ClassDB::bind_method("_auto_triangles_toggled", &AnimationNodeBlendSpace2DEditor::_auto_triangles_toggled);
|
||||
|
||||
ClassDB::bind_method("_file_opened", &AnimationNodeBlendSpace2DEditor::_file_opened);
|
||||
|
||||
}
|
||||
|
||||
AnimationNodeBlendSpace2DEditor *AnimationNodeBlendSpace2DEditor::singleton = NULL;
|
||||
|
|
@ -1019,4 +1016,3 @@ AnimationNodeBlendSpace2DEditor::AnimationNodeBlendSpace2DEditor() {
|
|||
dragging_selected = false;
|
||||
dragging_selected_attempt = false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@
|
|||
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_plugin.h"
|
||||
#include "editor/plugins/animation_tree_editor_plugin.h"
|
||||
#include "editor/property_editor.h"
|
||||
#include "scene/animation/animation_blend_space_2d.h"
|
||||
#include "scene/gui/button.h"
|
||||
#include "scene/gui/graph_edit.h"
|
||||
#include "scene/gui/popup.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "editor/plugins/animation_tree_editor_plugin.h"
|
||||
/**
|
||||
@author Juan Linietsky <reduzio@gmail.com>
|
||||
*/
|
||||
|
|
@ -20,7 +20,6 @@ class AnimationNodeBlendSpace2DEditor : public AnimationTreeNodeEditorPlugin {
|
|||
|
||||
Ref<AnimationNodeBlendSpace2D> blend_space;
|
||||
|
||||
|
||||
PanelContainer *panel;
|
||||
ToolButton *tool_blend;
|
||||
ToolButton *tool_select;
|
||||
|
|
@ -119,5 +118,4 @@ public:
|
|||
AnimationNodeBlendSpace2DEditor();
|
||||
};
|
||||
|
||||
|
||||
#endif // ANIMATION_BLEND_SPACE_2D_EDITOR_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue