[plugin] Menubar

Post here every finished plugin

Moderator: NADEO

Post Reply
User avatar
aseco
Posts: 99
Joined: 06 Jul 2010, 17:08
Location: Germany
Contact:

[plugin] Menubar

Post by aseco » 30 Dec 2010, 19:19

This plugin helps you create a graphical menu structure.

Since your plugin relies on the Menubar, if you are using it, you need to check if it is loaded before you can call methods of it:

Code: Select all

if ($this->isPluginLoaded('Flo\Menubar', 1.1)) ... then create the submenu and buttons
You set the plugin's menu icon like that:

Code: Select all

$this->callPublicMethod('Flo\Menubar', 'initMenu', Icons128x128_1::Replay);
If you want to add a button to your plugin's menu, then use this command:

Code: Select all

$this->callPublicMethod('Flo\Menubar', 'addButton', 'Button Name', array($this, 'callbackName'));
Third parameter is the name of the button and the fourth a callback method that is executed when the player clicks onto the button. This callback method will receive the player's login as parameter.
You can add one parameter to the end, which is "true", to indicate that the button will only be shown to admins.

Finally a screenshot of how the final result can look like:
Image

You can download the Menubar plugin here:
http://files.manialive.com/plugins/Menu ... _r1828.zip
Also find a download link on the manialive ManiaLink's plugin section!
Last edited by aseco on 14 Jan 2011, 11:09, edited 2 times in total.
i7 920 | Nvidia GTX260 | 4Gb DDR3
www.floschnell.de | I like that comic

User avatar
Jojo_44
Posts: 500
Joined: 12 Jul 2010, 15:58
Location: Germany->Bavaria
Contact:

Re: [plugin] Menubar

Post by Jojo_44 » 04 Jan 2011, 15:15

Hi,

I have two questions:

1. Is it possible to display a icon when the submenu have no button ?

2. How can I display a image (f.e. my clanlogo) instead of a icon ?

Thank you, Jojo
Image
my english sounds very unfriendly but it isn´t ;)

xan.96.gll
Posts: 3
Joined: 09 Sep 2010, 20:04

Re: [plugin] Menubar

Post by xan.96.gll » 08 Jan 2011, 14:19

aseco wrote: Finally a screenshot of how the final result can look like:
Image
Can you post the code for the Admin section?

Thanks!

User avatar
aseco
Posts: 99
Joined: 06 Jul 2010, 17:08
Location: Germany
Contact:

Re: [plugin] Menubar

Post by aseco » 10 Jan 2011, 12:15

xan.96.gll wrote:Can you post the code for the Admin section?

Thanks!
Just released the whole plugin, you can find it here: http://forum.maniaplanet.com/viewtopic.php?f=47&t=559
i7 920 | Nvidia GTX260 | 4Gb DDR3
www.floschnell.de | I like that comic

User avatar
aseco
Posts: 99
Joined: 06 Jul 2010, 17:08
Location: Germany
Contact:

Re: [plugin] Menubar

Post by aseco » 10 Jan 2011, 12:21

Just released a new version of the Menubar that fixes a display issue that existed since the latest ManiaLive release.
This will also break compability with previous versions, so do not use it with an old version of ML.
Download here or on the manialink
i7 920 | Nvidia GTX260 | 4Gb DDR3
www.floschnell.de | I like that comic

User avatar
aseco
Posts: 99
Joined: 06 Jul 2010, 17:08
Location: Germany
Contact:

Re: [plugin] Menubar

Post by aseco » 14 Jan 2011, 11:10

New release due to the changes made in the latest ManiaLive version.
Download at http://files.manialive.com/plugins/Menubar_r1828.zip .
Or at the manialive:plugins Manialink.
i7 920 | Nvidia GTX260 | 4Gb DDR3
www.floschnell.de | I like that comic

Post Reply

Return to “ManiaLive Plugins”

Who is online

Users browsing this forum: No registered users and 3 guests