clean up line wrap

This commit is contained in:
Chris Danford
2003-11-06 07:23:22 +00:00
parent 1ed86b18fa
commit 855106f07d
4 changed files with 137 additions and 93 deletions
+55 -52
View File
@@ -1651,7 +1651,7 @@ NextScreen=ScreenRanking
[ScreenEditMenu] [ScreenEditMenu]
ExplanationX=320 ExplanationX=320
ExplanationY=410 ExplanationY=410
ExplanationText=In this mode, you can edit existing notes patterns,::create note patterns, or synchronize notes with the music. ExplanationText=In this mode, you can edit existing notes patterns, create note patterns, or synchronize notes with the music.
HelpText=&UP; &DOWN; change line &LEFT; &RIGHT; change value START to continue HelpText=&UP; &DOWN; change line &LEFT; &RIGHT; change value START to continue
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
@@ -1667,7 +1667,7 @@ TimerSeconds=0
[ScreenEditCoursesMenu] [ScreenEditCoursesMenu]
ExplanationX=320 ExplanationX=320
ExplanationY=410 ExplanationY=410
ExplanationText=In this mode, you can edit courses.::For lines marked with "START", press the START button::to accept the action or open a sub-menu. ExplanationText=In this mode, you can edit courses. For lines marked with "START", press the START button to accept the action or open a sub-menu.
HelpText=&UP; &DOWN; change line &LEFT; &RIGHT; change value HelpText=&UP; &DOWN; change line &LEFT; &RIGHT; change value
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
@@ -1768,13 +1768,16 @@ ItemsStartX=160
ItemsGapX=14 ItemsGapX=14
ItemsStartY=88 ItemsStartY=88
ItemsSpacingY=34 ItemsSpacingY=34
ExplanationP1X=180 ExplanationP1X=70
ExplanationP1Y=412 ExplanationP1Y=412
ExplanationP2X=460 ExplanationP2X=570
ExplanationP2Y=412 ExplanationP2Y=412
ExplanationTogetherX=320 ExplanationTogetherX=70
ExplanationTogetherY=412 ExplanationTogetherY=412
ExplanationTogetherOnCommand=wrapwidthpixels,1000;horizalign,left;cropright,1;linear,0.5;cropright,0
ExplanationZoom=0.5 ExplanationZoom=0.5
ExplanationP1OnCommand=wrapwidthpixels,600;horizalign,left
ExplanationP2OnCommand=wrapwidthpixels,600;horizalign,right
ColorSelected=1,1,1,1 // normal ColorSelected=1,1,1,1 // normal
ColorNotSelected=0.5,0.5,0.5,1 // grayed ColorNotSelected=0.5,0.5,0.5,1 // grayed
NumShownItems=10 NumShownItems=10
@@ -1789,7 +1792,7 @@ StyleIcon=0
TimerSeconds=0 TimerSeconds=0
[ScreenCenterImage] [ScreenCenterImage]
HelpText=Use arrow keys to translate.::Hold SHIFT and press the arrow keys to scale.::Press SPACE to reset centering. Press ESCAPE when done. HelpText=Use arrow keys to translate. Hold SHIFT and press the arrow keys to scale. Press SPACE to reset centering. Press ESCAPE when done.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
@@ -2081,12 +2084,12 @@ TimerSeconds=20
StyleIcon=1 StyleIcon=1
[ScreenInputOptions] [ScreenInputOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options START to accept changes BACK to discard changes
AutoMapOnJoyChange=&oq;ON&cq; will cause StepMania automatically remap::all the joysticks attached to your computer if the joysticks::attached to your system are different than the last time you::started the game. Auto mapping will override any::manually defined mappings. AutoMapOnJoyChange=&oq;ON&cq; will cause StepMania automatically remap all the joysticks attached to your computer if the joysticks attached to your system are different than the last time you started the game. Auto mapping will override any manually defined mappings.
MenuButtons=The default setting allows the dance pad's panels to navigate::the menus. Changing this to &oq;dedicated only&cq; will restrict::menu navigation to only the Menu* set of buttons. Be sure to map::the Menu* set of buttons before setting this to &oq;dedicated&cq;! MenuButtons=The default setting allows the dance pad's panels to navigate the menus. Changing this to &oq;dedicated only&cq; will restrict menu navigation to only the Menu* set of buttons. Be sure to map the Menu* set of buttons before setting this to &oq;dedicated&cq;!
AutoPlay=This option is useful for those who would like to play::without using a pad. However, you will not be able to set::high scores or earn extra stages while this options is ON. AutoPlay=This option is useful for those who would like to play without using a pad. However, you will not be able to set high scores or earn extra stages while this options is ON.
BackDelayed=Turning this option ON will require that you hold the Back button::for 0.5 seconds before it will regiser. This is useful if you find::yourself accidentally pressing the Back button on your controller. BackDelayed=Turning this option ON will require that you hold the Back button for 0.5 seconds before it will regiser. This is useful if you find yourself accidentally pressing the Back button on your controller.
OptionsNavigation=When using &oq;SM style&cq;, the Start button will take::you to the next screen and Up/Down will switch option lines.::When using &oq;Arcade style&cq;, the Start button will move the cursor::to the next line and Up/Down will be ignored. OptionsNavigation=When using &oq;SM style&cq;, the Start button will take you to the next screen and Up/Down will switch option lines. When using &oq;Arcade style&cq;, the Start button will move the cursor to the next line and Up/Down will be ignored.
WheelSpeed=Adjusts the speed of the DDR style music wheel. WheelSpeed=Adjusts the speed of the DDR style music wheel.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
@@ -2103,10 +2106,10 @@ Line6=conf,WheelSpeed
[ScreenCoinOptions] [ScreenCoinOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
CoinMode=When set to HOME, options will be shown on the title screen.::When set to PAY the title menu choices are hidden and you must::insert coins before joining in. When set to FREE the title menu::choices are hidden and you can joining in without inserting coins. CoinMode=When set to HOME, options will be shown on the title screen. When set to PAY the title menu choices are hidden and you must insert coins before joining in. When set to FREE the title menu choices are hidden and you can joining in without inserting coins.
SongsPerPlay=The number of songs a player can play in Arcade mode.::Set this to &oq;Event Mode&cq;, and you can continue playing forever.::Also, when this option is set to &oq;Unlimited&cq;, failing will take you::back to the the Select Music or Select Course screen. SongsPerPlay=The number of songs a player can play in Arcade mode. Set this to &oq;Event Mode&cq;, and you can continue playing forever. Also, when this option is set to &oq;Unlimited&cq;, failing will take you back to the the Select Music or Select Course screen.
CoinsPerCredit=The number of coins that must be inserted before a player can join. CoinsPerCredit=The number of coins that must be inserted before a player can join.
JointPremium=When set to OFF, game styles that require both sides of the machine::will cost 2 credits. When set to ON game styles that require both sides::of the machine will cost only 1 credit. JointPremium=When set to OFF, game styles that require both sides of the machine will cost 2 credits. When set to ON game styles that require both sides of the machine will cost only 1 credit.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
@@ -2122,14 +2125,14 @@ Line4=conf,JointPremium
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
MenuTimer=Turn this &oq;OFF&cq; to disable the time limit in menus. MenuTimer=Turn this &oq;OFF&cq; to disable the time limit in menus.
ScoringType=Defines which scoring method to use. ScoringType=Defines which scoring method to use.
JudgeDifficulty=Increase this value to cause your steps to be judged more strictly::(i.e. shrink the timing window). JudgeDifficulty=Increase this value to cause your steps to be judged more strictly (i.e. shrink the timing window).
LifeDifficulty=Increase this value to cause your life meter to::drain faster and refill slower. LifeDifficulty=Increase this value to cause your life meter to drain faster and refill slower.
ProgressiveLifebar=Set whether the lifebar is harsher on consecutive boo/miss judgments.::OFF for no effect, 8 to make each consecutive miss a multiple of the first miss. ProgressiveLifebar=Set whether the lifebar is harsher on consecutive boo/miss judgments. OFF for no effect, 8 to make each consecutive miss a multiple of the first miss.
ProgressiveStageLifebar=Determine whether the lifebar gets harsher on later stages.:: LifeDifficulty + this = Lifedifficulty on a final stage. Has no::effect on event mode. ProgressiveStageLifebar=Determine whether the lifebar gets harsher on later stages. LifeDifficulty + this = Lifedifficulty on a final stage. Has no effect on event mode.
ProgressiveNonstopLifebar=Determine whether the lifebar gets harsher as a nonstop course::progresses. LifeDifficulty + this = Lifedifficulty on a final stage of a course. ProgressiveNonstopLifebar=Determine whether the lifebar gets harsher as a nonstop course progresses. LifeDifficulty + this = Lifedifficulty on a final stage of a course.
DefaultFailType=Choose the conditions for game over.::ARCADE will stop the music immediately when all players have 0 life.::END OF SONG will cause the game to end at the conclusion of the current song::if all players failed at some point during the song.::OFF disables game over entirely. DefaultFailType=Choose the conditions for game over. ARCADE will stop the music immediately when all players have 0 life. END OF SONG will cause the game to end at the conclusion of the current song if all players failed at some point during the song. OFF disables game over entirely.
ShowSongOptions=Select the availability of the Song Options screen.::When HIDE, it can not be accessed. When SHOW, it will always be shown.::When set to ASK, it can be accessed by pressing START a::second time after the Player Options screen. ShowSongOptions=Select the availability of the Song Options screen. When HIDE, it can not be accessed. When SHOW, it will always be shown. When set to ASK, it can be accessed by pressing START a second time after the Player Options screen.
ShowNameEntry=Determines if name entry should never be shown, always be shown, or shown when::the course is listed on the high scores screen. ShowNameEntry=Determines if name entry should never be shown, always be shown, or shown when the course is listed on the high scores screen.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
@@ -2149,16 +2152,16 @@ Line10=conf,ShowNameEntry
[ScreenGraphicOptions] [ScreenGraphicOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
DisplayMode=Choose whether you would like StepMania to run full screen,::or to display in a window on your desktop. DisplayMode=Choose whether you would like StepMania to run full screen, or to display in a window on your desktop.
DisplayColor=Choose the color depth of the StepMania window.::This option may not take effect in windowed mode. DisplayColor=Choose the color depth of the StepMania window. This option may not take effect in windowed mode.
TextureColor=Choose the color depth of textures.::32 bit texture use more memory, but look nicer. TextureColor=Choose the color depth of textures. 32 bit texture use more memory, but look nicer.
MovieColor=Choose the color depth of textures.::32 bit texture use more memory, but look nicer. MovieColor=Choose the color depth of textures. 32 bit texture use more memory, but look nicer.
DisplayResolution=Choose the output resolution. A higher resolution::will show more detail, but requires a faster video card. DisplayResolution=Choose the output resolution. A higher resolution will show more detail, but requires a faster video card.
TextureResolution=Choose the maximum texture resolution. Setting this::to anything below 1024 will cause some textures to appear blurry,::but may increase your frame rate. TextureResolution=Choose the maximum texture resolution. Setting this to anything below 1024 will cause some textures to appear blurry, but may increase your frame rate.
RefreshRate=Controls how many times per second the screen will refresh.::This setting only has an effect when the Display Mode::is set to &oq;full screen&cq;. RefreshRate=Controls how many times per second the screen will refresh. This setting only has an effect when the Display Mode is set to &oq;full screen&cq;.
WaitForVsync=Wait for the monitor's vertical retrace before displaying::the next frame. This option only has an effect when the::Display Mode is set to &oq;full screen&cq;. Turning this option off will not::cap your frame rate to the refresh rate, but may result in &oq;tearing&cq;. WaitForVsync=Wait for the monitor's vertical retrace before displaying the next frame. This option only has an effect when the Display Mode is set to &oq;full screen&cq;. Turning this option off will not cap your frame rate to the refresh rate, but may result in &oq;tearing&cq;.
KeepTexturesInMemory=Set to ON hold textures in memory instead of::freeing them. This will eliminate the time needed to load::the texture next from disk next time this is needed. Do not set to ON::unless you have 128MB of memory or more. KeepTexturesInMemory=Set to ON hold textures in memory instead of freeing them. This will eliminate the time needed to load the texture next from disk next time this is needed. Do not set to ON unless you have 128MB of memory or more.
ShowStats=Display Performance Statistics in the upper right corner::of the screen. FPS = frames per second.::TPF = triangles per frame. DPF = draws per frame. ShowStats=Display Performance Statistics in the upper right corner of the screen. FPS = frames per second. TPF = triangles per frame. DPF = draws per frame.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
@@ -2179,11 +2182,11 @@ Line10=conf,ShowStats
[ScreenGameplayOptions] [ScreenGameplayOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
EasterEggs=Enable or disable some special easter eggs. EasterEggs=Enable or disable some special easter eggs.
MarvelousTiming=Enable or disable marvelous judgement. NEVER - never show Marvelous,::COURSES ONLY - only during nonstop/oni modes, ALWAYS - all modes of play MarvelousTiming=Enable or disable marvelous judgement. NEVER - never show Marvelous, COURSES ONLY - only during nonstop/oni modes, ALWAYS - all modes of play
HiddenSongs=Some songs are only playable during Oni courses and::with roulette. Leave this &oq;OFF&cq; to always display all songs. HiddenSongs=Some songs are only playable during Oni courses and with roulette. Leave this &oq;OFF&cq; to always display all songs.
AllowExtraStage= AllowExtraStage=
PickExtraStage=Instead of a set extra stage, this allows::the player to choose which song to play.::Difficulty and options are still locked. PickExtraStage=Instead of a set extra stage, this allows the player to choose which song to play. Difficulty and options are still locked.
SoloSingles=Turn this option &oq;ON&cq; to enable Solo-Style::for 4-panel single play. SoloSingles=Turn this option &oq;ON&cq; to enable Solo-Style for 4-panel single play.
UnlockSystem=Enable or disable unlock system. UnlockSystem=Enable or disable unlock system.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
@@ -2201,10 +2204,10 @@ Line7=conf,UnlockSystem
[ScreenBackgroundOptions] [ScreenBackgroundOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
Mode=Choose what type of backgrounds you would like displayed.::&oq;Animations&cq; uses any random items in the BGAnimations folder.::&oq;Visualizations&cq; chooses a random overlay movie from the Visualization folder.::&oq;Random Movies&cq; cycles through movies in the RandomMovies folder. Mode=Choose what type of backgrounds you would like displayed. &oq;Animations&cq; uses any random items in the BGAnimations folder. &oq;Visualizations&cq; chooses a random overlay movie from the Visualization folder. &oq;Random Movies&cq; cycles through movies in the RandomMovies folder.
Brightness=Controls how bright the background will appear.::Turn this setting down if you have a hard time seeing the notes. Brightness=Controls how bright the background will appear. Turn this setting down if you have a hard time seeing the notes.
Danger=Turn this option &oq;OFF&cq; to disable the flashing &oq;Danger&cq;::background that shows when you're about to die. Danger=Turn this option &oq;OFF&cq; to disable the flashing &oq;Danger&cq; background that shows when you're about to die.
DancingCharacters=Turn this option &oq;OFF&cq; to disable the dancing characters::in the background. Even if this option is &oq;ON&cq;,::characters will only show if you have some installed. DancingCharacters=Turn this option &oq;OFF&cq; to disable the dancing characters in the background. Even if this option is &oq;ON&cq;, characters will only show if you have some installed.
BeginnerHelper=Turn this on to enable a demonstration dancer during Beginner play. BeginnerHelper=Turn this on to enable a demonstration dancer during Beginner play.
RandomBackgrounds=Choose the maximum number of random backgrounds to be loaded simultaneously. RandomBackgrounds=Choose the maximum number of random backgrounds to be loaded simultaneously.
StyleIcon=0 StyleIcon=0
@@ -2223,19 +2226,19 @@ Line6=conf,RandomBackgrounds
[ScreenAppearanceOptions] [ScreenAppearanceOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
Language=Choose your language. Language=Choose your language.
Announcer=Choose from this list of installed annoucner packs.::For more information about creating announcer packs, see the README. Announcer=Choose from this list of installed annoucner packs. For more information about creating announcer packs, see the README.
Theme=Choose from this list of installed theme packs.::For more information about creating theme packs, see the README. Theme=Choose from this list of installed theme packs. For more information about creating theme packs, see the README.
DefaultNoteSkin=Choose from this list of installed note skins.::For more information about creating a note skin, see the README. DefaultNoteSkin=Choose from this list of installed note skins. For more information about creating a note skin, see the README.
Instructions=Toggle whether the Instructions screen is shown. Instructions=Toggle whether the Instructions screen is shown.
Caution=Toggle whether the Caution screen is shown. Caution=Toggle whether the Caution screen is shown.
OniScoreDisplay=Toggle whether the score in Oni mode displays Dance Points or the Dance Percent. OniScoreDisplay=Toggle whether the score in Oni mode displays Dance Points or the Dance Percent.
SongGroup=Toggle whether the Select Group screen is shown. SongGroup=Toggle whether the Select Group screen is shown.
WheelSections=ALWAYS means sections in group + ABC; NEVER means no sections;::ABC ONLY shows sections in just ABC sort WheelSections=ALWAYS means sections in group + ABC; NEVER means no sections; ABC ONLY shows sections in just ABC sort.
Translations=Choose whether to displays song titles in their native::language (日本語), or to transliterate when possible Translations=Choose whether to display song titles in their native language (日本語), or to transliterate when possible.
Lyrics=Choose whether to show lyrics if a song::has them available (LRC File) Lyrics=Choose whether to show lyrics if a song has them available (LRC File)
10+footInRed=Choose where 10 footers or higher are displayed::in red on the song select wheel. 10+footInRed=Choose where 10 footers or higher are displayed in red on the song select wheel.
CourseSort=Determines how courses are sorted. CourseSort=Determines how courses are sorted.
RandomAtEnd=Determines if courses with random songs should be placed at the end::of the course select wheel. RandomAtEnd=Determines if courses with random songs should be placed at the end of the course select wheel.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
@@ -2262,7 +2265,7 @@ Line14=conf,Lyrics
[ScreenAutogenOptions] [ScreenAutogenOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
AutogenMissingTypes=Show steps for songs that were created by Autogen. AutogenMissingTypes=Show steps for songs that were created by Autogen.
AutogenGroupCourses=Show group Nonstop and Endless courses that::were created by Autogen. AutogenGroupCourses=Show group Nonstop and Endless courses that were created by Autogen.
StyleIcon=0 StyleIcon=0
TimerSeconds=0 TimerSeconds=0
PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster PrevScreen=ScreenOptionsMenu@ScreenOptionsMaster
@@ -2541,9 +2544,9 @@ TextColor5=1.0,1,1.0,1
[ScreenSoundOptions] [ScreenSoundOptions]
HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes HelpText=&UP; &DOWN; to change line &LEFT; &RIGHT; to select between options::START to accept changes BACK to discard changes
MasterVolume= MasterVolume=
PreloadSounds=If YES, preload most sounds in advance. This increases load times,::and should normally be left OFF. PreloadSounds=If YES, preload most sounds in advance. This increases load times, and should normally be left OFF.
ResamplingQuality=Advanced: Select the resampling quality to use. ResamplingQuality=Advanced: Select the resampling quality to use.
AttractSound=Set to ON to play sound during the attract screens.::Set to OFF to mute sounds durring attract. AttractSound=Set to ON to play sound during the attract screens. Set to OFF to mute sounds durring attract.
DemonstrationSound= DemonstrationSound=
SoundVolume= SoundVolume=
StyleIcon=0 StyleIcon=0
+49 -17
View File
@@ -21,6 +21,7 @@
#include "ThemeManager.h" #include "ThemeManager.h"
#include "GameConstantsAndTypes.h" #include "GameConstantsAndTypes.h"
#include "Font.h" #include "Font.h"
#include "ActorUtil.h" // for HandleParams
/* XXX: /* XXX:
* We need some kind of font modifier string for metrics. For example, * We need some kind of font modifier string for metrics. For example,
@@ -77,6 +78,8 @@ BitmapText::BitmapText()
m_bShadow = true; m_bShadow = true;
m_bRainbow = false; m_bRainbow = false;
m_iWrapWidthPixels = -1;
} }
BitmapText::~BitmapText() BitmapText::~BitmapText()
@@ -130,9 +133,9 @@ void BitmapText::BuildChars()
m_iWidestLineWidth = 0; m_iWidestLineWidth = 0;
m_iLineWidths.clear(); m_iLineWidths.clear();
for( unsigned l=0; l<m_szTextLines.size(); l++ ) // for each line for( unsigned l=0; l<m_wTextLines.size(); l++ ) // for each line
{ {
m_iLineWidths.push_back(m_pFont->GetLineWidthInSourcePixels( m_szTextLines[l] )); m_iLineWidths.push_back(m_pFont->GetLineWidthInSourcePixels( m_wTextLines[l] ));
m_iWidestLineWidth = max(m_iWidestLineWidth, m_iLineWidths.back()); m_iWidestLineWidth = max(m_iWidestLineWidth, m_iLineWidths.back());
} }
@@ -140,9 +143,9 @@ void BitmapText::BuildChars()
verts.clear(); verts.clear();
tex.clear(); tex.clear();
if(m_szTextLines.empty()) return; if(m_wTextLines.empty()) return;
int TotalHeight = m_pFont->GetHeight() * m_szTextLines.size(); int TotalHeight = m_pFont->GetHeight() * m_wTextLines.size();
unsigned i; unsigned i;
int MinSpacing = 0; int MinSpacing = 0;
@@ -150,7 +153,7 @@ void BitmapText::BuildChars()
int Padding = max(m_pFont->GetLineSpacing(), MinSpacing) - m_pFont->GetHeight(); int Padding = max(m_pFont->GetLineSpacing(), MinSpacing) - m_pFont->GetHeight();
/* There's padding between every line: */ /* There's padding between every line: */
TotalHeight += Padding * (m_szTextLines.size()-1); TotalHeight += Padding * (m_wTextLines.size()-1);
int iY; // the top position of the first row of characters int iY; // the top position of the first row of characters
switch( m_VertAlign ) switch( m_VertAlign )
@@ -161,10 +164,10 @@ void BitmapText::BuildChars()
default: ASSERT( false ); return; default: ASSERT( false ); return;
} }
for( i=0; i<m_szTextLines.size(); i++ ) // foreach line for( i=0; i<m_wTextLines.size(); i++ ) // foreach line
{ {
iY += m_pFont->GetHeight(); iY += m_pFont->GetHeight();
const wstring &szLine = m_szTextLines[i]; const wstring &szLine = m_wTextLines[i];
const int iLineWidth = m_iLineWidths[i]; const int iLineWidth = m_iLineWidths[i];
int iX; int iX;
@@ -237,18 +240,22 @@ void BitmapText::SetText( CString sText, CString sAlternateText, int iWrapWidthP
if(StringWillUseAlternate(sText, sAlternateText)) if(StringWillUseAlternate(sText, sAlternateText))
sText = sAlternateText; sText = sAlternateText;
if(m_szText == sText) if( iWrapWidthPixels == -1 ) // wrap not specified
iWrapWidthPixels = m_iWrapWidthPixels;
if(m_sText == sText && iWrapWidthPixels==m_iWrapWidthPixels)
return; return;
m_szText = sText; m_sText = sText;
m_iWrapWidthPixels = iWrapWidthPixels;
// Break the string into lines. // Break the string into lines.
// //
m_szTextLines.clear(); m_wTextLines.clear();
if( iWrapWidthPixels == -1 ) if( iWrapWidthPixels == -1 )
{ {
split( CStringToWstring(sText), L"\n", m_szTextLines, false ); split( CStringToWstring(sText), L"\n", m_wTextLines, false );
} }
else else
{ {
@@ -285,13 +292,13 @@ void BitmapText::SetText( CString sText, CString sAlternateText, int iWrapWidthP
} }
else else
{ {
m_szTextLines.push_back( CStringToWstring(sCurLine) ); m_wTextLines.push_back( CStringToWstring(sCurLine) );
sCurLine = sWord; sCurLine = sWord;
iCurLineWidth = iWidthWord; iCurLineWidth = iWidthWord;
} }
} }
} }
m_szTextLines.push_back( CStringToWstring(sCurLine) ); m_wTextLines.push_back( CStringToWstring(sCurLine) );
} }
BuildChars(); BuildChars();
@@ -330,12 +337,12 @@ void BitmapText::CropToWidth( int iMaxWidthInSourcePixels )
{ {
iMaxWidthInSourcePixels = max( 0, iMaxWidthInSourcePixels ); iMaxWidthInSourcePixels = max( 0, iMaxWidthInSourcePixels );
for( unsigned l=0; l<m_szTextLines.size(); l++ ) // for each line for( unsigned l=0; l<m_wTextLines.size(); l++ ) // for each line
{ {
while( m_iLineWidths[l] > iMaxWidthInSourcePixels ) while( m_iLineWidths[l] > iMaxWidthInSourcePixels )
{ {
m_szTextLines[l].erase(m_szTextLines[l].end()-1, m_szTextLines[l].end()); m_wTextLines[l].erase(m_wTextLines[l].end()-1, m_wTextLines[l].end());
m_iLineWidths[l] = m_pFont->GetLineWidthInSourcePixels( m_szTextLines[l] ); m_iLineWidths[l] = m_pFont->GetLineWidthInSourcePixels( m_wTextLines[l] );
} }
} }
@@ -345,7 +352,7 @@ void BitmapText::CropToWidth( int iMaxWidthInSourcePixels )
// draw text at x, y using colorTop blended down to colorBottom, with size multiplied by scale // draw text at x, y using colorTop blended down to colorBottom, with size multiplied by scale
void BitmapText::DrawPrimitives() void BitmapText::DrawPrimitives()
{ {
if( m_szTextLines.empty() ) if( m_wTextLines.empty() )
return; return;
Actor::SetRenderStates(); // set Actor-specified render states Actor::SetRenderStates(); // set Actor-specified render states
@@ -425,3 +432,28 @@ void BitmapText::SetVertAlign( VertAlign va )
Actor::SetVertAlign(va); Actor::SetVertAlign(va);
BuildChars(); BuildChars();
} }
void BitmapText::HandleCommand( const CStringArray &asTokens )
{
HandleParams;
const CString& sName = asTokens[0];
// Commands that go in the tweening queue:
// Commands that take effect immediately (ignoring the tweening queue):
if( sName=="wrapwidthpixels" ) SetWrapWidthPixels( iParam(1) );
else
{
Actor::HandleCommand( asTokens );
return;
}
CheckHandledParams;
}
void BitmapText::SetWrapWidthPixels( int iWrapWidthPixels )
{
if( m_iWrapWidthPixels == iWrapWidthPixels )
return;
SetText( m_sText, "", iWrapWidthPixels );
}
+7 -4
View File
@@ -28,6 +28,7 @@ public:
bool LoadFromTextureAndChars( CString sTexturePath, CString sChars ); bool LoadFromTextureAndChars( CString sTexturePath, CString sChars );
void SetText( CString sText, CString sAlternateText = "", int iWrapWidthPixels = -1 ); void SetText( CString sText, CString sAlternateText = "", int iWrapWidthPixels = -1 );
void SetTextMaxWidth( float MaxWidth, const CString &text, const CString &alttext = "" ); void SetTextMaxWidth( float MaxWidth, const CString &text, const CString &alttext = "" );
void SetWrapWidthPixels( int iWrapWidthPixels );
int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; }; int GetWidestLineWidthInSourcePixels() { return m_iWidestLineWidth; };
void CropToWidth( int iWidthInSourcePixels ); void CropToWidth( int iWidthInSourcePixels );
@@ -40,21 +41,23 @@ public:
void SetHorizAlign( HorizAlign ha ); void SetHorizAlign( HorizAlign ha );
void SetVertAlign( VertAlign va ); void SetVertAlign( VertAlign va );
CString GetText() const { return m_szText; } CString GetText() const { return m_sText; }
/* Return true if the string 's' will use an alternate string, if available. */ /* Return true if the string 's' will use an alternate string, if available. */
bool StringWillUseAlternate(CString sText, CString sAlternateText) const; bool StringWillUseAlternate(CString sText, CString sAlternateText) const;
virtual void HandleCommand( const CStringArray &asTokens );
public: public:
Font* m_pFont; Font* m_pFont;
protected: protected:
// recalculate the items below on SetText() // recalculate the items below on SetText()
CString m_szText; CString m_sText;
vector<wstring> m_szTextLines; vector<wstring> m_wTextLines;
vector<int> m_iLineWidths; // in source pixels vector<int> m_iLineWidths; // in source pixels
int m_iWidestLineWidth; // in source pixels int m_iWidestLineWidth; // in source pixels
int m_iWrapWidthPixels; // -1 = no wrap
bool m_bRainbow; bool m_bRainbow;
+26 -20
View File
@@ -23,25 +23,27 @@
const float ITEM_X[NUM_PLAYERS] = { 260, 420 }; const float ITEM_X[NUM_PLAYERS] = { 260, 420 };
#define ICONS_X( p ) THEME->GetMetricF("ScreenOptions",ssprintf("IconsP%dX",p+1)) #define ICONS_X( p ) THEME->GetMetricF("ScreenOptions",ssprintf("IconsP%dX",p+1))
#define ARROWS_X THEME->GetMetricF("ScreenOptions","ArrowsX") #define ARROWS_X THEME->GetMetricF("ScreenOptions","ArrowsX")
#define LABELS_X THEME->GetMetricF("ScreenOptions","LabelsX") #define LABELS_X THEME->GetMetricF("ScreenOptions","LabelsX")
#define LABELS_ZOOM THEME->GetMetricF("ScreenOptions","LabelsZoom") #define LABELS_ZOOM THEME->GetMetricF("ScreenOptions","LabelsZoom")
#define LABELS_H_ALIGN THEME->GetMetricI("ScreenOptions","LabelsHAlign") #define LABELS_H_ALIGN THEME->GetMetricI("ScreenOptions","LabelsHAlign")
#define ITEMS_ZOOM THEME->GetMetricF("ScreenOptions","ItemsZoom") #define ITEMS_ZOOM THEME->GetMetricF("ScreenOptions","ItemsZoom")
#define ITEMS_START_X THEME->GetMetricF("ScreenOptions","ItemsStartX") #define ITEMS_START_X THEME->GetMetricF("ScreenOptions","ItemsStartX")
#define ITEMS_GAP_X THEME->GetMetricF("ScreenOptions","ItemsGapX") #define ITEMS_GAP_X THEME->GetMetricF("ScreenOptions","ItemsGapX")
#define ITEMS_START_Y THEME->GetMetricF("ScreenOptions","ItemsStartY") #define ITEMS_START_Y THEME->GetMetricF("ScreenOptions","ItemsStartY")
#define ITEMS_SPACING_Y THEME->GetMetricF("ScreenOptions","ItemsSpacingY") #define ITEMS_SPACING_Y THEME->GetMetricF("ScreenOptions","ItemsSpacingY")
#define EXPLANATION_X(p) THEME->GetMetricF("ScreenOptions",ssprintf("ExplanationP%dX",p+1)) #define EXPLANATION_X(p) THEME->GetMetricF("ScreenOptions",ssprintf("ExplanationP%dX",p+1))
#define EXPLANATION_Y(p) THEME->GetMetricF("ScreenOptions",ssprintf("ExplanationP%dY",p+1)) #define EXPLANATION_Y(p) THEME->GetMetricF("ScreenOptions",ssprintf("ExplanationP%dY",p+1))
#define EXPLANATION_TOGETHER_X THEME->GetMetricF("ScreenOptions","ExplanationTogetherX") #define EXPLANATION_ON_COMMAND(p) THEME->GetMetric ("ScreenOptions",ssprintf("ExplanationOnCommandP%dY",p+1))
#define EXPLANATION_TOGETHER_Y THEME->GetMetricF("ScreenOptions","ExplanationTogetherY") #define EXPLANATION_TOGETHER_X THEME->GetMetricF("ScreenOptions","ExplanationTogetherX")
#define ITEMS_SPACING_Y THEME->GetMetricF("ScreenOptions","ItemsSpacingY") #define EXPLANATION_TOGETHER_Y THEME->GetMetricF("ScreenOptions","ExplanationTogetherY")
#define EXPLANATION_ZOOM THEME->GetMetricF("ScreenOptions","ExplanationZoom") #define EXPLANATION_TOGETHER_ON_COMMAND THEME->GetMetric ("ScreenOptions","ExplanationTogetherOnCommand")
#define COLOR_SELECTED THEME->GetMetricC("ScreenOptions","ColorSelected") #define ITEMS_SPACING_Y THEME->GetMetricF("ScreenOptions","ItemsSpacingY")
#define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenOptions","ColorNotSelected") #define EXPLANATION_ZOOM THEME->GetMetricF("ScreenOptions","ExplanationZoom")
#define NUM_SHOWN_ITEMS THEME->GetMetricI("ScreenOptions","NumShownItems") #define COLOR_SELECTED THEME->GetMetricC("ScreenOptions","ColorSelected")
#define COLOR_NOT_SELECTED THEME->GetMetricC("ScreenOptions","ColorNotSelected")
#define NUM_SHOWN_ITEMS THEME->GetMetricI("ScreenOptions","NumShownItems")
ScreenOptions::ScreenOptions( CString sClassName ) : Screen(sClassName) ScreenOptions::ScreenOptions( CString sClassName ) : Screen(sClassName)
{ {
@@ -773,9 +775,13 @@ void ScreenOptions::OnChange()
{ {
case INPUTMODE_INDIVIDUAL: case INPUTMODE_INDIVIDUAL:
pText = &m_textExplanation[p]; pText = &m_textExplanation[p];
pText->FinishTweening();
pText->Command( EXPLANATION_ON_COMMAND(p) );
break; break;
case INPUTMODE_TOGETHER: case INPUTMODE_TOGETHER:
pText = &m_textExplanation[0]; pText = &m_textExplanation[0];
pText->FinishTweening();
pText->Command( EXPLANATION_TOGETHER_ON_COMMAND );
break; break;
} }
@@ -791,7 +797,7 @@ void ScreenOptions::OnChange()
sLineName.Replace("\n-",""); sLineName.Replace("\n-","");
sLineName.Replace("\n",""); sLineName.Replace("\n","");
sLineName.Replace(" ",""); sLineName.Replace(" ","");
pText->SetText( THEME->GetMetric(m_sName,sLineName), "", 800 ); pText->SetText( THEME->GetMetric(m_sName,sLineName) );
} }
} }
} }