Author Topic: Creating a UMM Menu  (Read 2882 times)

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Creating a UMM Menu
« on: August 06, 2008, 10:31:09 PM »
I have a question. Rather than having my uniform mutators strewn throughout the "Mutator" menu, is it possible to make a separate Menu, like the BCS:TB config menu, and place all of the uniform mutators in there? I opened up the BCS:TB Menu code and other UMM Menu codes and just got hopelessly confused.

Offline KrrKs

  • Posts: 461
  • Cookies: 25
Re: Creating a UMM Menu
« Reply #1 on: August 07, 2008, 08:31:43 AM »
I don't know if this helps (it's just so obvios that it normaly can't but ... it's a try)

statet in the UMM.py:
Quote
# Creating Main Menu Mods:
#  There are several types of mods, though all are the same setup (save for the startup mods)
#  These types are (behind the name is the place to put the file):
#  StartUp (StartupModules)
#  Configurations (ConfigModules)
#  Configurations::Options (ConfigModules/Options)
#  Configurations::Options::General (ConfigModules/Options/General)
#  Configurations::Options::Sound (ConfigModules/Options/Sound)
#  Configurations::Options::Graphics (ConfigModules/Options/Graphics)
#
#  All locations are relative to your BC path and the following path:
#  scripts/Custom/UnifiedMainMenu/
#
#  As for the basic structure of your plugin, you need atleast 2 functions.
#   GetName - this must return the name of your mod
#     It has no arguments
#   CreateMenu - this must return your configuration screen, if there isn't one, then return None
#     It has the following arguments:
#      pOptionsPane - pOptionsPane is the right hand side of the options window, can be entered as None (in the stock scripts it isn't really used, except for the keyboard configuration)
#      pContentPanel - this is the direct "parent" your UI will be added to.
#      bGameEnded - wether or not the game ended, must defaults to 0
#
#  There is an exception, namely in the StartUp modules. These mods have an extra function:
#   StartUp - this doesn't return anything, and it will have to contain all the code you need for your mod to be "hooked" into BC
#     It has no arguments

and this is in the BCS TB main script:
Quote
# Grab the variables.  (That sounds like something that would get you brought up
# on sexual harrassment charges. "He grabbed my variables!" Yes. Moving on...)
ESRHullCustomizationOption  = pModule.ESRHullCustomizationOptionDefault
SRCutscene                  = pModule.SRCutsceneDefault
EngineeringOption           = pModule.EngineeringOptionDefault

### Section II: Global Variables
# Defines the location where we will save our defaults.
ConfigPath  = "scripts\\Custom\\UnifiedMainMenu\\ConfigModules\\Options\\SavedConfigs\\BCSTBConfig.py"

### Section III: Functions
# Name of the mod (req. in UMM).  This defines the name of the options menu.
def GetName():
                return "BCS: The Beginning"

# Builds our menu.  Remember to add the "return App.TGPane_Create(0,0)" command!
def CreateMenu(pOptionsPane, pContentPanel, bGameEnded = 0):
                # Make the submenus.
                CreateESRSubmenu(pOptionsPane, pContentPanel)
                CreateSRSubmenu(pOptionsPane, pContentPanel)

                # Add the Engineering Menu Option.
                CreateEngineeringFixButton(pOptionsPane, pContentPanel)

                # Make the Save Config button.
                CreateButton("Save Configuration as Default", pContentPanel, pOptionsPane, pContentPanel, __name__ + ".SaveConfig")

                return App.TGPane_Create(0,0)

## Set of functions for ESR.
def CreateESRSubmenu(pOptionsPane, pContentPanel):
                # Create the ESR Menu.
                pESRMenu = App.STCharacterMenu_Create("Emergency Repair")
                pContentPanel.AddChild(pESRMenu)

                # Create the submenu for hull repair
                pHullMenu = App.STCharacterMenu_Create("Hull Repair (HR) Options")
                pESRMenu.AddChild(pHullMenu)

                # Add buttons.
                CreateButton("1: Disable Hull Repair.", pHullMenu, pOptionsPane, pContentPanel, __name__ + ".HandleESRButtonClicked", EventInt = 0)

                return pESRMenu

puh, thats a punch of a text. however, you have to define the script and subfunc in which you save / from which you load you settings, and then get a name for the submenu in the UMM. Sadly i don't have any Uniform mutators, so i don' know how they work/ what you will have to say instead of the ".HandleESRButtonClicked" Function.

Hope this helps at least a little bit

Offline JimmyB76

  • Posts: 6423
  • Cookies: 421
Re: Creating a UMM Menu
« Reply #2 on: August 07, 2008, 08:45:26 AM »
Quote
# Grab the variables.  (That sounds like something that would get you brought up
# on sexual harrassment charges. "He grabbed my variables!" Yes. Moving on...)

