This commit is contained in:
Juan Linietsky 2016-01-25 10:30:47 -03:00
commit 5245adcf81
21 changed files with 182 additions and 81 deletions

View file

@ -1,5 +1,6 @@
EnsureSConsVersion(0,14); EnsureSConsVersion(0,14);
import string import string
import os import os
import os.path import os.path
@ -77,6 +78,9 @@ env_base.android_permission_chunk=""
env_base.android_appattributes_chunk="" env_base.android_appattributes_chunk=""
env_base.disabled_modules=[] env_base.disabled_modules=[]
env_base.split_drivers=False
env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository env_base.__class__.android_add_maven_repository=methods.android_add_maven_repository
env_base.__class__.android_add_dependency=methods.android_add_dependency env_base.__class__.android_add_dependency=methods.android_add_dependency
@ -90,6 +94,7 @@ env_base.__class__.android_add_to_attributes = methods.android_add_to_attributes
env_base.__class__.disable_module = methods.disable_module env_base.__class__.disable_module = methods.disable_module
env_base.__class__.add_source_files = methods.add_source_files env_base.__class__.add_source_files = methods.add_source_files
env_base.__class__.use_windows_spawn_fix = methods.use_windows_spawn_fix
env_base["x86_opt_gcc"]=False env_base["x86_opt_gcc"]=False
env_base["x86_opt_vc"]=False env_base["x86_opt_vc"]=False

View file

