summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/gdscript/gd_tokenizer.cpp10
-rw-r--r--scene/2d/sprite.cpp1
-rw-r--r--scene/gui/graph_edit.cpp11
-rw-r--r--scene/gui/graph_node.cpp1
-rw-r--r--tools/editor/icons/2x/icon_load.pngbin228 -> 503 bytes
-rw-r--r--tools/editor/icons/2x/icon_open.pngbin228 -> 0 bytes
-rw-r--r--tools/editor/icons/icon_load.pngbin170 -> 301 bytes
-rw-r--r--tools/editor/icons/icon_open.pngbin170 -> 0 bytes
-rw-r--r--tools/editor/icons/source/icon_load.svg85
-rw-r--r--tools/editor/plugins/animation_player_editor_plugin.cpp2
-rw-r--r--tools/editor/plugins/texture_region_editor_plugin.cpp7
-rw-r--r--tools/editor/plugins/texture_region_editor_plugin.h2
12 files changed, 108 insertions, 11 deletions
diff --git a/modules/gdscript/gd_tokenizer.cpp b/modules/gdscript/gd_tokenizer.cpp
index 383a092d96..39c4530d96 100644
--- a/modules/gdscript/gd_tokenizer.cpp
+++ b/modules/gdscript/gd_tokenizer.cpp
@@ -282,7 +282,7 @@ void GDTokenizerText::_advance() {
case '\n': {
line++;
INCPOS(1);
- column=0;
+ column=1;
int i=0;
while(GETCHAR(i)==' ' || GETCHAR(i)=='\t') {
i++;
@@ -303,7 +303,7 @@ void GDTokenizerText::_advance() {
}
}
INCPOS(1);
- column=0;
+ column=1;
line++;
int i=0;
while(GETCHAR(i)==' ' || GETCHAR(i)=='\t') {
@@ -335,7 +335,7 @@ void GDTokenizerText::_advance() {
break;
} else if (_code[pos]=='\n') {
new_line++;
- new_col=0;
+ new_col=1;
} else {
new_col++;
}
@@ -358,7 +358,7 @@ void GDTokenizerText::_advance() {
}
}
INCPOS(1);
- column=0;
+ column=1;
line++;
continue;
@@ -654,7 +654,7 @@ void GDTokenizerText::_advance() {
} else {
if (CharType(GETCHAR(i))=='\n') {
line++;
- column=0;
+ column=1;
}
str+=CharType(GETCHAR(i));
diff --git a/scene/2d/sprite.cpp b/scene/2d/sprite.cpp
index c5b338bf59..8723db95d6 100644
--- a/scene/2d/sprite.cpp
+++ b/scene/2d/sprite.cpp
@@ -214,6 +214,7 @@ void Sprite::set_frame(int p_frame) {
frame=p_frame;
+ _change_notify("frame");
emit_signal(SceneStringNames::get_singleton()->frame_changed);
}
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index 4eecabd10c..acc3ec3b2e 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -151,7 +151,7 @@ void GraphEdit::_update_scroll_offset() {
}
}
- connections_layer->set_pos(-Point2(h_scroll->get_val(),v_scroll->get_val())*zoom);
+ connections_layer->set_pos(-Point2(h_scroll->get_val(),v_scroll->get_val()));
set_block_minimum_size_adjust(false);
awaiting_scroll_offset_update=false;
@@ -650,8 +650,8 @@ void GraphEdit::_draw_cos_line(CanvasItem* p_where,const Vector2& p_from, const
cp_offset=MAX(MIN(cp_len-diff,cp_neg_len),-diff*0.5);
}
- Vector2 c1 = Vector2(cp_offset,0);
- Vector2 c2 = Vector2(-cp_offset,0);
+ Vector2 c1 = Vector2(cp_offset*zoom,0);
+ Vector2 c2 = Vector2(-cp_offset*zoom,0);
int lines=0;
_bake_segment2d(p_where,0,1,p_from,c1,p_to,c2,0,3,9,8,p_color,p_to_color,lines);
@@ -726,9 +726,9 @@ void GraphEdit::_connections_layer_draw() {
continue;
}
- Vector2 frompos=gfrom->get_connection_output_pos(E->get().from_port)+gfrom->get_offset();
+ Vector2 frompos=gfrom->get_connection_output_pos(E->get().from_port)+gfrom->get_offset()*zoom;
Color color = gfrom->get_connection_output_color(E->get().from_port);
- Vector2 topos=gto->get_connection_input_pos(E->get().to_port)+gto->get_offset();
+ Vector2 topos=gto->get_connection_input_pos(E->get().to_port)+gto->get_offset()*zoom;
Color tocolor = gto->get_connection_input_color(E->get().to_port);
_draw_cos_line(connections_layer,frompos,topos,color,tocolor);
@@ -1052,6 +1052,7 @@ void GraphEdit::set_zoom(float p_zoom) {
top_layer->update();
_update_scroll();
+ connections_layer->update();
if (is_visible()) {
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index 213c5f62c0..eec973ebef 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -769,6 +769,7 @@ void GraphNode::_bind_methods() {
ADD_PROPERTY( PropertyInfo(Variant::STRING,"title"),_SCS("set_title"),_SCS("get_title"));
ADD_PROPERTY( PropertyInfo(Variant::BOOL,"show_close"),_SCS("set_show_close_button"),_SCS("is_close_button_visible"));
+ ADD_PROPERTY( PropertyInfo(Variant::BOOL,"resizeable"),_SCS("set_resizeable"),_SCS("is_resizeable"));
ADD_SIGNAL(MethodInfo("offset_changed"));
ADD_SIGNAL(MethodInfo("dragged",PropertyInfo(Variant::VECTOR2,"from"),PropertyInfo(Variant::VECTOR2,"to")));
diff --git a/tools/editor/icons/2x/icon_load.png b/tools/editor/icons/2x/icon_load.png
index 2e797c448b..729eedd2dd 100644
--- a/tools/editor/icons/2x/icon_load.png
+++ b/tools/editor/icons/2x/icon_load.png
Binary files differ
diff --git a/tools/editor/icons/2x/icon_open.png b/tools/editor/icons/2x/icon_open.png
deleted file mode 100644
index 2e797c448b..0000000000
--- a/tools/editor/icons/2x/icon_open.png
+++ /dev/null
Binary files differ
diff --git a/tools/editor/icons/icon_load.png b/tools/editor/icons/icon_load.png
index cc05e98ebb..98da8135f2 100644
--- a/tools/editor/icons/icon_load.png
+++ b/tools/editor/icons/icon_load.png
Binary files differ
diff --git a/tools/editor/icons/icon_open.png b/tools/editor/icons/icon_open.png
deleted file mode 100644
index cc05e98ebb..0000000000
--- a/tools/editor/icons/icon_open.png
+++ /dev/null
Binary files differ
diff --git a/tools/editor/icons/source/icon_load.svg b/tools/editor/icons/source/icon_load.svg
new file mode 100644
index 0000000000..f8e78fb4ea
--- /dev/null
+++ b/tools/editor/icons/source/icon_load.svg
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.91 r13725"
+ inkscape:export-filename="/home/godotengine/godot/tools/editor/icons/2x/icon_load.png"
+ inkscape:export-xdpi="180"
+ inkscape:export-ydpi="180"
+ sodipodi:docname="icon_load.svg">
+ <defs
+ id="defs4" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.627417"
+ inkscape:cx="12.685427"
+ inkscape:cy="1.6294402"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ units="px"
+ inkscape:snap-bbox="true"
+ inkscape:bbox-paths="true"
+ inkscape:bbox-nodes="true"
+ inkscape:snap-bbox-edge-midpoints="true"
+ inkscape:snap-bbox-midpoints="false"
+ inkscape:snap-object-midpoints="true"
+ inkscape:snap-center="true"
+ inkscape:window-width="1920"
+ inkscape:window-height="1119"
+ inkscape:window-x="0"
+ inkscape:window-y="26"
+ inkscape:window-maximized="1"
+ inkscape:snap-smooth-nodes="true"
+ inkscape:object-nodes="true"
+ showguides="false">
+ <inkscape:grid
+ type="xygrid"
+ id="grid3336"
+ spacingx="0.5"
+ spacingy="0.5"
+ empspacing="2" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title></dc:title>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0,-1036.3622)">
+ <path
+ style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#e0e0e0;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ d="M 1.5000703,2 C 1.0834036,2 0.7251221,2.1928844 0.4590547,2.4589844 0.1929873,2.7250844 7.03e-5,3.0834 7.03e-5,3.5 l 0.5,8.5 c 0.041565,0.581917 0.1536332,1.110716 0.5214844,1.478516 C 1.3894058,13.846416 1.916737,14 2.5000703,14 l 0.5,0 0.5,0 9.9997657,0 c 0.231666,-10e-5 0.432919,-0.159266 0.486328,-0.384766 l 2,-7.4999996 C 16.060474,5.8013344 15.822456,5.5002 15.499836,5.5 L 4.7559297,5.5 C 4.5236856,5.5003 4.3126587,5.6584963 4.2696015,5.8867188 L 3.0383769,12.412759 C 2.9838992,12.701515 2.7130529,12.963778 2.2988984,12.972656 1.7175274,12.985119 1.5058274,12.46121 1.5000703,12 l -0.5,-8.5 c 0,-0.083 0.057083,-0.2249844 0.1660156,-0.3339844 C 1.2750185,3.0571156 1.416737,3 1.5000703,3 L 12.499836,3 c 0.08333,0 0.225052,0.057016 0.333984,0.1660156 0.108933,0.109 0.224913,0.2750776 0.166016,0.3339844 l 0,1 1,0 0,-1 c 0,-0.4166 -0.192917,-0.7749156 -0.458984,-1.0410156 C 13.274784,2.1928844 12.916503,2 12.499836,2 Z"
+ transform="translate(0,1036.3622)"
+ id="path8167"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sscccscccccccssscccssssccssss" />
+ </g>
+</svg>
diff --git a/tools/editor/plugins/animation_player_editor_plugin.cpp b/tools/editor/plugins/animation_player_editor_plugin.cpp
index b4d54c6b1e..d6d452dd72 100644
--- a/tools/editor/plugins/animation_player_editor_plugin.cpp
+++ b/tools/editor/plugins/animation_player_editor_plugin.cpp
@@ -666,7 +666,7 @@ void AnimationPlayerEditor::set_state(const Dictionary& p_state) {
return;
Node *n = EditorNode::get_singleton()->get_edited_scene()->get_node(p_state["player"]);
- if (n && n->cast_to<AnimationPlayer>()) {
+ if (n && n->cast_to<AnimationPlayer>() && EditorNode::get_singleton()->get_editor_selection()->is_selected(n)) {
player=n->cast_to<AnimationPlayer>();
_update_player();
show();
diff --git a/tools/editor/plugins/texture_region_editor_plugin.cpp b/tools/editor/plugins/texture_region_editor_plugin.cpp
index 43086fb208..6b918e6e8f 100644
--- a/tools/editor/plugins/texture_region_editor_plugin.cpp
+++ b/tools/editor/plugins/texture_region_editor_plugin.cpp
@@ -653,6 +653,7 @@ void TextureRegionEditor::edit(Object *p_obj)
} else {
p_obj->connect("texture_changed",this,"_edit_region");
}
+ p_obj->add_change_receptor(this);
p_obj->connect("exit_tree",this,"_node_removed",varray(p_obj),CONNECT_ONESHOT);
_edit_region();
} else {
@@ -673,6 +674,12 @@ void TextureRegionEditor::edit(Object *p_obj)
edit_draw->update();
}
+void TextureRegionEditor::_changed_callback(Object *p_changed, const char *p_prop) {
+ if ((String)p_prop == "region_rect") {
+ _edit_region();
+ }
+}
+
void TextureRegionEditor::_edit_region()
{
Ref<Texture> texture = NULL;
diff --git a/tools/editor/plugins/texture_region_editor_plugin.h b/tools/editor/plugins/texture_region_editor_plugin.h
index 3658a38f11..f0bb7c9bc2 100644
--- a/tools/editor/plugins/texture_region_editor_plugin.h
+++ b/tools/editor/plugins/texture_region_editor_plugin.h
@@ -116,6 +116,8 @@ protected:
Vector2 snap_point(Vector2 p_target) const;
+ virtual void _changed_callback(Object *p_changed, const char *p_prop);
+
public:
void _edit_region();