mirror of
https://github.com/thegeneralist01/Scene-Manager-DevRepo
synced 2026-01-11 15:40: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>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -31,6 +31,10 @@
|
|||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="InputManager, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>bin\Debug\InputManager.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RAGENativeUI">
|
||||
<HintPath>D:\Program Files\Rockstar Games\Grand Theft Auto V\RAGENativeUI.dll</HintPath>
|
||||
</Reference>
|
||||
|
|
@ -64,6 +68,7 @@
|
|||
<Compile Include="Menus\MenuManager.cs" />
|
||||
<Compile Include="Object Classes\Path.cs" />
|
||||
<Compile Include="Menus\PathCreationMenu.cs" />
|
||||
<Compile Include="PNWUserInput.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Menus\PathMainMenu.cs" />
|
||||
<Compile Include="Menus\SettingsMenu.cs" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue