Bridge Commander Central

BC Forums => BC Scripting => Topic started by: MLeo on January 16, 2009, 05:48:13 AM

Title: I ATE'NT DEAD
Post by: MLeo on January 16, 2009, 05:48:13 AM
Kudos to you who knows the reference. ;)

This is just to show that I still occasionally do scripting for BC.

And now, this is not MVAM-able Vahhrer from a Warbird.
The main reason to allow this through SubMenu is for Shuttles.
So you can do SubMenu = ["Parent Ship", "Shuttles"]
And the ship you apply that to will be under the ship, and the additional submenu of "Shuttles". Of course, MVAM still applies. You could even have a shuttles menu for a subship.

Also, can anyone else notice the other, already kinda old, thing in the picture, but now updated to use the same code?
Title: Re: I ATE'NT DEAD
Post by: LJ on January 16, 2009, 06:06:43 AM
Player Bridge is now submenued? :-)

How is that mesh decomposition lib comming btw?
Title: Re: I ATE'NT DEAD
Post by: Aeries on January 16, 2009, 06:16:34 AM
SWEET! So we could have, say...

Sovereign -> First Contact Sovereign
              -> Post Nemesis Sovereign

Or even...

TOS Constitution -> TOS
                        -> Cadge

Things like that? :3
Title: Re: I ATE'NT DEAD
Post by: MLeo on January 16, 2009, 06:25:59 AM
Player Bridge is now submenued? :-)

How is that mesh decomposition lib comming btw?
Don't worry (or should you?), this was 20 minutes work (the little spare time I had this week) to recreate the main idea behind SubMenuV5 (which is on another comp right now, but I suspect really bad coding :P), to get a little back to coding for fun.

As for my Excalibur work, reading C isn't fun. And the lib was written in a more C style than C++ style. Reading C/C++ code can be fun, but for some reason I'm missing it with his. :( And I seem to lack some C# ideas.


SWEET! So we could have, say...

Sovereign -> First Contact Sovereign
              -> Post Nemesis Sovereign

Or even...

TOS Constitution -> TOS
                        -> Cadge

Things like that? :3
Did you know this was already possible with BridgeSubMenu? :P

The "new" part here is that it uses the same code as the ship counterpart. So it new allows nesting of bridges in the same way as nesting of ships, as seen above.
Title: Re: I ATE'NT DEAD
Post by: Aeries on January 16, 2009, 06:29:24 AM
Did you know this was already possible with BridgeSubMenu? :P

The "new" part here is that it uses the same code as the ship counterpart. So it new allows nesting of bridges in the same way as nesting of ships, as seen above.

Oohhhh. No, I was not aware of this. :]
Title: Re: I ATE'NT DEAD
Post by: MLeo on January 16, 2009, 06:44:55 AM
Did you know this was already possible with BridgeSubMenu? :P

The "new" part here is that it uses the same code as the ship counterpart. So it new allows nesting of bridges in the same way as nesting of ships, as seen above.

Oohhhh. No, I was not aware of this. :]
What this does allow, but was not previously possible, is to have the Sovereign bridge selectable, just as the normal bridge.

In the screenshot above, I just had to modify the Galaxy bridge plugin to say it's SubMenu is "Sovereign", and it gets put under it.
Title: Re: I ATE'NT DEAD
Post by: MLeo on January 16, 2009, 06:53:14 AM
Btw, this was a bug previously.
The Hybrid came after the Keldon, or something like that.
Or was it the Galor? Something odd with those ships (well, explainably correct, and logical).

Oh yeah, now I know, these are the "names" of the ships:
CardFreighter
CardHybrid
Galor
Keldon

But their display names are:
Card Freighter
Hybrid
Galor
Keldon

Which isn't in the expected order.

Also, I've chosen for a case insensitive ordering, but for the not progammers this may seem to be a rather odd remark. :P
Title: Re: I ATE'NT DEAD
Post by: JimmyB76 on January 16, 2009, 09:45:18 AM
i had always been curious about something...   is there somehow a way to "force" an order of the ship list to make it customizable?
for example, suppose someone wanted their Card Ship list in an unusual non-alphabetical order such as:
Card Ships
--- Keldon
--- Galor
--- Hybrid
--- Card Freighter
and so forth?


