clean up and fixes
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
// Textos
|
// Textos
|
||||||
#define WINDOW_CAPTION "Coffee Crisis"
|
#define WINDOW_CAPTION "Coffee Crisis"
|
||||||
#define TEXT_COPYRIGHT "@2020,2021 JailDesigner (v2.0)"
|
#define TEXT_COPYRIGHT "@2020,2021 JailDesigner (v2.0.1)"
|
||||||
|
|
||||||
// Recursos
|
// Recursos
|
||||||
#define BINFILE_SCORE 0
|
#define BINFILE_SCORE 0
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include "/Library/Frameworks/SDL2.framework/Versions/A/Headers/SDL.h"
|
//#include "/Library/Frameworks/SDL2.framework/Versions/A/Headers/SDL.h"
|
||||||
|
#include <SDL2/SDL.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
|
|||||||
@@ -227,11 +227,21 @@ bool Menu::increaseSelectorIndex()
|
|||||||
mSelector.h = mSelector.originH = getSelectorHeight(mSelector.index);
|
mSelector.h = mSelector.originH = getSelectorHeight(mSelector.index);
|
||||||
|
|
||||||
// Calcula cual es el siguiente elemento
|
// Calcula cual es el siguiente elemento
|
||||||
if (mSelector.index < (mTotalItems - 1))
|
//if (mSelector.index < (mTotalItems - 1))
|
||||||
|
//{
|
||||||
|
// mSelector.index++;
|
||||||
|
// while ((!mItem[mSelector.index].selectable) && (mSelector.index < (mTotalItems - 1)))
|
||||||
|
// mSelector.index++;
|
||||||
|
// success = true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Calcula cual es el siguiente elemento (versión con loop)
|
||||||
|
//if (mSelector.index < (mTotalItems - 1))
|
||||||
{
|
{
|
||||||
mSelector.index++;
|
++mSelector.index %= mTotalItems;
|
||||||
while ((!mItem[mSelector.index].selectable) && (mSelector.index < (mTotalItems - 1)))
|
while (!mItem[mSelector.index].selectable)
|
||||||
mSelector.index++;
|
//mSelector.index++;
|
||||||
|
++mSelector.index %= mTotalItems;
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,11 +271,28 @@ bool Menu::decreaseSelectorIndex()
|
|||||||
mSelector.h = mSelector.originH = getSelectorHeight(mSelector.index);
|
mSelector.h = mSelector.originH = getSelectorHeight(mSelector.index);
|
||||||
|
|
||||||
// Calcula cual es el siguiente elemento
|
// Calcula cual es el siguiente elemento
|
||||||
if (mSelector.index > 0)
|
//if (mSelector.index > 0)
|
||||||
|
//{
|
||||||
|
// mSelector.index--;
|
||||||
|
// while ((!mItem[mSelector.index].selectable) && (mSelector.index > 0))
|
||||||
|
// mSelector.index--;
|
||||||
|
// success = true;
|
||||||
|
//}
|
||||||
|
|
||||||
|
// Calcula cual es el siguiente elemento (versión con loop)
|
||||||
|
//if (mSelector.index > 0)
|
||||||
{
|
{
|
||||||
mSelector.index--;
|
if (mSelector.index == 0)
|
||||||
while ((!mItem[mSelector.index].selectable) && (mSelector.index > 0))
|
mSelector.index = mTotalItems;
|
||||||
|
else
|
||||||
mSelector.index--;
|
mSelector.index--;
|
||||||
|
while (!mItem[mSelector.index].selectable)
|
||||||
|
{
|
||||||
|
if (mSelector.index == 0)
|
||||||
|
mSelector.index = mTotalItems;
|
||||||
|
else
|
||||||
|
mSelector.index--;
|
||||||
|
}
|
||||||
success = true;
|
success = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user