Bridge Commander Central

BC Forums => BC Scripting => Topic started by: MLeo on April 13, 2009, 12:35:13 PM

Title: Chameleon Bridge Commander
Post by: MLeo on April 13, 2009, 12:35:13 PM
Just another tiny mod, like DiamondBC - Projectiles.

Chameleon BC!

A little mod that allows you to change the interface colours (and interface sounds) of BC.
There is one tiny restriction to this, you have to restart BC to see the effect after you change the Theme.
I may find a way in the future to make it instant. But for 30 minutes, I can't really complain.

At the moment there is just one non-default theme (stock colours), the White GUI, where, you guessed it, everything is white. ;)
I have asked Mark for permission to convert (atleast the colours part) his GUIMod to this new format.
This is only a v0.5 release, since there are a couple more parts that I would like to change as well, such as icons, which Mark's GUIMod also changes.

It is kinda annoying (for me) to say, but UMM isn't the first thing that gets run, so I had to overwrite a stock file to do so (loadinterface.py to be precise).
And unless you can change options.cfg files, you will need UMM to see the options associated with it. You can find it in the General Options.
You will need a recent version, after 20060225, the previous one contained a bug that didn't load the correct set of plugins for General Options.

If you wish to not install the UMM configuration menu, then you need to change the Theme option under General Options of options.cfg

I should probably make a tiny change to WhiteGUI, since you currently have to remember where the Options button is to change it back on a later occasion.
I'll do that for the final release.

Both zips can be extracted to the Bridge Commander directory.
Title: Re: Chameleon Bridge Commander
Post by: LJ on April 13, 2009, 05:49:07 PM
Cool :-)

Just out of interest, did you have a go at iterating the UI tree?
Title: Re: Chameleon Bridge Commander
Post by: MLeo on April 14, 2009, 02:43:47 AM
Yeah, but assigning colours and making them stick is somehow really hard to do.

It's one of those things I have to take another look at in the future.
Title: Re: Chameleon Bridge Commander
Post by: MLeo on April 14, 2009, 02:10:25 PM
And Mark gave permission!
Put this in scripts/Custom/Chameleon/

Now I need to get icons sorted as well for the release.
Title: Re: Chameleon Bridge Commander
Post by: NeoKaede on April 22, 2009, 01:31:12 PM
It's not working for me, for some reason. I added the scripts, but the only option I have is "Chameleon" under "Options/General" in UMM, nothing else. I tried changing the theme directly in Chameleon.py, but the game still loads the Stock menu. Here's the console dump:

Code: [Select]
>> This is a console tracker dump       by USS Frontier
##############
>> This dump started on -> Wed Apr 22 19:21:04 2009
##############
#----------------------------------------------------------------------->>> Wed Apr 22 19:21:04 2009
####
Loaded Colour theme: Stock
Loaded Interface Sound theme: Stock
Outdated Foundation, updating functions
Outdated Foundation, installing FolderManager
Repairing ship description outputs...
Foundation Tech loaded
BridgeFX Enabled...
CameraFX Enabled...
ExplosionFX Enabled...
SpecialFX Enabled...
WarpFX Enabled...
AttributeError: PreLoadAssets
Tracking Console
Registering listener Cloak Timing FoundationTriggers.8388727
['RemoveShip8388687', 'TractorStartedHitting8388734', '__doc__', 'TractorStoppedHitting8388736', 'FTB Event Loop0', 'AddShip8392975', '__name__', 'AI Inaccurate Weapons8388737', '8388727', 'NanoFXTrigger8392976', '__file__', 'SDT Trigger8388808', '__builtins__', 'WeaponHit8388708', 'TorpedoFired8388710', 'NanoFXBlinkers8392975']
Registering listener Decloak Timing FoundationTriggers.8388729
['RemoveShip8388687', 'TractorStartedHitting8388734', '__doc__', 'TractorStoppedHitting8388736', 'FTB Event Loop0', 'AddShip8392975', '__name__', 'AI Inaccurate Weapons8388737', '8388727', 'NanoFXTrigger8392976', '8388729', '__file__', 'SDT Trigger8388808', '__builtins__', 'WeaponHit8388708', 'TorpedoFired8388710', 'NanoFXBlinkers8392975']
Registering listener Engineering Extension Trigger init FoundationTriggers.8388629
['RemoveShip8388687', 'TractorStartedHitting8388734', '__doc__', 'TractorStoppedHitting8388736', '8388629', 'FTB Event Loop0', 'AddShip8392975', '__name__', 'AI Inaccurate Weapons8388737', '8388727', 'NanoFXTrigger8392976', '8388729', '__file__', 'SDT Trigger8388808', '__builtins__', 'WeaponHit8388708', 'TorpedoFired8388710', 'NanoFXBlinkers8392975']
Registering listener Engineering Extension Trigger Restart FoundationTriggers.8388622
['RemoveShip8388687', 'TractorStartedHitting8388734', '__doc__', 'TractorStoppedHitting8388736', '8388629', 'FTB Event Loop0', 'AddShip8392975', '__name__', 'AI Inaccurate Weapons8388737', '8388727', 'NanoFXTrigger8392976', '8388729', '__file__', 'SDT Trigger8388808', '__builtins__', 'WeaponHit8388708', '8388622', 'TorpedoFired8388710', 'NanoFXBlinkers8392975']
Error: was unable to load EmergEscapeK7 - ImportError: No module named ShipManager
Traceback (innermost last):
  File ".\Scripts\Custom\Autoload\LoadEngineeringExtension.py", line 157, in ImportQBautostart
  File ".\Scripts\Custom\QBautostart\EmergEscapeK7.py", line 4, in ?