lol ya gotta love wowie's little things he puts in throughout BCS:TB's scripts  :lol:

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Creating a UMM Menu
« Reply #3 on: August 07, 2008, 01:21:35 PM »
I did look at this code, however, I don't understand what it's saying in the slightest. If someone would be willing to walk me through it, I would be very appreciative.

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Creating a UMM Menu
« Reply #4 on: August 07, 2008, 01:26:24 PM »
I don't think you can, easily, do this for uniform mutator packs.
This has to do with the fact that an uniform mutator pack is nothing more than a mutator with a number of overrides, all generic components with no extra info whatsoever.


I know I've been saying this for a long time, but BP Uniforms is your best bet. ;)
It comes without mutators (though can be activated with mutators and be used along side with mutators to have backwards compatibility), it has, therefor, it's own menu. And you can mix and match character uniforms.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Creating a UMM Menu
« Reply #5 on: August 07, 2008, 04:00:50 PM »
I know I've been saying this for a long time, but BP Uniforms is your best bet. ;)
It comes without mutators (though can be activated with mutators and be used along side with mutators to have backwards compatibility), it has, therefor, it's own menu. And you can mix and match character uniforms.
Is BP Uniforms part of BP Core, or just an unreleased mod you have been working on?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Creating a UMM Menu
« Reply #6 on: August 07, 2008, 04:02:27 PM »
Unreleased mod as of yet, since I've been having trouble with the menu's.

And to lift a tip of the veil, I've also been plagued by troubles with the menu's with SubMenu.
And yes, there is a connection. ;)
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Creating a UMM Menu
« Reply #7 on: August 07, 2008, 04:04:12 PM »
Ooh, is it integrated into the QB menu?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Creating a UMM Menu
« Reply #8 on: August 07, 2008, 04:08:25 PM »
It already was.

Actually, I have 2 problems (or more, I can't remember them all right now, actually, more like 3 or 4 with BPUniforms, UI related, and 2 with SubMenu, one UI related, and one performance related, unless you want to add 6, per menu, to your QB loadtime?), they are related so to speak.

I won't divulge here, but when it works, it will be great!

Finally an update for BridgeSubMenu as well!
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Creating a UMM Menu
« Reply #9 on: August 07, 2008, 04:10:05 PM »
Could I possibly make a submenu in the mutator menu, and put all of the uniform mutators there?

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Creating a UMM Menu
« Reply #10 on: August 07, 2008, 04:14:59 PM »
No submenu's in mutators.

And you still have the problem I outlined above. ;)
How can you tell which are uniform mutators or not?
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.

Offline Kirk

  • Posts: 1438
  • Cookies: 139
    • My Released Mods
Re: Creating a UMM Menu
« Reply #11 on: August 07, 2008, 04:21:27 PM »
How can you tell which are uniform mutators or not?
Sadly, I have no idea how I could tell BC which mutators are uniform mutators, or how to make a new menu with new mutators that BC would recognize. :(

Offline SMBW

  • Noob
  • Posts: 35
  • Cookies: 107
Re: Creating a UMM Menu
« Reply #12 on: August 07, 2008, 05:02:56 PM »
lol - sry that I interfere but here might be a misunderstanding:

Maybe I'm the only one who misunderstands everyone else, but as I understand it kirk2164 would like to restructure his mutator menu (create a submenu and putt in all uniform mutators which are on his install). It's only for his personal install....

Rather than having my uniform mutators strewn throughout the "Mutator" menu, is it possible to make a separate Menu, like the BCS:TB config menu, and place all of the uniform mutators in there?

MLeo's answers sound to me like he is looking for a way to create a mod which can be used on any install...

I don't think you can, easily, do this for uniform mutator packs.
This has to do with the fact that an uniform mutator pack is nothing more than a mutator with a number of overrides, all generic components with no extra info whatsoever.

I think kirk2164's idea can be done because kirk2164 knows which mutators he wants to have in his submenu (or UMM menu) while a general mod is impossible as MLeo already explained because one cannot find out if a mod is a uniform mod.

If I understood something wrong pls correct me! Sry again!
Don't part with your illusions. When they are gone you may still exist, but you have ceased to live.  - -  Mark Twain

Sorry for my bad English!

Offline MLeo

  • Retired Staff
  • Posts: 3636
  • Cookies: 833
  • Software Simian
    • the Programming Pantheon
Re: Creating a UMM Menu
« Reply #13 on: August 07, 2008, 06:43:36 PM »
Well, there still aren't any submutators.
And if he wants to go into his Autoload directory and find all mutators that's fine by me.

Also, there is another problem, for mutators to work, they need to be in the real mutator list (that is, the internal list) so he would have to filter them when they are added to the screen.
I still can't read peoples minds, nor can I read peoples computers, even worse, I can't combine the two to read what is going wrong with your BC install...

"It was filed under 'B' for blackmail." - Morse, Inspector Morse - The dead of Jericho.