summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorAnton Yabchinskiy <arn@bestmx.ru>2014-12-03 14:49:56 +0300
committerAnton Yabchinskiy <arn@devline.ru>2014-12-04 16:32:43 +0300
commit99676d7e742ebb31b920eb37d7a955b235be35ed (patch)
treee4474598eb2b6b771a25897e0b3170059ad0ed7c /scene
parentfff056bdc5b030e39ecfa619c8f58b20305ebeae (diff)
parent8ad12525a90d90d77dc08b3d6decae33be5675c4 (diff)
Merge branch 'master' of https://github.com/okamstudio/godot
Diffstat (limited to 'scene')
-rw-r--r--scene/animation/animation_player.cpp2
-rw-r--r--scene/audio/sound_room_params.cpp6
-rw-r--r--scene/gui/base_button.cpp27
-rw-r--r--scene/resources/circle_shape_2d.cpp4
-rw-r--r--scene/scene_string_names.cpp3
-rw-r--r--scene/scene_string_names.h3
6 files changed, 37 insertions, 8 deletions
diff --git a/scene/animation/animation_player.cpp b/scene/animation/animation_player.cpp
index 2fbbd54d9f..011850138b 100644
--- a/scene/animation/animation_player.cpp
+++ b/scene/animation/animation_player.cpp
@@ -374,7 +374,7 @@ void AnimationPlayer::_animation_process_animation(AnimationData* p_anim,float p
Error err = a->transform_track_interpolate(i,p_time,&loc,&rot,&scale);
- ERR_CONTINUE(err!=OK); //used for testing, should be removed
+ //ERR_CONTINUE(err!=OK); //used for testing, should be removed
if (err!=OK)
diff --git a/scene/audio/sound_room_params.cpp b/scene/audio/sound_room_params.cpp
index 01d373ebff..f1067f12e0 100644
--- a/scene/audio/sound_room_params.cpp
+++ b/scene/audio/sound_room_params.cpp
@@ -54,7 +54,7 @@ void SoundRoomParams::_notification(int p_what) {
case NOTIFICATION_ENTER_TREE: {
-#if 0
+//#if 0
Node *n=this;
Room *room_instance=NULL;
while(n) {
@@ -74,11 +74,11 @@ void SoundRoomParams::_notification(int p_what) {
if (room_instance) {
room=room_instance->get_sound_room();
} else {
- room=get_scene()->get_default_world()->get_sound_space();
+ room=get_viewport()->find_world()->get_sound_space();
}
_update_sound_room();
-#endif
+//#endif
} break;
case NOTIFICATION_EXIT_TREE: {
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index cf3bef73ea..0167687621 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -30,7 +30,7 @@
#include "os/keyboard.h"
#include "print_string.h"
#include "button_group.h"
-
+#include "scene/scene_string_names.h"
void BaseButton::_input_event(InputEvent p_event) {
@@ -60,12 +60,21 @@ void BaseButton::_input_event(InputEvent p_event) {
status.pressing_inside=true;
pressed();
+ if (get_script_instance()) {
+ Variant::CallError ce;
+ get_script_instance()->call(SceneStringNames::get_singleton()->_pressed,NULL,0,ce);
+ }
+
emit_signal("pressed");
} else {
status.pressed=!status.pressed;
pressed();
+ if (get_script_instance()) {
+ Variant::CallError ce;
+ get_script_instance()->call(SceneStringNames::get_singleton()->_pressed,NULL,0,ce);
+ }
emit_signal("pressed");
toggled(status.pressed);
@@ -99,6 +108,11 @@ void BaseButton::_input_event(InputEvent p_event) {
if (!toggle_mode) { //mouse press attempt
pressed();
+ if (get_script_instance()) {
+ Variant::CallError ce;
+ get_script_instance()->call(SceneStringNames::get_singleton()->_pressed,NULL,0,ce);
+ }
+
emit_signal("pressed");
} else {
@@ -110,6 +124,10 @@ void BaseButton::_input_event(InputEvent p_event) {
toggled(status.pressed);
emit_signal("toggled",status.pressed);
+ if (get_script_instance()) {
+ get_script_instance()->call(SceneStringNames::get_singleton()->_toggled,status.pressed);
+ }
+
}
@@ -177,6 +195,9 @@ void BaseButton::_input_event(InputEvent p_event) {
emit_signal("pressed");
toggled(status.pressed);
+ if (get_script_instance()) {
+ get_script_instance()->call(SceneStringNames::get_singleton()->_toggled,status.pressed);
+ }
emit_signal("toggled",status.pressed);
}
}
@@ -362,6 +383,9 @@ void BaseButton::_bind_methods() {
ObjectTypeDB::bind_method(_MD("get_click_on_press"),&BaseButton::get_click_on_press);
ObjectTypeDB::bind_method(_MD("get_draw_mode"),&BaseButton::get_draw_mode);
+ BIND_VMETHOD(MethodInfo("_pressed"));
+ BIND_VMETHOD(MethodInfo("_toggled",PropertyInfo(Variant::BOOL,"pressed")));
+
ADD_SIGNAL( MethodInfo("pressed" ) );
ADD_SIGNAL( MethodInfo("released" ) );
ADD_SIGNAL( MethodInfo("toggled", PropertyInfo( Variant::BOOL,"pressed") ) );
@@ -369,6 +393,7 @@ void BaseButton::_bind_methods() {
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "toggle_mode"), _SCS("set_toggle_mode"), _SCS("is_toggle_mode"));
ADD_PROPERTY( PropertyInfo( Variant::BOOL, "click_on_press"), _SCS("set_click_on_press"), _SCS("get_click_on_press"));
+
BIND_CONSTANT( DRAW_NORMAL );
BIND_CONSTANT( DRAW_PRESSED );
BIND_CONSTANT( DRAW_HOVER );
diff --git a/scene/resources/circle_shape_2d.cpp b/scene/resources/circle_shape_2d.cpp
index 056be87e72..d6a9db690b 100644
--- a/scene/resources/circle_shape_2d.cpp
+++ b/scene/resources/circle_shape_2d.cpp
@@ -54,9 +54,7 @@ void CircleShape2D::_bind_methods() {
ObjectTypeDB::bind_method(_MD("set_radius","radius"),&CircleShape2D::set_radius);
ObjectTypeDB::bind_method(_MD("get_radius"),&CircleShape2D::get_radius);
-
-
- ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius"),_SCS("set_radius"),_SCS("get_radius") );
+ ADD_PROPERTY( PropertyInfo(Variant::REAL,"radius",PROPERTY_HINT_RANGE,"0.01,16384,0.5"),_SCS("set_radius"),_SCS("get_radius") );
}
diff --git a/scene/scene_string_names.cpp b/scene/scene_string_names.cpp
index df9b02ea3f..8ad7e06c0f 100644
--- a/scene/scene_string_names.cpp
+++ b/scene/scene_string_names.cpp
@@ -147,4 +147,7 @@ SceneStringNames::SceneStringNames() {
_mouse_enter=StaticCString::create("_mouse_enter");
_mouse_exit=StaticCString::create("_mouse_exit");
+ _pressed=StaticCString::create("_pressed");
+ _toggled=StaticCString::create("_toggled");
+
}
diff --git a/scene/scene_string_names.h b/scene/scene_string_names.h
index 11799b9e86..512674f648 100644
--- a/scene/scene_string_names.h
+++ b/scene/scene_string_names.h
@@ -95,6 +95,9 @@ public:
StringName _input;
StringName _ready;
+ StringName _pressed;
+ StringName _toggled;
+
StringName _update_scroll;
StringName _update_xform;