Added Changing of textures for buttons. Change button events to be on release #311
|
@ -236,14 +236,14 @@ namespace SHADE
|
|||
|
||||
auto material = renderable->GetModifiableMaterial();
|
||||
if(!comp.isHovered && !comp.isClicked)
|
||||
if (SHAssetManager::GetType(comp.GetDefaultTexture()) == AssetType::TEXTURE)
|
||||
if (comp.GetDefaultTexture() != 0 && SHAssetManager::GetType(comp.GetDefaultTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetDefaultTexture());
|
||||
//SHLOG_INFO("SETTING DEFAULT TEXTURE")
|
||||
}
|
||||
else if (comp.isClicked)
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetClickedTexture()) == AssetType::TEXTURE)
|
||||
if (comp.GetClickedTexture() != 0 && SHAssetManager::GetType(comp.GetClickedTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetClickedTexture());
|
||||
//SHLOG_INFO("SETTING CLICKED TEXTURE")
|
||||
|
@ -251,7 +251,7 @@ namespace SHADE
|
|||
}
|
||||
else
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetHoveredTexture()) == AssetType::TEXTURE)
|
||||
if (comp.GetHoveredTexture() != 0 && SHAssetManager::GetType(comp.GetHoveredTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetHoveredTexture());
|
||||
//SHLOG_INFO("SETTING HOVERED TEXTURE")
|
||||
|
@ -357,7 +357,7 @@ namespace SHADE
|
|||
auto material = renderable->GetModifiableMaterial();
|
||||
if (comp.GetValue() == false)
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetDefaultTexture()) == AssetType::TEXTURE)
|
||||
if (comp.GetDefaultTexture()!= 0 && SHAssetManager::GetType(comp.GetDefaultTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetDefaultTexture());
|
||||
//SHLOG_INFO("SETTING DEFAULT TEXTURE")
|
||||
|
@ -365,7 +365,7 @@ namespace SHADE
|
|||
}
|
||||
else
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetToggledTexture()) == AssetType::TEXTURE)
|
||||
if (comp.GetToggledTexture() != 0 && SHAssetManager::GetType(comp.GetToggledTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetToggledTexture());
|
||||
//SHLOG_INFO("SETTING DEFAULT TEXTURE")
|
||||
|
|
Loading…
Reference in New Issue