TM-FORUM

The TrackMania universal forum ^_^
It is currently Fri Jul 25, 2014 2:03 am

All times are UTC + 2 hours [ DST ]




Post new topic Reply to topic  [ 190 posts ]  Go to page 1, 2, 3, 4, 5 ... 13  Next
Author Message
 Post subject: [XAseco] Fufi Menu v0.37
PostPosted: Mon Aug 11, 2008 8:07 pm 
Offline
Pit Crew
Pit Crew
User avatar

Joined: Fri Jun 15, 2007 10:59 am
Posts: 1302
Location: Dresden, Germany
Owned TM-games: TMNF, TMUF
Fufi Menu (XASECO 1.14 tested)
by oorf I f*ckfish aka Alexander P.
http://fish.stabb.de

XAseco 1.14 or better required

Since XAseco is lacking of a menu which already exists in the other controllers, I decided to write one exclusively for XAseco, so no I won't port it to Aseco since there is already the oliverde8 menu which works similar.

Download

Fufi Menu Version 0.37
Fufi Menu All Older Versions

Update v0.37
  • New menu entries for XAseco v1.16 /cptms and /dedicptms commands
Update v0.36
  • New menu entry for XAseco v1.14 /admin relays command
Update v0.35
  • New menu entry for XAseco v1.13 /lastwin command
Update v0.34
  • New menu entries for XAseco v1.12 commands
Update v0.33
  • Added/removed menu entries for XAseco v1.11 commands
Update v0.32
  • New menu entries for XAseco v1.10 commands
Update v0.31
  • New menu entries for XAseco v1.09 commands
Update v0.3
  • Updated Checkpoints Tracking and Jfreu Info Messages for recent XAseco changes
  • New menu entries for recent XAseco commands
  • More menu structure tweaks
