Fixed button click state not resetting bug #398
|
@ -5193,6 +5193,7 @@
|
|||
Default Texture: 63979907
|
||||
Hovered Texture: 51379325
|
||||
Clicked Texture: 66788278
|
||||
current texture: 0
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 458
|
||||
|
@ -5226,6 +5227,7 @@
|
|||
Default Texture: 61602036
|
||||
Hovered Texture: 58910810
|
||||
Clicked Texture: 57786063
|
||||
current texture: 0
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 458
|
||||
|
@ -5259,6 +5261,7 @@
|
|||
Default Texture: 64806384
|
||||
Hovered Texture: 58347825
|
||||
Clicked Texture: 63234380
|
||||
current texture: 0
|
||||
IsActive: true
|
||||
UI Component:
|
||||
Canvas ID: 458
|
||||
|
|
|
@ -119,7 +119,7 @@ namespace SHADE_Scripting.UI
|
|||
return;
|
||||
if (tweening == true && thread != null)
|
||||
{
|
||||
Debug.Log("Tweening value " + thread.GetValue());
|
||||
|
||||
transform.LocalScale = defaultScale * thread.GetValue();
|
||||
currentScale = thread.GetValue();
|
||||
if (thread.IsCompleted())
|
||||
|
|
|
@ -58,6 +58,7 @@ RTTR_REGISTRATION
|
|||
.property("Default Texture", &SHButtonComponent::GetDefaultTexture, &SHButtonComponent::SetDefaultTexture)
|
||||
.property("Hovered Texture", &SHButtonComponent::GetHoveredTexture, &SHButtonComponent::SetHoveredTexture)
|
||||
.property("Clicked Texture", &SHButtonComponent::GetClickedTexture, &SHButtonComponent::SetClickedTexture)
|
||||
.property("current texture", &SHButtonComponent::currentTexture)
|
||||
;
|
||||
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace SHADE
|
|||
void SetHoveredTexture(AssetID texture) noexcept;
|
||||
void SetClickedTexture(AssetID texture) noexcept;
|
||||
|
||||
|
||||
AssetID currentTexture;
|
||||
|
||||
friend class SHUISystem;
|
||||
private:
|
||||
|
@ -35,7 +35,7 @@ namespace SHADE
|
|||
AssetID hoveredTexture;
|
||||
AssetID clickedTexture;
|
||||
|
||||
AssetID currentTexture;
|
||||
|
||||
|
||||
|
||||
RTTR_ENABLE()
|
||||
|
|
|
@ -263,6 +263,11 @@ namespace SHADE
|
|||
|
||||
return true;
|
||||
}
|
||||
//In case the UI was clicked but the mouse is not held down and the key up frame was missed because of active state.
|
||||
if (comp.isClicked && !SHInputManager::GetKey(SHInputManager::SH_KEYCODE::LMB))
|
||||
{
|
||||
comp.isClicked = false;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
|
@ -318,7 +323,7 @@ namespace SHADE
|
|||
//SHLOG_INFO("SETTING HOVERED TEXTURE")
|
||||
}
|
||||
}
|
||||
if (textureID != 0 && textureID != comp.currentTexture)
|
||||
if (textureID != 0)
|
||||
{
|
||||
auto material = renderable->GetModifiableMaterial();
|
||||
comp.currentTexture = textureID;
|
||||
|
|
Loading…
Reference in New Issue