run a command to set color (etc) instead of hardcoded effects
This commit is contained in:
@@ -12,6 +12,7 @@
|
|||||||
#include "GameState.h"
|
#include "GameState.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
REGISTER_ACTOR_CLASS( CourseEntryDisplay )
|
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 )
|
if( !SEPARATE_COURSE_METERS && pn != GAMESTATE->m_MasterPlayerNumber )
|
||||||
return;
|
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].SetText( text );
|
||||||
m_textDifficultyNumber[pn].SetDiffuse( c );
|
m_textDifficultyNumber[pn].PlayCommand( "DifficultyChanged" );
|
||||||
|
|
||||||
m_textFoot[pn].SetText( "1" );
|
m_textFoot[pn].SetText( "1" );
|
||||||
m_textFoot[pn].SetDiffuse( c );
|
m_textFoot[pn].PlayCommand( "DifficultyChanged" );
|
||||||
}
|
}
|
||||||
|
|
||||||
void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex )
|
void CourseEntryDisplay::SetFromGameState( int iCourseEntryIndex )
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "ActorUtil.h"
|
#include "ActorUtil.h"
|
||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
#include "XmlFile.h"
|
#include "XmlFile.h"
|
||||||
|
#include "LuaBinding.h"
|
||||||
|
|
||||||
REGISTER_ACTOR_CLASS( DifficultyMeter );
|
REGISTER_ACTOR_CLASS( DifficultyMeter );
|
||||||
|
|
||||||
@@ -51,7 +52,6 @@ void DifficultyMeter::Load( const CString &sType )
|
|||||||
* DifficultyMeters on screen at once, with different names. */
|
* DifficultyMeters on screen at once, with different names. */
|
||||||
m_iNumFeetInMeter.Load(sType,"NumFeetInMeter");
|
m_iNumFeetInMeter.Load(sType,"NumFeetInMeter");
|
||||||
m_iMaxFeetInMeter.Load(sType,"MaxFeetInMeter");
|
m_iMaxFeetInMeter.Load(sType,"MaxFeetInMeter");
|
||||||
m_iGlowIfMeterGreaterThan.Load(sType,"GlowIfMeterGreaterThan");
|
|
||||||
m_bShowFeet.Load(sType,"ShowFeet");
|
m_bShowFeet.Load(sType,"ShowFeet");
|
||||||
m_bShowDifficulty.Load(sType,"ShowDifficulty");
|
m_bShowDifficulty.Load(sType,"ShowDifficulty");
|
||||||
m_bShowMeter.Load(sType,"ShowMeter");
|
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 );
|
int iNumOff = max( 0, m_iNumFeetInMeter-iNumOn );
|
||||||
sNewText.insert( sNewText.end(), iNumOff, off );
|
sNewText.insert( sNewText.end(), iNumOff, off );
|
||||||
|
|
||||||
m_textFeet.SetText( sNewText );
|
Lua *L = LUA->Get();
|
||||||
if( m_bAutoColorFeet )
|
LuaHelpers::Push( dc, L );
|
||||||
m_textFeet.SetDiffuse( SONGMAN->GetDifficultyColor(dc) );
|
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.SetText( sNewText );
|
||||||
m_textFeet.SetEffectGlowShift();
|
|
||||||
else
|
|
||||||
m_textFeet.StopEffect();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if( m_bShowMeter )
|
if( m_bShowMeter )
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ private:
|
|||||||
|
|
||||||
ThemeMetric<int> m_iNumFeetInMeter;
|
ThemeMetric<int> m_iNumFeetInMeter;
|
||||||
ThemeMetric<int> m_iMaxFeetInMeter;
|
ThemeMetric<int> m_iMaxFeetInMeter;
|
||||||
ThemeMetric<int> m_iGlowIfMeterGreaterThan;
|
|
||||||
ThemeMetric<bool> m_bShowFeet;
|
ThemeMetric<bool> m_bShowFeet;
|
||||||
ThemeMetric<bool> m_bShowDifficulty;
|
ThemeMetric<bool> m_bShowDifficulty;
|
||||||
ThemeMetric<bool> m_bShowMeter;
|
ThemeMetric<bool> m_bShowMeter;
|
||||||
|
|||||||
Reference in New Issue
Block a user