From 78b8cad05d2a64b2d4c6ddf604f356cad0ab9d69 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Fri, 28 Apr 2006 01:35:03 +0000 Subject: [PATCH] allow STextEntry to be used as a regular screen and not a pushed screen --- stepmania/src/ScreenTextEntry.cpp | 19 +++++++++++++++++++ stepmania/src/ScreenTextEntry.h | 8 ++++++++ 2 files changed, 27 insertions(+) diff --git a/stepmania/src/ScreenTextEntry.cpp b/stepmania/src/ScreenTextEntry.cpp index 5d1a645b00..04095dab11 100644 --- a/stepmania/src/ScreenTextEntry.cpp +++ b/stepmania/src/ScreenTextEntry.cpp @@ -38,6 +38,25 @@ namespace bool g_bPassword; }; +void ScreenTextEntry::SetTextEntrySettings( + RString sQuestion, + RString sInitialAnswer, + int iMaxInputLength, + bool(*Validate)(const RString &sAnswer,RString &sErrorOut), + void(*OnOK)(const RString &sAnswer), + void(*OnCancel)(), + bool bPassword + ) +{ + g_sQuestion = sQuestion; + g_sInitialAnswer = sInitialAnswer; + g_iMaxInputLength = iMaxInputLength; + g_pValidate = Validate; + g_pOnOK = OnOK; + g_pOnCancel = OnCancel; + g_bPassword = bPassword; +} + void ScreenTextEntry::TextEntry( ScreenMessage smSendOnPop, RString sQuestion, diff --git a/stepmania/src/ScreenTextEntry.h b/stepmania/src/ScreenTextEntry.h index 4b0e8af7b3..a2f45df79c 100644 --- a/stepmania/src/ScreenTextEntry.h +++ b/stepmania/src/ScreenTextEntry.h @@ -24,6 +24,14 @@ enum KeyboardRowSpecialKey class ScreenTextEntry : public ScreenWithMenuElements { public: + static void SetTextEntrySettings( + RString sQuestion, + RString sInitialAnswer, + int iMaxInputLength, + bool(*Validate)(const RString &sAnswer,RString &sErrorOut) = NULL, + void(*OnOK)(const RString &sAnswer) = NULL, + void(*OnCanel)() = NULL, + bool bPassword = false ); static void TextEntry( ScreenMessage smSendOnPop, RString sQuestion,