[Plugin]Oliverde8 Hud Menu | [Manialive 1] & [Manialive 2.8]

Post here every finished plugin

Moderator: NADEO

Post Reply
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...

Post by oliverde8 »

Hmm that is a lot of errors and some quite serious :cry:

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
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
Knutselmaaster
Posts: 1206
Joined: 15 Jun 2010, 18:03
Location: Somewhere between Paris and Disney in France.
Contact:

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN

Post by Knutselmaaster »

Don't hesitate to contact me for assistance testing it.
gl&hf!
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN

Post 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 :roll:
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
Knutselmaaster
Posts: 1206
Joined: 15 Jun 2010, 18:03
Location: Somewhere between Paris and Disney in France.
Contact:

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN

Post 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.
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN

Post 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
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
aseco
Posts: 96
Joined: 06 Jul 2010, 17:08
Location: Germany
Contact:

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN

Post 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 :-)
i7 920 | Nvidia GTX260 | 4Gb DDR3
www.floschnell.de | I like that comic
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...(BROKEN

Post 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
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
oliverde8
Posts: 1286
Joined: 16 Jun 2010, 07:33
Location: in a Blue Box

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ...

Post 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 :mrgreen: .

Hud Menu should now work on servers having more then 1 player using it :geek:
Image
Developper for The next generation, Clean and Powerfull controller eXpansion for your SM & TM server . Working on eXpansion² with full MP4 support and many other awesome features...
User avatar
Knutselmaaster
Posts: 1206
Joined: 15 Jun 2010, 18:03
Location: Somewhere between Paris and Disney in France.
Contact:

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ... WORKS

Post by Knutselmaaster »

Great, i will test it asap ;)
nouseforname
Posts: 32
Joined: 30 Dec 2010, 19:03

Re: [Plugin]Oliverde8 Hud Menu | over 340 buttons ... WORKS

Post 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?
Post Reply

Return to “ManiaLive Plugins”

Who is online

Users browsing this forum: No registered users and 1 guest