![]() There's a video demonstration on the GitHub readme for the project. New WheelSliceAction("Brave", () => player.SetSharedData("walkingStyle", "Brave")),ĮxtraSlices.Add(new WheelSliceSubMenu("icon.arrowleft", wheel.ID)) ĥ) Finally we just need to call the display method of our primary wheel to show the user our wheel. New WheelSliceAction("Normal", () => player.SetSharedData("walkingStyle", "Normal")), Notice that we also add a WheelSliceSubMenu to our subwheel itself in order to give the user the opportunity to navigate back to our primary wheel. New WheelSliceSubMenu("icon.list", extraWheel.ID)Ĥ) We will now add a few slices to our subwheel. New WheelSliceAction("ay", () => player.SendChatMessage("You pressed on a play icon slice")), We supply that slice with the id of our subwheel. The other slice is used to open subwheels. One will be a simple action slice that takes an Action which will be invoked if the user clicks on the slice. Var extraWheel = new InteractionWheel(1, "Walkingstyle") ģ) Now that we have our primary and subwheel set up we will create two slices for our primary wheel. The primary wheel now knows of the subwheel and will be able to navigate to it. We then add this subwheel to the list of subwheels on our primary wheel. Var wheel = new PrimaryInteractionWheel(0, "My wheel", keyToBind: "c") Ģ) Next, create a subwheel by instantiating an InteractionWheel. The id will be used by subwheels to reference which wheel they will return to. You'd probably also need to include the server-side files in your namespace.ġ) We first have to instantiate our primary wheel, and we supply it with id 0. To get started move the GenericWheel-Client folder to your client_packages and ensure you have included the GenericWheel-Client/js/index.js in your own index.js. There's a lot free to use by wheelnav.js but you can also add your own. and the system also supports icons for the wheels. The wheel will automatically close and destroy itself when the user releases the designated key that you supply when instantiating the primary wheel. It is not necessary to create subwheels, but you can simply fill it with slices with actions hooked. My idea was to have one primary wheel from where subwheels could spring from. ![]() This was initially created as a feature for a larger gamemode that will become available at my GitHub later. I wrote a C# wrapper to control when to display the wheel and hooked server-side actions to each slice in the wheel. It is made possible using the wheelnav.js library by Software Tailoring that eases development of interactive wheels and are highly customizable. Once you have it ready you can display it to the player. This resource allows you to setup interactive wheels with actions hooked to the slices presented in the pie - all from server-side.
0 Comments
Leave a Reply. |