Update UIAbstractCheckButton.cpp (#18858)

This factory method to create a checkbox instance was not working (UICheckBox.cpp:79):
CheckBox* CheckBox::create(const std::string& backGround,
                           const std::string& cross,
                           TextureResType texType)
Because the program tries to load missing textures. I just added some exit conditions to avoid it.
This commit is contained in:
Sylvain L. Kamdem 2018-08-06 04:46:19 +01:00 committed by leda
parent c8c5fc74f7
commit d41820b14b
1 changed files with 4 additions and 1 deletions

View File

@ -173,6 +173,7 @@ void AbstractCheckButton::loadTextureBackGroundSelected(const std::string& backG
{
_backGroundSelectedFileName = backGroundSelected;
_isBackgroundSelectedTextureLoaded = !backGroundSelected.empty();
if (!_isBackgroundSelectedTextureLoaded) return;
_backGroundSelectedTexType = texType;
switch (_backGroundSelectedTexType)
@ -236,6 +237,7 @@ void AbstractCheckButton::loadTextureBackGroundDisabled(const std::string& backG
{
_backGroundDisabledFileName = backGroundDisabled;
_isBackgroundDisabledTextureLoaded = !backGroundDisabled.empty();
if (!_isBackgroundDisabledTextureLoaded) return;
_backGroundDisabledTexType = texType;
switch (_backGroundDisabledTexType)
@ -269,6 +271,7 @@ void AbstractCheckButton::loadTextureFrontCrossDisabled(const std::string& front
{
_frontCrossDisabledFileName = frontCrossDisabled;
_isFrontCrossDisabledTextureLoaded = !frontCrossDisabled.empty();
if (!_isFrontCrossDisabledTextureLoaded) return;
_frontCrossDisabledTexType = texType;
switch (_frontCrossDisabledTexType)