ImportError: No module named ShipManager
####

####################
>> This dump ended on -> Wed Apr 22 19:21:04 2009
>> Console Tracker Dump END
####################
>> This dump ended on -> Wed Apr 22 19:23:12 2009
>> Console Tracker Dump END
####################
>> This dump ended on -> Wed Apr 22 19:23:12 2009
>> Console Tracker Dump END
Title: Re: Chameleon Bridge Commander
Post by: JimmyB76 on April 22, 2009, 01:51:55 PM
the only option I have is "Chameleon" under "Options/General" in UMM, nothing else.
ya same for me...  it reverted everything to stock menu colors, but i havent yet tried to change anything tho...
Title: Re: Chameleon Bridge Commander
Post by: MLeo on April 22, 2009, 01:53:27 PM
Quite possible I accidently uploaded an inbetween version.

Could you (both) attach your options.cfg?

I assume you selected either the WhiteGUI or Marks GUI mod?
Title: Re: Chameleon Bridge Commander
Post by: JimmyB76 on April 22, 2009, 01:58:40 PM
there were no selection options i could find...   just the mutator in Options/General and thats it...
and this is on a KM install, so Mark's GUI mod is included already...

here is my options.cfg all the same...
Title: Re: Chameleon Bridge Commander
Post by: NeoKaede on April 22, 2009, 02:01:56 PM
Quite possible I accidently uploaded an inbetween version.

Could you (both) attach your options.cfg?

I assume you selected either the WhiteGUI or Marks GUI mod?

You mean there's an in-game option for changing themes? I can't find it.
Title: Re: Chameleon Bridge Commander
Post by: MLeo on April 22, 2009, 02:16:13 PM
It should be under General, of course, if I haven't released the fix (I thought I did) for UMM, then you won't be able to find it.
*Adds a new version of UMM to his todo list*

Go to scripts/Custom/UnifiedMainMenu/ConfigModules/Options/General/ and copy ChameleonBCMenu.py to another directory, say, Graphics.
Reactivate the mod for Graphics and try it again.


