Hi :D
As part of a scripting job, I had to make a menu system for a server.
It looks|behaves similar to seby's CMS.
Here is a screenshot
(https://i37.servimg.com/u/f37/18/45/45/23/menusy10.jpg)
To use it, you have to learn a few functions
CSMenu
This is a class that you will need to use in order to initialize an instance of a menu.
Format:
CSMenu(string sTitle)
TestMenu1 <- CSMenu("Test Menu 1");
All further references to CSMenu are an instance of a created menu.
CSMenuItem CSMenu.CreateItem(string sItemName)
This will return a CSMenuItem which you can use to bind select and hover functions.
CSMenuItem CSMenuItem.Bind(function hFunction (player))
CSMenuItem CSMenuItem.BindHover(function hFunction (player))
Example:
TestMenu1.CreateItem("TM1 Option 1").Bind(function(player)
{
::MessagePlayer("You have selected TestMenu1 option 1", player);
}).BindHover(function(player)
{
::MessagePlayer("You have hovered over TestMenu1 option 1", player);
});
The example looks familiar, doesn't it? @KAKAN :DCSMenu.Show(player hPlayer)
This will show a menu to a player
function onPlayerCommand(player, command, parameters)
{
TestMenu1.Show(player);
}
You can download the source including the example file here:
https://mirror.cloudwards.es/FMS.7z https://elitekillerz.net/mirror/FMS.7z
Please note that you may need to adjust the client side script to integrate with yours.
This is released under the copyleft CLNS, a copy of which can be found in /store/script/License.txt
Using GUI for a menu. Great !
But, I would do some changes to the background: should be more round than squarish, and more transparent
( I find the square background kinda ugly now, but that's only my opinion )
Quote from: sseebbyy on Nov 11, 2016, 12:18 PMUsing GUI for a menu. Great !
But, I would do some changes to the background: should be more round than squarish, and more transparent
( I find the square background kinda ugly now, but that's only my opinion )
It was more transparent, however it didn't look very nice that way. Anyways you only need to change a single line to change the transparency.
This is a GUIWindow which means that we can't round the edges + square edges seem more modern IMO
Quote from: EK.CrystalBlue on Nov 11, 2016, 12:23 PMThis is a GUIWindow which means that we can't round the edges + square edges seem more modern IMO
I still like round ones though ;p
Use GUISprite.
Quote from: Xmair on Nov 11, 2016, 01:15 PMUse GUISprite.
I don't think GUISprite.AddChild would work and anyways you can convert it if you want if it would work. I'd prefer it square edged.
Quote from: KAKAN on Nov 11, 2016, 01:06 PMQuote from: EK.CrystalBlue on Nov 11, 2016, 12:23 PMThis is a GUIWindow which means that we can't round the edges + square edges seem more modern IMO
I still like round ones though ;p
It kinda fits more to the game
Squirrels object oriented engine isn't working properly, link updated with a workaround.
A problem with .Parent has been solved. I had solved it on my PC but didn't upload it and it got combined with an unrelated system (intentionally). Thanks to
@sseebbyy for cleaning that up.
Quote from: D.VICTOR on Oct 06, 2018, 12:28 AMesta quebrada el link!!!
Fixed.
I don't recommend using this menu.