Update v0.2
  • Fixed the menu structure, removed unworking entries, fixed jfreu dependencies and rearranged some stuff
  • Reduced the number of manialink calls (that's always a good thing)
  • Changed the usage and structure of the "addEntry"- and the "addSeparator"-function, for details about the new usage have a look at the "Plugin Access" section below, basically what I did is add one functionality: in 0.1 there was only the possibility to insert an entry after another entry, now it's also possible to insert one before another entry

Installation

If you don't follow the steps carefully, the plugin will not be working properly.
  1. Unrar the archive into the ASECO folder
  2. Insert the following line into "plugins.xml" (after all other plugins (actually it can be placed before or after the Fufi Widgets, if you use them))
    Code:
    <plugin>plugin.fufi.menu.php</plugin>
  3. Configure some stuff if you like to (see configuration section below)
  4. Done! Have fun!


Configuration

Inside the main XAseco folder, you'll find a file called "fufi_menu_config.xml". Inside this file you can configure everything you want to customize the menu to your needs:
  • menu_caption: the text in the menu button
  • styles: all used styles and substyles for the menu graphics, feel free to play around
  • size: the size of the menu button
  • separatorheight: the height of a "separator" entry in the menu
  • menutimeout: the amount of milliseconds until the menu closes automatically if nothing was clicked
  • position: the position of the menu button and according to that the main starting point for the menu
  • horizontalorientation: the way the menu arranges its submenus horizontally (1.. left-to-right, 2...right-to-left)
  • verticalorientation: the way the menu arranges its submenus vertically (1.. top-to-bottom, 2...bottom-to-top)
  • for the last three entries I included presets for all the four corners of the screen, you'll just have to take out the comments
  • entries: for a detailed description on how the entries work, please have a look at the "Structure" section below


Structure

Now I'll come to the most interesting but also probably most confusing part of the menu: the menu structure. Once you understood the structure, it will be easy for you to add new submenus with your own entries or remove existing menus. The best way to understand the structure is to have a look at the entries section inside "fufi_menu_config.xml". I've built in a lot of features that won't be necessary for the majority of users, but I'll still try to write everything down here.

The maximum possibilities of the tag "entry" are like that:

Code:
<entry
   type='entrytype'
   caption='somecaption'
   indicator='someindicator'
   params='0'
   chatcmd='/chatcommand'
   chatcmdparams='someparams'
   dependencies='someplugin.php'
   ability='chat_musicadmin'
   globalvariable='someglobalvariable'
   rights='TMUF'
   unique='uniquekey'
/>


The attributes of entry are used like that:

  • type: [optional] if left out, the entry will ether be an extendable menu group or an actual clickable entry, if set to "help" it's basically the same as the beforementioned, but the icon next to the entry will be the help icon, if set to "separator" there will be some vertical space in the menu on this place, to make the structure more readable
  • caption: [optional] this one is needed for every entry but the separators, it defines the text which is shown in the menu for this entry
  • indicator: [optional] this one's a bit tricky. It is used for boolean properties which should already display their state inside the menu with the help of a red (false), green (true) or yellow (pending) icon.
    The "indicator" attribute has to be a valid function name that returns 0 for "false", 1 for "true" and 2 for "pending",every other value will disable the icon, I'll get back later to the usage of this functionality.
  • params: [optional] With the help of the params you can pass values to the indicator function (comma separated)
  • chatcmd: [optional] This is the heart of the menu, here you define the chat command which should be emulated, when a user clicks an entry in the menu, if left out, the entry will serve as a menu group which can hold subentries
  • chatcmdparams: [optional] Setting this attribute only makes sense if you define an "indicator"-function and the entry therefore represents a boolean value, as most of you know, a lot of settings in XAseco can be activated by "/somechatcommand ON" and deactived by "/somechatcommand OFF", to make that possible, "chatcmdparams" in this case would be "OFF/ON" (slash separated), if left out, the menu would always perform "/somechatcommand"
  • dependencies: [optional] comma separated list of plugins that have to be installed, so these menu entries will be displayed
  • ability: [optional] since XAseco has the tiered admin system, every chat command can be limited to special user groups, if a user needs a special ability to execute this menu entry/chat command, you'll need to specify the ability in this attribute (all abilities can be found inside "adminops.xml")
    If a chat command starts with "/admin" or "/jfreu" the menu will automatically check for the abilities, so there's no need to define the "ability" attribute there.
  • globalvariable: [optional] some features in XAseco like karma and voting are activated via global variables, so this attribute checks for the existence of the defined variable and if it's set to true and displays the entry if the condition is given
  • rights: [optional] if left out, every player will see this entry, if set to "TMUF" only United players will see it
  • unique: This attribute always has to be defined and contains a string that identifies the entry uniquely, it is mainly used to define entry points for plugin generated menu entries


Structural Example

For an example that should cover all the possibilities, I'll try to rip out some code from the original menu mixed with some imaginary code (the code itself, especially the structure makes no sense at all, but it's good enough for an example):

Code:
01   <entry caption='Music' dependencies='plugin.musicserver.php' unique='music'>
02      <entry caption='List' chatcmd='/music list' unique='musiclist'/>
03      <entry caption='Administration' ability='chat_musicadmin' unique='musicadmin'>
04         <entry caption='Track Override' indicator='fufi_getMusicOverrideIndicator' chatcmd='/music override' chatcmdparams='off/on' unique='musicoverride'/>
05      </entry>
06      <entry caption='10 Coppers' chatcmd='/donate 10' dependencies='plugin.donate.php' rights='TMUF' unique='don10'/>
07      <entry caption='Game Mode' unique='admingamemode'>
08         <entry caption='Rounds' indicator='fufi_getGameModeIndicator' params='0' chatcmd='/admin setgamemode rounds' unique='admingmrounds'/>
09         <entry caption='Time Attack' indicator='fufi_getGameModeIndicator' params='1' chatcmd='/admin setgamemode ta' unique='admingmtimeattack'/>
10      </entry>
11      <entry type='separator' unique='musicsep1'/>
12      <entry type='help' caption='Help' chatcmd='/helpall' unique='helpall1'/>
13      <entry caption='Track Karma' globalvariable='feature_karma' chatcmd='/karma' unique='karma'/>
14   </entry>


