Wheel Menu
Learn how to build a WheelMenu in the Athena Framework on both sides.
Summary
Wheel Menu's are exactly how they sound. It's a wheel with a bunch of items you can select. Those items inside of the menu can have other items buried behind it.
To create a nested WheelMenu just add more then 8 Options and scroll the page (handled automatically)
Video Guide
Currently not available
Basic Example - Serverside
This example simply has an event where if an event is passed from server to server. It will log the current data the WheelMenu Option holds into the server console.
InteractionController.add({
position: { x: 0, y: 1, z: 71 },
description: 'Open Wheelmenu',
callback: (player: alt.Player) => {
const menu: Array<IWheelOption> = [
{
name: 'Test the menu!',
icon: 'icon-house',
color: 'red',
data: [
{
description: 'Test the menu!',
icon: 'current icon is => icon-house',
color: 'current color is => red',
}
],
doNotClose: false,
emitServer: 'WheelMenu-TestEvent',
},
];
Athena.player.emit.wheelMenu(player, 'Hello World!', menu);
},
});
alt.onClient('WheelMenu-TestEvent', (player: alt.Player, data: Array<any>) => {
console.log('WheelMenu-TestEvent got fired! Hello World!');
console.log(`Current Data of test-event => ${JSON.stringify(data)}`);
});Basic Example - Clientside
This example simply has an callback where data is passed into. It will log the current data the WheelMenu Option holds into the developer (F8) console.
Valid Options
Disclaimer: The IWheelOption will work on both sides, while the IWheelOptionExt will only work on the clientside.
Last updated