Jeck - Some basic options handling rewrites, main menu update, example alternate theme (for testing). I'm closing issues 44 and 45, as hopefully this resolves them satisfactorily.

* The alternate theme is just useful for testing themes, but please comment on the changes to the main theme.
 * Options reading and initializing separated from UI.
 * Options UI abstracted a bit, made more easily extensible.
 * With some extension, the options UI could be used as the basis for more complicated themes, if we load a file and use it to do stuff like GameStateOptions::Start()
This commit is contained in:
wagic.jeck
2009-10-20 03:46:18 +00:00
parent af41e28180
commit 7f7320f904
25 changed files with 1482 additions and 1137 deletions

View File

@@ -7,7 +7,7 @@ MenuItem::MenuItem(int id, JLBFont *font, string text, int x, int y, JQuad * _of
{
mText = _(text);
updatedSinceLastRender = 1;
mParticleSys = NEW hgeParticleSystem(particle, particleTex);
mParticleSys = NEW hgeParticleSystem(resources.RetrievePSI(particle, particleTex));
mParticleSys->MoveTo(mX, mY);
mHasFocus = hasFocus;
@@ -27,14 +27,27 @@ void MenuItem::Render()
{
JRenderer * renderer = JRenderer::GetInstance();
if (mHasFocus)
{
PIXEL_TYPE start = ARGB(46,255,255,200);
if(mParticleSys)
start = mParticleSys->info.colColorStart.GetHWColor();
PIXEL_TYPE colors[] =
{
ARGB(0,0,0,0),
start,
ARGB(0,0,0,0),
start,
};
renderer->FillRect(255,0,SCREEN_WIDTH-155,SCREEN_HEIGHT,colors);
// set additive blending
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE);
mParticleSys->Render();
// set normal blending
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
mFont->SetColor(options[Metrics::MAINMENU_TC].asColor());
mFont->SetColor(ARGB(255,255,255,255));
onQuad->SetColor(ARGB(70,255,255,255));
renderer->RenderQuad(onQuad, SCREEN_WIDTH , SCREEN_HEIGHT/2 , 0,8,8);
onQuad->SetColor(ARGB(255,255,255,255));