So what will happen in these lines? (the numbers in the list correspond to the line numbers)
  1. a new submenu with the caption "Music" is created, it will only show up in the actual menu, if the plugin "plugin.musicserver.php" is in the list of the active plugins, the unique key is "music"
  2. creates a simple clickable entry with the caption "List" which executes the chat command "/music list", I'm not gonna tell you any more about the unique key, it should be obvious that it's always there and always different
  3. here a new submenu under the "Music" menu is created (caption is "Administration"), the ability tag says that this menu and all its submenus and entries will only be visible to players, that have the ability "chat_musicadmin" inside the "adminops.xml"
  4. creates a clickable entry that is bound to a boolean value, the indicator points to a function name:
    That means, whenever this menu will be accessed, the function "function fufi_getMusicOverrideIndicator()" will be called and the result of this function determines on how this entry will be marked. The function in fact checks if MusicOverride is on or off and will return true or false which then results in a green or red icon next to the entry (see the simple source of this function inside "plugins/plugin.fufi.menu.php"), of course you can define your own indicator functions inside your plugins, I just defined the ones for functinalities included in the original XAseco release
  5. closing tag for the "Administration" submenu
  6. creates a Donation entry (only works with active plugin "plugin.donate.php" and will only be shown to United users because of the "rights" attribute)
  7. a new submenu with the caption "Game Mode" is created
  8. at the first view this looks quite similar to the "Track Override" entry, but it's got one difference: the indicator function "fufi_getGameModeIndicator" now also takes a parameter defined in the attribute "params":
    That results in a method call like this: fufi_getGameModeIndicator(0)
    The function then checks if GameMode 0 (which means "Rounds") is currently active or will be active in the next round, the result of the function then determines the icon which is shown next to the entry (again, double check with the source of this function inside "plugins/plugin.fufi.menu.php")
  9. similar to line 8, but results in a function call like this: fufi_getGameModeIndicator(1)
  10. closing tag for the "Game Mode" submenu
  11. creates a vertical gap (separator) in the menu
  12. similar to all other entries, this one creates a simple clickable entry which executes the chat command "/helpall", the only difference is that with the attribute "type='help'" the icon of this entry will be a help icon
  13. this entry will only be shown if the global variable "feature_karma" is defined and set to true
  14. closing tag for the "Music" submenu

Please don't be scared of all those attributes, if you really want to work with the menu you'll get a hold of its functionality very soon.

And now let's proceed to the really cool part, using the menu from within your own plugins.


Plugin Access

This section will cover how to access the menu if you want to add your own groups and entries for your plugins. You should have read the sections about the structure to understand this one, but basically it's very easy.

To see a tiny working example, have a look at the [url=index.php?page=downloads&subpage=133]Fufi Widgets[/url], I implemented the menu function there.

First of all you'll need to react on an event called "onMenuLoaded" just like you react on all the other events, XAseco releases.
Code:
Aseco::registerEvent('onMenuLoaded', 'myplugin_initMenu');


Then of course you'll need to implement the function "myplugin_initMenu".
Code:
function myplugin_initMenu($aseco, $menu){
   [...]
}


Inside this function (which will only be called once at the start of the server when the menu is loaded) you can now work with the $menu variable to access the menu.
Therefore there are two methods, the first one is called "addEntry" and looks like this:
Code:
function addEntry($insertInGroup, $entryPoint, $insertAfter='true', $caption, $unique, $chatcmd='', $chatcmdparams='', $ability='', $indicator='', $params='', $type='', $rights='')


Now that's the beautiful part of it, nearly all of those parameters directly correspond to the XML structure I described before:
  • $insertInGroup - That's the moment, where you'll need the unique key of the group where you want to insert your entry, if left empty, your entry will be inserted into the root menu
  • $entryPoint - Here you'll have to enter the unique key of the entry in the menu where you want to insert your entry, depending on the next parameter, our entry will be positioned before or after the "entryPoint", if left out or the key is unknown, your entry will be inserted at the very beginning or the very end of the group
  • $insertAfter - This is a boolean value, if set to true your entry will be placed after the one specified in the parameter before, if set to false it will be placed before the other entry
  • $caption - similar to XML attribute caption
  • $unique - similar to XML attribute unique
  • $chatcmd - similar to XML attribute chatcmd
  • $chatcmdparams - similar to XML attribute chatcmdparams
  • $ability - similar to XML attribute ability
  • $indicator - similar to XML attribute indicator
  • $params - similar to XML attribute params
  • $type - similar to XML attribute type
  • $rights - similar to XML attribute rights

The other function which is actually just a shortcut to "addEntry" is called "addSeparator" and looks like this:
Code:
addSeparator($insertInGroup, $entryPoint, $insertAfter, $unique)

