[Finished | Need opinions] Script Communicator Menu
-
Trigger events in your script through a single menu!
https://github.com/LfxB/ScriptCommunicatorMenu
Want to access all your mods' menus through a single menu? Run a method in your script without using a hotkey? This C# script will allow you to do so.
Although only tested with other C# scripts so far, this menu should also be able to communicate with scripts written in languages that can use the EventWaitHandle class (C++, VB .net, etc.).
It is simple to use, as explained in the Example project included on GitHub. No need to reference the ScriptCommunicatorMenu dll.
Basically you must create an EventWaitHandle object with a name that corresponds with a *.scmod text file in your GTA V installation folder or scripts folder, and then wait for the event to be triggered by the menu. Once triggered, your script will run whatever code you want, such as opening a menu. Then you must reset the event so that the menu may trigger the event again in the future.
Keep in mind, the example project uses a C# helper class to further simplify the creation of the event and other goodies. Translate for other languages if needed!
About the menu itself:
I guess it's ugly and barebones lol, but it has features such as scrolling, long descriptions, etc. It does not do any aspect ratio calculations in hopes of avoiding fps drops. Any contributions would be welcome. Heck, I wouldn't mind replacing it for an entirely new one!Note: If you want to create a menu for your mod, this will not help you do that. This simply helps you launch different menus from a single menu (among other possibilities), so that we don't have to use up one or more keys for a single script. With that in mind, I'd recommend using PauseMenuHelper if you don't need a menu that runs in real-time (i.e. while the game is not paused).
Well, that is all. Any feedback, questions, criticisms, etc. are much appreciated!
-
@stillhere This is an amazing initiative, as I am sure, it will get rid of multiple keys reference to different set of actions of script. I personally find the Menu Based system is much user friendly as people then don't have to memorize the keybindings in order to initiate certain action. As I am taking a break from modding for sometime now. But I will surely give it a try once I resume that era.
Just a quick question, As you had a problem making it compatible with controllers, so did you manage to get rid of that issue?Anyways, great work bud and I do thank you for your contribution.
-
@ashishcw Thanks man, especially for dealing with my rambling as I worked on it!
The menu can be launched through a combination of up to 3 gamepad buttons. By default it is set to VehicleHandbrake + VehicleHorn. And of course, controller navigation is fully supported.I have uploaded a compiled version just now