Add format property to SpinBox and deprecate prefix/suffix#103998
Add format property to SpinBox and deprecate prefix/suffix#103998KoBeWi wants to merge 1 commit intogodotengine:masterfrom
format property to SpinBox and deprecate prefix/suffix#103998Conversation
|
Updated the PR. I resolved the error and default format problems. I used godot.windows.editor.dev.x86_64_qc6Dnmuqgh.mp4I still have to replace usages of old prefix/suffix, but the implementation is ready for review. |
|
Should the old prefix and suffix be hidden from the inspector? |
|
I would be inclined to say yes, but part of me wonders what the user reception would be to see an entire property disappearing. I'm not sure how exactly it is handled right now, but perhaps they could be visible only if set previously? |
doc/classes/SpinBox.xml
Outdated
| </member> | ||
| <member name="prefix" type="String" setter="set_prefix" getter="get_prefix" default=""""> | ||
| <member name="format" type="String" setter="set_format" getter="get_format" default=""""> | ||
| Specifies formatting of the displayed numeric value, using the same rules as operator [code]%[/code] in [String]. Only applies when the value is not being currently edited. If empty, the value will use default display. Using [code]%s[/code] placeholder will display the value with default formatting. If the format is invalid, the [SpinBox] will show "ERROR", with the actual error message available in the configuration warning. |
There was a problem hiding this comment.
I swear to God [operator String.operator %] should be a valid reference based on what I have seen of the codebase, and yet it may not be for some reason.
|
Does this feature support displaying hexadecimal numbers as %0X? I really need this function. |
|
Yes a0yYZsVlFd.mp4Anything the String formatting supports. |
Closes godotengine/godot-proposals#4478 without breaking compatibility.
prefix/suffixis used normally ifformatis not specified.YM12EoZJbL.mp4