also, with the Shuttle submenus, are the shuttles already detected from the carrier scripts?
or is it something youd have to add in via the ships plugin?  (which is easy enough, anyway)
Title: Re: I ATE'NT DEAD
Post by: MLeo on January 16, 2009, 10:09:20 AM
At this point, I'm just allowing ships to double as menu's, so it isn't restricted to MVAM parent ships as it was in V3. In V3 (and 3.7, come to think of it, didn't I not fix the "problem" with the ordering there?) if a ship wanted a submenu that had the same name as a ship, then I would rename it to <<name>>_m (and not show the _m!).

The carrier idea is good, except that unlike MVAM, a shuttle can belong to many different ships. So where should I put it?

I think it might be a good idea to create "aliasses" as the "innovation" in this version.

So something like this:
Code: [Select]
Foundation.ShipDef.Ship.alias = ["Alias 1", "Alias 2", "Alias 3", ["Submenu", "Subsubmenu", "Alias 4"], ["SubMenu b", None]]And with that you can "assign" the ship to multiple spots.
The first 3 are renamings (only in the menu!) of the same ship, which will appear at wherever the ship is currently positioned (so it includes SubMenu and MVAM). The lists a bit further are respectively an additional submenu with an alias, and the submenu with the normal shipname (that's the reason there is the None value).

Now, one thing to wonder about, how would the "Do not show" ability interact with this new feature?


About ordering, it's one of those things I wanted to do for V4, and the common part (LibSubMenu) generates a tree already, so if you edit that, you can edit the order.
Eventually, I want to make the buttons/menus draggable (only within the container they are currently in!).

And, perhaps, a filter box? Performance might be quite bad with that. :( Rebuilding the menu structure each time would be horrible. :P
Title: Re: I ATE'NT DEAD
Post by: MLeo on January 16, 2009, 10:41:11 AM
Here is a quick mock-up of the alias feature (ok, it works, so not a mockup :lol:).

If the ship is marked as "Do not show", then nothing is shown.

[EDIT] I forgot:
Here is the alias structure for this instance:
Code: [Select]
Foundation.ShipDef.FTBVahhrer3.alias = ["Alias 1", "Alias 2", ["Menu Alias", "Alias 3"], ["Menu Alias", None]]
[EDIT 2] The normal SubMenu structure is also preserved, as you can see in the screenshot.
Title: Re: I ATE'NT DEAD
Post by: Kirk on January 17, 2009, 08:34:20 AM
Glad to see see you're still scripting for BC MLeo. :D I really like this idea, my ship menu can never be too organized. :P
Title: Re: I ATE'NT DEAD
Post by: Dalek on January 17, 2009, 09:05:13 AM
That is good to hear! Although clearly you've been reading too many Terry Practhett books...:D

Liking the idea of SubMenuBride tingy (I barely understand most of what being said :D)!
Title: Re: I ATE'NT DEAD
Post by: MLeo on January 17, 2009, 10:16:22 AM
That is good to hear! Although clearly you've been reading too many Terry Practhett books...:D
Finally! Someone got the reference.

And you can never read too many Pratchett books.


Quote
Liking the idea of SubMenuBride tingy (I barely understand most of what being said :D)!
Bridge Sub Menu, it's just that, the (Ship) SubMenu version for bridges.
Title: Re: I ATE'NT DEAD
Post by: Dalek on January 17, 2009, 10:53:09 AM
That is good to hear! Although clearly you've been reading too many Terry Practhett books...:D
Finally! Someone got the reference.

And you can never read too many Pratchett books.


Quote
Liking the idea of SubMenuBride tingy (I barely understand most of what being said :D)!
Bridge Sub Menu, it's just that, the (Ship) SubMenu version for bridges.

Oh. :D I can be thick like that sometimes. Thank god for hemogoblins.
Title: Re: I ATE'NT DEAD
Post by: El on January 18, 2009, 03:53:30 PM

And you can never read too many Pratchett books.


QFT!!