About Store Forum Documentation Contact



Post Reply 
New Menu.func(MenuPush) problem
Author Message
KrysleQuinsen Offline
Member

Post: #1
New Menu.func(MenuPush) problem
Hi, just update the engine to the latest version and I have some problem with the new Menu.func() using MenuPush class instead of the original Str which I heavily using.

Right now MenuPush currently uses Node<MenuElm> 'display_name' instead of 'name' which is for code commands.

Code:
Node<MenuElm> n;
n.New().create("aa");   //output is "aa" | abs=0
n.New().create("bb").display("bbbbbbbbbbb"); // output is "bbbbbbbbbbb" | abs=1
n.New().create("cc").display("wsad");    // output is "wsad" | abs=2
Node<MenuElm> &c=(n+="main");
c.New().create("sub").display("display"); // output is [0]"main" [1]"display" | abs=3
menu.create();
menu.setData(n);
menu.func(menupush_test);

Also, is it possible to have MenuPush() to return the old value like "main\\sub"? it is not that important but just for convenience not to change every line of the code. smile

Edit: Nevermind the second request, I forget it is MemPtr<MenuPush> pfft
(This post was last modified: 08-19-2021 08:50 AM by KrysleQuinsen.)
08-19-2021 08:05 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: New Menu.func(MenuPush) problem
Thank you,
fixed: https://github.com/Esenthel/EsenthelEngi...1b4a794585

The best way is to make a helper function:
Code:
Str MenuPushPath(C CMemPtr<MenuPush> &path)
{
   Str p; FREPA(path){if(i)p+='/'; p+=path[i].name;}
   return p;
}
08-19-2021 09:12 AM
Find all posts by this user Quote this message in a reply
Post Reply