Decouple <vector>
This commit is contained in:
+52
-49
@@ -6,6 +6,9 @@
|
||||
#include "ScreenOptions.h"
|
||||
#include "GameConstantsAndTypes.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
|
||||
typedef bool (*MenuRowUpdateEnabled)();
|
||||
|
||||
struct MenuRowDef
|
||||
@@ -23,20 +26,20 @@ struct MenuRowDef
|
||||
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=nullptr,
|
||||
const char *c1=nullptr, const char *c2=nullptr,
|
||||
const char *c3=nullptr, const char *c4=nullptr,
|
||||
const char *c5=nullptr, const char *c6=nullptr,
|
||||
const char *c7=nullptr, const char *c8=nullptr,
|
||||
const char *c9=nullptr, const char *c10=nullptr,
|
||||
const char *c11=nullptr, const char *c12=nullptr,
|
||||
const char *c13=nullptr, const char *c14=nullptr,
|
||||
const char *c15=nullptr, const char *c16=nullptr,
|
||||
const char *c17=nullptr, const char *c18=nullptr,
|
||||
const char *c19=nullptr, const char *c20=nullptr,
|
||||
const char *c21=nullptr, const char *c22=nullptr,
|
||||
const char *c23=nullptr, const char *c24=nullptr,
|
||||
MenuRowDef( int r, RString n, MenuRowUpdateEnabled pe, EditMode s,
|
||||
bool bTT, bool bTI, int d, const char *c0=nullptr,
|
||||
const char *c1=nullptr, const char *c2=nullptr,
|
||||
const char *c3=nullptr, const char *c4=nullptr,
|
||||
const char *c5=nullptr, const char *c6=nullptr,
|
||||
const char *c7=nullptr, const char *c8=nullptr,
|
||||
const char *c9=nullptr, const char *c10=nullptr,
|
||||
const char *c11=nullptr, const char *c12=nullptr,
|
||||
const char *c13=nullptr, const char *c14=nullptr,
|
||||
const char *c15=nullptr, const char *c16=nullptr,
|
||||
const char *c17=nullptr, const char *c18=nullptr,
|
||||
const char *c19=nullptr, const char *c20=nullptr,
|
||||
const char *c21=nullptr, const char *c22=nullptr,
|
||||
const char *c23=nullptr, const char *c24=nullptr,
|
||||
const char *c25=nullptr ): iRowCode(r), sName(n),
|
||||
bEnabled(true), pfnEnabled(pe), emShowIn(s),
|
||||
iDefaultChoice(d), choices(),
|
||||
@@ -50,7 +53,7 @@ struct MenuRowDef
|
||||
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, std::vector<RString> options):
|
||||
iRowCode(r), sName(n), bEnabled(e), pfnEnabled(nullptr),
|
||||
@@ -62,20 +65,20 @@ struct MenuRowDef
|
||||
if (str != "") choices.push_back(str);
|
||||
}
|
||||
}
|
||||
|
||||
MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI,
|
||||
int d, const char *c0=nullptr, const char *c1=nullptr,
|
||||
const char *c2=nullptr, const char *c3=nullptr,
|
||||
const char *c4=nullptr, const char *c5=nullptr,
|
||||
const char *c6=nullptr, const char *c7=nullptr,
|
||||
const char *c8=nullptr, const char *c9=nullptr,
|
||||
const char *c10=nullptr, const char *c11=nullptr,
|
||||
const char *c12=nullptr, const char *c13=nullptr,
|
||||
const char *c14=nullptr, const char *c15=nullptr,
|
||||
const char *c16=nullptr, const char *c17=nullptr,
|
||||
const char *c18=nullptr, const char *c19=nullptr,
|
||||
const char *c20=nullptr, const char *c21=nullptr,
|
||||
const char *c22=nullptr, const char *c23=nullptr,
|
||||
|
||||
MenuRowDef( int r, RString n, bool e, EditMode s, bool bTT, bool bTI,
|
||||
int d, const char *c0=nullptr, const char *c1=nullptr,
|
||||
const char *c2=nullptr, const char *c3=nullptr,
|
||||
const char *c4=nullptr, const char *c5=nullptr,
|
||||
const char *c6=nullptr, const char *c7=nullptr,
|
||||
const char *c8=nullptr, const char *c9=nullptr,
|
||||
const char *c10=nullptr, const char *c11=nullptr,
|
||||
const char *c12=nullptr, const char *c13=nullptr,
|
||||
const char *c14=nullptr, const char *c15=nullptr,
|
||||
const char *c16=nullptr, const char *c17=nullptr,
|
||||
const char *c18=nullptr, const char *c19=nullptr,
|
||||
const char *c20=nullptr, const char *c21=nullptr,
|
||||
const char *c22=nullptr, const char *c23=nullptr,
|
||||
const char *c24=nullptr, const char *c25=nullptr ):
|
||||
iRowCode(r), sName(n), bEnabled(e), pfnEnabled(nullptr),
|
||||
emShowIn(s), iDefaultChoice(d), choices(),
|
||||
@@ -89,7 +92,7 @@ struct MenuRowDef
|
||||
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, int low, int high ):
|
||||
iRowCode(r), sName(n), bEnabled(e), pfnEnabled(nullptr),
|
||||
@@ -128,20 +131,20 @@ struct MenuDef
|
||||
RString sClassName;
|
||||
std::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(),
|
||||
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()
|
||||
{
|
||||
@@ -159,8 +162,8 @@ struct MenuDef
|
||||
class ScreenMiniMenu : public ScreenOptions
|
||||
{
|
||||
public:
|
||||
static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK,
|
||||
ScreenMessage smSendOnCancel = SM_None,
|
||||
static void MiniMenu( const MenuDef* pDef, ScreenMessage smSendOnOK,
|
||||
ScreenMessage smSendOnCancel = SM_None,
|
||||
float fX = 0, float fY = 0 );
|
||||
|
||||
void Init();
|
||||
@@ -183,7 +186,7 @@ protected:
|
||||
|
||||
public:
|
||||
ScreenMiniMenu(): m_SMSendOnOK(), m_SMSendOnCancel(), m_vMenuRows() {}
|
||||
|
||||
|
||||
static bool s_bCancelled;
|
||||
static int s_iLastRowCode;
|
||||
static std::vector<int> s_viLastAnswers;
|
||||
@@ -194,7 +197,7 @@ public:
|
||||
/*
|
||||
* (c) 2003-2004 Chris Danford
|
||||
* All rights reserved.
|
||||
*
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the
|
||||
* "Software"), to deal in the Software without restriction, including
|
||||
@@ -204,7 +207,7 @@ public:
|
||||
* copyright notice(s) and this permission notice appear in all copies of
|
||||
* the Software and that both the above copyright notice(s) and this
|
||||
* permission notice appear in supporting documentation.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
|
||||
|
||||
Reference in New Issue
Block a user