From 7acb419e21ab019b36f7e7345ea700e7476f3f1e Mon Sep 17 00:00:00 2001 From: Paul Date: Mon, 12 Feb 2001 16:06:24 +0000 Subject: [PATCH] --- data/translations/text.dat | 13 +++++++ source/frontend/start.cpp | 76 ++++++++++++++++++++++++++------------ source/frontend/start.h | 10 +++++ source/game/game.cpp | 4 ++ 4 files changed, 80 insertions(+), 23 deletions(-) diff --git a/data/translations/text.dat b/data/translations/text.dat index d586d2e9f..bdeb91cd8 100644 --- a/data/translations/text.dat +++ b/data/translations/text.dat @@ -157,3 +157,16 @@ eng=Set SQUEAKYBOOTS mode eng=Set NET mode [STR__DEBUG__CORALBLOWER_MODE] eng=Set CORALBLOWER mode + +[STR__DEBUG__LEVEL_SELECT] +eng=LEVEL SELECT +[STR__DEBUG__LEVEL_SELECT_START] +eng=START GAME +[STR__DEBUG__LEVEL_SELECT_00] +eng=00 +[STR__DEBUG__LEVEL_SELECT_01] +eng=01 +[STR__DEBUG__LEVEL_SELECT_02] +eng=02 +[STR__DEBUG__LEVEL_SELECT_03] +eng=03 diff --git a/source/frontend/start.cpp b/source/frontend/start.cpp index 94a4a34e4..1dd600215 100644 --- a/source/frontend/start.cpp +++ b/source/frontend/start.cpp @@ -34,7 +34,13 @@ #include "gfx\prim.h" #endif -#include "gfx\font.h" +#ifndef __GUI_GFACTORY_H__ +#include "gui\gfactory.h" +#endif + +#ifndef __GUI_GFRAME_H__ +#include "gui\gframe.h" +#endif /* Std Lib @@ -64,19 +70,45 @@ Vars ---- */ +int CFrontEndStart::s_levelValues[]= +{ + 0, + 1, + 2, + 3, +}; +CGUITextReadout::TextReadoutData CFrontEndStart::s_levelReadoutText[]= +{ + {0,STR__DEBUG__LEVEL_SELECT_00}, + {1,STR__DEBUG__LEVEL_SELECT_01}, + {2,STR__DEBUG__LEVEL_SELECT_02}, + {3,STR__DEBUG__LEVEL_SELECT_03}, +}; + +extern int s_globalLevelSelectThing; + + /*---------------------------------------------------------------------- Function: Purpose: Params: Returns: ---------------------------------------------------------------------- */ -FontBank *s_smallFont; void CFrontEndStart::init() { - s_smallFont=new ("Start SmallFont") FontBank(); - s_smallFont->initialise(&standardFont); - s_smallFont->setJustification(FontBank::JUST_CENTRE); - s_smallFont->setOt(5); + m_guiFrame=new ("optionsframe") CGUIControlFrame(); + m_guiFrame->init(NULL); + m_guiFrame->setObjectXYWH(50,40,412,100); + + CGUIFactory::createCycleButtonFrame(m_guiFrame, + 50,10,312,40, + STR__DEBUG__LEVEL_SELECT, + &m_level,s_levelValues,s_levelReadoutText); + + CGUIFactory::createValueButtonFrame(m_guiFrame, + 50,50,312,40, + STR__DEBUG__LEVEL_SELECT_START, + &m_startGame,true); } /*---------------------------------------------------------------------- @@ -87,7 +119,7 @@ void CFrontEndStart::init() ---------------------------------------------------------------------- */ void CFrontEndStart::shutdown() { - s_smallFont->dump(); delete s_smallFont; + m_guiFrame->shutdown(); } /*---------------------------------------------------------------------- @@ -98,10 +130,12 @@ void CFrontEndStart::shutdown() ---------------------------------------------------------------------- */ void CFrontEndStart::select() { + m_guiFrame->select(); m_shuttingDown=false; m_selectedSlot=NO_SLOT_SELECTED; m_escapeToTitles=false; CFader::setFadingIn(); + m_startGame=false; } /*---------------------------------------------------------------------- @@ -112,6 +146,7 @@ void CFrontEndStart::select() ---------------------------------------------------------------------- */ void CFrontEndStart::unselect() { + m_guiFrame->unselect(); } /*---------------------------------------------------------------------- @@ -132,10 +167,7 @@ void CFrontEndStart::render() setRGB3(g4,50, 0,50); AddPrimToList(g4,MAX_OT-1); - if(!CFader::isFading()) - { - s_smallFont->print(256,120,"Press START to enter game scene"); - } + m_guiFrame->render(); } /*---------------------------------------------------------------------- @@ -144,23 +176,21 @@ void CFrontEndStart::render() Params: Returns: ---------------------------------------------------------------------- */ -#ifndef __PAD_PADS_H__ -#include "pad\pads.h" -#endif void CFrontEndStart::think(int _frames) { + if(!CFader::isFading()) + { + m_guiFrame->think(_frames); + } + if(!m_shuttingDown) { -/////////// PKG - if(PadGetDown(0)&PAD_START&&!CFader::isFading()) -{ - m_selectedSlot=0; -} -/////////// PKG - if(m_selectedSlot!=NO_SLOT_SELECTED|| - m_escapeToTitles) - { + if(/*m_selectedSlot!=NO_SLOT_SELECTED|| + m_escapeToTitles||*/ + m_startGame) + { m_shuttingDown=true; + s_globalLevelSelectThing=m_level; CFader::setFadingOut(); } } diff --git a/source/frontend/start.h b/source/frontend/start.h index 9355a8755..a5f3cf2fb 100644 --- a/source/frontend/start.h +++ b/source/frontend/start.h @@ -22,6 +22,10 @@ #include "frontend\frontend.h" #endif +#ifndef __GUI_GREADOUT_H__ +#include "gui\greadout.h" +#endif + /* Std Lib ------- */ @@ -58,6 +62,12 @@ private: int m_escapeToTitles; int m_shuttingDown; + class CGUIControlFrame *m_guiFrame; + int m_level; + static int s_levelValues[]; + static CGUITextReadout::TextReadoutData s_levelReadoutText[]; + int m_startGame; + }; diff --git a/source/game/game.cpp b/source/game/game.cpp index 5a1908c8d..6ca079bd5 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -64,6 +64,10 @@ MATRIX CGameScene::CamMtx; /*****************************************************************************/ +int s_globalLevelSelectThing=0; + +/*****************************************************************************/ + CGameScene GameScene; /*****************************************************************************/