Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
fbda0cc4
Commit
fbda0cc4
authored
Aug 25, 2017
by
Scayze
Committed by
Rémi Verschelde
Aug 30, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AutoUse Pencil on Polygon creation
parent
98ad0e5a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
0 deletions
+18
-0
collision_polygon_2d_editor_plugin.cpp
editor/plugins/collision_polygon_2d_editor_plugin.cpp
+4
-0
collision_polygon_editor_plugin.cpp
editor/plugins/collision_polygon_editor_plugin.cpp
+4
-0
navigation_polygon_editor_plugin.cpp
editor/plugins/navigation_polygon_editor_plugin.cpp
+6
-0
polygon_2d_editor_plugin.cpp
editor/plugins/polygon_2d_editor_plugin.cpp
+4
-0
No files found.
editor/plugins/collision_polygon_2d_editor_plugin.cpp
View file @
fbda0cc4
...
...
@@ -344,6 +344,10 @@ void CollisionPolygon2DEditor::edit(Node *p_collision_polygon) {
if
(
p_collision_polygon
)
{
node
=
Object
::
cast_to
<
CollisionPolygon2D
>
(
p_collision_polygon
);
//Enable the pencil tool if the polygon is empty
if
(
node
->
get_polygon
().
size
()
==
0
)
{
_menu_option
(
MODE_CREATE
);
}
if
(
!
canvas_item_editor
->
get_viewport_control
()
->
is_connected
(
"draw"
,
this
,
"_canvas_draw"
))
canvas_item_editor
->
get_viewport_control
()
->
connect
(
"draw"
,
this
,
"_canvas_draw"
);
wip
.
clear
();
...
...
editor/plugins/collision_polygon_editor_plugin.cpp
View file @
fbda0cc4
...
...
@@ -468,6 +468,10 @@ void CollisionPolygonEditor::edit(Node *p_collision_polygon) {
if
(
p_collision_polygon
)
{
node
=
Object
::
cast_to
<
CollisionPolygon
>
(
p_collision_polygon
);
//Enable the pencil tool if the polygon is empty
if
(
node
->
get_polygon
().
size
()
==
0
)
{
_menu_option
(
MODE_CREATE
);
}
wip
.
clear
();
wip_active
=
false
;
edited_point
=
-
1
;
...
...
editor/plugins/navigation_polygon_editor_plugin.cpp
View file @
fbda0cc4
...
...
@@ -69,6 +69,7 @@ void NavigationPolygonEditor::_create_nav() {
undo_redo
->
add_do_method
(
node
,
"set_navigation_polygon"
,
Ref
<
NavigationPolygon
>
(
memnew
(
NavigationPolygon
)));
undo_redo
->
add_undo_method
(
node
,
"set_navigation_polygon"
,
Variant
(
REF
()));
undo_redo
->
commit_action
();
_menu_option
(
MODE_CREATE
);
}
void
NavigationPolygonEditor
::
_menu_option
(
int
p_option
)
{
...
...
@@ -423,6 +424,11 @@ void NavigationPolygonEditor::edit(Node *p_collision_polygon) {
if
(
p_collision_polygon
)
{
node
=
Object
::
cast_to
<
NavigationPolygonInstance
>
(
p_collision_polygon
);
//Enable the pencil tool if the polygon is empty
if
(
!
node
->
get_navigation_polygon
().
is_null
())
{
if
(
node
->
get_navigation_polygon
()
->
get_polygon_count
()
==
0
)
_menu_option
(
MODE_CREATE
);
}
if
(
!
canvas_item_editor
->
get_viewport_control
()
->
is_connected
(
"draw"
,
this
,
"_canvas_draw"
))
canvas_item_editor
->
get_viewport_control
()
->
connect
(
"draw"
,
this
,
"_canvas_draw"
);
wip
.
clear
();
...
...
editor/plugins/polygon_2d_editor_plugin.cpp
View file @
fbda0cc4
...
...
@@ -720,6 +720,10 @@ void Polygon2DEditor::edit(Node *p_collision_polygon) {
if
(
p_collision_polygon
)
{
node
=
Object
::
cast_to
<
Polygon2D
>
(
p_collision_polygon
);
//Enable the pencil tool if the polygon is empty
if
(
node
->
get_polygon
().
size
()
==
0
)
{
_menu_option
(
MODE_CREATE
);
}
if
(
!
canvas_item_editor
->
get_viewport_control
()
->
is_connected
(
"draw"
,
this
,
"_canvas_draw"
))
canvas_item_editor
->
get_viewport_control
()
->
connect
(
"draw"
,
this
,
"_canvas_draw"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment