本文整理汇总了C++中Preference::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ Preference::Set方法的具体用法?C++ Preference::Set怎么用?C++ Preference::Set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preference
的用法示例。
在下文中一共展示了Preference::Set方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleScreenMessage
void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_DoneConnecting )
{
if( !ScreenTextEntry::s_bCancelledLast )
{
CString sNewName = ScreenTextEntry::s_sLastAnswer;
NSMAN->PostStartUp(sNewName);
NSMAN->DisplayStartupStatus();
UpdateConnectStatus( );
g_sLastServer.Set( ScreenTextEntry::s_sLastAnswer );
}
}
else if( SM == SM_ServerNameEnter )
{
if( !ScreenTextEntry::s_bCancelledLast )
{
if ( NSMAN->LANserver == NULL)
NSMAN->LANserver = new StepManiaLanServer;
NSMAN->LANserver->servername = ScreenTextEntry::s_sLastAnswer;
if (NSMAN->LANserver->ServerStart())
{
NSMAN->isLanServer = true;
SCREENMAN->SystemMessage( "Server Started." );
}
else
SCREENMAN->SystemMessage( "Server failed: " + NSMAN->LANserver->lastError + ssprintf(" Code:%d",NSMAN->LANserver->lastErrorCode) );
}
}
ScreenOptions::HandleScreenMessage( SM );
}
示例2: ChangeVisualDelay
void ChangeVisualDelay( float fDelta )
{
Preference<float> *pRet = Preference<float>::GetPreferenceByName("VisualDelaySeconds");
float fSecs = pRet->Get();
fSecs += fDelta;
fSecs = Rage::clamp( fSecs, -1.0f, 1.0f );
pRet->Set( fSecs );
}
示例3: ChangeVolume
void ChangeVolume( float fDelta )
{
Preference<float> *pRet = Preference<float>::GetPreferenceByName("SoundVolume");
float fVol = pRet->Get();
fVol += fDelta;
fVol = Rage::clamp( fVol, 0.0f, 1.0f );
pRet->Set( fVol );
SOUNDMAN->SetMixVolume();
}
示例4: MoveMap
static void MoveMap( int &sel, Preference<T> &opt, bool ToSel, const T *mapping, unsigned cnt )
{
if( ToSel )
{
sel = FindClosestEntry( opt.Get(), mapping, cnt );
} else {
/* sel -> opt */
opt.Set( mapping[sel] );
}
}
示例5: HandleScreenMessage
void ScreenNetworkOptions::HandleScreenMessage( const ScreenMessage SM )
{
if( SM == SM_DoneConnecting )
{
if( !ScreenTextEntry::s_bCancelledLast )
{
RString sNewName = ScreenTextEntry::s_sLastAnswer;
NSMAN->PostStartUp(sNewName);
NSMAN->DisplayStartupStatus();
UpdateConnectStatus( );
g_sLastServer.Set( ScreenTextEntry::s_sLastAnswer );
}
}
ScreenOptions::HandleScreenMessage( SM );
}
示例6: MoveData
static void MoveData( int &sel, Preference<bool> &opt, bool ToSel )
{
if( ToSel ) sel = opt;
else opt.Set( !!sel );
}