Godot Version
v4.2.1.stable.official [b09f793f5]
Question
The button has some options for toggle, but no way to look at the variable which uses that information, it would be great to have that as a property to mess around, tried to find the documento and whatever was written there did not help me at all.
I did get around using disable the button.
I am trying to get inputs on the button from left mouse click and right mouse click.
With the left it will use the internal way of how the button works, it is fine.
And using the right button have to use another signal which tests for event, up until here is all good.
The problem is how to controle the inputs on the button. You see disabling it would be the way to go but that is used internally to change the appearance of the button according to the textures set to it, the really big problem with this is that is reset to the first texture available in the list if the disable textures is not set. Either way it will chose a texture to present itself when disable, it will not maintain the current texture, which if it did then will not be hitting a wall here.
So need for example to right click the button and change an animated frame on topo of it but when I do that the button must be disable until I toggle that frame away.
The button would have just 2 textures, one for when it is no been pressed or toggle off, and the other one for been pressed or toggle on. But how the disable mess things out I need to provide a texture for disable, which is used when the button is toggle on, to create the effect to pressed it and keep pressed until something else happens, blocking the player the ability to keep toggling it on and off.
So when button is pressed it keeps that way, and to prevent the player to undo the press I disable it. without the texture for disable state it will reset the button to the unpressed state, now I am not sure if the internal state of the button is pressed or not when it is disable, which disabling it should not reset or change the current sate, because it does mess with the button and it has no way to feed back its internal state it is really hard to do some cool stuff. yes just because of this little detail.
Maybe I am having the wrong approach to the matter. And having hard time to figure how to do it.
using another signal for input detection solves the use of a diferente button to put some mark on the button. But trying to use disable on the button also will not detect this event of the right click.
this disable should be a button thing and not a node things.
The way the texturebutton is, it kind of gives the impression that the disable state is not a node state , so it should only work for the settings inputs available to it and not to the event of other inputs outside the button function.
Then I cannot really block the player input because doing so will change the texture to only one possible way which I don’t have much control of it, because I need it to be at the current texture which is on.
Either way, I was just trying to use the buttons feature trying to keep implementation at minimum. And that made me realize how some details about the texturebutton makes it somewhat limited depending on what you are trying to do.
I know to circle around this by creating a variable state to controle which click does what and when , but again, no feed back from the texture button to do this properly, couldn’t find any anyways.
All I need is a way to know in which state the button is, of course is about toggle.
In the documentation there is no property like toggle, to look at it, I am not trying to change the mode from toggle and press mode, I am trying to access the variable which tells me if the button is been pressed, it does not matter the mode, the variable which holds that information should be just one, used in both modes.
As the player could be holding down the click on a button so the state will evaluate as been pressed, which visually is what the button does. same thing works just fine visually for toggle mode. But where the hell is this variable?
also the variable in question if changed should change the visual accordingly. So some nice stuff could be done that way too from code.