From 48b75b058101b995e27f4dedc3c01dac1ff13ec0 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Wed, 31 Aug 2005 02:14:59 +0000 Subject: [PATCH] run a command to set color (etc) instead of hardcoded effects --- stepmania/src/CourseEntryDisplay.cpp | 13 ++++++++++--- stepmania/src/DifficultyMeter.cpp | 17 +++++++++-------- stepmania/src/DifficultyMeter.h | 1 - 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/stepmania/src/CourseEntryDisplay.cpp b/stepmania/src/CourseEntryDisplay.cpp index 0dc04b3f0a..1fcbae356b 100644 --- a/stepmania/src/CourseEntryDisplay.cpp +++ b/stepmania/src/CourseEntryDisplay.cpp @@ -12,6 +12,7 @@ #include "GameState.h" #include "Style.h" #include "ActorUtil.h" +#include "LuaBinding.h" REGISTER_ACTOR_CLASS( CourseEntryDisplay ) @@ -81,12 +82,18 @@ void CourseEntryDisplay::SetDifficulty( PlayerNumber pn, const CString &text, Di if( !SEPARATE_COURSE_METERS && pn != GAMESTATE->m_MasterPlayerNumber ) return; - RageColor c = SONGMAN->GetDifficultyColor( dc ); + Lua *L = LUA->Get(); + LuaHelpers::Push( dc, L ); + m_textDifficultyNumber[pn].m_pLuaInstance->Set( L, "Difficulty" ); + LuaHelpers::Push( dc, L ); + m_textFoot[pn].m_pLuaInstance->Set( L, "Difficulty" ); + LUA->Release(L); + m_textDifficultyNumber[pn].SetText( text ); - m_textDifficultyNumber[pn].SetDiffuse( c ); + m_textDifficultyNumber[pn].PlayCommand( "DifficultyChanged" ); m_textFoot[pn].SetText( "1" ); - m_textFoot[pn].SetDiffuse( c ); + m_textFoot[pn].PlayCommand( "DifficultyChanged" ); } void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex ) diff --git a/stepmania/src/DifficultyMeter.cpp b/stepmania/src/DifficultyMeter.cpp index 19dbf9cd58..10ff727a7a 100644 --- a/stepmania/src/DifficultyMeter.cpp +++ b/stepmania/src/DifficultyMeter.cpp @@ -11,6 +11,7 @@ #include "ActorUtil.h" #include "Style.h" #include "XmlFile.h" +#include "LuaBinding.h" REGISTER_ACTOR_CLASS( DifficultyMeter ); @@ -51,7 +52,6 @@ void DifficultyMeter::Load( const CString &sType ) * DifficultyMeters on screen at once, with different names. */ m_iNumFeetInMeter.Load(sType,"NumFeetInMeter"); m_iMaxFeetInMeter.Load(sType,"MaxFeetInMeter"); - m_iGlowIfMeterGreaterThan.Load(sType,"GlowIfMeterGreaterThan"); m_bShowFeet.Load(sType,"ShowFeet"); m_bShowDifficulty.Load(sType,"ShowDifficulty"); m_bShowMeter.Load(sType,"ShowMeter"); @@ -204,14 +204,15 @@ void DifficultyMeter::SetInternal( int iMeter, Difficulty dc, const CString &sDi int iNumOff = max( 0, m_iNumFeetInMeter-iNumOn ); sNewText.insert( sNewText.end(), iNumOff, off ); - m_textFeet.SetText( sNewText ); - if( m_bAutoColorFeet ) - m_textFeet.SetDiffuse( SONGMAN->GetDifficultyColor(dc) ); + Lua *L = LUA->Get(); + LuaHelpers::Push( dc, L ); + m_textFeet.m_pLuaInstance->Set( L, "Difficulty" ); + LuaHelpers::Push( iMeter, L ); + m_textFeet.m_pLuaInstance->Set( L, "Meter" ); + LUA->Release(L); + m_textFeet.PlayCommand( "DifficultyChanged" ); - if( iMeter > m_iGlowIfMeterGreaterThan ) - m_textFeet.SetEffectGlowShift(); - else - m_textFeet.StopEffect(); + m_textFeet.SetText( sNewText ); } if( m_bShowMeter ) diff --git a/stepmania/src/DifficultyMeter.h b/stepmania/src/DifficultyMeter.h index 6da9b28408..03cb1fae12 100644 --- a/stepmania/src/DifficultyMeter.h +++ b/stepmania/src/DifficultyMeter.h @@ -46,7 +46,6 @@ private: ThemeMetric m_iNumFeetInMeter; ThemeMetric m_iMaxFeetInMeter; - ThemeMetric m_iGlowIfMeterGreaterThan; ThemeMetric m_bShowFeet; ThemeMetric m_bShowDifficulty; ThemeMetric m_bShowMeter;