Flakes Menu System [rel004]

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761
Flakes Menu System [rel004]
« on November 11th, 2016, 10:46 AM »Last edited
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

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)
Code: [Select]
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:
Code: [Select]
    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 :D

CSMenu.Show(player hPlayer)
This will show a menu to a player
Code: [Select]
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

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 917
Re: Flakes Menu System [rel004]
« Reply #1, on November 11th, 2016, 12:18 PM »
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 )

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761
Re: Flakes Menu System [rel004]
« Reply #2, on November 11th, 2016, 12:23 PM »Last edited on November 11th, 2016, 01:10 PM
Quote from sseebbyy on November 11th, 2016, 12:18 PM
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 )
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

KAKAN

  • Wiki Contributor
  • Posts: 3,346
You can contact me using Discord, at Developers.CPP( check off-board to find the invite link )
Github: https://github.com/theKAKAN

Xmair

  • Wiki Contributor
  • Posts: 872
VU Full Member | VCCNR Developer | KTB Developer | EAD Ex-Scripter

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761

Sebastian

  • VC:MP Beta Tester
  • Something like this: hga hga hga
  • Posts: 917

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761
Re: Flakes Menu System [rel004]
« Reply #7, on November 19th, 2016, 09:48 AM »
Squirrels object oriented engine isn't working properly, link updated with a workaround.
Re: Flakes Menu System [rel004]
« Reply #8, on June 3rd, 2017, 03:30 PM »
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.

D.VICTOR

  • Newbie
  • *VCMP*
  • Posts: 36

EK.IceFlake

  • Hero Member
  • "We are the champions my fellahs" - Sufyan/VK.SuFy
  • Posts: 1,761