Soldak Home   Drox Operative   Din's Curse   Depths of Peril   Zombasite  

Go Back   Soldak Entertainment Forums > Din's Curse > Din's Curse modding
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
  #1  
Old 12-18-2010, 01:32 PM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default Adding a new menu?

If I want to add a whole new menu to the game, that uses a different name, do I override the systems.gdb->UISystem object?

For example, located in some file that I create:
Code:
PartyMember overrides UISystem
{
    // Recognize a PartyMember0 UI menu
    GameMenu PartyMember0
}
What I really want to do is modularize my code into smaller files and more menus. My real concern is:

Is there some sort of MNU_MAX that I need to worry about?
Reply With Quote
  #2  
Old 12-19-2010, 01:24 AM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default

In terms of just getting this to work, I believe I've answered my own question. Here's the example .gdb override the worked for me, and figuring this out also helped explain why certain menu files I created just never seemed to be visible in game:

Code:
PartyMemberMenuChanges overrides UISystem
{
    // NOTE: We appear to need to write in every menu that will
    // appear if we are going to override the UISystem::GameMenu
    // settings.
    
	GameMenu Game
	GameMenu Player
	GameMenu TimedEvent
	GameMenu SelectedEntity
    // Recognize the PartyMemberN container.
	GameMenu PartyMembers
    // Recognize a PartyMember0 UI menu
	GameMenu PartyMember0
	GameMenu PartyMember1
	GameMenu PartyMember2
	GameMenu PartyMember3
	GameMenu PartyMember4
	GameMenu PartyMember5
	GameMenu PartyMember6
	GameMenu PartyMember7
	GameMenu PartyMember8
	GameMenu PartyMember9
	GameMenu PartyMember10
	GameMenu Client1
	GameMenu Client2
	GameMenu Client3
	GameMenu Client4
	GameMenu Client5
	GameMenu Client6
	GameMenu Client7
	GameMenu Client8

}

Last edited by jeremyosborne : 12-19-2010 at 01:26 AM. Reason: spelling and grammar, my usual foibles
Reply With Quote
  #3  
Old 12-20-2010, 12:11 PM
Shadow's Avatar
Shadow Shadow is offline
Super Moderator
 
Join Date: Jun 2007
Location: Dallas, TX
Posts: 9,413
Default

There shouldn't be any max files limit.

Those GameMenu lines are only needed if you make a new menu that needs to automatically show up on the main game screen.

In this case it would be better to use addsTo instead of override, so you can do something like this:

PartyMemberMenuChanges addsTo UISystem
{
GameMenu PartyMembers
}

Most of the time you want to use overrides, but if you just want to add some things that can have multiple lines and you want to keep all of the old ones, addsTo works better.
__________________
Steven Peeler
Designer/programmer
Depths of Peril, Kivi's Underworld, Din's Curse, Drox Operative, Zombasite, Din's Legacy, & Drox Operative 2
Patreon
Reply With Quote
  #4  
Old 12-20-2010, 12:16 PM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default

I didn't know addsTo existed. NICE!

Thanks Shadow!
Reply With Quote
  #5  
Old 12-20-2010, 12:24 PM
jeremyosborne jeremyosborne is offline
Champion
 
Join Date: Oct 2010
Posts: 194
Default

And thanks for the clarification about the GameMenu parameter. That solves the mystery why I was able to place my invisible PartyMembers menu into the game in my tests without declaring it in GameMenu: it never needed to be visible, it just needed to be positioned. However, my new PartyMemberN, like PartyMember0, status menus wouldn't show up, so I guess they fall into the need to show up automatically category and need to be declared as GameMenu properties.

I'll clean up my mod and use your suggestion.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 05:15 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright 2007 - 2019 Soldak Entertainment, Inc.