Commit graph

139 commits

Author SHA1 Message Date
toger5 202e4c8836 also loop for classes if there is no coustom theme fixes #11250 2017-09-14 18:15:39 +02:00
Hein-Pieter van Braam 5e18967d77 Fix serveral recent new clang-format errors 2017-09-08 00:20:16 +02:00
Juan Linietsky 1eeda0f32f Restored auto snapping of controls to pixels, fixes #10847 and probably several more issues. Made it optional in the project settings but defaults to true. 2017-09-07 11:22:07 -03:00
Ignacio Etcheverry c16d00591b DocData and type hints fixes
- Makes vararg methods automatically use PROPERTY_USAGE_NIL_IS_VARIANT on return types
- Completely removes the ":type" suffix for method names. Virtual methods must use the MethodInfo constructors that takes Variant::Type or PropertyHint as the first parameter for the return type (with CLASS_INFO as a helper to get the PropertyInfo). Parameters must use PROPERTY_HINT_RESOURCE_TYPE and hint string.
- PROPERTY_USAGE_NIL_IS_VARIANT is no longer needed for parameters, because parameters cannot be void.
- Adds missing PROPERTY_USAGE_NIL_IS_VARIANT to virtual and built-in methods that return Variant.
2017-08-29 19:40:21 +02:00
Rémi Verschelde bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00
Hein-Pieter van Braam cacced7e50 Convert Object::cast_to() to the static version
Currently we rely on some undefined behavior when Object->cast_to() gets
called with a Null pointer. This used to work fine with GCC < 6 but
newer versions of GCC remove all codepaths in which the this pointer is
Null. However, the non-static cast_to() was supposed to be null safe.

This patch makes cast_to() Null safe and removes the now redundant Null
checks where they existed.

It is explained in this article: https://www.viva64.com/en/b/0226/
2017-08-24 23:08:24 +02:00
Wilson E. Alvarez baa94a3758 Removed unnecessary returns and break statements 2017-08-22 13:01:57 -04:00
Juan Linietsky 2cc8309249 Merge pull request #10351 from neikeq/enums-are-for-the-weak
ClassDB: Provide the enum name of integer constants
2017-08-21 19:56:08 -03:00
Ignacio Etcheverry 32dd9a9f66 ClassDB: Provide the enum name of integer constants 2017-08-20 22:07:43 +02:00
Juan Linietsky 541fdffc0a Merge pull request #10319 from neikeq/pr-engine-editor-hint
Adds Engine::is_editor_hint() method
2017-08-20 12:55:46 -03:00
Ignacio Etcheverry 90b8a5b71e Removes editor_hint from SceneTree 2017-08-19 01:29:45 +02:00
Juan Linietsky 1ecb48b8c2 Changed anchor constants to enum, removed ANCHOR_CENTER, fixes #9889 2017-08-15 19:49:28 -03:00
Gilles Roudiere 0041e08f74 Avoids inverted anchors
Add a push_opposite_anchor argument pushing the opposite anchor if
needed
2017-08-13 21:20:14 +02:00
Gilles Roudiere c26af6f2b7 Adds a function to set Anchors with a layout preset 2017-08-13 21:20:14 +02:00
Gilles Roudiere e76b535a1a Handle undo/redo of anchor positioning 2017-08-13 21:20:13 +02:00
Gilles Roudiere bd0384a9e9 Add anchor visualization 2017-08-13 21:20:13 +02:00
Gilles Roudiere 0d35d4d53b Replace GUI anchor type by a float between 0 and 1 2017-08-13 21:20:13 +02:00
Ignacio Etcheverry 2f290038d6 Removes type information from method binds 2017-08-10 07:17:50 +02:00
Ignacio Etcheverry 1e74f27f8f Adds missing type information to virtual method binds 2017-08-10 07:17:50 +02:00
Indah Sylvia 5ae78fdf6a Makes all Godot API's methods Lower Case 2017-08-07 18:24:35 +07:00
Geequlim 0b11062d93 Fix property type expose of Control.stretch_ratio.
Fix set integer value from inspector to round instead of floor.
2017-07-31 14:15:38 +08:00
Juan Linietsky 25678b1876 -Renamed GlobalConfig to ProjectSettings, makes more sense.
-Added system for feature overrides, it's pretty cool :)
2017-07-19 17:06:03 -03:00
Poommetee Ketson 49c7620326 Add object type hint for docs 2017-07-19 02:03:34 +07:00
Poommetee Ketson e2dd495ff2 Control: save SIZE_FILL size flag property 2017-07-13 13:50:15 +07:00
alexholly 3b5ac579a9 removed floor so that global pos works with scale 2017-07-08 21:04:04 +02:00
Juan Linietsky 7c679dd830 More fill modes for containers, closes #9504 2017-07-06 19:06:55 -03:00
Juan Linietsky bd9d98c172 Ability to set rotation and scaling pivot for controls. 2017-07-06 17:42:44 -03:00
Juan Linietsky fd9b4ba6e6 -Ability for controls to grow the left/top when anchored. This makes anchoring controls to the right/bottom easier when they are resized. 2017-07-06 13:30:24 -03:00
Juan Linietsky 42b2d52c88 Properly adjust the visible editor rect and make limits respected, closes #8328 2017-06-12 16:19:12 -03:00
alexholly a3c90b0293 renamed all Rect2.pos to Rect2.position 2017-06-04 02:09:17 +02:00
Kristupas Stumbrys 0251e9eb01 Fixing typo for rect_position in _change_notify call for Control 2017-05-28 16:38:22 +03:00
Juan Linietsky 5b3709d309 Removal of InputEvent as built-in Variant type..
this might cause bugs I haven't found yet..
2017-05-20 17:05:38 -03:00
Sergey Pusnei 8589ca3903 Rename [gs]et_pos to [gs]et_position for Controls
Control set_pos -> set_position
Control set_global_pos -> set_global_position
[gs]et_mouse_pos -> [gs]et_mouse_position
[gs]et_global_mouse_pos -> [gs]et_global_mouse_position
fixes #8005
2017-04-10 08:27:34 +02:00
Rémi Verschelde df61dc4b2b Add "Godot Engine contributors" copyright line 2017-04-08 00:11:42 +02:00
Andreas Haas 0a287cfe4c
Fix more property names in _change_notify calls. 2017-04-03 18:35:15 +02:00
Robert Hernandez 8078b5ecf6 Fixed Node2D/Control not updating properties 2017-04-01 20:13:52 -04:00
Rémi Verschelde debeee56f7 Fix typos in source code using codespell
From https://github.com/lucasdemarchi/codespell
2017-03-24 21:45:31 +01:00
Rémi Verschelde 3cf4103a89 Merge pull request #8023 from CrazyGuy108/master
List Control::has_point as a virtual method
2017-03-18 10:36:55 +01:00
CrazyGuy108 9589936d6e
List Control::has_point as a virtual method
According to Issue #8018, a BIND_VMETHOD macro wasn't present in scene/gui/control.cpp, while it was declared to be a virtual method in scene/gui/control.h.

