This commit is contained in:
parent
b02ddd5d0f
commit
fff2459f10
7 changed files with 125 additions and 105 deletions
|
@ -112,23 +112,19 @@ int h=40;
|
|||
|
||||
CGUITextReadout::TextReadoutData onOffTextReadouts[]=
|
||||
{
|
||||
{ 0, STR__ON, },
|
||||
{ 1, STR__OFF, },
|
||||
{ 0, 0, },
|
||||
{ false, STR__ON, },
|
||||
{ true, STR__OFF, },
|
||||
{ 0, 0, },
|
||||
};
|
||||
CGUISpriteReadout::SpriteReadoutData onOffSpriteReadouts[]=
|
||||
{
|
||||
{ 0, FRM__CROSS, },
|
||||
{ 1, FRM__TICK, },
|
||||
{ 0, 0, },
|
||||
{ false, FRM__CROSS, },
|
||||
{ true, FRM__TICK, },
|
||||
{ 0, 0, },
|
||||
};
|
||||
int onOffValues[]=
|
||||
{
|
||||
0,1,
|
||||
0,
|
||||
};
|
||||
int musicStatus=0;
|
||||
int sfxStatus=0;
|
||||
int musicStatus=false;
|
||||
int sfxStatus=false;
|
||||
int readyToExit=false;
|
||||
|
||||
|
||||
|
||||
|
@ -139,99 +135,59 @@ void CPaulScene::init()
|
|||
{
|
||||
CGUIGroupFrame *fr;
|
||||
CGUITextBox *tb;
|
||||
CGUIButton *bu;
|
||||
CGUIToggleButton *tg;
|
||||
CGUITextReadout *tr;
|
||||
CGUISpriteReadout *sr;
|
||||
|
||||
s_fontBank.initialise(&standardFont);
|
||||
|
||||
baseGUIObject=new ("Uber GUI object") CGUIControlFrame();
|
||||
baseGUIObject->init(NULL,1);
|
||||
baseGUIObject->init(NULL);
|
||||
baseGUIObject->setObjectXYWH(32,32,512-64,256-64);
|
||||
|
||||
fr=new ("frame") CGUIGroupFrame();
|
||||
fr->init(baseGUIObject,2);
|
||||
fr->init(baseGUIObject);
|
||||
fr->setObjectXYWH(10,10,448-20,30);
|
||||
tb=new ("textbox") CGUITextBox();
|
||||
tb->init(fr,20);
|
||||
tb->init(fr);
|
||||
tb->setObjectXYWH(0,0,300,30);
|
||||
tb->setText(STR__PAULS_TEST__MUSIC);
|
||||
bu=new ("button") CGUIButton();
|
||||
bu->init(fr,21);
|
||||
// bu->setObjectXYWH(0,0,0,0);
|
||||
bu->setButtonTarget(&musicStatus);
|
||||
bu->setButtonData(onOffValues);
|
||||
tg=new ("togglebutton") CGUIToggleButton();
|
||||
tg->init(fr);
|
||||
tg->setButtonTarget(&musicStatus);
|
||||
tr=new ("textreadout") CGUITextReadout();
|
||||
tr->init(fr,22);
|
||||
tr->init(fr);
|
||||
tr->setObjectXYWH(300,0,128,30);
|
||||
tr->setReadoutTarget(&musicStatus);
|
||||
tr->setReadoutData(onOffTextReadouts);
|
||||
|
||||
fr=new ("frame") CGUIGroupFrame();
|
||||
fr->init(baseGUIObject,3);
|
||||
fr->init(baseGUIObject);
|
||||
fr->setObjectXYWH(10,50,448-20,30);
|
||||
tb=new ("textbox") CGUITextBox();
|
||||
tb->init(fr,30);
|
||||
tb->init(fr);
|
||||
tb->setObjectXYWH(0,0,300,30);
|
||||
tb->setText(STR__PAULS_TEST__SFX);
|
||||
bu=new ("button") CGUIButton();
|
||||
bu->init(fr,31);
|
||||
// bu->setObjectXYWH(0,0,0,0);
|
||||
bu->setButtonTarget(&sfxStatus);
|
||||
bu->setButtonData(onOffValues);
|
||||
tg=new ("togglebutton") CGUIToggleButton();
|
||||
tg->init(fr);
|
||||
tg->setButtonTarget(&sfxStatus);
|
||||
sr=new ("spritereadout") CGUISpriteReadout();
|
||||
sr->init(fr,32);
|
||||
sr->init(fr);
|
||||
sr->setObjectXYWH(300,0,128,30);
|
||||
sr->setReadoutTarget(&sfxStatus);
|
||||
sr->setReadoutData(onOffSpriteReadouts);
|
||||
|
||||
|
||||
|
||||
fr=new ("frame") CGUIGroupFrame();
|
||||
fr->init(baseGUIObject,3);
|
||||
fr->setObjectXYWH(10,90,448-20,30);
|
||||
fr->init(baseGUIObject);
|
||||
fr->setObjectXYWH(10,155,448-20,30);
|
||||
tb=new ("textbox") CGUITextBox();
|
||||
tb->init(fr,30);
|
||||
tb->setObjectXYWH(0,0,300,30);
|
||||
tb->setText(STR__PAULS_TEST__SFX);
|
||||
bu=new ("button") CGUIButton();
|
||||
bu->init(fr,31);
|
||||
// bu->setObjectXYWH(0,0,0,0);
|
||||
bu->setButtonTarget(&sfxStatus);
|
||||
bu->setButtonData(onOffValues);
|
||||
sr=new ("spritereadout") CGUISpriteReadout();
|
||||
sr->init(fr,32);
|
||||
sr->setObjectXYWH(300,0,128,30);
|
||||
sr->setReadoutTarget(&sfxStatus);
|
||||
sr->setReadoutData(onOffSpriteReadouts);
|
||||
|
||||
tb->init(fr);
|
||||
tb->setObjectXYWH(0,0,428,30);
|
||||
tb->setText(STR__PAULS_TEST__EXIT);
|
||||
tg=new ("togglebutton") CGUIToggleButton();
|
||||
tg->init(fr);
|
||||
tg->setButtonTarget(&readyToExit);
|
||||
|
||||
|
||||
/*
|
||||
tb=new ("textbox") CGUITextBox();
|
||||
tb->init(baseGUIObject,1);
|
||||
tb->setObjectXYWH(10,10,400,25);
|
||||
tb->setText(STR__PAULS_TEST_STRING_1);
|
||||
|
||||
fr=new ("frame") CGUIGroupFrame();
|
||||
fr->init(baseGUIObject,2);
|
||||
fr->setObjectXYWH(10,40,400,25);
|
||||
tb=new ("textbox") CGUITextBox();
|
||||
tb->init(fr,20);
|
||||
tb->setObjectXYWH(50,1,300,22);
|
||||
tb->setText(STR__PAULS_TEST_STRING_1);
|
||||
bu=new ("button") CGUIButton();
|
||||
bu->init(fr,21);
|
||||
bu->setObjectXYWH(50,1,10,10);
|
||||
bu->setButtonTarget(&testValue);
|
||||
bu->setButtonData(testButtonData);
|
||||
|
||||
tr=new ("textreadout") CGUITextReadout();
|
||||
tr->init(baseGUIObject,3);
|
||||
tr->setObjectXYWH(10,70,400,25);
|
||||
tr->setReadoutTarget(&testValue);
|
||||
tr->setReadoutData(testReadoutData);
|
||||
*/
|
||||
// Heh.. this'll actually work =)
|
||||
// baseGUIObject->shutdown();
|
||||
|
||||
|
@ -275,8 +231,9 @@ void CPaulScene::render()
|
|||
y+=charHeight;
|
||||
}
|
||||
}
|
||||
|
||||
baseGUIObject->render();
|
||||
|
||||
if(baseGUIObject)
|
||||
baseGUIObject->render();
|
||||
}
|
||||
|
||||
|
||||
|
@ -288,14 +245,16 @@ void CPaulScene::render()
|
|||
---------------------------------------------------------------------- */
|
||||
void CPaulScene::think(int _frames)
|
||||
{
|
||||
/*
|
||||
CGUITextBox *tb;
|
||||
tb=(CGUITextBox *)guiGetItem(1);
|
||||
tb->setObjectWH(w,h);
|
||||
tb->setText(str);
|
||||
*/
|
||||
|
||||
baseGUIObject->think(_frames);
|
||||
if(readyToExit)
|
||||
{
|
||||
baseGUIObject->shutdown();
|
||||
delete baseGUIObject;
|
||||
baseGUIObject=NULL;
|
||||
readyToExit=0;
|
||||
}
|
||||
|
||||
if(baseGUIObject)
|
||||
baseGUIObject->think(_frames);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue