Game Development Community

dev|Pro Game Development Curriculum

GamepadButtonsGui Replicating

by Carl A Harris · 10/18/2009 (1:32 am) · 0 comments

I'm not sure if anyone else noticed this in TGEA181.

I found that everytime I started the default single player game "simple.mis". Then looked at the GUI Editor (F10). The "GamepadButtonsGui" would replicate itself. Everytime I quit and reloaded the game, yet another "GamepadButtonsGui" would have been added.

Anyway, in the file "common/unifiedShell/GamepadButtonsGui.gui". I added a field at line 20 of the
"new GuiControl(GamepadButtonsGui){" control just below hovertime = "1000" that says Exists = "1".

Then, inside "common/unifiedShell/MainMenuGui.cs" at 23. I changed :

function MainMenuButtonHolder::onWake(%this)
{
	%this.add(GamepadButtonsGui);

	GamepadButtonsGui.setButton($BUTTON_A, "Go", ListMenu.CallbackOnA);
}

To this :

function MainMenuButtonHolder::onWake(%this)
{
	if(!GamepadButtonsGui.Exists)
	{
		%this.add(GamepadButtonsGui);
	}
	GamepadButtonsGui.setButton($BUTTON_A, "Go", ListMenu.CallbackOnA);
}

So the system would know not to replicate the game pad controls.

Not sure if anyone else had this issue, but I thought I would share, just in case.

About the author

Recent Blogs