summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/classes/AStar.xml4
-rw-r--r--doc/classes/AStar2D.xml4
-rw-r--r--doc/classes/ColorPicker.xml2
-rw-r--r--doc/classes/MainLoop.xml34
-rw-r--r--doc/classes/SceneTreeTimer.xml6
-rw-r--r--doc/classes/TextureProgress.xml2
-rw-r--r--drivers/unix/os_unix.cpp2
-rw-r--r--modules/gdscript/gdscript_functions.cpp44
-rw-r--r--scene/gui/texture_progress.cpp11
9 files changed, 59 insertions, 50 deletions
diff --git a/doc/classes/AStar.xml b/doc/classes/AStar.xml
index 9ca09371dd..e835af01e8 100644
--- a/doc/classes/AStar.xml
+++ b/doc/classes/AStar.xml
@@ -110,8 +110,10 @@
</return>
<argument index="0" name="to_position" type="Vector3">
</argument>
+ <argument index="1" name="include_disabled" type="bool" default="false">
+ </argument>
<description>
- Returns the ID of the closest point to [code]to_position[/code]. Returns -1 if there are no points in the points pool.
+ Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool.
</description>
</method>
<method name="get_closest_position_in_segment" qualifiers="const">
diff --git a/doc/classes/AStar2D.xml b/doc/classes/AStar2D.xml
index 0eff2bd560..3002e3c351 100644
--- a/doc/classes/AStar2D.xml
+++ b/doc/classes/AStar2D.xml
@@ -87,8 +87,10 @@
</return>
<argument index="0" name="to_position" type="Vector2">
</argument>
+ <argument index="1" name="include_disabled" type="bool" default="false">
+ </argument>
<description>
- Returns the ID of the closest point to [code]to_position[/code]. Returns -1 if there are no points in the points pool.
+ Returns the ID of the closest point to [code]to_position[/code], optionally taking disabled points into account. Returns -1 if there are no points in the points pool.
</description>
</method>
<method name="get_closest_position_in_segment" qualifiers="const">
diff --git a/doc/classes/ColorPicker.xml b/doc/classes/ColorPicker.xml
index b62eb443d9..cd36f4fdf0 100644
--- a/doc/classes/ColorPicker.xml
+++ b/doc/classes/ColorPicker.xml
@@ -97,6 +97,8 @@
</theme_item>
<theme_item name="margin" type="int" default="4">
</theme_item>
+ <theme_item name="overbright_indicator" type="Texture">
+ </theme_item>
<theme_item name="preset_bg" type="Texture">
</theme_item>
<theme_item name="screen_picker" type="Texture">
diff --git a/doc/classes/MainLoop.xml b/doc/classes/MainLoop.xml
index 23ce20a434..9e65da8eea 100644
--- a/doc/classes/MainLoop.xml
+++ b/doc/classes/MainLoop.xml
@@ -15,29 +15,29 @@
var quit = false
func _initialize():
- print("Initialized:")
- print(" Starting time: %s" % str(time_elapsed))
+ print("Initialized:")
+ print(" Starting time: %s" % str(time_elapsed))
func _idle(delta):
- time_elapsed += delta
- # Return true to end the main loop
- return quit
+ time_elapsed += delta
+ # Return true to end the main loop.
+ return quit
func _input_event(event):
- # Record keys
- if event is InputEventKey and event.pressed and !event.echo:
- keys_typed.append(OS.get_scancode_string(event.scancode))
- # Quit on Escape press
- if event.scancode == KEY_ESCAPE:
- quit = true
- # Quit on any mouse click
- if event is InputEventMouseButton:
- quit = true
+ # Record keys.
+ if event is InputEventKey and event.pressed and !event.echo:
+ keys_typed.append(OS.get_scancode_string(event.scancode))
+ # Quit on Escape press.
+ if event.scancode == KEY_ESCAPE:
+ quit = true
+ # Quit on any mouse click.
+ if event is InputEventMouseButton:
+ quit = true
func _finalize():
- print("Finalized:")
- print(" End time: %s" % str(time_elapsed))
- print(" Keys typed: %s" % var2str(keys_typed))
+ print("Finalized:")
+ print(" End time: %s" % str(time_elapsed))
+ print(" Keys typed: %s" % var2str(keys_typed))
[/codeblock]
</description>
<tutorials>
diff --git a/doc/classes/SceneTreeTimer.xml b/doc/classes/SceneTreeTimer.xml
index a33f875be2..5678833752 100644
--- a/doc/classes/SceneTreeTimer.xml
+++ b/doc/classes/SceneTreeTimer.xml
@@ -8,9 +8,9 @@
As opposed to [Timer], it does not require the instantiation of a node. Commonly used to create a one-shot delay timer as in the following example:
[codeblock]
func some_function():
- print("start")
- yield(get_tree().create_timer(1.0), "timeout")
- print("end")
+ print("Timer started.")
+ yield(get_tree().create_timer(1.0), "timeout")
+ print("Timer ended.")
[/codeblock]
</description>
<tutorials>
diff --git a/doc/classes/TextureProgress.xml b/doc/classes/TextureProgress.xml
index 21b294cf90..479ab865ba 100644
--- a/doc/classes/TextureProgress.xml
+++ b/doc/classes/TextureProgress.xml
@@ -34,7 +34,7 @@
</member>
<member name="mouse_filter" type="int" setter="set_mouse_filter" getter="get_mouse_filter" override="true" enum="Control.MouseFilter" default="1" />
<member name="nine_patch_stretch" type="bool" setter="set_nine_patch_stretch" getter="get_nine_patch_stretch" default="false">
- If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid.
+ If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid. When using a radial [member fill_mode], this setting will enable stretching.
</member>
<member name="radial_center_offset" type="Vector2" setter="set_radial_center_offset" getter="get_radial_center_offset" default="Vector2( 0, 0 )">
Offsets [member texture_progress] if [member fill_mode] is [constant FILL_CLOCKWISE] or [constant FILL_COUNTER_CLOCKWISE].
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index 80d7a2ccaa..b3d98a0648 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -187,7 +187,7 @@ uint64_t OS_Unix::get_system_time_secs() const {
uint64_t OS_Unix::get_system_time_msecs() const {
struct timeval tv_now;
gettimeofday(&tv_now, NULL);
- return uint64_t(tv_now.tv_sec * 1000 + tv_now.tv_usec / 1000);
+ return uint64_t(tv_now.tv_sec) * 1000 + uint64_t(tv_now.tv_usec) / 1000;
}
OS::Date OS_Unix::get_date(bool utc) const {
diff --git a/modules/gdscript/gdscript_functions.cpp b/modules/gdscript/gdscript_functions.cpp
index 97790e00bb..d9535d0f1f 100644
--- a/modules/gdscript/gdscript_functions.cpp
+++ b/modules/gdscript/gdscript_functions.cpp
@@ -572,37 +572,31 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
} break;
case OBJ_WEAKREF: {
VALIDATE_ARG_COUNT(1);
- if (p_args[0]->get_type() != Variant::OBJECT) {
-
+ if (p_args[0]->get_type() == Variant::OBJECT) {
+ if (p_args[0]->is_ref()) {
+ Ref<WeakRef> wref = memnew(WeakRef);
+ REF r = *p_args[0];
+ if (r.is_valid()) {
+ wref->set_ref(r);
+ }
+ r_ret = wref;
+ } else {
+ Ref<WeakRef> wref = memnew(WeakRef);
+ Object *obj = *p_args[0];
+ if (obj) {
+ wref->set_obj(obj);
+ }
+ r_ret = wref;
+ }
+ } else if (p_args[0]->get_type() == Variant::NIL) {
+ r_ret = memnew(WeakRef);
+ } else {
r_error.error = Variant::CallError::CALL_ERROR_INVALID_ARGUMENT;
r_error.argument = 0;
r_error.expected = Variant::OBJECT;
r_ret = Variant();
return;
}
-
- if (p_args[0]->is_ref()) {
-
- REF r = *p_args[0];
- if (!r.is_valid()) {
- r_ret = Variant();
- return;
- }
-
- Ref<WeakRef> wref = memnew(WeakRef);
- wref->set_ref(r);
- r_ret = wref;
- } else {
- Object *obj = *p_args[0];
- if (!obj) {
- r_ret = Variant();
- return;
- }
- Ref<WeakRef> wref = memnew(WeakRef);
- wref->set_obj(obj);
- r_ret = wref;
- }
-
} break;
case FUNC_FUNCREF: {
VALIDATE_ARG_COUNT(2);
diff --git a/scene/gui/texture_progress.cpp b/scene/gui/texture_progress.cpp
index c534df5cbe..9b60a9d1c3 100644
--- a/scene/gui/texture_progress.cpp
+++ b/scene/gui/texture_progress.cpp
@@ -344,6 +344,9 @@ void TextureProgress::_notification(int p_what) {
case FILL_CLOCKWISE:
case FILL_COUNTER_CLOCKWISE:
case FILL_CLOCKWISE_AND_COUNTER_CLOCKWISE: {
+ if (nine_patch_stretch)
+ s = get_size();
+
float val = get_as_ratio() * rad_max_degrees / 360;
if (val == 1) {
Rect2 region = Rect2(Point2(), s);
@@ -384,7 +387,13 @@ void TextureProgress::_notification(int p_what) {
draw_polygon(points, colors, uvs, progress);
}
if (Engine::get_singleton()->is_editor_hint()) {
- Point2 p = progress->get_size();
+ Point2 p;
+
+ if (nine_patch_stretch)
+ p = get_size();
+ else
+ p = progress->get_size();
+
p.x *= get_relative_center().x;
p.y *= get_relative_center().y;
p = p.floor();