-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move "easy" input string function things to scripts
this was scuffed and is now 1% less scuffed (caused crashing?)
- Loading branch information
Showing
2 changed files
with
37 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function easyInputStringWithParams(question, maxLength, isPassword, f, params) | ||
SCREENMAN:AddNewScreenToTop("ScreenTextEntry") | ||
local settings = { | ||
Question = question, | ||
MaxInputLength = maxLength, | ||
Password = isPassword, | ||
OnOK = function(answer) | ||
f(answer, params) | ||
end | ||
} | ||
SCREENMAN:GetTopScreen():Load(settings) | ||
end | ||
|
||
function easyInputStringWithFunction(question, maxLength, isPassword, f) | ||
easyInputStringWithParams( | ||
question, | ||
maxLength, | ||
isPassword, | ||
function(answer, params) | ||
f(answer) | ||
end, | ||
{} | ||
) | ||
end | ||
|
||
--Tables are passed by reference right? So the value is tablewithvalue to pass it by ref | ||
function easyInputString(question, maxLength, isPassword, tablewithvalue) | ||
easyInputStringWithParams( | ||
question, | ||
maxLength, | ||
isPassword, | ||
function(answer, params) | ||
tablewithvalue.inputString = answer | ||
end, | ||
{} | ||
) | ||
end |