More effective fixes. Still no issues.

Note: you will most likely end up recompiling the whole thing.
This commit is contained in:
Jason Felds
2011-03-19 20:40:35 -04:00
parent 22b7b34897
commit 12872f0a50
21 changed files with 214 additions and 60 deletions
+74 -25
View File
@@ -20,33 +20,60 @@ struct MenuRowDef
bool bThemeTitle;
bool bThemeItems;
MenuRowDef() {}
MenuRowDef( int r, RString n, MenuRowUpdateEnabled pe, EditMode s, bool bTT, bool bTI, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL, const char *c20=NULL, const char *c21=NULL, const char *c22=NULL, const char *c23=NULL, const char *c24=NULL, const char *c25=NULL )
MenuRowDef(): iRowCode(0), sName(""), bEnabled(false),
pfnEnabled(), emShowIn(), iDefaultChoice(0),
choices(), bThemeTitle(false), bThemeItems(false) {}
MenuRowDef( int r, RString n, MenuRowUpdateEnabled pe, EditMode s,
bool bTT, bool bTI, int d, const char *c0=NULL,
const char *c1=NULL, const char *c2=NULL,
const char *c3=NULL, const char *c4=NULL,
const char *c5=NULL, const char *c6=NULL,
const char *c7=NULL, const char *c8=NULL,
const char *c9=NULL, const char *c10=NULL,
const char *c11=NULL, const char *c12=NULL,
const char *c13=NULL, const char *c14=NULL,
const char *c15=NULL, const char *c16=NULL,
const char *c17=NULL, const char *c18=NULL,
const char *c19=NULL, const char *c20=NULL,
const char *c21=NULL, const char *c22=NULL,
const char *c23=NULL, const char *c24=NULL,
const char *c25=NULL ): iRowCode(r), sName(n),
bEnabled(true), pfnEnabled(pe), emShowIn(s),
iDefaultChoice(d), choices(),
bThemeTitle(bTT), bThemeItems(bTI)
{
iRowCode = r;
sName = n;
bEnabled = true;
pfnEnabled = pe;
emShowIn = s;
bThemeTitle = bTT;
bThemeItems = bTI;
iDefaultChoice = d;
#define PUSH( c ) if(c) choices.push_back(c);
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22);PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25);
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);
PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);
PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);
PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22);
PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25);
#undef PUSH
}
MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI, int d, const char *c0=NULL, const char *c1=NULL, const char *c2=NULL, const char *c3=NULL, const char *c4=NULL, const char *c5=NULL, const char *c6=NULL, const char *c7=NULL, const char *c8=NULL, const char *c9=NULL, const char *c10=NULL, const char *c11=NULL, const char *c12=NULL, const char *c13=NULL, const char *c14=NULL, const char *c15=NULL, const char *c16=NULL, const char *c17=NULL, const char *c18=NULL, const char *c19=NULL, const char *c20=NULL, const char *c21=NULL, const char *c22=NULL, const char *c23=NULL, const char *c24=NULL, const char *c25=NULL )
MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI,
int d, const char *c0=NULL, const char *c1=NULL,
const char *c2=NULL, const char *c3=NULL,
const char *c4=NULL, const char *c5=NULL,
const char *c6=NULL, const char *c7=NULL,
const char *c8=NULL, const char *c9=NULL,
const char *c10=NULL, const char *c11=NULL,
const char *c12=NULL, const char *c13=NULL,
const char *c14=NULL, const char *c15=NULL,
const char *c16=NULL, const char *c17=NULL,
const char *c18=NULL, const char *c19=NULL,
const char *c20=NULL, const char *c21=NULL,
const char *c22=NULL, const char *c23=NULL,
const char *c24=NULL, const char *c25=NULL ):
iRowCode(r), sName(n), bEnabled(e), pfnEnabled(NULL),
emShowIn(s), iDefaultChoice(d), choices(),
bThemeTitle(bTT), bThemeItems(bTI)
{
iRowCode = r;
sName = n;
bEnabled = e;
pfnEnabled = NULL;
emShowIn = s;
bThemeTitle = bTT;
bThemeItems = bTI;
iDefaultChoice = d;
#define PUSH( c ) if(c) choices.push_back(c);
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22);PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25);
PUSH(c0);PUSH(c1);PUSH(c2);PUSH(c3);PUSH(c4);PUSH(c5);
PUSH(c6);PUSH(c7);PUSH(c8);PUSH(c9);PUSH(c10);PUSH(c11);
PUSH(c12);PUSH(c13);PUSH(c14);PUSH(c15);PUSH(c16);PUSH(c17);
PUSH(c18);PUSH(c19);PUSH(c20);PUSH(c21);PUSH(c22);PUSH(c22);
PUSH(c23);PUSH(c23);PUSH(c24);PUSH(c25);
#undef PUSH
}
@@ -76,11 +103,29 @@ struct MenuDef
RString sClassName;
vector<MenuRowDef> rows;
MenuDef( RString c, MenuRowDef r0=MenuRowDef(), MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(), MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(), MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(), MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(), MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(), MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(), MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(), MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(), MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(), MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(), MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(), MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(), MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(), MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(), MenuRowDef r29=MenuRowDef() )
MenuDef( RString c, MenuRowDef r0=MenuRowDef(),
MenuRowDef r1=MenuRowDef(), MenuRowDef r2=MenuRowDef(),
MenuRowDef r3=MenuRowDef(), MenuRowDef r4=MenuRowDef(),
MenuRowDef r5=MenuRowDef(), MenuRowDef r6=MenuRowDef(),
MenuRowDef r7=MenuRowDef(), MenuRowDef r8=MenuRowDef(),
MenuRowDef r9=MenuRowDef(), MenuRowDef r10=MenuRowDef(),
MenuRowDef r11=MenuRowDef(), MenuRowDef r12=MenuRowDef(),
MenuRowDef r13=MenuRowDef(), MenuRowDef r14=MenuRowDef(),
MenuRowDef r15=MenuRowDef(), MenuRowDef r16=MenuRowDef(),
MenuRowDef r17=MenuRowDef(), MenuRowDef r18=MenuRowDef(),
MenuRowDef r19=MenuRowDef(), MenuRowDef r20=MenuRowDef(),
MenuRowDef r21=MenuRowDef(), MenuRowDef r22=MenuRowDef(),
MenuRowDef r23=MenuRowDef(), MenuRowDef r24=MenuRowDef(),
MenuRowDef r25=MenuRowDef(), MenuRowDef r26=MenuRowDef(),
MenuRowDef r27=MenuRowDef(), MenuRowDef r28=MenuRowDef(),
MenuRowDef r29=MenuRowDef() ): sClassName(c), rows()
{
sClassName = c;
#define PUSH( r ) if(!r.sName.empty()) rows.push_back(r);
PUSH(r0);PUSH(r1);PUSH(r2);PUSH(r3);PUSH(r4);PUSH(r5);PUSH(r6);PUSH(r7);PUSH(r8);PUSH(r9);PUSH(r10);PUSH(r11);PUSH(r12);PUSH(r13);PUSH(r14);PUSH(r15);PUSH(r16);PUSH(r17);PUSH(r18);PUSH(r19);PUSH(r20);PUSH(r21);PUSH(r22);PUSH(r23);PUSH(r24);PUSH(r25);PUSH(r26);PUSH(r27);PUSH(r28);PUSH(r29);
PUSH(r0);PUSH(r1);PUSH(r2);PUSH(r3);PUSH(r4);PUSH(r5);PUSH(r6);
PUSH(r7);PUSH(r8);PUSH(r9);PUSH(r10);PUSH(r11);PUSH(r12);
PUSH(r13);PUSH(r14);PUSH(r15);PUSH(r16);PUSH(r17);PUSH(r18);
PUSH(r19);PUSH(r20);PUSH(r21);PUSH(r22);PUSH(r23);PUSH(r24);
PUSH(r25);PUSH(r26);PUSH(r27);PUSH(r28);PUSH(r29);
#undef PUSH
}
};
@@ -89,7 +134,9 @@ struct MenuDef
class ScreenMiniMenu : public ScreenOptions
{
public:
static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK, ScreenMessage smSendOnCancel = SM_None, float fX = 0, float fY = 0 );
static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK,
ScreenMessage smSendOnCancel = SM_None,
float fX = 0, float fY = 0 );
void Init();
void BeginScreen();
@@ -110,6 +157,8 @@ protected:
vector<MenuRowDef> m_vMenuRows;
public:
ScreenMiniMenu(): m_SMSendOnOK(), m_SMSendOnCancel(), m_vMenuRows() {}
static bool s_bCancelled;
static int s_iLastRowCode;
static vector<int> s_viLastAnswers;