The parameters are similar to the ones of "addEntry" just less^^.

And now the fun part, I'll use those two functions to make up a menu for my imaginary plugin. I'm aware of the fact, that the order in which I add the entries is a bit chaotic, but I wanted to display the possibilities of the $insertAfter parameter. The comments describe the funtionality of the corresponding function calls.
Code:
function myplugin_initMenu($aseco, $menu){

   // creates a menu group with the caption "My Plugin" in the root menu, after all other entries
   $menu->addEntry('', '', 'My Plugin', 'myplugin');

   // creates an entry inside the new group which executes the chatcommand "/myplugin list"
   $menu->addEntry('myplugin', '', 'Show List', 'mypluginlist', '/myplugin list');
   
   // adds an entry at the beginning of the "My Plugin" group, which will only be shown to players with the ability "chat_mypluginadmin"
   $menu->addEntry('myplugin', -1, 'Do Weird Admin Stuff', 'mypluginadminstuff', '/myplugin adminstuff', '', 'chat_mypluginadmin');

   // adds a simple chat command at the end of the menu, also the type is "help" so the icon will be the help icon
   $menu->addEntry('myplugin', '', 'Help', 'mypluginhelp', '/myplugin help', '', '', '', '', 'help');

   // adds a separator after the "Show List" entry
   $menu->addSeparator('myplugin', 'mypluginlist', 'mypluginsep1');

}



Screenshots

Image

Image

_________________
inactive, sorry


Last edited by f*ckfish on Fri Dec 05, 2008 12:08 am, edited 5 times in total.

Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Mon Aug 11, 2008 8:40 pm 
Offline
happy cruiser
happy cruiser
User avatar

Joined: Fri Oct 12, 2007 2:47 am
Posts: 144
Location: Minnesota, USA
Owned TM-games: TMUF
Wow! That looks awesome!


Last edited by blooper on Sun Apr 07, 2013 11:56 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Mon Aug 11, 2008 8:43 pm 
Offline
Pit Crew
Pit Crew
User avatar

Joined: Sun Dec 09, 2007 6:04 pm
Posts: 881
Location: Norway
Owned TM-games: TMN, TMNF, TMUF
Was it you that once upon a time said "And there shall be light" ?

looks awesome :thumbsup:

_________________
/lille79
Old man of the Norwegian Trackmania team Super Sheep Racing
To visit my homepage/blog, and download the usbTMFserver, this is the place to go.


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Mon Aug 11, 2008 8:48 pm 
Offline
TM-Patrol
TM-Patrol
User avatar

Joined: Wed May 23, 2007 10:20 am
Posts: 1461
Location: Venray
Owned TM-games: TMU, TMN, TMF
Manialink(s): intr
really looks nice. It even has more features the oliverde8's release. :D

_________________
Code:
tmnforever is nations and united makes it special. tmnforever has united. I need united!


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Mon Aug 11, 2008 10:00 pm 
Offline
swift roadking
swift roadking

Joined: Sun Apr 20, 2008 11:58 am
Posts: 840
Location: Germany
Owned TM-games: TMUF,TMNF, TMN
Manialink(s): therookies
waiting for since i know u r working on it. ;)
looks really great. for sure we all will find a place for it^^

_________________
Owner of the Rookie servers and some more. :)
Rookies HP
My Project
Rookies Manialink


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 12:14 am 
Offline
road tourist
road tourist

Joined: Wed Oct 25, 2006 10:59 am
Posts: 102
Location: MARSEILLE
Very nice plugin :thumbsup:

Could you provide a setting for the way round and cup for the system of points (F1GP; MOTOGP; INDY; etc), one can as a "Fast"?

If no: exellent job :thumbsup:

If you seek server for the test: no problem :pil :1 :3

_________________
Aïoli

Jeff

Image
Image
O.M-Server Dirt-Cross 0-50K
O.M-Server Pro-Dirt-Cross 20-70K
O.M-Server Elite-Dirt-Cross 40-80K
O.M-Server Expert-Dirt-Cross 80-100K


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 1:23 am 
Offline
Pit Crew
Pit Crew

Joined: Sun Aug 19, 2007 3:58 pm
Posts: 5456
Owned TM-games: TMN, TMU, TMF, TM²C
jeffroselier wrote:
Could you provide a setting for the way round and cup for the system of points (F1GP; MOTOGP; INDY; etc), one can as a "Fast"?

