summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/doc/doc_data.cpp2
-rw-r--r--tools/docdump/makehtml.py19
-rw-r--r--tools/editor/editor_help.cpp3
-rw-r--r--tools/editor/editor_node.cpp4
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp4
-rw-r--r--tools/editor/plugins/canvas_item_editor_plugin.cpp4
-rw-r--r--tools/editor/plugins/collision_shape_2d_editor_plugin.cpp9
-rw-r--r--tools/editor/plugins/spatial_editor_plugin.cpp102
-rw-r--r--tools/editor/scenes_dock.cpp2
-rw-r--r--tools/editor/spatial_editor_gizmos.cpp2
-rw-r--r--tools/pe_bliss/utils.cpp44
11 files changed, 97 insertions, 98 deletions
diff --git a/tools/doc/doc_data.cpp b/tools/doc/doc_data.cpp
index 432f358627..c1d3e5e314 100644
--- a/tools/doc/doc_data.cpp
+++ b/tools/doc/doc_data.cpp
@@ -189,9 +189,11 @@ void DocData::generate(bool p_basic_types) {
arginfo=E->get().return_val;
if (arginfo.type==Variant::NIL)
continue;
+#ifdef DEBUG_METHODS_ENABLED
if (m && m->get_return_type()!=StringName())
method.return_type=m->get_return_type();
else
+#endif
method.return_type=(arginfo.hint==PROPERTY_HINT_RESOURCE_TYPE)?arginfo.hint_string:Variant::get_type_name(arginfo.type);
} else {
diff --git a/tools/docdump/makehtml.py b/tools/docdump/makehtml.py
index d533ca1b8b..9b9c62f33b 100644
--- a/tools/docdump/makehtml.py
+++ b/tools/docdump/makehtml.py
@@ -1,5 +1,19 @@
import sys
import xml.etree.ElementTree as ET
+from xml.sax.saxutils import escape, unescape
+
+html_escape_table = {
+ '"': """,
+ "'": "'"
+}
+
+html_unescape_table = {v:k for k, v in html_escape_table.items()}
+
+def html_escape(text):
+ return escape(text, html_escape_table)
+
+def html_unescape(text):
+ return unescape(text, html_unescape_table)
input_list = []
@@ -96,7 +110,7 @@ def make_html_class_list(class_list,columns):
idx=0
for n in class_list:
- col = idx/col_max
+ col = int(idx/col_max)
if (col>=columns):
col=columns-1
fit_columns[col]+=[n]
@@ -299,6 +313,7 @@ def make_type(p_type,p_parent):
def make_text_def(class_name,parent,text):
+ text = html_escape(text)
pos=0
while(True):
pos = text.find("[",pos)
@@ -598,7 +613,6 @@ def make_html_class(node):
descr=node.find("description")
if (descr!=None and descr.text.strip()!=""):
-
h4=ET.SubElement(div,"h4")
h4.text="Description:"
@@ -644,7 +658,6 @@ def make_html_class(node):
class_names=[]
classes={}
-
for file in input_list:
tree = ET.parse(file)
doc=tree.getroot()
diff --git a/tools/editor/editor_help.cpp b/tools/editor/editor_help.cpp
index 1bc09c5102..321ac76240 100644
--- a/tools/editor/editor_help.cpp
+++ b/tools/editor/editor_help.cpp
@@ -1428,7 +1428,8 @@ EditorHelp::EditorHelp() {
{
Panel *pc = memnew( Panel );
Ref<StyleBoxFlat> style( memnew( StyleBoxFlat ) );
- style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") );
+ style->set_bg_color( EditorSettings::get_singleton()->get("text_editor/background_color") );
+ pc->set_v_size_flags(SIZE_EXPAND_FILL);
pc->add_style_override("panel", style); //get_stylebox("normal","TextEdit"));
vbc->add_child(pc);
class_desc = memnew( RichTextLabel );
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index b8b2a5262c..7d837f3211 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -3822,9 +3822,7 @@ void EditorNode::_quick_run(const String& p_resource) {
void EditorNode::notify_child_process_exited() {
- play_button->set_pressed(false);
- play_scene_button->set_pressed(false);
- //pause_button->set_pressed(false);
+ _menu_option_confirm(RUN_STOP,false);
stop_button->set_pressed(false);
editor_run.stop();
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index 99dcf4ed28..ca44df269b 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -1814,8 +1814,8 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh>
for(int i=0;i<portal_points.size()-1;i++) {
- float a = portal_points[i].atan2();
- float b = portal_points[i+1].atan2();
+ float a = portal_points[i].angle();
+ float b = portal_points[i+1].angle();
if (a>b) {
SWAP( portal_points[i], portal_points[i+1] );
diff --git a/tools/editor/plugins/canvas_item_editor_plugin.cpp b/tools/editor/plugins/canvas_item_editor_plugin.cpp
index 90bfe0bfdf..e3f4edf967 100644
--- a/tools/editor/plugins/canvas_item_editor_plugin.cpp
+++ b/tools/editor/plugins/canvas_item_editor_plugin.cpp
@@ -999,7 +999,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
if (b.button_index==BUTTON_RIGHT) {
- if (!b.pressed && tool==TOOL_SELECT && b.mod.alt) {
+ if (b.pressed && tool==TOOL_SELECT && b.mod.alt) {
Point2 click=Point2(b.x,b.y);
@@ -1488,7 +1488,7 @@ void CanvasItemEditor::_viewport_input_event(const InputEvent& p_event) {
Matrix32 rot;
rot.elements[1] = (dfrom - center).normalized();
rot.elements[0] = rot.elements[1].tangent();
- node->set_rot(snap_angle(rot.xform_inv(dto-center).atan2(), node->get_rot()));
+ node->set_rot(snap_angle(rot.xform_inv(dto-center).angle(), node->get_rot()));
display_rotate_to = dto;
display_rotate_from = center;
viewport->update();
diff --git a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp
index f56b9a2fd9..7e5d52d17d 100644
--- a/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -42,6 +42,13 @@ Variant CollisionShape2DEditor::get_handle_value(int idx) const {
} break;
case LINE_SHAPE: {
+ Ref<LineShape2D> line = node->get_shape();
+
+ if (idx==0) {
+ return line->get_d();
+ } else {
+ return line->get_normal();
+ }
} break;
@@ -121,7 +128,7 @@ void CollisionShape2DEditor::set_handle(int idx, Point2& p_point) {
if (idx==0){
line->set_d(p_point.length());
}else{
- line->set_normal(p_point/30.0);
+ line->set_normal(p_point.normalized());
}
canvas_item_editor->get_viewport_control()->update();
diff --git a/tools/editor/plugins/spatial_editor_plugin.cpp b/tools/editor/plugins/spatial_editor_plugin.cpp
index e2202214dd..7816efe89f 100644
--- a/tools/editor/plugins/spatial_editor_plugin.cpp
+++ b/tools/editor/plugins/spatial_editor_plugin.cpp
@@ -862,6 +862,57 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
//VisualServer::get_singleton()->instance_set_transform(cursor_instance,Transform(Matrix3(),cursor.cursor_pos));
}
}
+
+ if (b.mod.alt) {
+
+ if (nav_scheme == NAVIGATION_MAYA)
+ break;
+
+ _find_items_at_pos(Vector2( b.x, b.y ),clicked_includes_current,selection_results,b.mod.shift);
+
+ clicked_wants_append=b.mod.shift;
+
+ if (selection_results.size() == 1) {
+
+ clicked=selection_results[0].item->get_instance_ID();
+ selection_results.clear();
+
+ if (clicked) {
+ _select_clicked(clicked_wants_append,true);
+ clicked=0;
+ }
+
+ } else if (!selection_results.empty()) {
+
+ NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
+ StringName root_name = root_path.get_name(root_path.get_name_count()-1);
+
+ for (int i = 0; i < selection_results.size(); i++) {
+
+ Spatial *spat=selection_results[i].item;
+
+ Ref<Texture> icon;
+ if (spat->has_meta("_editor_icon"))
+ icon=spat->get_meta("_editor_icon");
+ else
+ icon=get_icon( has_icon(spat->get_type(),"EditorIcons")?spat->get_type():String("Object"),"EditorIcons");
+
+ String node_path="/"+root_name+"/"+root_path.rel_path_to(spat->get_path());
+
+ selection_menu->add_item(spat->get_name());
+ selection_menu->set_item_icon(i, icon );
+ selection_menu->set_item_metadata(i, node_path);
+ selection_menu->set_item_tooltip(i,String(spat->get_name())+
+ "\nType: "+spat->get_type()+"\nPath: "+node_path);
+ }
+
+ selection_menu->set_global_pos(Vector2( b.global_x, b.global_y ));
+ selection_menu->popup();
+ selection_menu->call_deferred("grab_click_focus");
+
+ break;
+ }
+ }
}
if (_edit.mode!=TRANSFORM_NONE && b.pressed) {
@@ -888,57 +939,6 @@ void SpatialEditorViewport::_sinput(const InputEvent &p_event) {
//VisualServer::get_singleton()->poly_clear(indicators);
set_message("Transform Aborted.",3);
}
-
- if (!b.pressed && (spatial_editor->get_tool_mode()==SpatialEditor::TOOL_MODE_SELECT && b.mod.alt)) {
-
- if (nav_scheme == NAVIGATION_MAYA)
- break;
-
- _find_items_at_pos(Vector2( b.x, b.y ),clicked_includes_current,selection_results,b.mod.shift);
-
- clicked_wants_append=b.mod.shift;
-
- if (selection_results.size() == 1) {
-
- clicked=selection_results[0].item->get_instance_ID();
- selection_results.clear();
-
- if (clicked) {
- _select_clicked(clicked_wants_append,true);
- clicked=0;
- }
-
- } else if (!selection_results.empty()) {
-
- NodePath root_path = get_tree()->get_edited_scene_root()->get_path();
- StringName root_name = root_path.get_name(root_path.get_name_count()-1);
-
- for (int i = 0; i < selection_results.size(); i++) {
-
- Spatial *spat=selection_results[i].item;
-
- Ref<Texture> icon;
- if (spat->has_meta("_editor_icon"))
- icon=spat->get_meta("_editor_icon");
- else
- icon=get_icon( has_icon(spat->get_type(),"EditorIcons")?spat->get_type():String("Object"),"EditorIcons");
-
- String node_path="/"+root_name+"/"+root_path.rel_path_to(spat->get_path());
-
- selection_menu->add_item(spat->get_name());
- selection_menu->set_item_icon(i, icon );
- selection_menu->set_item_metadata(i, node_path);
- selection_menu->set_item_tooltip(i,String(spat->get_name())+
- "\nType: "+spat->get_type()+"\nPath: "+node_path);
- }
-
- selection_menu->set_global_pos(Vector2( b.global_x, b.global_y ));
- selection_menu->popup();
- selection_menu->call_deferred("grab_click_focus");
-
- break;
- }
- }
} break;
case BUTTON_MIDDLE: {
diff --git a/tools/editor/scenes_dock.cpp b/tools/editor/scenes_dock.cpp
index dfd729354d..c9b376ebec 100644
--- a/tools/editor/scenes_dock.cpp
+++ b/tools/editor/scenes_dock.cpp
@@ -155,7 +155,7 @@ void ScenesDock::_notification(int p_what) {
if (initialized)
return;
- initialized=false;
+ initialized=true;
EditorFileSystem::get_singleton()->connect("filesystem_changed",this,"_fs_changed");
diff --git a/tools/editor/spatial_editor_gizmos.cpp b/tools/editor/spatial_editor_gizmos.cpp
index 4dc9c4f43e..5efca44c7d 100644
--- a/tools/editor/spatial_editor_gizmos.cpp
+++ b/tools/editor/spatial_editor_gizmos.cpp
@@ -745,7 +745,7 @@ static float _find_closest_angle_to_half_pi_arc(const Vector3& p_from, const Vec
}
//min_p = p_arc_xform.affine_inverse().xform(min_p);
- float a = Vector2(min_p.x,-min_p.z).atan2();
+ float a = Vector2(min_p.x,-min_p.z).angle();
return a*180.0/Math_PI;
}
diff --git a/tools/pe_bliss/utils.cpp b/tools/pe_bliss/utils.cpp
index 00a20ef6f2..e6a75d5497 100644
--- a/tools/pe_bliss/utils.cpp
+++ b/tools/pe_bliss/utils.cpp
@@ -23,9 +23,6 @@
#include "utils.h"
#include "pe_exception.h"
-#ifndef PE_BLISS_WINDOWS
-#include <iconv.h>
-#endif
namespace pe_bliss
{
@@ -50,22 +47,13 @@ const u16string pe_utils::to_ucs2(const std::wstring& str)
if(str.empty())
return ret;
- ret.resize(str.length());
-
- iconv_t conv = iconv_open("UCS-2", "WCHAR_T");
- if(conv == reinterpret_cast<iconv_t>(-1))
- throw pe_exception("Error opening iconv", pe_exception::encoding_convertion_error);
-
- size_t inbytesleft = str.length() * sizeof(wchar_t);
- size_t outbytesleft = ret.length() * sizeof(unicode16_t);
- const wchar_t* in_pos = str.c_str();
- unicode16_t* out_pos = &ret[0];
-
- size_t result = iconv(conv, const_cast<char**>(reinterpret_cast<const char**>(&in_pos)), &inbytesleft, reinterpret_cast<char**>(&out_pos), &outbytesleft);
- iconv_close(conv);
+ int len = str.length();
- if(result == static_cast<size_t>(-1))
- throw pe_exception("Iconv error", pe_exception::encoding_convertion_error);
+ ret.resize(len);
+
+ for(int i=0;i<len;i++) {
+ ret[i]=str[i]&0xFFFF;
+ }
return ret;
}
@@ -76,22 +64,12 @@ const std::wstring pe_utils::from_ucs2(const u16string& str)
if(str.empty())
return ret;
+ int len = str.length();
ret.resize(str.length());
-
- iconv_t conv = iconv_open("WCHAR_T", "UCS-2");
- if(conv == reinterpret_cast<iconv_t>(-1))
- throw pe_exception("Error opening iconv", pe_exception::encoding_convertion_error);
-
- size_t inbytesleft = str.length() * sizeof(unicode16_t);
- size_t outbytesleft = ret.length() * sizeof(wchar_t);
- const unicode16_t* in_pos = str.c_str();
- wchar_t* out_pos = &ret[0];
-
- size_t result = iconv(conv, const_cast<char**>(reinterpret_cast<const char**>(&in_pos)), &inbytesleft, reinterpret_cast<char**>(&out_pos), &outbytesleft);
- iconv_close(conv);
-
- if(result == static_cast<size_t>(-1))
- throw pe_exception("Iconv error", pe_exception::encoding_convertion_error);
+
+ for(int i=0;i<len;i++) {
+ ret[i]=str[i];
+ }
return ret;
}