How to get rid of default-controls?

How to get rid of default-controls?

Discuss game development here, from a distinct game project to an accessible third-party mutator, down to the interaction and design of individual units if you like.

Moderator: Moderators

Post Reply
camo
Posts: 29
Joined: 17 Aug 2010, 20:24

How to get rid of default-controls?

Post 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 788 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)
User avatar
Niobium
Posts: 456
Joined: 07 Dec 2008, 02:35

Re: How to get rid of default-controls?

Post 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)
camo
Posts: 29
Joined: 17 Aug 2010, 20:24

Re: How to get rid of default-controls?

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

Return to “Game Development”