That has nothing to do with this menu plugin. I can see about incorporating that into a future release though. What are the common point systems and the exact point distributions that should be supported?

_________________
Developer of XASECO for TMF/TMN ESWC & XASECO2 for TM²: see XAseco.org
Find your way around the Mania community from the TMN ESWC hub, TMF hub, TM² hub, and SM hub


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 9:32 am 
Offline
road tourist
road tourist

Joined: Wed Oct 25, 2006 10:59 am
Posts: 102
Location: MARSEILLE
Ok

Here are the distribution points:

Trackmania: 10, 6, 4, 3, 2, 1
AND FET 12, 10, 9, 8, 7, 6, 5, 4,, 3, 2, 1
MotoGP: 25, 20, 16, 13, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
MotoGP5: 30, 25, 21, 18, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Formula1: 10, 8, 6, 5, 4, 3, 2, 1
Simple10: 10, 9, 8, 7, 6, 5, 4, 3, 2, 1
Simple5: 5, 4, 3, 2, 1

If the other players have other ideas of points for the round modem / cup made your proposals.

Again thank you to take into account this point system for very interested in these two modes :thumbsup:

_________________
Aïoli

Jeff

Image
Image
O.M-Server Dirt-Cross 0-50K
O.M-Server Pro-Dirt-Cross 20-70K
O.M-Server Elite-Dirt-Cross 40-80K
O.M-Server Expert-Dirt-Cross 80-100K


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 12:57 pm 
Offline
happy cruiser
happy cruiser

Joined: Fri Sep 07, 2007 6:01 pm
Posts: 152
Location: The Netherlands
Owned TM-games: TMUF, Canyon
That looks great :gobananas:

I want it NOW :3


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 1:16 pm 
Offline
smooth traffic navigator
smooth traffic navigator
User avatar

Joined: Mon Feb 11, 2008 1:30 pm
Posts: 262
Location: Slovenia
Owned TM-games: TMUF
Awesome work Fufi. Tnx :thumbsup:

_________________
Image
OverLimit-Zone
http://sesepasekej.weebly.com/


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 1:20 pm 
Offline
cyclist
cyclist
User avatar

Joined: Sat Aug 19, 2006 5:13 pm
Posts: 39
Owned TM-games: TMU, TMO, TMS, TM²
Wow :idea:

Great Job !

_________________
Image


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 1:28 pm 
Offline
smooth traffic navigator
smooth traffic navigator
User avatar

Joined: Mon Feb 11, 2008 1:30 pm
Posts: 262
Location: Slovenia
Owned TM-games: TMUF
Maybe the music box should be in the menu.

_________________
Image
OverLimit-Zone
http://sesepasekej.weebly.com/


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 2:32 pm 
Offline
Pit Crew
Pit Crew
User avatar

Joined: Fri Jun 15, 2007 10:59 am
Posts: 1302
Location: Dresden, Germany
Owned TM-games: TMNF, TMUF
k4nm4n wrote:
Maybe the music box should be in the menu.

it is, it's just not in the screenshot since I don't have the plugin active =)

_________________
inactive, sorry


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 3:06 pm 
Offline
cyclist
cyclist
User avatar

Joined: Sat Sep 16, 2006 8:35 pm
Posts: 36
Location: Slovakia
Owned TM-games: TMo,TMs,TMn,TMu :D
Veeery nice !!! :gobananas: :3 :pil :1

_________________
Image


Top
 Profile  
 
 Post subject: Re: [WIP][XAseco] Fufi Menu
PostPosted: Tue Aug 12, 2008 4:43 pm 
Offline
road tourist
road tourist

Joined: Wed Oct 25, 2006 10:59 am
Posts: 102
Location: MARSEILLE
Added settings plugin "Autotrack Manager" :thumbsup:

_________________
Aïoli

Jeff

Image
Image
O.M-Server Dirt-Cross 0-50K
O.M-Server Pro-Dirt-Cross 20-70K
O.M-Server Elite-Dirt-Cross 40-80K
O.M-Server Expert-Dirt-Cross 80-100K


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 190 posts ]  Go to page 1, 2, 3, 4, 5 ... 13  Next

All times are UTC + 2 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group