Erwan
- fix issue 215 - added test for purple screen (this is the small white square on top of the loading screen)
This commit is contained in:
@@ -27,13 +27,12 @@ PIXEL_TYPE SimpleMenu::jewelGraphics[9] = {0x3FFFFFFF,0x63645AEA,0x610D0D98,
|
||||
0x610D0D98,0xFF110F67,0xFD030330};
|
||||
|
||||
|
||||
SimpleMenu::SimpleMenu(int id, JGuiListener* listener, JLBFont* font, int x, int y, const char * _title, int _maxItems): JGuiController(id, listener){
|
||||
SimpleMenu::SimpleMenu(int id, JGuiListener* listener, int fontId, int x, int y, const char * _title, int _maxItems): JGuiController(id, listener), fontId(fontId){
|
||||
autoTranslate = true;
|
||||
mHeight = 2 * VMARGIN;
|
||||
mWidth = 0;
|
||||
mX = x;
|
||||
mY = y;
|
||||
mFont = font;
|
||||
title = _(_title);
|
||||
startId = 0;
|
||||
maxItems = _maxItems;
|
||||
@@ -52,11 +51,6 @@ SimpleMenu::SimpleMenu(int id, JGuiListener* listener, JLBFont* font, int x, int
|
||||
if (NULL == spadeR) spadeR = resources.RetrieveQuad("spade_ur.png", 2, 1, 16, 13, "spade_ur", RETRIEVE_MANAGE);
|
||||
if (NULL == jewel) jewel = NEW JQuad(jewelTex, 1, 1, 3, 3);
|
||||
if (NULL == side) side = resources.RetrieveQuad("menuside.png", 1, 1, 1, 7,"menuside", RETRIEVE_MANAGE);
|
||||
|
||||
if (NULL == titleFont) {
|
||||
resources.LoadJLBFont("smallface", 7);
|
||||
titleFont = resources.GetJLBFont("smallface");
|
||||
}
|
||||
|
||||
if (NULL == stars) {
|
||||
JQuad * starQuad = resources.GetQuad("stars");
|
||||
@@ -94,6 +88,8 @@ void SimpleMenu::drawVertPole(int x, int y, int height) {
|
||||
}
|
||||
|
||||
void SimpleMenu::Render() {
|
||||
JLBFont * titleFont = resources.GetJLBFont("smallface");
|
||||
JLBFont * mFont = resources.GetJLBFont(fontId);
|
||||
if (0 == mWidth) {
|
||||
float sY = mY + VMARGIN;
|
||||
for (int i = startId; i < startId + mCount; ++i) {
|
||||
@@ -167,7 +163,7 @@ void SimpleMenu::Update(float dt){
|
||||
}
|
||||
|
||||
void SimpleMenu::Add(int id, const char * text,string desc, bool forceFocus){
|
||||
SimpleMenuItem * smi = NEW SimpleMenuItem(this, id, mFont, text, 0, mY + VMARGIN + mCount*LINE_HEIGHT, (mCount == 0),autoTranslate);
|
||||
SimpleMenuItem * smi = NEW SimpleMenuItem(this, id, fontId, text, 0, mY + VMARGIN + mCount*LINE_HEIGHT, (mCount == 0),autoTranslate);
|
||||
smi->desc = desc;
|
||||
JGuiController::Add(smi);
|
||||
if (mCount <= maxItems) mHeight += LINE_HEIGHT;
|
||||
|
||||
Reference in New Issue
Block a user