Page 1 of 1

How to get rid of default-controls?

Posted: 28 May 2011, 12:38
by camo
Hi!

Since my project won't use any of the typical *A-Stuff, i need to get rid of all the remains of it in the GUI.
From what I found, I managed to remove the resbar and write my own tool-tip-function, but not the commandmenu.

I wrote my own Menus with OGL-Functions (see attached) but the original menu is still bothering me.
Go away, menu!
Go away, menu!
go_away.png (261.75 KiB) Viewed 792 times
I don't want to remove specific buttons, but the complete menu or just place it at another location.


(Alternativly I could use a completely empty Chili, but it seems to be much faster to write it all from scratch than to wait for it to be released)

Re: How to get rid of default-controls?

Posted: 28 May 2011, 19:11
by Niobium
You can do it through a widget (and thus likely possible in the handler itself if your mod overrides it):

Code: Select all

function widget:GameFrame(n)
	
	local function DummyHandler(xIcons, yIcons, cmdCount, commands)
		widgetHandler.commands = commands
		widgetHandler:CommandsChanged()
		return "", xIcons, yIcons, {}, {}, {}, {}, {}, {}, {}, {[9999]=1} -- Without the entry in table, we get odd behavior such as not being able to rotate buildings
	end
	
	widgetHandler:ConfigLayoutHandler(DummyHandler)
	Spring.ForceLayoutUpdate()
	
	widgetHandler:RemoveWidgetCallIn('GameFrame', self)
end
Probably requires 'handler=true' in widget:GetInfo. Also I don't think the code works if you put it in :Initialize (thus why it is in :GameFrame)

Re: How to get rid of default-controls?

Posted: 28 May 2011, 19:53
by camo
Yep, that did it!

I added it to the resbar-remove-widget in the Initialize-Part (works). The crucial point was to add the handler=true (whatever it means) as suggested by you.

Thanks to the keyword I also found this, which looks like there is already a dummyhandler (But without the last table-entry).


Thanks, dude!