@ -1419,7 +1419,7 @@ Globals::Globals() {
set("application/name","" ); set("application/name","" );
set("application/main_scene",""); set("application/main_scene","");
custom_prop_info["application/main_scene"]=PropertyInfo(Variant::STRING,"application/main_scene",PROPERTY_HINT_FILE,"scn,res,xscn,xml"); custom_prop_info["application/main_scene"]=PropertyInfo(Variant::STRING,"application/main_scene",PROPERTY_HINT_FILE,"scn,res,xscn,xml,tscn");
set("application/disable_stdout",false); set("application/disable_stdout",false);
set("application/use_shared_user_dir",true); set("application/use_shared_user_dir",true);

View file

@ -243,7 +243,7 @@ int PacketPeerStream::get_max_packet_size() const {
void PacketPeerStream::set_stream_peer(const Ref<StreamPeer> &p_peer) { void PacketPeerStream::set_stream_peer(const Ref<StreamPeer> &p_peer) {
ERR_FAIL_COND(p_peer.is_null()); //ERR_FAIL_COND(p_peer.is_null());
if (p_peer.ptr() != peer.ptr()) { if (p_peer.ptr() != peer.ptr()) {
ring_buffer.advance_read(ring_buffer.data_left()); // reset the ring buffer ring_buffer.advance_read(ring_buffer.data_left()); // reset the ring buffer

View file

@ -76,7 +76,7 @@ public:
bool fullscreen; bool fullscreen;
bool resizable; bool resizable;
float get_aspect() const { return (float)width/(float)height; } float get_aspect() const { return (float)width/(float)height; }
VideoMode(int p_width=1280,int p_height=720,bool p_fullscreen=false, bool p_resizable = true) {width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; } VideoMode(int p_width=1024,int p_height=600,bool p_fullscreen=false, bool p_resizable = true) {width=p_width; height=p_height; fullscreen=p_fullscreen; resizable = p_resizable; }
}; };
protected: protected:
friend class Main; friend class Main;

View file

@ -13724,7 +13724,7 @@ returns:= "username=user&amp;password=pass"
<argument index="1" name="button" type="int"> <argument index="1" name="button" type="int">
</argument> </argument>
<description> <description>
Returns true if the joystick button at the given index is currently pressed. Returns false otherwise. (see JOY_* constans in [InputEvent]) Returns if the joystick button at the given index is currently pressed. (see JOY_* constans in [@Global Scope])
</description> </description>
</method> </method>
<method name="is_action_pressed"> <method name="is_action_pressed">
@ -13757,7 +13757,7 @@ returns:= "username=user&amp;password=pass"
<argument index="0" name="device" type="int"> <argument index="0" name="device" type="int">
</argument> </argument>
<description> <description>
Returns true if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in [InputEvent]. Unknown joysticks are not expected to match these constants, but you can still retrieve events from them. Returns if the specified device is known by the system. This means that it sets all button and axis indices exactly as defined in the JOY_* constants (see [@Global Scope]). Unknown joysticks are not expected to match these constants, but you can still retrieve events from them.
</description> </description>
</method> </method>
<method name="get_joy_axis"> <method name="get_joy_axis">
@ -13768,7 +13768,7 @@ returns:= "username=user&amp;password=pass"
<argument index="1" name="axis" type="int"> <argument index="1" name="axis" type="int">
</argument> </argument>
<description> <description>
Returns the current value of the joystick axis at given index (see JOY_* enum in [InputEvent]) Returns the current value of the joystick axis at given index (see JOY_* constants in [@Global Scope])
</description> </description>
</method> </method>
<method name="get_joy_name"> <method name="get_joy_name">
@ -13853,6 +13853,7 @@ returns:= "username=user&amp;password=pass"
<argument index="1" name="connected" type="bool"> <argument index="1" name="connected" type="bool">
</argument> </argument>
<description> <description>
Emitted when a joystick device has been connected or disconnected
</description> </description>
</signal> </signal>
</signals> </signals>

View file

@ -63,7 +63,7 @@ import string
if env['vsproj']=="yes": if env['vsproj']=="yes":
env.AddToVSProject(env.drivers_sources) env.AddToVSProject(env.drivers_sources)
if (False): #split drivers, this used to be needed for windows until separate builders for windows were created if (env.split_drivers): #split drivers, this used to be needed for windows until separate builders for windows were created
for f in env.drivers_sources: for f in env.drivers_sources:
fname = "" fname = ""

View file

@ -1310,6 +1310,49 @@ def android_add_to_attributes(self,file):
def disable_module(self): def disable_module(self):
self.disabled_modules.append(self.current_module) self.disabled_modules.append(self.current_module)
def use_windows_spawn_fix(self):
if (os.name!="nt"):
return #not needed, only for windows
self.split_drivers=True
import subprocess
def mySubProcess(cmdline,env):
#print "SPAWNED : " + cmdline
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env = env)
data, err = proc.communicate()
rv = proc.wait()
if rv:
print "====="
print err
print "====="
return rv
def mySpawn(sh, escape, cmd, args, env):
newargs = ' '.join(args[1:])
cmdline = cmd + " " + newargs
rv=0
if len(cmdline) > 32000 and cmd.endswith("ar") :
cmdline = cmd + " " + args[1] + " " + args[2] + " "
for i in range(3,len(args)) :
rv = mySubProcess( cmdline + args[i], env )
if rv :
break
else:
rv = mySubProcess( cmdline, env )
return rv
self['SPAWN'] = mySpawn
def save_active_platforms(apnames,ap): def save_active_platforms(apnames,ap):
for x in ap: for x in ap:

View file

@ -283,13 +283,23 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
return NULL; return NULL;
} }
tokenizer->advance(); tokenizer->advance();
if (tokenizer->get_token()!=GDTokenizer::TK_CONSTANT || tokenizer->get_token_constant().get_type()!=Variant::STRING) {
_set_error("Expected string constant as 'preload' argument."); String path;
bool valid = false;
Node *subexpr = _parse_and_reduce_expression(p_parent, p_static);
if (subexpr) {
if (subexpr->type == Node::TYPE_CONSTANT) {
ConstantNode *cn = static_cast<ConstantNode*>(subexpr);
if (cn->value.get_type() == Variant::STRING) {
valid = true;
path = (String) cn->value;
}
}
}
if (!valid) {
_set_error("expected string constant as 'preload' argument.");
return NULL; return NULL;
} }
String path = tokenizer->get_token_constant();
if (!path.is_abs_path() && base_path!="") if (!path.is_abs_path() && base_path!="")
path=base_path+"/"+path; path=base_path+"/"+path;
path = path.replace("///","//").simplify_path(); path = path.replace("///","//").simplify_path();
@ -322,8 +332,6 @@ GDParser::Node* GDParser::_parse_expression(Node *p_parent,bool p_static,bool p_
} }
} }
tokenizer->advance();
if (tokenizer->get_token()!=GDTokenizer::TK_PARENTHESIS_CLOSE) { if (tokenizer->get_token()!=GDTokenizer::TK_PARENTHESIS_CLOSE) {
_set_error("Expected ')' after 'preload' path"); _set_error("Expected ')' after 'preload' path");
return NULL; return NULL;

View file

@ -247,3 +247,5 @@ def configure(env):
env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) env.Append( BUILDERS = { 'GLSL120' : env.Builder(action = methods.build_legacygl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) env.Append( BUILDERS = { 'GLSL' : env.Builder(action = methods.build_glsl_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } ) env.Append( BUILDERS = { 'GLSL120GLES' : env.Builder(action = methods.build_gles2_headers, suffix = 'glsl.h',src_suffix = '.glsl') } )
env.use_windows_spawn_fix()

View file

@ -839,7 +839,7 @@ const char * OS_OSX::get_video_driver_name(int p_driver) const {
OS::VideoMode OS_OSX::get_default_video_mode() const { OS::VideoMode OS_OSX::get_default_video_mode() const {
VideoMode vm; VideoMode vm;
vm.width=800; vm.width=1024;
vm.height=600; vm.height=600;
vm.fullscreen=false; vm.fullscreen=false;
vm.resizable=true; vm.resizable=true;

View file

@ -267,41 +267,7 @@ def configure(env):
# Workaround for MinGW. See: # Workaround for MinGW. See:
# http://www.scons.org/wiki/LongCmdLinesOnWin32 # http://www.scons.org/wiki/LongCmdLinesOnWin32
if (os.name=="nt"): env.use_windows_spawn_fix()
import subprocess
def mySubProcess(cmdline,env):
#print "SPAWNED : " + cmdline
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
proc = subprocess.Popen(cmdline, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, startupinfo=startupinfo, shell = False, env = env)
data, err = proc.communicate()
rv = proc.wait()
if rv:
print "====="
print err
print "====="
return rv
def mySpawn(sh, escape, cmd, args, env):
newargs = ' '.join(args[1:])
cmdline = cmd + " " + newargs
rv=0
if len(cmdline) > 32000 and cmd.endswith("ar") :
cmdline = cmd + " " + args[1] + " " + args[2] + " "
for i in range(3,len(args)) :
rv = mySubProcess( cmdline + args[i], env )
if rv :
break
else:
rv = mySubProcess( cmdline, env )
return rv
env['SPAWN'] = mySpawn
#build using mingw #build using mingw
if (os.name=="nt"): if (os.name=="nt"):

View file

@ -149,7 +149,7 @@ const char * OS_Windows::get_video_driver_name(int p_driver) const {
OS::VideoMode OS_Windows::get_default_video_mode() const { OS::VideoMode OS_Windows::get_default_video_mode() const {
return VideoMode(1280,720,false); return VideoMode(1024,600,false);
} }
int OS_Windows::get_audio_driver_count() const { int OS_Windows::get_audio_driver_count() const {

View file

@ -78,7 +78,7 @@ const char * OS_X11::get_video_driver_name(int p_driver) const {
} }
OS::VideoMode OS_X11::get_default_video_mode() const { OS::VideoMode OS_X11::get_default_video_mode() const {
return OS::VideoMode(1280,720,false); return OS::VideoMode(1024,600,false);
} }
int OS_X11::get_audio_driver_count() const { int OS_X11::get_audio_driver_count() const {

View file

@ -85,8 +85,7 @@ Error ResourceInteractiveLoaderText::_parse_ext_resource(VariantParser::Stream*
r_res=ResourceLoader::load(path,type); r_res=ResourceLoader::load(path,type);
if (r_res.is_null()) { if (r_res.is_null()) {
r_err_str="Couldn't load external resource: "+path; WARN_PRINT(String("Couldn't load external resource: "+path).utf8().get_data());
return ERR_PARSE_ERROR;
} }
VariantParser::get_token(p_stream,token,line,r_err_str); VariantParser::get_token(p_stream,token,line,r_err_str);
@ -394,6 +393,13 @@ Error ResourceInteractiveLoaderText::poll() {
int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance); int node_id = packed_scene->get_state()->add_node(parent,owner,type,name,instance);
if (next_tag.fields.has("groups")) {
Array groups = next_tag.fields["groups"];
for (int i=0;i<groups.size();i++) {
packed_scene->get_state()->add_node_group(node_id,packed_scene->get_state()->add_name(groups[i]));
}
}
while(true) { while(true) {
@ -1374,9 +1380,10 @@ bool ResourceFormatSaverText::recognize(const RES& p_resource) const {
} }
void ResourceFormatSaverText::get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const { void ResourceFormatSaverText::get_recognized_extensions(const RES& p_resource,List<String> *p_extensions) const {
p_extensions->push_back("tres"); //text resource
if (p_resource->get_type()=="PackedScene") if (p_resource->get_type()=="PackedScene")
p_extensions->push_back("tscn"); //text scene p_extensions->push_back("tscn"); //text scene
else
p_extensions->push_back("tres"); //text resource
} }

View file

@ -4592,6 +4592,16 @@ ToolButton *EditorNode::add_bottom_panel_item(String p_text,Control *p_item) {
} }
bool EditorNode::are_bottom_panels_hidden() const {
for(int i=0;i<bottom_panel_items.size();i++) {
if (bottom_panel_items[i].button->is_pressed())
return false;
}
return true;
}
void EditorNode::hide_bottom_panel() { void EditorNode::hide_bottom_panel() {
_bottom_panel_switch(false,0); _bottom_panel_switch(false,0);

View file

@ -670,6 +670,7 @@ public:
ToolButton* add_bottom_panel_item(String p_text,Control *p_item); ToolButton* add_bottom_panel_item(String p_text,Control *p_item);
bool are_bottom_panels_hidden() const;
void make_bottom_panel_item_visible(Control *p_item); void make_bottom_panel_item_visible(Control *p_item);
void raise_bottom_panel_item(Control *p_item); void raise_bottom_panel_item(Control *p_item);
void hide_bottom_panel(); void hide_bottom_panel();

View file

@ -51,6 +51,8 @@ void GroupsEditor::_add_group(const String& p_group) {
undo_redo->add_undo_method(this,"update_tree"); undo_redo->add_undo_method(this,"update_tree");
undo_redo->commit_action(); undo_redo->commit_action();
group_name->clear();
} }
void GroupsEditor::_remove_group(Object *p_item, int p_column, int p_id) { void GroupsEditor::_remove_group(Object *p_item, int p_column, int p_id) {

View file

@ -603,6 +603,9 @@ bool CanvasItemEditor::_select(CanvasItem *item, Point2 p_click_pos, bool p_appe
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
continue; continue;
@ -643,6 +646,9 @@ void CanvasItemEditor::_key_move(const Vector2& p_dir, bool p_snap, KeyMoveMODE
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
continue; continue;
@ -702,6 +708,9 @@ Point2 CanvasItemEditor::_find_topleftmost_point() {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
@ -731,6 +740,9 @@ int CanvasItemEditor::get_item_count() {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
ic++; ic++;
}; };
@ -749,6 +761,8 @@ CanvasItem *CanvasItemEditor::get_single_item() {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
if (single_item) if (single_item)
return NULL; //morethan one return NULL; //morethan one
@ -1102,6 +1116,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
@ -1194,6 +1211,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
continue; continue;
@ -1400,6 +1420,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
continue; continue;
@ -1507,6 +1530,9 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->get()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
continue; continue;
@ -1881,6 +1907,8 @@ void CanvasItemEditor::_viewport_draw() {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item); CanvasItemEditorSelectedItem *se=editor_selection->get_node_editor_data<CanvasItemEditorSelectedItem>(canvas_item);
if (!se) if (!se)
continue; continue;
@ -2104,6 +2132,9 @@ void CanvasItemEditor::_notification(int p_what) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
if (canvas_item->cast_to<Control>()) if (canvas_item->cast_to<Control>())
has_control=true; has_control=true;
else else
@ -2509,6 +2540,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
canvas_item->set_meta("_edit_lock_",true); canvas_item->set_meta("_edit_lock_",true);
emit_signal("item_lock_status_changed"); emit_signal("item_lock_status_changed");
} }
@ -2524,6 +2558,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
canvas_item->set_meta("_edit_lock_",Variant()); canvas_item->set_meta("_edit_lock_",Variant());
emit_signal("item_lock_status_changed"); emit_signal("item_lock_status_changed");
@ -2542,6 +2579,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
canvas_item->set_meta("_edit_group_",true); canvas_item->set_meta("_edit_group_",true);
emit_signal("item_group_status_changed"); emit_signal("item_group_status_changed");
} }
@ -2557,6 +2597,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
canvas_item->set_meta("_edit_group_",Variant()); canvas_item->set_meta("_edit_group_",Variant());
emit_signal("item_group_status_changed"); emit_signal("item_group_status_changed");
} }
@ -2575,6 +2618,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
Control *c = canvas_item->cast_to<Control>(); Control *c = canvas_item->cast_to<Control>();
if (!c) if (!c)
@ -2693,6 +2739,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
if (canvas_item->cast_to<Node2D>()) { if (canvas_item->cast_to<Node2D>()) {
Node2D *n2d = canvas_item->cast_to<Node2D>(); Node2D *n2d = canvas_item->cast_to<Node2D>();
@ -2803,6 +2852,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
if (canvas_item->cast_to<Node2D>()) { if (canvas_item->cast_to<Node2D>()) {
@ -2853,6 +2904,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
if (canvas_item->cast_to<Node2D>()) { if (canvas_item->cast_to<Node2D>()) {
Node2D *n2d = canvas_item->cast_to<Node2D>(); Node2D *n2d = canvas_item->cast_to<Node2D>();
@ -2887,6 +2941,9 @@ void CanvasItemEditor::_popup_callback(int p_op) {
for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) { for(Map<Node*,Object*>::Element *E=selection.front();E;E=E->next()) {
CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>(); CanvasItem *canvas_item = E->key()->cast_to<CanvasItem>();
if (!canvas_item) continue; if (!canvas_item) continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
// counting invisible items, for now // counting invisible items, for now
//if (!canvas_item->is_visible()) continue; //if (!canvas_item->is_visible()) continue;
@ -2979,6 +3036,8 @@ void CanvasItemEditor::_popup_callback(int p_op) {
if (!canvas_item || !canvas_item->is_visible()) if (!canvas_item || !canvas_item->is_visible())
continue; continue;
if (canvas_item->get_viewport()!=EditorNode::get_singleton()->get_scene_root())
continue;
canvas_item->set_meta("_edit_ik_",true); canvas_item->set_meta("_edit_ik_",true);

View file

@ -533,6 +533,8 @@ void TileMapEditor::_canvas_draw() {
if (node->get_half_offset()!=TileMap::HALF_OFFSET_X) { if (node->get_half_offset()!=TileMap::HALF_OFFSET_X) {
int max_lines=2000; //avoid crash if size too smal
for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) { for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) {
Vector2 from = xform.xform(node->map_to_world(Vector2(i,si.pos.y))); Vector2 from = xform.xform(node->map_to_world(Vector2(i,si.pos.y)));
@ -540,10 +542,12 @@ void TileMapEditor::_canvas_draw() {
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1); canvas_item_editor->draw_line(from,to,col,1);
if (max_lines--==0)
break;
} }
} else { } else {
int max_lines=10000; //avoid crash if size too smal
for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) { for(int i=(si.pos.x)-1;i<=(si.pos.x+si.size.x);i++) {
@ -558,11 +562,17 @@ void TileMapEditor::_canvas_draw() {
Vector2 to = xform.xform(node->map_to_world(Vector2(i,j+1),true)+ofs); Vector2 to = xform.xform(node->map_to_world(Vector2(i,j+1),true)+ofs);
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1); canvas_item_editor->draw_line(from,to,col,1);
if (max_lines--==0)
break;
} }
} }
} }
int max_lines=10000; //avoid crash if size too smal
if (node->get_half_offset()!=TileMap::HALF_OFFSET_Y) { if (node->get_half_offset()!=TileMap::HALF_OFFSET_Y) {
for(int i=(si.pos.y)-1;i<=(si.pos.y+si.size.y);i++) { for(int i=(si.pos.y)-1;i<=(si.pos.y+si.size.y);i++) {
@ -573,6 +583,9 @@ void TileMapEditor::_canvas_draw() {
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1); canvas_item_editor->draw_line(from,to,col,1);
if (max_lines--==0)
break;
} }
} else { } else {
@ -590,6 +603,10 @@ void TileMapEditor::_canvas_draw() {
Vector2 to = xform.xform(node->map_to_world(Vector2(j+1,i),true)+ofs); Vector2 to = xform.xform(node->map_to_world(Vector2(j+1,i),true)+ofs);
Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2); Color col=i==0?Color(1,0.8,0.2,0.5):Color(1,0.3,0.1,0.2);
canvas_item_editor->draw_line(from,to,col,1); canvas_item_editor->draw_line(from,to,col,1);
if (max_lines--==0)
break;
} }
} }

View file

@ -360,8 +360,10 @@ void ScriptEditorDebugger::_parse_message(const String& p_msg,const Array& p_dat
if (EditorNode::get_log()->is_hidden()) { if (EditorNode::get_log()->is_hidden()) {
log_forced_visible=true; log_forced_visible=true;
if (EditorNode::get_singleton()->are_bottom_panels_hidden()) {
EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log()); EditorNode::get_singleton()->make_bottom_panel_item_visible(EditorNode::get_log());
} }
}
EditorNode::get_log()->add_message(t); EditorNode::get_log()->add_message(t);
} }
@ -538,9 +540,6 @@ void ScriptEditorDebugger::_notification(int p_what) {
forward->set_icon( get_icon("Forward","EditorIcons")); forward->set_icon( get_icon("Forward","EditorIcons"));
dobreak->set_icon( get_icon("Pause","EditorIcons")); dobreak->set_icon( get_icon("Pause","EditorIcons"));
docontinue->set_icon( get_icon("DebugContinue","EditorIcons")); docontinue->set_icon( get_icon("DebugContinue","EditorIcons"));
tb->set_normal_texture( get_icon("Close","EditorIcons"));
tb->set_hover_texture( get_icon("CloseHover","EditorIcons"));
tb->set_pressed_texture( get_icon("Close","EditorIcons"));
scene_tree_refresh->set_icon( get_icon("Reload","EditorIcons")); scene_tree_refresh->set_icon( get_icon("Reload","EditorIcons"));
le_set->connect("pressed",this,"_live_edit_set"); le_set->connect("pressed",this,"_live_edit_set");
le_clear->connect("pressed",this,"_live_edit_clear"); le_clear->connect("pressed",this,"_live_edit_clear");
@ -781,13 +780,6 @@ void ScriptEditorDebugger::_stack_dump_frame_selected() {
} }
void ScriptEditorDebugger::_hide_request() {
if (EditorNode::get_log()->is_visible())
EditorNode::get_singleton()->hide_bottom_panel();
emit_signal("show_debugger",false);
}
void ScriptEditorDebugger::_output_clear() { void ScriptEditorDebugger::_output_clear() {
//output->clear(); //output->clear();
@ -1188,7 +1180,6 @@ void ScriptEditorDebugger::_bind_methods() {
ObjectTypeDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break); ObjectTypeDB::bind_method(_MD("debug_break"),&ScriptEditorDebugger::debug_break);
ObjectTypeDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue); ObjectTypeDB::bind_method(_MD("debug_continue"),&ScriptEditorDebugger::debug_continue);
ObjectTypeDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear); ObjectTypeDB::bind_method(_MD("_output_clear"),&ScriptEditorDebugger::_output_clear);
ObjectTypeDB::bind_method(_MD("_hide_request"),&ScriptEditorDebugger::_hide_request);
ObjectTypeDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw); ObjectTypeDB::bind_method(_MD("_performance_draw"),&ScriptEditorDebugger::_performance_draw);
ObjectTypeDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select); ObjectTypeDB::bind_method(_MD("_performance_select"),&ScriptEditorDebugger::_performance_select);
ObjectTypeDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request); ObjectTypeDB::bind_method(_MD("_scene_tree_request"),&ScriptEditorDebugger::_scene_tree_request);
@ -1224,13 +1215,6 @@ ScriptEditorDebugger::ScriptEditorDebugger(EditorNode *p_editor){
tabs->set_area_as_parent_rect(); tabs->set_area_as_parent_rect();
add_child(tabs); add_child(tabs);
tb = memnew( TextureButton );
tb->connect("pressed",this,"_hide_request");
tb->set_anchor_and_margin(MARGIN_LEFT,ANCHOR_END,20);
tb->set_margin(MARGIN_TOP,2);
add_child(tb);
VBoxContainer *vbc = memnew( VBoxContainer ); VBoxContainer *vbc = memnew( VBoxContainer );
vbc->set_name("Debugger"); vbc->set_name("Debugger");

View file

@ -76,9 +76,6 @@ class ScriptEditorDebugger : public Control {
TextureButton *tb;
TabContainer *tabs; TabContainer *tabs;
LineEdit *reason; LineEdit *reason;
@ -129,7 +126,6 @@ class ScriptEditorDebugger : public Control {
void _performance_select(Object *, int, bool); void _performance_select(Object *, int, bool);
void _stack_dump_frame_selected(); void _stack_dump_frame_selected();
void _output_clear(); void _output_clear();
void _hide_request();
void _scene_tree_request(); void _scene_tree_request();
void _parse_message(const String& p_msg,const Array& p_data); void _parse_message(const String& p_msg,const Array& p_data);