This commit is contained in:
Juan Linietsky 2015-12-13 08:01:14 -03:00
commit 451b1d9144
9 changed files with 24 additions and 56 deletions

View file

@ -1,7 +1,9 @@
extends Node
# Member variables
var current_scene = null
# Changing scenes is most easily done using the functions `change_scene`
# and `change_scene_to` of the SceneTree. This script demonstrates how to
# change scenes without those helpers.
func goto_scene(path):
@ -18,20 +20,17 @@ func goto_scene(path):
func _deferred_goto_scene(path):
# Immediately free the current scene,
# there is no risk here.
current_scene.free()
# Immediately free the current scene, there is no risk here.
get_tree().get_current_scene().free()
# Load new scene
var s = ResourceLoader.load(path)
var packed_scene = ResourceLoader.load(path)
# Instance the new scene
current_scene = s.instance()
var instanced_scene = packed_scene.instance()
# Add it to the active scene, as child of root
get_tree().get_root().add_child(current_scene)
func _ready():
# Get the current scene at the time of initialization
current_scene = get_tree().get_current_scene()
# Add it to the scene tree, as direct child of root
get_tree().get_root().add_child(instanced_scene)
# Set it as the current scene, only after it has been added to the tree
get_tree().set_current_scene(instanced_scene)

View file

@ -1,16 +1,5 @@
extends Panel
# Member variables here, example:
# var a=2
# var b="textvar"
func _ready():
# Initalization here
pass
func _on_goto_scene_pressed():
get_node("/root/global").goto_scene("res://scene_b.scn")
pass # Replace with function body

View file

@ -1,16 +1,5 @@
extends Panel
# Member variables here, example:
# var a=2
# var b="textvar"
func _ready():
# Initalization here
pass
func _on_goto_scene_pressed():
get_node("/root/global").goto_scene("res://scene_a.scn")
pass # Replace with function body

View file

@ -50,9 +50,9 @@ void Slider::_input_event(InputEvent p_event) {
grab.pos=orientation==VERTICAL?mb.y:mb.x;
double max = orientation==VERTICAL ? get_size().height : get_size().width ;
if (orientation==VERTICAL)
set_val( ( ( -(double)grab.pos / max) * ( get_max() - get_min() ) ) + get_max() );
set_unit_value( 1 - ((double)grab.pos / max) );
else
set_val( ( ( (double)grab.pos / max) * ( get_max() - get_min() ) ) + get_min() );
set_unit_value((double)grab.pos / max);
grab.active=true;
grab.uvalue=get_unit_value();
} else {

View file

@ -1721,6 +1721,7 @@ void Tree::text_editor_enter(String p_text) {
text_editor->hide();
value_editor->hide();
if (!popup_edited_item)
return;
@ -2167,18 +2168,9 @@ void Tree::_input_event(InputEvent p_event) {
range_drag_enabled=false;
Input::get_singleton()->set_mouse_mode(Input::MOUSE_MODE_VISIBLE);
warp_mouse(range_drag_capture_pos);
} else {
text_editor->set_pos(pressing_item_rect.pos);
text_editor->set_size(pressing_item_rect.size);
} else
edit_selected();
text_editor->clear();
text_editor->set_text( pressing_for_editor_text );
text_editor->select_all();
text_editor->show_modal();
text_editor->grab_focus();
}
pressing_for_editor=false;
}

View file

@ -1816,7 +1816,7 @@ void EditorNode::_run(bool p_current,const String& p_custom) {
}
play_button->set_pressed(false);
play_button->set_icon(gui_base->get_icon("Play","EditorIcons"));
play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons"));
//pause_button->set_pressed(false);
play_scene_button->set_pressed(false);
play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons"));
@ -2688,7 +2688,7 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
editor_run.stop();
play_button->set_pressed(false);
play_button->set_icon(gui_base->get_icon("Play","EditorIcons"));
play_button->set_icon(gui_base->get_icon("MainPlay","EditorIcons"));
play_scene_button->set_pressed(false);
play_scene_button->set_icon(gui_base->get_icon("PlayScene","EditorIcons"));
//pause_button->set_pressed(false);

View file

@ -570,8 +570,7 @@ void ScriptEditorDebugger::_notification(int p_what) {
ppeer->set_stream_peer(connection);
if (!always_visible)
show();
show();
dobreak->set_disabled(false);
tabs->set_current_tab(0);
@ -1460,7 +1459,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
add_child(msgdialog);
hide();
always_visible=false;
log_forced_visible=false;
p_editor->get_undo_redo()->set_method_notify_callback(_method_changeds,this);

View file

@ -81,7 +81,6 @@ class ScriptEditorDebugger : public Control {
TabContainer *tabs;
Label *reason;
bool always_visible;
bool log_forced_visible;
ScriptEditorDebuggerVariables *variables;

View file

@ -2283,6 +2283,8 @@ void NavigationMeshSpatialGizmo::redraw() {
}
}
if (faces.empty())
return;
Map<_EdgeKey,bool> edge_map;
DVector<Vector3> tmeshfaces;
@ -2330,7 +2332,7 @@ void NavigationMeshSpatialGizmo::redraw() {
}
}
Ref<TriangleMesh> tmesh = memnew( TriangleMesh);
Ref<TriangleMesh> tmesh = memnew( TriangleMesh );
tmesh->create(tmeshfaces);
if (lines.size())