本文整理汇总了C++中LocalizedString::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ LocalizedString::GetValue方法的具体用法?C++ LocalizedString::GetValue怎么用?C++ LocalizedString::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocalizedString
的用法示例。
在下文中一共展示了LocalizedString::GetValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetVideoMode
RString RageDisplay_D3D::Init( const VideoModeParams &p, bool /* bAllowUnacceleratedRenderer */ )
{
GraphicsWindow::Initialize( true );
LOG->Trace( "RageDisplay_D3D::RageDisplay_D3D()" );
LOG->MapLog("renderer", "Current renderer: Direct3D");
g_pd3d = Direct3DCreate9(D3D_SDK_VERSION);
if(!g_pd3d)
{
LOG->Trace( "Direct3DCreate9 failed" );
return D3D_NOT_INSTALLED.GetValue();
}
if( FAILED( g_pd3d->GetDeviceCaps(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, &g_DeviceCaps) ) )
return HARDWARE_ACCELERATION_NOT_AVAILABLE.GetValue();
D3DADAPTER_IDENTIFIER9 identifier;
g_pd3d->GetAdapterIdentifier( D3DADAPTER_DEFAULT, 0, &identifier );
LOG->Trace(
"Driver: %s\n"
"Description: %s\n"
"Max texture size: %d\n"
"Alpha in palette: %s\n",
identifier.Driver,
identifier.Description,
g_DeviceCaps.MaxTextureWidth,
(g_DeviceCaps.TextureCaps & D3DPTEXTURECAPS_ALPHAPALETTE) ? "yes" : "no" );
LOG->Trace( "This display adaptor supports the following modes:" );
D3DDISPLAYMODE mode;
UINT modeCount = g_pd3d->GetAdapterModeCount(D3DADAPTER_DEFAULT, g_DefaultAdapterFormat);
for( UINT u=0; u < modeCount; u++ )
if( SUCCEEDED( g_pd3d->EnumAdapterModes( D3DADAPTER_DEFAULT, g_DefaultAdapterFormat, u, &mode ) ) )
LOG->Trace( " %ux%u %uHz, format %d", mode.Width, mode.Height, mode.RefreshRate, mode.Format );
g_PaletteIndex.clear();
for( int i = 0; i < 256; ++i )
g_PaletteIndex.push_back(i);
// Save the original desktop format.
g_pd3d->GetAdapterDisplayMode( D3DADAPTER_DEFAULT, &g_DesktopMode );
/* Up until now, all we've done is set up g_pd3d and do some queries. Now,
* actually initialize the window. Do this after as many error conditions as
* possible, because if we have to shut it down again we'll flash a window briefly. */
bool bIgnore = false;
return SetVideoMode( p, bIgnore );
}
示例2: OnInitDialog
BOOL CSMPackageInstallDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
// TODO: Add extra initialization here
DialogUtil::LocalizeDialogAndContents( *this );
DialogUtil::SetHeaderFont( *this, IDC_STATIC_HEADER_TEXT );
// mount the zip
RageFileOsAbsolute file;
if( !file.Open(m_sPackagePath) )
{
Dialog::OK( ssprintf(COULD_NOT_OPEN_FILE.GetValue(),m_sPackagePath.c_str()) );
exit(1); // better way to abort?
}
RageFileDriverZip zip;
if( !zip.Load(&file) )
{
Dialog::OK( ssprintf(IS_NOT_A_VALID_ZIP.GetValue(),m_sPackagePath.c_str()) );
exit(1); // better way to abort?
}
//
// Set the text of the first Edit box
//
RString sMessage1 = "\t" + m_sPackagePath;
CEdit* pEdit1 = (CEdit*)GetDlgItem(IDC_EDIT_MESSAGE1);
pEdit1->SetWindowText( sMessage1 );
//
// Set the text of the second Edit box
//
{
vector<RString> vs;
GetSmzipFilesToExtract( zip, vs );
CEdit* pEdit2 = (CEdit*)GetDlgItem(IDC_EDIT_MESSAGE2);
RString sText = "\t" + join( "\r\n\t", vs );
pEdit2->SetWindowText( sText );
}
RefreshInstallationList();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
示例3: RefreshText
void ScreenGameplaySyncMachine::RefreshText()
{
float fNew = PREFSMAN->m_fGlobalOffsetSeconds;
float fOld = AdjustSync::s_fGlobalOffsetSecondsOriginal;
float fStdDev = AdjustSync::s_fStandardDeviation;
RString s;
s += OLD_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fOld );
s += NEW_OFFSET.GetValue() + ssprintf( ": %0.3f\n", fNew );
s += STANDARD_DEVIATION.GetValue() + ssprintf( ": %0.3f\n", fStdDev );
s += COLLECTING_SAMPLE.GetValue() + ssprintf( ": %d / %d", AdjustSync::s_iAutosyncOffsetSample+1, AdjustSync::OFFSET_SAMPLE_COUNT );
m_textSyncInfo.SetText( s );
}
示例4: Init
void ScreenNetworkOptions::Init()
{
ScreenOptions::Init();
vector<OptionRowHandler*> vHands;
{
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
vHands.push_back( pHand );
pHand->m_Def.m_sName = "Connection";
pHand->m_Def.m_bOneChoiceForAllPlayers = true;
pHand->m_Def.m_bAllowThemeItems = false;
if ( NSMAN->useSMserver )
pHand->m_Def.m_vsChoices.push_back(CLIENT_DISCONNECT.GetValue());
else
pHand->m_Def.m_vsChoices.push_back(CLIENT_CONNECT.GetValue());
}
{
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
vHands.push_back( pHand );
pHand->m_Def.m_sName = "Scoreboard";
pHand->m_Def.m_vsChoices.clear();
pHand->m_Def.m_bOneChoiceForAllPlayers = true;
pHand->m_Def.m_bAllowThemeItems = false;
pHand->m_Def.m_vsChoices.push_back(SCORE_OFF.GetValue());
pHand->m_Def.m_vsChoices.push_back(SCORE_ON.GetValue());
}
/*
{
// Get info on all received servers from NSMAN.
AllServers.clear();
NSMAN->GetListOfLANServers( AllServers );
if( !AllServers.empty() )
{
OptionRowHandler *pHand = OptionRowHandlerUtil::MakeNull();
pHand->m_Def.m_sName = "Servers";
pHand->m_Def.m_bAllowThemeItems = false;
for (auto &server: AllServers)
{
pHand->m_Def.m_vsChoices.push_back( server.Name );
}
vHands.push_back( pHand );
}
}
*/
InitMenu( vHands );
m_pRows[PO_SCOREBOARD]->SetOneSharedSelection(PREFSMAN->m_bEnableScoreboard);
}
示例5: Input
void ScreenTitleMenu::Input( const InputEventPlus &input )
{
#if defined(DEBUG)
LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", input.DeviceI.device, input.DeviceI.button ); // debugging gameport joystick problem
#endif
if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */
return;
if( input.type == IET_FIRST_PRESS )
{
// detect codes
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME) ||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME2) )
{
GameLoop::ChangeTheme( THEME->GetNextSelectableTheme(), m_sName );
}
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER) ||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER2) )
{
ANNOUNCER->NextAnnouncer();
RString sName = ANNOUNCER->GetCurAnnouncerName();
if( sName=="" ) sName = "(none)";
SCREENMAN->SystemMessage( ANNOUNCER_.GetValue()+": "+sName );
SCREENMAN->SetNewScreen( m_sName );
}
}
ScreenSelectMaster::Input( input );
}
示例6: ClearMachineStats
RString ClearMachineStats()
{
Profile* pProfile = PROFILEMAN->GetMachineProfile();
pProfile->ClearStats();
PROFILEMAN->SaveMachineProfile();
return MACHINE_STATS_CLEARED.GetValue();
}
示例7: XInternAtom
LowLevelWindow_X11::LowLevelWindow_X11()
{
if( !OpenXConnection() )
RageException::Throw( "%s", FAILED_CONNECTION_XSERVER.GetValue().c_str() );
if( XRRQueryVersion( Dpy, &g_iRandRVerMajor, &g_iRandRVerMinor ) && g_iRandRVerMajor >= 1 && g_iRandRVerMinor >= 2) g_bUseXRandR12 = true;
#ifdef HAVE_XINERAMA
int xinerama_event_base = 0;
int xinerama_error_base = 0;
Atom fullscreen_monitors = XInternAtom( Dpy, "_NET_WM_FULLSCREEN_MONITORS", False );
if (XineramaQueryExtension( Dpy, &xinerama_event_base, &xinerama_error_base ) &&
NetWMSupported( Dpy, fullscreen_monitors ))
{
g_bUseXinerama = true;
}
#endif
const int iScreen = DefaultScreen( Dpy );
int iXServerVersion = XVendorRelease( Dpy ); /* eg. 40201001 */
int iMajor = iXServerVersion / 10000000; iXServerVersion %= 10000000;
int iMinor = iXServerVersion / 100000; iXServerVersion %= 100000;
int iRevision = iXServerVersion / 1000; iXServerVersion %= 1000;
int iPatch = iXServerVersion;
LOG->Info( "Display: %s (screen %i)", DisplayString(Dpy), iScreen );
LOG->Info( "X server vendor: %s [%i.%i.%i.%i]", XServerVendor( Dpy ), iMajor, iMinor, iRevision, iPatch );
LOG->Info( "Server GLX vendor: %s [%s]", glXQueryServerString( Dpy, iScreen, GLX_VENDOR ), glXQueryServerString( Dpy, iScreen, GLX_VERSION ) );
LOG->Info( "Client GLX vendor: %s [%s]", glXGetClientString( Dpy, GLX_VENDOR ), glXGetClientString( Dpy, GLX_VERSION ) );
m_bWasWindowed = true;
g_pScreenConfig = XRRGetScreenInfo( Dpy, RootWindow(Dpy, DefaultScreen(Dpy)) );
}
示例8: MountInitialFilesystems
void ArchHooks::MountInitialFilesystems( const RString &sDirOfExecutable )
{
#if defined(UNIX)
/* Mount the root filesystem, so we can read files in /proc, /etc, and so on.
* This is /rootfs, not /root, to avoid confusion with root's home directory. */
FILEMAN->Mount( "dir", "/", "/rootfs" );
/* Mount /proc, so Alsa9Buf::GetSoundCardDebugInfo() and others can access it.
* (Deprecated; use rootfs.) */
FILEMAN->Mount( "dir", "/proc", "/proc" );
#endif
RString Root;
struct stat st;
if( !stat(sDirOfExecutable + "/Packages", &st) && st.st_mode&S_IFDIR )
Root = sDirOfExecutable;
else if( !stat(sDirOfExecutable + "/Songs", &st) && st.st_mode&S_IFDIR )
Root = sDirOfExecutable;
else if( !stat(RageFileManagerUtil::sInitialWorkingDirectory + "/Songs", &st) && st.st_mode&S_IFDIR )
Root = RageFileManagerUtil::sInitialWorkingDirectory;
else
RageException::Throw( "%s", COULDNT_FIND_SONGS.GetValue().c_str() );
FILEMAN->Mount( "dir", Root, "/" );
}
示例9: Input
bool ScreenTitleMenu::Input( const InputEventPlus &input )
{
#if defined(DEBUG)
LOG->Trace( "ScreenTitleMenu::Input( %d-%d )", input.DeviceI.device, input.DeviceI.button ); // debugging gameport joystick problem
#endif
if( m_In.IsTransitioning() || m_Cancel.IsTransitioning() ) /* not m_Out */
return false;
bool bHandled = false;
if( input.type == IET_FIRST_PRESS )
{
// detect codes
// Theme changing pad codes are marked as deprecated in _fallback's
// metrics.ini, remove them after SM5? -Kyz
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME) ||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_THEME2) )
{
GameLoop::ChangeTheme(THEME->GetNextSelectableTheme());
bHandled = true;
}
if( CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER) ||
CodeDetector::EnteredCode(input.GameI.controller,CODE_NEXT_ANNOUNCER2) )
{
ANNOUNCER->NextAnnouncer();
RString sName = ANNOUNCER->GetCurAnnouncerName();
if( sName=="" ) sName = "(none)";
SCREENMAN->SystemMessage( ANNOUNCER_.GetValue()+": "+sName );
SCREENMAN->SetNewScreen( m_sName );
bHandled = true;
}
}
return ScreenSelectMaster::Input( input ) || bHandled;
}
示例10: AutosyncTempo
void AdjustSync::AutosyncTempo()
{
float fSlope = 0.0f;
float fIntercept = 0.0f;
if( !CalcLeastSquares( s_vAutosyncTempoData, fSlope, fIntercept, s_fAverageError ) )
{
s_vAutosyncTempoData.clear();
return;
}
if( s_fAverageError < ERROR_TOO_HIGH )
{
// Here we filter out any steps that are too far off.
//
// If it turns out that we want to be even more selective, we can
// keep only a fraction of the data, such as the 80% with the lowest
// error. However, throwing away the ones with high error should
// be enough in most cases.
float fFilteredError = 0.0;
s_iStepsFiltered = s_vAutosyncTempoData.size();
FilterHighErrorPoints( s_vAutosyncTempoData, fSlope, fIntercept, ERROR_TOO_HIGH );
s_iStepsFiltered -= s_vAutosyncTempoData.size();
if( !CalcLeastSquares( s_vAutosyncTempoData, fSlope, fIntercept, fFilteredError ) )
return;
GAMESTATE->m_pCurSong->m_Timing.m_fBeat0OffsetInSeconds += fIntercept;
const float fScaleBPM = 1.0f/(1.0f - fSlope);
FOREACH( BPMSegment, GAMESTATE->m_pCurSong->m_Timing.m_BPMSegments, i )
i->SetBPM( i->GetBPM() * fScaleBPM );
// We assume that the stops were measured as a number of beats.
// Therefore, if we change the bpms, we need to make a similar
// change to the stops.
FOREACH( StopSegment, GAMESTATE->m_pCurSong->m_Timing.m_StopSegments, i )
i->m_fStopSeconds *= 1.0f - fSlope;
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_APPLIED.GetValue() );
}
else
{
// deviation... error... close enough for an error message
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_NOT_APPLIED.GetValue() );
}
s_vAutosyncTempoData.clear();
}
示例11: FloatValidate
bool ScreenTextEntry::FloatValidate( const RString &sAnswer, RString &sErrorOut )
{
float f;
if( StringToFloat(sAnswer, f) )
return true;
sErrorOut = ssprintf( INVALID_FLOAT.GetValue(), sAnswer.c_str() );
return false;
}
示例12: IntValidate
bool ScreenTextEntry::IntValidate( const RString &sAnswer, RString &sErrorOut )
{
int f;
if(sAnswer >> f)
return true;
sErrorOut = ssprintf( INVALID_INT.GetValue(), sAnswer.c_str() );
return false;
}
示例13: AutosyncOffset
void AdjustSync::AutosyncOffset()
{
const float mean = calc_mean( s_fAutosyncOffset, s_fAutosyncOffset+OFFSET_SAMPLE_COUNT );
const float stddev = calc_stddev( s_fAutosyncOffset, s_fAutosyncOffset+OFFSET_SAMPLE_COUNT );
RString sAutosyncType;
switch( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType )
{
case SongOptions::AUTOSYNC_SONG:
sAutosyncType = AUTOSYNC_SONG;
break;
case SongOptions::AUTOSYNC_MACHINE:
sAutosyncType = AUTOSYNC_MACHINE;
break;
default:
ASSERT(0);
}
if( stddev < .03f ) // If they stepped with less than .03 error
{
switch( GAMESTATE->m_SongOptions.GetCurrent().m_AutosyncType )
{
case SongOptions::AUTOSYNC_SONG:
GAMESTATE->m_pCurSong->m_Timing.m_fBeat0OffsetInSeconds += mean;
break;
case SongOptions::AUTOSYNC_MACHINE:
PREFSMAN->m_fGlobalOffsetSeconds.Set( PREFSMAN->m_fGlobalOffsetSeconds + mean );
break;
default:
ASSERT(0);
}
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_APPLIED.GetValue() );
}
else
{
SCREENMAN->SystemMessage( AUTOSYNC_CORRECTION_NOT_APPLIED.GetValue() );
}
s_iAutosyncOffsetSample = 0;
s_fStandardDeviation = stddev;
}
示例14: MenuStart
bool ScreenNetworkOptions::MenuStart( const InputEventPlus &input )
{
switch( GetCurrentRow() )
{
case PO_CONNECTION:
if ( !NSMAN->useSMserver )
{
ScreenTextEntry::TextEntry( SM_DoneConnecting, ENTER_NETWORK_ADDRESS.GetValue()+"\n\n"+CONNECT_TO_YOURSELF.GetValue(), g_sLastServer.Get(), 128 );
}
else
{
NSMAN->CloseConnection();
SCREENMAN->SystemMessage( DISCONNECTED.GetValue() );
UpdateConnectStatus( );
}
return true;
case PO_SCOREBOARD:
if (m_pRows[PO_SCOREBOARD]->GetOneSharedSelection() == NO_SCOREBOARD_ON)
PREFSMAN->m_bEnableScoreboard.Set(true);
else
PREFSMAN->m_bEnableScoreboard.Set(false);
return true;
/*
case NetworkOptionRow::PO_SERVERS:
if ( !AllServers.empty() )
{
string sNewName = AllServers[m_pRows[GetCurrentRow()]->GetOneSharedSelection()].Address;
NSMAN->PostStartUp(sNewName);
NSMAN->DisplayStartupStatus();
UpdateConnectStatus( );
}
else
{
//If the server list is empty, keep passing the message on so exit works
ScreenOptions::MenuStart( input );
}
return true;
*/
default:
return ScreenOptions::MenuStart( input );
}
}
示例15: SetVideoMode
RString RageDisplay::SetVideoMode( VideoModeParams p, bool &bNeedReloadTextures )
{
RString err;
vector<RString> vs;
if( (err = this->TryVideoMode(p,bNeedReloadTextures)) == "" )
return RString();
LOG->Trace( "TryVideoMode failed: %s", err.c_str() );
vs.push_back( err );
// fall back to settings that will most likely work
p.bpp = 16;
if( (err = this->TryVideoMode(p,bNeedReloadTextures)) == "" )
return RString();
vs.push_back( err );
// "Intel(R) 82810E Graphics Controller" won't accept a 16 bpp surface if
// the desktop is 32 bpp, so try 32 bpp as well.
p.bpp = 32;
if( (err = this->TryVideoMode(p,bNeedReloadTextures)) == "" )
return RString();
vs.push_back( err );
// Fall back on a known resolution good rather than 640 x 480.
DisplayResolutions dr;
this->GetDisplayResolutions( dr );
if( dr.empty() )
{
vs.push_back( "No display resolutions" );
return SETVIDEOMODE_FAILED.GetValue() + " " + join(";",vs);
}
const DisplayResolution &d = *dr.begin();
p.width = d.iWidth;
p.height = d.iHeight;
if( (err = this->TryVideoMode(p,bNeedReloadTextures)) == "" )
return RString();
vs.push_back( err );
return SETVIDEOMODE_FAILED.GetValue() + " " + join(";",vs);
}