I've released the colour part of Marks GUI mod a few posts back.
I had to "reformat" it for Chameleon, and I've included the "Stock" colours as the default (seemed like the safest thing to do).
Title: Re: Chameleon Bridge Commander
Post by: NeoKaede on April 22, 2009, 02:31:18 PM
That did it! I tried with the "Graphics" and "Sounds" folders and works on both. Thanks :D
Title: Re: Chameleon Bridge Commander
Post by: JimmyB76 on April 22, 2009, 09:40:23 PM
yep everything seems as it should on my end too...  :)
Title: Re: Chameleon Bridge Commander
Post by: JimmyB76 on July 15, 2009, 11:50:42 AM
hey Mleo - (forgive me for bumping this thread) i was curious...
if i wanted to add more options for different GUI themes in my install that are currently available, how could i do that?
for example, if i wanted to have the option to choose this GUI theme (http://bridgecommander.filefront.com/file/BC_Dress_up_Pack_v20_Red_Alert;98876) to go along with the other choices given with Chameleon BC already (White, Stock, and Mark's), how would i go about doing that?
Title: Re: Chameleon Bridge Commander
Post by: MLeo on July 15, 2009, 01:28:08 PM
Code: [Select]
It's actually a good thing that you mentioned this, I kinda forgot. :S

It's probable that it alters the loadinterface.py, open that up and look for SetupColors, in it you see a series of SetupColor invocations.
For all effects and purposes, you just need to alter it through a series of text manipulations.
And of course put it into it's own file.

In the plugin file you start with the following:
[code]from ChameleonBC.Chameleon import ChameleonColoursDef

Then you start the plugin:
Code: [Select]
oBCDressupPack = ChameleonColoursDef("BC Dress up Pack",Don't forget the trailing comma!

Then comes the text manipulation part.
For each of the SetupColor lines, you strip off the
Code: [Select]
SetupColor( and the "App." part.
Then the first comma becomes:
Code: [Select]
= (sign.
Then at the end of each line, save the last, you place another comma. Except for the last line.

Then you end it with this:
Code: [Select]
)
And it's probably for the best to end it with an "Enter"/newline.

As an example, say, for instance, that the following 3 lines make up the entire SetupColors function:
Code: [Select]
SetupColor(App.g_kSTButtonMarkerDefault, 251.0 / 255.0, 224.0 / 255.0, 153.0 / 255.0, 1.0)
SetupColor(App.g_kSTButtonMarkerHighlighted, 251.0 / 255.0, 224.0 / 255.0, 153.0 / 255.0, 1.0)
SetupColor(App.g_kSTButtonMarkerSelected, 255.0 / 255.0, 252.0 / 255.0, 1.0 / 255.0, 1.0)
Then the result is:
Code: [Select]

from ChameleonBC.Chameleon import ChameleonColoursDef

oExample = ChameleonColoursDef("Example",
   g_kSTButtonMarkerDefault = (251.0 / 255.0, 224.0 / 255.0, 153.0 / 255.0, 1.0),
   g_kSTButtonMarkerHighlighted = (251.0 / 255.0, 224.0 / 255.0, 153.0 / 255.0, 1.0),
   g_kSTButtonMarkerSelected = (255.0 / 255.0, 252.0 / 255.0, 1.0 / 255.0, 1.0)
)
[/code]

If you were to do, say, a subset of the colours, then ChameleonBC will fill the rest in with the stock colours.
If you missspel an entry, then ChameleonBC will make mention of it in the console, but not crash.
Title: Re: Chameleon Bridge Commander
Post by: NeoKaede on July 15, 2009, 01:56:34 PM
You can do what Mleo says, or copy each color value from loadinterface.py and paste it in one of the examples that come with Chameleon (I used WhiteGUI.py); then, change the WhiteGUI part in

Code: [Select]
ChameleonColoursDef("White GUI"
to something different and save it with a different name :)

BTW Jimmy, if you want USS Phoenix's KDF Mod's menu colors, I ported them some time ago, and they look a lot like the Read Alert ones.
Title: Re: Chameleon Bridge Commander
Post by: MLeo on July 15, 2009, 02:10:21 PM
I tried that, and it just got real boring, real soon. Luckily with my programming knowledge (read regex) and the right tools I could do it faster and far less tediously.
Title: Re: Chameleon Bridge Commander
Post by: JimmyB76 on July 15, 2009, 03:52:23 PM
BTW Jimmy, if you want USS Phoenix's KDF Mod's menu colors, I ported them some time ago, and they look a lot like the Read Alert ones.
thats exactly what i had in mind for next, after i put in the red alert theme :)



edit - hmmm it would seem i dont have the option "Red Alert" in my Chameleon list along with the others...
whats wrong with my plugin?
Title: Re: Chameleon Bridge Commander
Post by: eclipse74569 on July 15, 2009, 04:34:20 PM
I'm working on a Nemesis style theme lol to pass the time when I'm not working on the First Contact pack.

All the others sounds cool.  I like the red alert idea!
Title: Re: Chameleon Bridge Commander
Post by: MLeo on July 15, 2009, 05:21:14 PM
Line 16, 30, 96 contain errors.
16 and 96 contain an extra comma, 30 misses an = sign.
Title: Re: Chameleon Bridge Commander
Post by: JimmyB76 on July 15, 2009, 06:05:55 PM
oh goodness (http://i17.photobucket.com/albums/b54/jimmyb76/random/BangHead.gif) no wonder why  :oops:
lol i cant believe i overlooked those obvious things...
ah well it is all working perfectly now, thanks for the help :)
Title: Re: Chameleon Bridge Commander
Post by: NeoKaede on July 16, 2009, 06:21:58 AM
thats exactly what i had in mind for next, after i put in the red alert theme :)

Here it is. Credits go to USS Phoenix, of course :)
Title: Re: Chameleon Bridge Commander
Post by: MLeo on July 17, 2009, 07:31:55 PM
Before I forget, do any of them include custom icons or sounds?