Page 7 of 14
Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...
Posted: 19 Apr 2011, 08:46
by oliverde8
Hmm that is a lot of errors and some quite serious
The Admin error was easy that is done,
I don't understand why when there is more then 1 player the Menu just don't work, I ma trying to investigate.
I think I also solved the spec player problems.
You may need to waity a lot to see the solution
Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN
Posted: 19 Apr 2011, 10:09
by Knutselmaaster
Don't hesitate to contact me for assistance testing it.
gl&hf!
Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN
Posted: 19 Apr 2011, 11:35
by oliverde8
Actually I have 1 probleme :S
When there is 2 players for some bizarre reasons the clicks don't work. I try to understand what I am doing wrong
can you help farfa, here is whats going on
First a small exemple menu
Menu
-Menu1
- -Menu1-1
- -Menu1-2
-Menu2
--Menu2-1
Admin
2 players on the server. 2 window object created one for each player.
Player 1 opens The Menu1, a new Window is generated with the buttons of this sub menu
Player 1 opens the Menu1-1 a new Window is generated for the sub menu Menu1-1
Player 2 opens the Menu2, a new window is generated. Everything is ok for Player 2
Player 1 try to open Menu 1-2 nothing happens,
Player 1 click on a button of Menu1-1 everything works
I don't understand what is happening, has onyone an idea;
One las thing I might also find a error in ManiaLive it self
In libraries\ManiaLive\Gui\Windowing\ need to use !== and not != because you are comparing objects which gives :
Code: Select all
function onIsAdded(Container $target)
{
// echo "added " . get_class($this) . " \n";
$this->parent = $target;
if ($target instanceof WindowDisplayable)
{
if ($this->window !== $target->window)
$this->announceWindow($target->window);
}
elseif ($target instanceof Control)
{
if ($target->getWindow() != null
&& $target->getWindow() !== $this->window)
$this->announceWindow($target->getWindow());
}
}
I had some crashes before not since I did this

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN
Posted: 19 Apr 2011, 11:58
by Knutselmaaster
Yes, that is a bit what i experienced too, for player 2 everything works ok, but for player 1 menus won't close.
Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN
Posted: 19 Apr 2011, 17:16
by oliverde8
Found the probleme, but I don't know the solution
I add an action to the background of my Control onDraw
$this->background->setAction($this->callback('onClick'));
The probleme is I use this same Control on multiple windows. 1 window per player to be exact. Every player has different "action id's" which are sent to the last window that used the controller. But th last window only knows the action id of it's own and not the other ones.
I am not sure how I can prevent that from happening

I tried to duplicate each of my controls but that didn't seem to work either(Yes I have cloned the background object also)
And why does everything works well on the first level but not on the others :S. May it be because I open the same Window(same name just with different buttons) many times for the same player. I open a window per level of Menu
Help plz, I am out of ideas
Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN
Posted: 24 Apr 2011, 09:10
by aseco
oliverde8 wrote:Found the probleme, but I don't know the solution
I add an action to the background of my Control onDraw
$this->background->setAction($this->callback('onClick'));
The probleme is I use this same Control on multiple windows. 1 window per player to be exact. Every player has different "action id's" which are sent to the last window that used the controller. But th last window only knows the action id of it's own and not the other ones.
I am not sure how I can prevent that from happening

I tried to duplicate each of my controls but that didn't seem to work either(Yes I have cloned the background object also)
And why does everything works well on the first level but not on the others :S. May it be because I open the same Window(same name just with different buttons) many times for the same player. I open a window per level of Menu
Help plz, I am out of ideas
Hi,
I had a quick look into your code and maybe detected a point that could cause troubles.
If I got it right, then you are assigning the same root objects to different windows.
That won't work out! you can only add a control to one window at a time.
So there are two ways to solve that (you figured the first one out yourself):
1) Creating the root objects at the startup and assign clones of these objects to each newly created window.
But cloning objects is a difficult task in php because you have to determine any reference and create subcomponents recursively - which causes ache in my stomach :-] (oh and if you have actions on these windows and you clone these, the actionids won't change!) -> I recommend you to definitely use the second possibility.
2) The way I solved it for the menubar was to create an array structure with internal php datatypes. This kept the whole structure of the menu and once a new player connected I took that structure and created the component structure from it. If you do this for every player, then you will have unique components for each of them.
I hope this helped in any way - if not feel free to contact me in any way

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN
Posted: 24 Apr 2011, 16:56
by oliverde8
Hi,
thanks a lot for the response, I hadn't time to look at it this week
I already tried your first Solution Cloning my route, and did it recursively but couldn't make it work, I will have alook for the second solution you suggest and look into your Menu
Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...
Posted: 01 May 2011, 16:46
by oliverde8
Hi,
I had some time today so I decided to have a look to the menu.
I find out why my cloning didn't work. The cloning was OK but the Windows didn't used the cloned data but the default data.
I changed the way the sub menus open and close, hopefully it works xd I did test it and it seems okay

.
Hud Menu should now work on servers having more then 1 player using it

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ... WORKS
Posted: 01 May 2011, 17:52
by Knutselmaaster
Great, i will test it asap

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ... WORKS
Posted: 01 May 2011, 18:35
by nouseforname
I just installed ML today, now i also tried your menu.
its there, i can go throu it, but all links to URL or MANIALINK seems not to work, same the the server join links.
What did i do wrong?