summaryrefslogtreecommitdiffstats
path: root/scene/gui/range.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use Core/Scene stringnames consistentlykobewi2024-05-131-1/+1
|
* Revert "Update Node::get_configuration_warnings signature"Rémi Verschelde2024-02-171-2/+2
| | | | This reverts commit d3852deaa450d77edb30df2bb1c77bd7bc45befc.
* Update Node::get_configuration_warnings signatureRedMser2024-02-081-2/+2
|
* Only allow finite numbers in Range.value.Jordyfel2023-08-281-0/+4
|
* Use NULL instead of COND checks when appropriateNinni Pipping2023-06-101-1/+1
| | | | Restricted to scene
* Merge pull request #70834 from pattlebass/spinbox-doesnt-spinRémi Verschelde2023-04-121-2/+21
|\ | | | | | | Fix `Range`-derived nodes not redrawing after `set_value_no_signal`
| * Fix Range-derived nodes not redrawingpattlebass2023-04-121-2/+21
| | | | | | | | | | | | When using set_value_no_signal(), Range-derived nodes wouldn't redraw. Also added a dedicated method to SpinBox to update its text.
* | One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
|/ | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Merge pull request #65101 from MrPhnix/range_value_bugRémi Verschelde2022-12-051-1/+1
|\ | | | | | | Bug: The range doesn't take into account the min value when setting the value.
| * incorrect range value with min value and stepPhnix2022-08-271-1/+1
| | | | | | | | | | | | If the minimum value and the steps are greater than 0, the value will not be calculated correctly. Co-Authored-By: Astral-Sheep <109028693+Astral-Sheep@users.noreply.github.com>
* | Merge pull request #67660 from Rindbee/improve-setter-for-RangeRémi Verschelde2022-12-011-12/+9
|\ \ | | | | | | | | | Improve validation when setting `max`/`min`/`page` in `Range`
| * | Improve validation when setting `max`/`min`/`page` in `Range`Rindbee2022-10-201-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | The incoming value is validated first and then compared. Previously, when the ScrollContainer was scrolled, the ScrollBar of the other axis of the ScrollContainer would emit the changed signal. This commit avoids that.
* | | Add set_value_no_signal() to Rangekobewi2022-10-311-2/+10
|/ /
* | Change return type of `get_configuration_warnings` to `PackedStringArray`Marc Gilleron2022-09-191-2/+2
| |
* | Rename `CanvasItem.update()` to `queue_redraw()`Micky2022-08-291-2/+2
|/ | | | | | | | | | Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on. Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency. Just a few comments have also been changed to say "redraw". In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
* Add some codes, returnes directly if the value is not changed.风青山2022-08-231-0/+20
| | | | Avoid executing the following value-changed logics if the value does not really change.
* Use range iterators for RBSet in most casesAaron Record2022-05-191-4/+4
|
* Replace most uses of Map by HashMapreduz2022-05-161-2/+2
| | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* String: Remove TTR and DTR defines in non-tools buildRémi Verschelde2022-03-281-1/+1
| | | | | This ensures we don't use TTR in runtime code, as it's specifically meant to source translations for the editor.
* Add GDExtension support to Scriptreduz2022-03-271-1/+1
| | | | | | | | | * Ability to create script languages from GDExtension * Some additions to gdnative_extension.h to make this happen * Moved the GDExtension binder to core This now allows creating scripting languages from GDExtension, with the same ease as if it was a module. It replaces the old PluginScript from Godot 3.x. Warning: GodotCPP will need to be updated to support this (it may be a bit of work as ScriptInstance needs to be created over there again).
* Discern between virtual and abstract class bindingsreduz2022-03-101-0/+5
| | | | | | | | | | | | | | * Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract". * Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions. * Converted a large amount of classes from "abstract" to "virtual" where it makes sense. Most classes that make sense have been converted. Missing: * Physics servers * VideoStream * Script* classes. which will go in a separate PR due to the complexity involved.
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix Range property dependencieskobewi2021-10-091-0/+14
|
* Optimize StringName usagereduz2021-07-181-2/+2
| | | | | | | | | | | * Added a new macro SNAME() that constructs and caches a local stringname. * Subsequent usages use the cached version. * Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time. * Replaced all theme usages by this new macro. * Replace all signal emission usages by this new macro. * Replace all call_deferred usages by this new macro. This is part of ongoing work to optimize GUI and the editor.
* Add PROPERTY_USAGE_NONE and use itAaron Franke2021-06-171-1/+1
|
* Use Array for node configuration warningsNathan Franke2021-04-111-10/+6
| | | | Previously, the warnings were passed as a string and delimitation of which were hard coded at each implementation.
* Removed _change_notifyreduz2021-02-101-2/+0
| | | | | | -For inspector refresh, the inspector now detects if a property change by polling a few times per second and then does update the control if so. This process is very cheap. -For property list refresh, a new signal (property_list_changed) was added to Object. _change_notify() is replaced by notify_property_list_changed() -Changed all objects using the old method to the signal, or just deleted the calls to _change_notify(<property>) since they are unnecesary now.
* Initialize class variables with default values in scene/ [2/2]Rafał Mikrut2021-02-091-10/+0
|
* Make Range return 1.0 ratio if minimum and maximum values are equalHugo Locurcio2021-01-151-1/+4
| | | | | | | | An error message is also no longer printed. This matches the behavior found in most UI frameworks where having equal minimum and maximum values is considered acceptable. This closes #43179.
* Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* Rename empty() to is_empty()Marcel Admiraal2020-12-281-1/+1
|
* Update all get_configuration_warning to retrieve warnings from the parentArrowInAKnee2020-05-161-1/+1
|
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-8/+16
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: Enforce separation line between function definitionsRémi Verschelde2020-05-141-0/+9
| | | | | | | | | | | | | | | | | | | | | | | I couldn't find a tool that enforces it, so I went the manual route: ``` find -name "thirdparty" -prune \ -o -name "*.cpp" -o -name "*.h" -o -name "*.m" -o -name "*.mm" \ -o -name "*.glsl" > files perl -0777 -pi -e 's/\n}\n([^#])/\n}\n\n\1/g' $(cat files) misc/scripts/fix_style.sh -c ``` This adds a newline after all `}` on the first column, unless they are followed by `#` (typically `#endif`). This leads to having lots of places with two lines between function/class definitions, but clang-format then fixes it as we enforce max one line of separation. This doesn't fix potential occurrences of function definitions which are indented (e.g. for a helper class defined in a .cpp), but it's better than nothing. Also can't be made to run easily on CI/hooks so we'll have to be careful with new code. Part of #33027.
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-34/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Replace NULL with nullptrlupoDharkael2020-04-021-1/+1
|
* Variant: Added 64-bit packed arrays, renamed Variant::REAL to FLOAT.Juan Linietsky2020-02-251-7/+7
| | | | | | | | | | | | | | | | | | | | | - Renames PackedIntArray to PackedInt32Array. - Renames PackedFloatArray to PackedFloat32Array. - Adds PackedInt64Array and PackedFloat64Array. - Renames Variant::REAL to Variant::FLOAT for consistency. Packed arrays are for storing large amount of data and creating stuff like meshes, buffers. textures, etc. Forcing them to be 64 is a huge waste of memory. That said, many users requested the ability to have 64 bits packed arrays for their games, so this is just an optional added type. For Variant, the float datatype is always 64 bits, and exposed as `float`. We still have `real_t` which is the datatype that can change from 32 to 64 bits depending on a compile flag (not entirely working right now, but that's the idea). It affects math related datatypes and code only. Neither Variant nor PackedArray make use of real_t, which is only intended for math precision, so the term is removed from there to keep only float.
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Range: Remove min/max check added in #33908Rémi Verschelde2019-11-261-4/+0
| | | | | | | | | | | | | | | | | | This wasn't a very good idea as it puts too strict requirements on how to set `min` and `max` values. For example, since the default min and max are 0 and 100, this triggers an error: ``` set_min(256) set_max(16384) ``` Since `min` will be higher than `max` temporarily. It can be worked around by setting max first, but it's not really intuitive. I'll relax the requirement as it's only a problem in `get_as_ratio`, which already has a check. Fix another min == max occurrence.
* Range: Fix cases where max was set to or below min valueRémi Verschelde2019-11-261-0/+2
| | | | | | | | It will now raise an error whenever this happens so that we can fix these situations. `max == min` is not allowed as it could lead to divisions by zero in ratios, and `max < min` doesn't make much sense. Fixes #33907.
* Fix some overflows and unitialized variablesRafał Mikrut2019-11-201-0/+2
|
* Memory leak and crash fixesRafał Mikrut2019-11-101-0/+1
|
* Fix Exponential Range Graphical ErrorEmmanuel Barroga2019-08-091-2/+2
| | | Fixes the Exponential Range Slider having a graphical error with less than 1 values.
* Improve the node configuration warning displayHugo Locurcio2019-07-091-2/+2
| | | | | | | - Refer to properties explicitly when possible - When multiple warnings are returned, always separate them by one blank line to make them easier to distinguish - Improve grammar and formatting
* Fix Range's "changed" signal emitting with a value even if binded to emit noneMichael Alexsander Silva Dias2019-06-161-1/+7
|
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Merge pull request #22381 from DualMatrix/range_exp_warningRémi Verschelde2018-09-281-0/+17
|\ | | | | Added warning when min_value of range <= 0 while exp_edit is true.
| * Added warning when min_value of range is smaller than 0 while exp_edit is true.DualMatrix2018-09-231-0/+17
| | | | | | | | | | | | Added warning when min_value of range is smaller than 0 while exp_edit is true. The new warning is: "If exp_edit is true min_value must be > 0."
* | Fixed step value not being respected for ranges in some cases.DualMatrix2018-09-241-2/+3
|/ | | | Fixed step value not being respected for ranges in some cases.
* Fix type of Range allow_greater/allow_lesser propertiesRémi Verschelde2018-08-161-2/+2
|