mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 07:30:40 +01:00
Added for path Import/Export feature
This commit is contained in:
parent
c70ab8d56a
commit
48873adb6c
1 changed files with 28 additions and 0 deletions
28
SceneManager/Utils/PNWUserInput.cs
Normal file
28
SceneManager/Utils/PNWUserInput.cs
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
using Rage;
|
||||
using Rage.Native;
|
||||
|
||||
namespace SceneManager.Utils
|
||||
{
|
||||
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