classes.xml was updated to also list this method in Control.
2017-03-14 19:08:13 -07:00
Karroffel 6ab3213a55 fixed ClassDB inconsistencies
fixes #7960
2017-03-13 21:17:31 +01:00
Rémi Verschelde 5dbf1809c6 A Whole New World (clang-format edition)
I can show you the code
Pretty, with proper whitespace
Tell me, coder, now when did
You last write readable code?

I can open your eyes
Make you see your bad indent
Force you to respect the style
The core devs agreed upon

A whole new world
A new fantastic code format
A de facto standard
With some sugar
Enforced with clang-format

A whole new world
A dazzling style we all dreamed of
And when we read it through
It's crystal clear
That now we're in a whole new world of code
2017-03-05 16:44:50 +01:00
Rémi Verschelde 49c065d29c Refactoring: rename tools/editor/ to editor/
The other subfolders of tools/ had already been moved to either
editor/, misc/ or thirdparty/, so the hiding the editor code that
deep was no longer meaningful.
2017-03-05 14:21:25 +01:00
Thaer Razeq f50488a361 Various fixes detected using PVS-Studio static analyzer.
- Add FIXME tags comments to some unfixed potential bugs
- Remove some checks (always false: unsigned never < 0)
- Fix some if statements based on reviews.
- Bunch of missing `else` statements
2017-02-28 07:52:02 -06:00
Juan Linietsky de0045cf1b -renamed globals.h to global_config.cpp (this seems to have caused a few modified files)
-.pck and .zip exporting redone, seems to be working..
2017-02-21 00:06:30 -03:00
Hein-Pieter van Braam 411ee71b4d Rename the _MD macro to D_METHOD
This new name also makes its purpose a little clearer

This is a step towards fixing #56
2017-02-13 12:50:02 +01:00
Hein-Pieter van Braam 0f687f0ccb Remove use of _SCS from ADD_METHOD
This saves typing and is a step towards fixing #56
2017-02-13 10:37:47 +01:00
Rémi Verschelde f44ee891be Style: Fix statements ending with ';;' 2017-01-16 08:49:52 +01:00
Rémi Verschelde 93ab45b6b5 Style: Fix whole-line commented code
They do not play well with clang-format which aligns the `//` part
with the rest of the code block, thus producing badly indented commented code.
2017-01-14 14:52:23 +01:00
Juan Linietsky e53c247cb1 Created new Engine singleton, and moved engine related OS functions to it. 2017-01-13 12:51:14 -03:00
Juan Linietsky 04c749a1f0 New API for visibility in both CanvasItem and Spatial
visible (property) - access set_visible(bool) is_visible()
is_visible_in_tree() - true when visible and parents visible
show() hide() - for convenience
2017-01-13 10:45:50 -03:00