mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 23:50:29 +01:00
Added UserInput class by PNW to handle user-defined filename for Export Path
This commit is contained in:
parent
d760675b27
commit
8b6dec31b5
2 changed files with 33 additions and 0 deletions
28
SceneManager/PNWUserInput.cs
Normal file
28
SceneManager/PNWUserInput.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Rage;
|
||||
using Rage.Native;
|
||||
|
||||
namespace SceneManager
|
||||
{
|
||||
internal static class PNWUserInput
|
||||
{
|
||||
public static string GetUserInput(string windowTitle, string defaultText, int maxLength)
|
||||
{
|
||||
NativeFunction.Natives.DISABLE_ALL_CONTROL_ACTIONS(2);
|
||||
|
||||
NativeFunction.Natives.DISPLAY_ONSCREEN_KEYBOARD(true, windowTitle, 0, defaultText, 0, 0, 0, maxLength);
|
||||
Game.DisplayHelp("Enter the filename you would like to save your path as\n~INPUT_FRONTEND_ACCEPT~ Export path\n~INPUT_FRONTEND_CANCEL~ Cancel", true);
|
||||
Game.DisplaySubtitle(windowTitle, 100000);
|
||||
|
||||
while (NativeFunction.Natives.UPDATE_ONSCREEN_KEYBOARD<int>() == 0)
|
||||
{
|
||||
GameFiber.Yield();
|
||||
}
|
||||
|
||||
NativeFunction.Natives.ENABLE_ALL_CONTROL_ACTIONS(2);
|
||||
Game.DisplaySubtitle("", 5);
|
||||
Game.HideHelp();
|
||||
|
||||
return NativeFunction.Natives.GET_ONSCREEN_KEYBOARD_RESULT<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue