New Pasword Input Screen and SMOnline Login

This commit is contained in:
Adam Lowman
2005-01-26 08:50:09 +00:00
parent 73a63247e6
commit 914b8233ee
7 changed files with 309 additions and 349 deletions
+132 -80
View File
@@ -49,7 +49,7 @@ ChoiceNames=1,2,3,4,5,6,7
DefaultChoice=1 DefaultChoice=1
NumChoicesOnPage1=100 NumChoicesOnPage1=100
WrapCursor=1 WrapCursor=1
Choice1=ApplyDefaultOptions;screen,ScreenCautionBranch Choice1=ApplyDefaultOptions;screen,ScreenCaution
Choice2=screen,ScreenSelectGame Choice2=screen,ScreenSelectGame
Choice3=screen,ScreenOptionsMenu Choice3=screen,ScreenOptionsMenu
Choice4=screen,ScreenEditMenu Choice4=screen,ScreenEditMenu
@@ -104,14 +104,6 @@ Class=ScreenTitleMenu
Fallback=ScreenTitleMenu Fallback=ScreenTitleMenu
ChoiceNames=1 ChoiceNames=1
[ScreenCautionBranch]
Class=ScreenBranch
Choices=1,2
Condition1=ShowCaution()
Condition2=true
NextScreen1=screen,ScreenCaution
NextScreen2=screen,ScreenSelectStyle
[ScreenCaution] [ScreenCaution]
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
Class=ScreenSelectMaster Class=ScreenSelectMaster
@@ -700,8 +692,8 @@ StyleIcon=1
MemoryCardIcons=1 MemoryCardIcons=1
SampleMusicDelay=0.25 SampleMusicDelay=0.25
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
NextScreen=ScreenStage NextScreen=ScreenBranchGameplay
NextOptionsScreen=@SelectFirstOptionsScreen() NextOptionsScreen=ScreenBranchFirstOptions
DoRouletteOnMenuTimer=1 DoRouletteOnMenuTimer=1
AlignMusicBeat=0 AlignMusicBeat=0
Codes= Codes=
@@ -756,45 +748,15 @@ ScoreFrameP2OnCommand=hidden,1
Fallback=ScreenSelectCourse Fallback=ScreenSelectCourse
DefaultSort=Endless DefaultSort=Endless
[ScreenSMOnlineLogin1]
PlayerNumber=1
Class=ScreenSMOnlineLogin
Fallback=ScreenSMOnlineLogin
[ScreenSMOnlineLogin2]
PlayerNumber=2
Class=ScreenSMOnlineLogin
Fallback=ScreenSMOnlineLogin
[ScreenSMOnlineLogin] [ScreenSMOnlineLogin]
PasswordBG= Fallback=ScreenOperatorMenu
NextScreen=@LoginScreen() NextScreen=ScreenNetRoom
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
PasswordBGX=235 CapitalizeAllOptionNames=0
PasswordBGY=260
PasswordBGOnCommand=
PasswordBGOffCommand=
TitleX=320
TitleY=50
TitleOnCommand=
TitleOffCommand=
UserNameX=320
UserNameY=150
UserNameOnCommand=
UserNameOffCommand=
PasswordX=315
PasswordY=260
PasswordOnCommand=
PasswordOffCommand=
LoginMessageX=320
LoginMessageY=290
LoginMessageOnCommand=
LoginMessageOffCommand=
StyleIcon=
MemoryCardIcons=
TimerSeconds=99
HelpText= HelpText=
Fallback=ScreenWithMenuElements StyleIcon=0
MemoryCardIcons=0
TimerSeconds=0
[ScreenNetRoom] [ScreenNetRoom]
MusicSelectScreen=ScreenSMOnlineSelectMusic MusicSelectScreen=ScreenSMOnlineSelectMusic
@@ -833,7 +795,7 @@ CreateRoomOnCommand=diffusealpha,0;linear,1;diffusealpha,1.0;zoom,0.5
CreateRoomOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0 CreateRoomOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
NumRoomsShow=10 NumRoomsShow=10
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
NextScreen=ScreenGameplayBranch NextScreen=ScreenStage
Fallback=ScreenNetSelectMusic Fallback=ScreenNetSelectMusic
[ScreenSMOnlineSelectMusic] [ScreenSMOnlineSelectMusic]
@@ -842,44 +804,50 @@ Class=ScreenNetSelectMusic
Fallback=ScreenNetSelectMusic Fallback=ScreenNetSelectMusic
[ScreenNetSelectMusic] [ScreenNetSelectMusic]
WheelX=SCREEN_CENTER_X+160 ChatInputBoxY=SCREEN_CENTER_Y+90
WheelY=SCREEN_CENTER_Y+4
WheelOnCommand=
WheelOffCommand=
BPMDisplayX=SCREEN_CENTER_X-200
BPMDisplayY=SCREEN_CENTER_Y+180
BPMDisplayOnCommand=addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6
BPMDisplayOffCommand=bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6
OptionIconsP1X=SCREEN_CENTER_X-290
OptionIconsP1Y=SCREEN_CENTER_Y-175
OptionIconsP1OnCommand=zoomy,0;linear,0.5;zoomy,1
OptionIconsP1OffCommand=linear,0.5;zoomy,0
OptionIconsP2X=SCREEN_CENTER_X-290
OptionIconsP2Y=SCREEN_CENTER_Y-145
OptionIconsP2OnCommand=zoomy,0;linear,0.5;zoomy,1
OptionIconsP2OffCommand=linear,0.5;zoomy,0
ChatInputBoxY=SCREEN_CENTER_Y+110
ChatInputBoxX=SCREEN_CENTER_X-150 ChatInputBoxX=SCREEN_CENTER_X-150
ChatInputBoxOnCommand=addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6 ChatInputBoxOnCommand=addx,-SCREEN_WIDTH*0.6;bounceend,0.5;addx,SCREEN_WIDTH*0.6
ChatInputBoxOffCommand=bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6 ChatInputBoxOffCommand=bouncebegin,0.5;addx,-SCREEN_WIDTH*0.6
ChatInputBoxWidth=300 ChatInputBoxWidth=300
ChatInputBoxHeight=50 ChatInputBoxHeight=50
ChatInputBoxColor=0.5,0.5,1.0,0.7 //transparent cyan ChatInputBoxColor=0.5,0.5,1.0,0.7 //transparent cyan
ChatOutputBoxY=SCREEN_CENTER_Y-28 ChatOutputBoxY=SCREEN_CENTER_Y-48
ChatOutputBoxX=SCREEN_CENTER_X-150 ChatOutputBoxX=SCREEN_CENTER_X-150
ChatOutputBoxOnCommand=diffusealpha,0;linear,0.5;diffusealpha,1 ChatOutputBoxOnCommand=diffusealpha,0;linear,0.5;diffusealpha,1
ChatOutputBoxOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.0;zoomy,0.0 ChatOutputBoxOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.0;zoomy,0.0
ChatOutputBoxWidth=300 ChatOutputBoxWidth=300
ChatOutputBoxHeight=200 ChatOutputBoxHeight=200
ChatOutputBoxColor=1.0,0.5,0.5,0.7 //transparent reddish ChatOutputBoxColor=1.0,0.5,0.5,0.7 //transparent reddish
ChatInputY=SCREEN_CENTER_Y+90 ChatInputY=SCREEN_CENTER_Y+70
ChatInputX=SCREEN_CENTER_X-300 ChatInputX=SCREEN_CENTER_X-300
ChatInputOnCommand=zoomx,0.0;zoomy,0.0;diffusealpha,0;linear,0.5;diffusealpha,0.8;zoomx,0.5;zoomy,0.5 ChatInputOnCommand=zoomx,0.0;zoomy,0.0;diffusealpha,0;linear,0.5;diffusealpha,0.8;zoomx,0.5;zoomy,0.5
ChatInputOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.25;zoomy,0.25 ChatInputOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.25;zoomy,0.25
ChatOutputY=SCREEN_CENTER_Y+84 ChatOutputY=SCREEN_CENTER_Y+64
ChatOutputX=SCREEN_CENTER_X-300 ChatOutputX=SCREEN_CENTER_X-300
ChatOutputOnCommand=zoomx,1.0;zoomy,1.0;diffusealpha,0;linear,0.5;diffusealpha,0.8;zoomx,0.5;zoomy,0.5 ChatOutputOnCommand=zoomx,1.0;zoomy,1.0;diffusealpha,0;linear,0.5;diffusealpha,0.8;zoomx,0.5;zoomy,0.5
ChatOutputOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.25;zoomy,0.25 ChatOutputOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.25;zoomy,0.25
GroupsListY=SCREEN_CENTER_Y-90
GroupsListX=SCREEN_CENTER_X+160
GroupsListOnCommand=zoomx,0.0;diffusealpha,0;linear,0.5;diffusealpha,1;zoomx,1.0
GroupsListOffCommand=diffusealpha,1;linear,0.5;diffusealpha,0;zoomx,0.0
GroupsBGColor=0.7,0.7,0.7,0.7 //grayish
GroupsBGWidth=300
GroupsBGHeight=150
GroupsBGY=SCREEN_CENTER_Y-90
GroupsBGX=SCREEN_CENTER_X+160
GroupsBGOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
GroupsBGOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
SongsListY=SCREEN_CENTER_Y+110
SongsListX=SCREEN_CENTER_X+160
SongsListOnCommand=addy,400;bounceend,0.5;addy,-400
SongsListOffCommand=bouncebegin,0.5;addy,400
SongsBGColor=0.7,0.7,0.7,0.7
SongsBGWidth=300
SongsBGHeight=220
SongsBGX=SCREEN_CENTER_X+160
SongsBGY=SCREEN_CENTER_Y+110
SongsBGOnCommand=addx,SCREEN_WIDTH*0.6;bounceend,0.5;addx,-SCREEN_WIDTH*0.6
SongsBGOffCommand=bouncebegin,0.5;addx,SCREEN_WIDTH*0.6
UsersBGColor=0.7,0.7,0.7,0.7 UsersBGColor=0.7,0.7,0.7,0.7
UsersBGWidth=640 UsersBGWidth=640
UsersBGHeight=50 UsersBGHeight=50
@@ -898,6 +866,17 @@ Users1Color=1.0,1.0,1.0,1.0 //Inactive; Undefined
Users2Color=0.5,0.5,1.0,1.0 //Active, In NetScreen Users2Color=0.5,0.5,1.0,1.0 //Active, In NetScreen
Users3Color=0.5,1.0,0.5,1.0 //Active, In Options Users3Color=0.5,1.0,0.5,1.0 //Active, In Options
Users4Color=1.0,0.5,0.5,1.0 //Active, in Evaluation Users4Color=1.0,0.5,0.5,1.0 //Active, in Evaluation
SelectionColor=0.0,1.0,0.2,0.4
SelectionHeight=30
SelectionWidth=300
SelectionY=SCREEN_CENTER_Y-90
SelectionX=SCREEN_CENTER_X+160
SelectionOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0;diffusealpha,0.7
SelectionOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
SelectionTo1Command=linear,0.3;zoomy,1.0;zoomx,1.0;x,480;y,150
SelectionTo2Command=linear,0.3;zoomy,1.0;zoomx,1.0;x,480;y,350
SelectionTo3Command=linear,0.3;x,260;y,400;zoomx,0.4;zoomy,2.0
SelectionTo4Command=linear,0.3;x,80;y,70;zoomx,0.4;zoomy,2.2
optionsY=SCREEN_CENTER_Y-170 optionsY=SCREEN_CENTER_Y-170
optionsX=SCREEN_CENTER_X-240 optionsX=SCREEN_CENTER_X-240
optionsOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,0.7;zoomx,0.7 optionsOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,0.7;zoomx,0.7
@@ -925,6 +904,28 @@ DiffBGY=SCREEN_CENTER_Y+160
DiffBGX=SCREEN_CENTER_X-60 DiffBGX=SCREEN_CENTER_X-60
DiffBGOnCommand=zoomz,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0 DiffBGOnCommand=zoomz,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
DiffBGOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0 DiffBGOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
ExInfoBGColor=0.7,0.7,0.7,0.7
ExInfoBGWidth=200
ExInfoBGHeight=60
ExInfoBGY=SCREEN_CENTER_Y+160
ExInfoBGX=SCREEN_CENTER_X-220
ExInfoBGOnCommand=zoomz,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
ExInfoBGOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
SongsArtistY=SCREEN_CENTER_Y+140
SongsArtistX=SCREEN_CENTER_X-220
SongsArtistWidth=200
SongsArtistOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
SongsArtistOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
SongsSubtitleY=SCREEN_CENTER_Y+160
SongsSubtitleX=SCREEN_CENTER_X-220
SongsSubtitleWidth=200
SongsSubtitleOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
SongsSubtitleOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
SongsGroupY=SCREEN_CENTER_Y+180
SongsGroupX=SCREEN_CENTER_X-220
SongsGroupWidth=200
SongsGroupOnCommand=zoomx,0.0;zoomy,0.0;linear,0.5;zoomy,1.0;zoomx,1.0
SongsGroupOffCommand=linear,0.5;zoomx,0.0;zoomy,0.0
ChatOutputLines=18 ChatOutputLines=18
NumStylesShow=1 NumStylesShow=1
NumSongsShow=4 NumSongsShow=4
@@ -932,7 +933,7 @@ NumGroupsShow=3
StyleIcon= StyleIcon=
MemoryCardIcons= MemoryCardIcons=
TimerSeconds= TimerSeconds=
HelpText=Up: Options, Down: Change Difficulty, Left + Right: Change Sort HelpText=
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
NextScreen=ScreenStage NextScreen=ScreenStage
NoSongsScreen=ScreenTitleBranch NoSongsScreen=ScreenTitleBranch
@@ -990,16 +991,24 @@ DifficultyRatingOrientation=0
DifficultyRatingSpacing=40.0 DifficultyRatingSpacing=40.0
PreviewMusicMode=0 // 0 = play music as you select, 1 = no music plays, select once and preview music plays, select again for confirm, 2 = no music plays at all, 3 = play music as select, press twice to confirm, 4 = static menu music plays, no confirm PreviewMusicMode=0 // 0 = play music as you select, 1 = no music plays, select once and preview music plays, select again for confirm, 2 = no music plays at all, 3 = play music as select, press twice to confirm, 4 = static menu music plays, no confirm
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
NextScreen=ScreenStage NextScreen=ScreenBranchGameplay
NextOptionsScreen=@SelectFirstOptionsScreen() NextOptionsScreen=ScreenBranchFirstOptions
TimerSeconds=60 TimerSeconds=60
TimerStealth=0 TimerStealth=0
StyleIcon=0 StyleIcon=0
MemoryCardIcons=0 MemoryCardIcons=0
[ScreenBranchGameplay]
Class=ScreenBranch
Choices=1,2
Condition1=IsExtraStage() or IsExtraStage2()
Condition2=true
NextScreen1=screen,ScreenStageExtra
NextScreen2=screen,ScreenStage
[ScreenStage] [ScreenStage]
NextScreen=@SelectGameplayScreen() NextScreen=ScreenGameplay
PrevScreen=@SongSelectionScreen() PrevScreen=ScreenBranchSelectSongOrCourse
// This is the minimum delay after the "in" transition before the // This is the minimum delay after the "in" transition before the
// "out" transition will begin. (NextScreen is loaded during this // "out" transition will begin. (NextScreen is loaded during this
// time.) // time.)
@@ -1030,11 +1039,16 @@ BackgroundOffCommand=
OverlayOnCommand= OverlayOnCommand=
OverlayOffCommand= OverlayOffCommand=
[ScreenStageExtra]
Class=ScreenStage
Fallback=ScreenStage
NextScreen=ScreenGameplayExtra
[ScreenGameplay] [ScreenGameplay]
ShowEvaluationOnFail=0 ShowEvaluationOnFail=0
StaticBGY=SCREEN_CENTER_Y+0 StaticBGY=SCREEN_CENTER_Y+0
StaticBGX=SCREEN_CENTER_X+0 StaticBGX=SCREEN_CENTER_X+0
PrevScreen=@SongSelectionScreen() PrevScreen=ScreenBranchSelectSongOrCourse
NextScreen=@SelectEvaluationScreen() NextScreen=@SelectEvaluationScreen()
InitialBackgroundBrightnessRegular=1 InitialBackgroundBrightnessRegular=1
InitialBackgroundBrightnessNonstop=1 InitialBackgroundBrightnessNonstop=1
@@ -3319,7 +3333,7 @@ TimerSeconds=24
MaxRankingNameLength=4 MaxRankingNameLength=4
StyleIcon=1 StyleIcon=1
MemoryCardIcons=1 MemoryCardIcons=1
NextScreen=@SelectEndingScreen() NextScreen=ScreenBranchEnding
PlayerP1OnePlayerOneSideX=SCREEN_CENTER_X-160 PlayerP1OnePlayerOneSideX=SCREEN_CENTER_X-160
PlayerP2OnePlayerOneSideX=SCREEN_CENTER_X+160 PlayerP2OnePlayerOneSideX=SCREEN_CENTER_X+160
PlayerP1TwoPlayersTwoSidesX=SCREEN_CENTER_X-160 PlayerP1TwoPlayersTwoSidesX=SCREEN_CENTER_X-160
@@ -3327,6 +3341,14 @@ PlayerP2TwoPlayersTwoSidesX=SCREEN_CENTER_X+160
PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X PlayerP1OnePlayerTwoSidesX=SCREEN_CENTER_X
PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X PlayerP2OnePlayerTwoSidesX=SCREEN_CENTER_X
[ScreenBranchEnding]
Class=ScreenBranch
Choices=Credits,MusicScroll
ConditionCredits=GetBestFinalGrade() <= Grade("AA")
ConditionMusicScroll=true
NextScreenCredits=screen,ScreenCredits
NextScreenMusicScroll=screen,ScreenMusicScroll
[EditMenu] [EditMenu]
Arrows1X=SCREEN_CENTER_X-130 Arrows1X=SCREEN_CENTER_X-130
Arrows2X=SCREEN_CENTER_X+270 Arrows2X=SCREEN_CENTER_X+270
@@ -3501,6 +3523,18 @@ LineNames=1
OptionMenuFlags=together OptionMenuFlags=together
Line1=conf,Game Line1=conf,Game
[ScreenBranchSelectSongOrCourse]
Class=ScreenBranch
Choices=1,2,3,4
Condition1=PlayModeName() == "Nonstop"
Condition2=PlayModeName() == "Oni"
Condition3=PlayModeName() == "Endless"
Condition4=true
NextScreen1=screen,ScreenSelectCourseNonstop
NextScreen2=screen,ScreenSelectCourseOni
NextScreen3=screen,ScreenSelectCourseEndless
NextScreen4=screen,ScreenSelectBranchForNet
[ScreenEvaluationExitBranch] [ScreenEvaluationExitBranch]
Class=ScreenBranch Class=ScreenBranch
Choices=1,2,3 Choices=1,2,3
@@ -3511,9 +3545,19 @@ NextScreen1=screen,ScreenNetRoom
NextScreen2=screen,ScreenNetSelectMusic NextScreen2=screen,ScreenNetSelectMusic
NextScreen3=screen,ScreenSelectMusic NextScreen3=screen,ScreenSelectMusic
[ScreenSelectBranchForNet]
Class=ScreenBranch
Choices=1,2,3
Condition1=IsNetSMOnline()
Condition2=IsNetConnected()
Condition3=true
NextScreen1=screen,ScreenSMOnlineLogin
NextScreen2=screen,ScreenNetSelectMusic
NextScreen3=screen,ScreenSelectMusic
[ScreenPlayerOptions] [ScreenPlayerOptions]
Fallback=ScreenOptions Fallback=ScreenOptions
PrevScreen=@SongSelectionScreen() PrevScreen=ScreenBranchSelectSongOrCourse
NextScreen=ScreenSongOptions NextScreen=ScreenSongOptions
TimerSeconds=30 TimerSeconds=30
StyleIcon=0 StyleIcon=0
@@ -3549,7 +3593,7 @@ CancelAllP2ShowCommand=
Fallback=ScreenOptions Fallback=ScreenOptions
Class=ScreenOptionsMaster Class=ScreenOptionsMaster
PrevScreen=ScreenSelectMusic PrevScreen=ScreenSelectMusic
NextScreen=ScreenStage NextScreen=ScreenBranchGameplay
TimerSeconds=30 TimerSeconds=30
StyleIcon=0 StyleIcon=0
MemoryCardIcons=0 MemoryCardIcons=0
@@ -3562,10 +3606,18 @@ Line3=list,NoteSkins
Line4=list,Persp Line4=list,Persp
Line5=Steps Line5=Steps
[ScreenBranchFirstOptions]
Class=ScreenBranch
Choices=1,2
Condition1=PlayModeName() == "Rave"
Condition2=true
NextScreen1=screen,ScreenRaveOptions
NextScreen2=screen,ScreenPlayerOptions
[ScreenSongOptions] [ScreenSongOptions]
Fallback=ScreenOptions Fallback=ScreenOptions
PrevScreen=@SelectFirstOptionsScreen() PrevScreen=ScreenBranchFirstOptions
NextScreen=ScreenStage NextScreen=ScreenBranchGameplay
Game=Change the current game type with this option. Game=Change the current game type with this option.
TimerSeconds=30 TimerSeconds=30
StyleIcon=0 StyleIcon=0
@@ -3650,7 +3702,7 @@ TimerSeconds=40
StyleIcon=1 StyleIcon=1
MemoryCardIcons=1 MemoryCardIcons=1
PrevScreen=ScreenTitleBranch PrevScreen=ScreenTitleBranch
NextScreen=@SongSelectionScreen() NextScreen=ScreenBranchSelectSongOrCourse
[BeginnerHelper] [BeginnerHelper]
# All X,Y coordinates are relative to the HelperX,Y # All X,Y coordinates are relative to the HelperX,Y
+14 -10
View File
@@ -99,7 +99,6 @@ void ScreenManager::ThemeChanged()
// reload shared BGA // reload shared BGA
m_pSharedBGA->LoadFromAniDir( m_sLastLoadedBackgroundPath ); m_pSharedBGA->LoadFromAniDir( m_sLastLoadedBackgroundPath );
m_pSharedBGA->PlayCommand( "On" );
} }
void ScreenManager::EmptyDeleteQueue() void ScreenManager::EmptyDeleteQueue()
@@ -214,14 +213,7 @@ void ScreenManager::Input( const DeviceInput& DeviceI, const InputEventType type
// DeviceI.device, DeviceI.button, GameI.controller, GameI.button, MenuI.player, MenuI.button, StyleI.player, StyleI.col ); // DeviceI.device, DeviceI.button, GameI.controller, GameI.button, MenuI.player, MenuI.button, StyleI.player, StyleI.col );
// pass input only to topmost state // pass input only to topmost state
if( m_ScreenStack.empty() ) if( !m_ScreenStack.empty() )
return;
/* If a screen is queued to load, discard other inputs. Coin inputs
* are handled before they get here, so they won't be discarded. */
if( m_sDelayedScreen != "" )
return;
m_ScreenStack.back()->Input( DeviceI, type, GameI, MenuI, StyleI ); m_ScreenStack.back()->Input( DeviceI, type, GameI, MenuI, StyleI );
} }
@@ -384,7 +376,6 @@ retry:
// any common textures loaded. // any common textures loaded.
BGAnimation *pNewBGA = new BGAnimation; BGAnimation *pNewBGA = new BGAnimation;
pNewBGA->LoadFromAniDir( sNewBGA ); pNewBGA->LoadFromAniDir( sNewBGA );
pNewBGA->PlayCommand( "On" );
SAFE_DELETE( m_pSharedBGA ); SAFE_DELETE( m_pSharedBGA );
m_pSharedBGA = pNewBGA; m_pSharedBGA = pNewBGA;
@@ -461,6 +452,19 @@ void ScreenManager::TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion,
m_MessageSendOnPop = SM_SendWhenDone; m_MessageSendOnPop = SM_SendWhenDone;
} }
void ScreenManager::Password( ScreenMessage SM_SendWhenDone, const CString &sText, void(*OnOK)(CString sPassword), void(*OnCancel)() )
{
if( m_ScreenStack.size() )
m_ScreenStack.back()->HandleScreenMessage( SM_LoseFocus );
// add the new state onto the back of the array
Screen *pNewScreen = new ScreenTextEntry( "ScreenTextEntry", sText, "", OnOK, OnCancel, true );
pNewScreen->Init();
SetFromNewScreen( pNewScreen, true );
m_MessageSendOnPop = SM_SendWhenDone;
}
void ScreenManager::MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel ) void ScreenManager::MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel )
{ {
if( m_ScreenStack.size() ) if( m_ScreenStack.size() )
+1
View File
@@ -41,6 +41,7 @@ public:
void SetNewScreen( const CString &sName ); void SetNewScreen( const CString &sName );
void AddNewScreenToTop( const CString &sName, ScreenMessage messageSendOnPop ); void AddNewScreenToTop( const CString &sName, ScreenMessage messageSendOnPop );
void Prompt( ScreenMessage SM_SendWhenDone, const CString &sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL ); void Prompt( ScreenMessage SM_SendWhenDone, const CString &sText, bool bYesNo = false, bool bDefaultAnswer = false, void(*OnYes)(void*) = NULL, void(*OnNo)(void*) = NULL, void* pCallbackData = NULL );
void Password( ScreenMessage SM_SendWhenDone, const CString &sText, void(*OnOK)(CString sPassword) = NULL, void(*OnCanel)() = NULL );
void TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL ); void TextEntry( ScreenMessage SM_SendWhenDone, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL );
void MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel = SM_None ); void MiniMenu( Menu* pDef, ScreenMessage SM_SendOnOK, ScreenMessage SM_SendOnCancel = SM_None );
void PopTopScreen( ScreenMessage SM = SM_None ); void PopTopScreen( ScreenMessage SM = SM_None );
+127 -186
View File
@@ -1,213 +1,155 @@
#include "global.h"
#if !defined(WITHOUT_NETWORKING) #if !defined(WITHOUT_NETWORKING)
#include "global.h"
#include "ScreenSMOnlineLogin.h" #include "ScreenSMOnlineLogin.h"
#include "ScreenManager.h" #include "RageLog.h"
#include "ThemeManager.h" #include "ProfileManager.h"
#include "RageTimer.h"
#include "ActorUtil.h"
#include "Actor.h"
#include "GameSoundManager.h" #include "GameSoundManager.h"
#include "MenuTimer.h" #include "ThemeManager.h"
#include "NetworkSyncManager.h" #include "PrefsManager.h"
#include "RageUtil.h" #include "ScreenManager.h"
#include "ScreenTextEntry.h"
#include "ScreenPrompt.h"
#include "VirtualKeyboard.h"
#include "GameState.h" #include "GameState.h"
#include "ScreenDimensions.h" #include "NetworkSyncManager.h"
#include "ScreenTextEntry.h"
#include "crypto/CryptMD5.h" #include "crypto/CryptMD5.h"
REGISTER_SCREEN_CLASS(ScreenSMOnlineLogin);
#define PREV_SCREEN THEME->GetMetric (m_sName,"PrevScreen")
#define NEXT_SCREEN THEME->GetMetric (m_sName,"NextScreen")
const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8); const ScreenMessage SM_SMOnlinePack = ScreenMessage(SM_User+8);
const ScreenMessage SM_PasswordDone = ScreenMessage(SM_User+9);
OptionRowData g_ProfileLine[1] = {
OptionRowData("Profile",false)
};
REGISTER_SCREEN_CLASS( ScreenSMOnlineLogin ); ScreenSMOnlineLogin::ScreenSMOnlineLogin(CString sClassName) : ScreenOptions(sClassName) {
ScreenSMOnlineLogin::ScreenSMOnlineLogin( const CString& sName ) : ScreenWithMenuElements( sName ) LOG->Trace( "ScreenSMOnlineLogin::ScreenSMOnlineLogin()" );
{
m_iPlayer = THEME->GetMetricI( sName, "PlayerNumber" ) - 1;
if ( GAMESTATE->IsPlayerEnabled( (PlayerNumber)m_iPlayer ) ) g_ProfileLine[0].choices.clear();
m_sUserName = GAMESTATE->GetPlayerDisplayName((PlayerNumber)m_iPlayer); PROFILEMAN->GetLocalProfileNames( g_ProfileLine[0].choices );
if(!g_ProfileLine[0].choices.size()) {
SCREENMAN->SystemMessage("You Must Define A Profile!");
SCREENMAN->SetNewScreen("ScreenProfileOptions");
}
else {
InitMenu(INPUTMODE_SHARE_CURSOR, g_ProfileLine, 1);
SOUND->PlayMusic( THEME->GetPathToS("ScreenMachineOptions music"));
Row &row = *m_Rows.back();
BitmapText *bt = row.m_textItems.back();
bt->SetText("Login"); //Change "Exit" Text
}
}
void ScreenSMOnlineLogin::ImportOptions() {
vector<CString> vsProfiles;
PROFILEMAN->GetLocalProfileIDs( vsProfiles );
CStringArray::iterator iter;
iter = find(
vsProfiles.begin(),
vsProfiles.end(),
PREFSMAN->m_sDefaultLocalProfileID[0] );
if( iter != vsProfiles.end() )
m_Rows[0]->SetOneSelection((PlayerNumber) 0, iter - vsProfiles.begin());
iter = find(
vsProfiles.begin(),
vsProfiles.end(),
PREFSMAN->m_sDefaultLocalProfileID[1] );
if( iter != vsProfiles.end() )
m_Rows[0]->SetOneSelection((PlayerNumber) 1, iter - vsProfiles.begin());
}
void ScreenSMOnlineLogin::ExportOptions() {
vector<CString> vsProfiles;
PROFILEMAN->GetLocalProfileIDs( vsProfiles );
if(GAMESTATE->IsPlayerEnabled((PlayerNumber) 0))
PREFSMAN->m_sDefaultLocalProfileID[0] = vsProfiles[m_Rows[0]->GetOneSelection((PlayerNumber) 0)];
if(GAMESTATE->IsPlayerEnabled((PlayerNumber) 1))
PREFSMAN->m_sDefaultLocalProfileID[0] = vsProfiles[m_Rows[0]->GetOneSelection((PlayerNumber) 1)];
}
void ScreenSMOnlineLogin::GoToPrevScreen() {
SCREENMAN->SetNewScreen(PREV_SCREEN);
}
void ScreenSMOnlineLogin::GoToNextScreen() {
PREFSMAN->SaveGlobalPrefsToDisk();
PROFILEMAN->LoadLocalProfileFromMachine((PlayerNumber) 0);
PROFILEMAN->LoadLocalProfileFromMachine((PlayerNumber) 1); //Update Profiles
if(GAMESTATE->IsPlayerEnabled((PlayerNumber) 0) && GAMESTATE->IsPlayerEnabled((PlayerNumber) 1) &&
(GAMESTATE->GetPlayerDisplayName((PlayerNumber) 0) == GAMESTATE->GetPlayerDisplayName((PlayerNumber) 1))) {
SCREENMAN->SystemMessage("Each Player Needs A Unique Profile!");
SCREENMAN->SetNewScreen("ScreenSMOnlineLogin");
}
else {
m_iPlayer=0;
while(!GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer))
++m_iPlayer;
SCREENMAN->Password(SM_PasswordDone, "You are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
}
}
void ScreenSMOnlineLogin::HandleScreenMessage(const ScreenMessage SM) {
switch(SM) {
case SM_PasswordDone:
if(!ScreenTextEntry::s_bCancelledLast)
SendLogin(ScreenTextEntry::s_sLastAnswer);
else else
m_sUserName = "INVALID"; SCREENMAN->SetNewScreen(PREV_SCREEN);
m_sprPassword.SetName( "PasswordBG" );
m_sprPassword.Load( THEME->GetPathG( m_sName, "PasswordBG" ) );
m_sprPassword.SetHorizAlign( align_left );
SET_XY_AND_ON_COMMAND( m_sprPassword );
this->AddChild( &m_sprPassword );
m_textTitle.LoadFromFont( THEME->GetPathF(m_sName,"text") );
m_textTitle.SetName( "Title" );
SET_XY_AND_ON_COMMAND( m_textTitle );
this->AddChild( &m_textTitle );
m_textTitle.SetText( NSMAN->GetServerName() );
m_textUserName.LoadFromFont( THEME->GetPathF(m_sName,"text") );
m_textUserName.SetName( "UserName" );
m_textUserName.SetWrapWidthPixels( (int)SCREEN_WIDTH );
SET_XY_AND_ON_COMMAND( m_textUserName );
this->AddChild( &m_textUserName );
//XXX: Yuck, this should be metric'ed out when we get a chance
m_textUserName.SetText( "You are logging on as " + m_sUserName + " if this is incorrect, please change your profile." );
m_textPassword.LoadFromFont( THEME->GetPathF(m_sName,"text") );
m_textPassword.SetName( "Password" );
SET_XY_AND_ON_COMMAND( m_textPassword );
this->AddChild( &m_textPassword );
m_sPassword = "";
m_textLoginMessage.LoadFromFont( THEME->GetPathF(m_sName,"text") );
m_textLoginMessage.SetName( "LoginMessage" );
SET_XY_AND_ON_COMMAND( m_textLoginMessage );
this->AddChild( &m_textLoginMessage );
NSMAN->isSMOLoggedIn[m_iPlayer] = false;
}
void ScreenSMOnlineLogin::Input( const DeviceInput& DeviceI, const InputEventType type,
const GameInput& GameI, const MenuInput& MenuI,
const StyleInput& StyleI )
{
if( m_In.IsTransitioning() || m_Out.IsTransitioning() )
return;
if( (type != IET_FIRST_PRESS) && (type != IET_SLOW_REPEAT) && (type != IET_FAST_REPEAT ) )
return;
bool bHoldingShift =
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LSHIFT)) ||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RSHIFT));
bool bHoldingCtrl =
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL)) ||
(!NSMAN->useSMserver); //If we are disconnected, assume no chatting
switch( DeviceI.button )
{
case KEY_ENTER:
case KEY_KP_ENTER:
if ( m_sPassword != "" )
SendLogin();
return;
break; break;
case KEY_BACK:
if(!m_sPassword.empty())
m_sPassword = m_sPassword.erase( m_sPassword.size()-1 );
UpdateTextInput();
break;
default:
char c;
c = DeviceI.ToChar();
if( bHoldingShift && !bHoldingCtrl )
{
c = (char)toupper(c);
switch( c )
{
case '`': c='~'; break;
case '1': c='!'; break;
case '2': c='@'; break;
case '3': c='#'; break;
case '4': c='$'; break;
case '5': c='%'; break;
case '6': c='^'; break;
case '7': c='&'; break;
case '8': c='*'; break;
case '9': c='('; break;
case '0': c=')'; break;
case '-': c='_'; break;
case '=': c='+'; break;
case '[': c='{'; break;
case ']': c='}'; break;
case '\'': c='"'; break;
case '\\': c='|'; break;
case ';': c=':'; break;
case ',': c='<'; break;
case '.': c='>'; break;
case '/': c='?'; break;
}
}
if( (c >= ' ') && (!bHoldingCtrl) )
{
m_sPassword += c;
UpdateTextInput();
}
break;
}
Screen::Input( DeviceI, type, GameI, MenuI, StyleI ); // default input handler
}
void ScreenSMOnlineLogin::HandleScreenMessage( const ScreenMessage SM )
{
Screen::HandleScreenMessage( SM );
switch( SM )
{
case SM_GoToPrevScreen:
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "PrevScreen") );
break;
case SM_GoToNextScreen:
SCREENMAN->SetNewScreen( THEME->GetMetric (m_sName, "NextScreen") );
break;
case SM_SMOnlinePack: case SM_SMOnlinePack:
int ResponceCode = NSMAN->m_SMOnlinePacket.Read1(); int ResponceCode = NSMAN->m_SMOnlinePacket.Read1();
if ( ResponceCode == 0 ) if (ResponceCode == 0) {
{
int Status = NSMAN->m_SMOnlinePacket.Read1(); int Status = NSMAN->m_SMOnlinePacket.Read1();
if ( Status == 0 ) if(Status == 0) {
{ NSMAN->isSMOLoggedIn[m_iPlayer++] = true;
NSMAN->isSMOLoggedIn[m_iPlayer] = true; if(GAMESTATE->IsPlayerEnabled((PlayerNumber) m_iPlayer))
SCREENMAN->SendMessageToTopScreen( SM_GoToNextScreen ); SCREENMAN->Password(SM_PasswordDone, "You are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
}
else else
{ SCREENMAN->SetNewScreen(NEXT_SCREEN);
}
else {
CString Responce = NSMAN->m_SMOnlinePacket.ReadNT(); CString Responce = NSMAN->m_SMOnlinePacket.ReadNT();
m_textLoginMessage.SetText( Responce ); SCREENMAN->Password( SM_PasswordDone, Responce + "\n\nYou are logging on as:\n" + GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer) + "\n\nPlease enter you password.", NULL );
} }
} }
//Else we ignore it.
break; break;
} }
} ScreenOptions::HandleScreenMessage(SM);
}
void ScreenSMOnlineLogin::MenuStart( PlayerNumber pn ) void ScreenSMOnlineLogin::MenuStart(PlayerNumber pn,const InputEventType type) {
{ ScreenOptions::MenuStart(pn,type);
SendLogin(); }
}
void ScreenSMOnlineLogin::MenuBack( PlayerNumber pn ) CString ScreenSMOnlineLogin::GetSelectedProfileID() {
{ vector<CString> vsProfiles;
SCREENMAN->SendMessageToTopScreen( SM_GoToPrevScreen ); PROFILEMAN->GetLocalProfileIDs( vsProfiles );
}
void ScreenSMOnlineLogin::TweenOffScreen() const Row &row = *m_Rows[GetCurrentRow()];
{ const int Selection = row.GetOneSharedSelection();
OFF_COMMAND( m_textTitle ); if( !Selection )
OFF_COMMAND( m_textUserName ); return "";
OFF_COMMAND( m_textPassword ); return vsProfiles[ Selection-1 ];
OFF_COMMAND( m_textLoginMessage ); }
OFF_COMMAND( m_sprPassword );
}
void ScreenSMOnlineLogin::UpdateTextInput() void ScreenSMOnlineLogin::SendLogin(CString sPassword) {
{ CString PlayerName = GAMESTATE->GetPlayerDisplayName((PlayerNumber) m_iPlayer);
CString PasswordText;
for ( unsigned i = 0; i < m_sPassword.length(); ++i )
PasswordText+='*';
m_textPassword.SetText( PasswordText );
}
void ScreenSMOnlineLogin::SendLogin()
{
CString HashedName; CString HashedName;
CString PreHashedName; CString PreHashedName;
unsigned char Output[16]; unsigned char Output[16];
const unsigned char *Input = (unsigned char *)m_sPassword.c_str(); const unsigned char *Input = (unsigned char *)sPassword.c_str();
MD5Context BASE; MD5Context BASE;
@@ -217,7 +159,7 @@ void ScreenSMOnlineLogin::SendLogin()
MD5Init( &BASE ); MD5Init( &BASE );
MD5Update( &BASE, Input, m_sPassword.length()); MD5Update( &BASE, Input, sPassword.length());
MD5Final( Output, &BASE ); MD5Final( Output, &BASE );
@@ -238,17 +180,16 @@ void ScreenSMOnlineLogin::SendLogin()
NSMAN->m_SMOnlinePacket.Write1((uint8_t)0); //Login command NSMAN->m_SMOnlinePacket.Write1((uint8_t)0); //Login command
NSMAN->m_SMOnlinePacket.Write1((uint8_t)m_iPlayer); //Player NSMAN->m_SMOnlinePacket.Write1((uint8_t)m_iPlayer); //Player
NSMAN->m_SMOnlinePacket.Write1((uint8_t)0); //MD5 hash style NSMAN->m_SMOnlinePacket.Write1((uint8_t)0); //MD5 hash style
NSMAN->m_SMOnlinePacket.WriteNT(m_sUserName); NSMAN->m_SMOnlinePacket.WriteNT(PlayerName);
NSMAN->m_SMOnlinePacket.WriteNT(HashedName); NSMAN->m_SMOnlinePacket.WriteNT(HashedName);
NSMAN->SendSMOnline( ); NSMAN->SendSMOnline( );
} }
#endif #endif
/* /*
* (c) 2004 Charles Lohr * (c) 2004 Charles Lohr Adam Lowman
* All rights reserved. * All rights reserved.
* Elements from ScreenTextEntry
* *
* Permission is hereby granted, free of charge, to any person obtaining a * Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the * copy of this software and associated documentation files (the
+13 -36
View File
@@ -1,45 +1,22 @@
/* ScreenSMOnlineLogin - Login for StepMania online */
#ifndef SCREENSMONLINELOGIN_H #ifndef SCREENSMONLINELOGIN_H
#define SCREENSMONLINELOGIN_H #define SCREENSMONLINELOGIN_H
#include "ScreenWithMenuElements.h" #include "ScreenOptions.h"
#include "Sprite.h"
#include "Quad.h"
#include "BitmapText.h"
class ScreenSMOnlineLogin : public ScreenWithMenuElements class ScreenSMOnlineLogin : public ScreenOptions {
{
public:
ScreenSMOnlineLogin( const CString& sName );
virtual void Input( const DeviceInput& DeviceI, const InputEventType type, public:
const GameInput& GameI, const MenuInput& MenuI, ScreenSMOnlineLogin(CString sName);
const StyleInput& StyleI ); virtual void HandleScreenMessage(const ScreenMessage SM);
virtual void MenuStart(PlayerNumber pn,const InputEventType type);
virtual void MenuStart( PlayerNumber pn ); void SendLogin(CString sPassword);
virtual void MenuBack( PlayerNumber pn );
virtual void HandleScreenMessage( const ScreenMessage SM );
virtual void TweenOffScreen();
void UpdateTextInput();
void SendLogin();
private:
BitmapText m_textTitle;
BitmapText m_textUserName;
BitmapText m_textPassword;
BitmapText m_textLoginMessage;
CString m_sUserName;
CString m_sPassword;
Sprite m_sprPassword;
private:
void ImportOptions();
void ExportOptions();
void GoToNextScreen();
void GoToPrevScreen();
CString GetSelectedProfileID();
int m_iPlayer; int m_iPlayer;
}; };
+9 -25
View File
@@ -22,7 +22,6 @@
CString ScreenTextEntry::s_sLastAnswer = ""; CString ScreenTextEntry::s_sLastAnswer = "";
bool ScreenTextEntry::s_bCancelledLast = false; bool ScreenTextEntry::s_bCancelledLast = false;
/* XXX: Don't let the user use internal-use codepoints (those /* XXX: Don't let the user use internal-use codepoints (those
* that resolve to Unicode codepoints above 0xFFFF); those are * that resolve to Unicode codepoints above 0xFFFF); those are
* subject to change and shouldn't be written to .SMs. * subject to change and shouldn't be written to .SMs.
@@ -31,9 +30,11 @@ bool ScreenTextEntry::s_bCancelledLast = false;
* a whole UTF-8 character. Better would be to operate in longchars. * a whole UTF-8 character. Better would be to operate in longchars.
*/ */
//REGISTER_SCREEN_CLASS( ScreenTextEntry ); //REGISTER_SCREEN_CLASS( ScreenTextEntry );
ScreenTextEntry::ScreenTextEntry( CString sClassName, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer), void(*OnCancel)() ) :
ScreenTextEntry::ScreenTextEntry( CString sClassName, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer), void(*OnCancel)(), bool bPassword ) :
Screen( sClassName ) Screen( sClassName )
{ {
m_bPassword = bPassword; // Added Password Support -APL 1/20/05
m_bIsTransparent = true; // draw screens below us m_bIsTransparent = true; // draw screens below us
m_pOnOK = OnOK; m_pOnOK = OnOK;
@@ -43,7 +44,6 @@ ScreenTextEntry::ScreenTextEntry( CString sClassName, CString sQuestion, CString
m_bCancelled = false; m_bCancelled = false;
m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenPrompt background") ); m_Background.LoadFromAniDir( THEME->GetPathToB("ScreenPrompt background") );
m_Background.PlayCommand( "On" );
this->AddChild( &m_Background ); this->AddChild( &m_Background );
m_textQuestion.LoadFromFont( THEME->GetPathToF("Common normal") ); m_textQuestion.LoadFromFont( THEME->GetPathToF("Common normal") );
@@ -73,6 +73,12 @@ ScreenTextEntry::ScreenTextEntry( CString sClassName, CString sQuestion, CString
void ScreenTextEntry::UpdateText() void ScreenTextEntry::UpdateText()
{ {
CString txt = WStringToCString(m_sAnswer); CString txt = WStringToCString(m_sAnswer);
if(m_bPassword) {
int len = txt.GetLength();
txt = "";
for(int i=0;i<len;++i)
txt += "*";
}
FontCharAliases::ReplaceMarkers(txt); FontCharAliases::ReplaceMarkers(txt);
m_textAnswer.SetText( txt ); m_textAnswer.SetText( txt );
} }
@@ -177,33 +183,11 @@ void ScreenTextEntry::Input( const DeviceInput& DeviceI, const InputEventType ty
} }
} }
//In the event we are using the numpad...
switch ( DeviceI.button )
{
case KEY_KP_C0: c='0'; break;
case KEY_KP_C1: c='1'; break;
case KEY_KP_C2: c='2'; break;
case KEY_KP_C3: c='3'; break;
case KEY_KP_C4: c='4'; break;
case KEY_KP_C5: c='5'; break;
case KEY_KP_C6: c='6'; break;
case KEY_KP_C7: c='7'; break;
case KEY_KP_C8: c='8'; break;
case KEY_KP_C9: c='9'; break;
case KEY_KP_SLASH: c='/'; break;
case KEY_KP_ASTERISK: c='*'; break;
case KEY_KP_HYPHEN: c='-'; break;
case KEY_KP_PLUS: c='+'; break;
case KEY_KP_PERIOD: c='.'; break;
case KEY_KP_EQUAL: c='='; break;
}
if( c >= ' ' ) if( c >= ' ' )
{ {
m_sAnswer += c; m_sAnswer += c;
UpdateText(); UpdateText();
} }
break; break;
} }
} }
+2 -1
View File
@@ -13,7 +13,7 @@
class ScreenTextEntry : public Screen class ScreenTextEntry : public Screen
{ {
public: public:
ScreenTextEntry( CString sName, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL ); ScreenTextEntry( CString sName, CString sQuestion, CString sInitialAnswer, void(*OnOK)(CString sAnswer) = NULL, void(*OnCanel)() = NULL, bool bPassword = false );
virtual void Update( float fDeltaTime ); virtual void Update( float fDeltaTime );
virtual void DrawPrimitives(); virtual void DrawPrimitives();
@@ -31,6 +31,7 @@ protected:
void UpdateText(); void UpdateText();
bool m_bPassword;
BGAnimation m_Background; BGAnimation m_Background;
BitmapText m_textQuestion; BitmapText m_textQuestion;
Quad m_rectAnswerBox; Quad m_rectAnswerBox;