View topic - How to get rid of default-controls?



All times are UTC + 1 hour


Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: 28 May 2011, 11:38 

Joined: 17 Aug 2010, 19:24
Location: Start 1
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.
Attachment:
File comment: Go away, menu!
go_away.png
go_away.png [ 261.75 KiB | Viewed 226 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)


Top
 Offline Profile  
 
PostPosted: 28 May 2011, 18:11 
User avatar

Joined: 07 Dec 2008, 02:35
You can do it through a widget (and thus likely possible in the handler itself if your mod overrides it):

Code:
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)


Top
 Offline Profile  
 
PostPosted: 28 May 2011, 18:53 

Joined: 17 Aug 2010, 19:24
Location: Start 1
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!


Top
 Offline Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group

Site layout created by Roflcopter et al.