diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 63a739187d..e493badfba 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -37,6 +37,34 @@ float GetButtonY( KeyboardRow r ) } CString ScreenTextEntry::s_sLastAnswer = ""; + +void ScreenTextEntry::TextEntry( + ScreenMessage smSendOnPop, + CString sQuestion, + CString sInitialAnswer, + int iMaxInputLength, + bool(*Validate)(CString sAnswer,CString &sErrorOut), + void(*OnOK)(CString sAnswer), + void(*OnCancel)(), + bool bPassword + ) +{ + // add the new state onto the back of the array + ScreenTextEntry *pNewScreen = new ScreenTextEntry( + "ScreenTextEntry", + smSendOnPop, + sQuestion, + sInitialAnswer, + iMaxInputLength, + Validate, + OnOK, + OnCancel, + bPassword ); + pNewScreen->Init(); + SCREENMAN->ZeroNextUpdate(); + SCREENMAN->SetFromNewScreen( pNewScreen ); +} + bool ScreenTextEntry::s_bCancelledLast = false; /* XXX: Don't let the user use internal-use codepoints (those diff --git a/stepmania/src/ScreenTextEntry.h b/stepmania/src/ScreenTextEntry.h index 3c2b6100bc..c80b9964d9 100644 --- a/stepmania/src/ScreenTextEntry.h +++ b/stepmania/src/ScreenTextEntry.h @@ -27,6 +27,21 @@ enum KeyboardRowSpecialKey class ScreenTextEntry : public Screen { public: + static void TextEntry( + ScreenMessage smSendOnPop, + CString sQuestion, + CString sInitialAnswer, + int iMaxInputLength, + bool(*Validate)(CString sAnswer,CString &sErrorOut) = NULL, + void(*OnOK)(CString sAnswer) = NULL, + void(*OnCanel)() = NULL, + bool bPassword = false + ); + static void Password( ScreenMessage smSendOnPop, const CString &sQuestion, void(*OnOK)(CString sPassword) = NULL, void(*OnCanel)() = NULL ) + { + TextEntry( smSendOnPop, sQuestion, "", 255, NULL, OnOK, OnCanel, true ); + } + ScreenTextEntry( CString sName, ScreenMessage smSendOnPop,