Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Goober5000 on December 21, 2002, 04:05:12 pm

Title: messing with FRED2 popup menus
Post by: Goober5000 on December 21, 2002, 04:05:12 pm
I'm working on redoing up the FRED2 sexp popup menus (hoping to have it done before the Christmas release) but I've hit a wall.

What I'm trying to do is add another level of submenus to each category, depending on whether the sexp is in a particular subcategory.  So the Change sexps are further divided into Messaging and Mission Goals, AI and IFF, Beams and Turrets, etc.  I want to leave it customizable, like :v:'s category system, and I'm only subcategorizing the Change sexps (since that's by far the biggest list).  I think this will speed up FREDding tremendously, because it'll cut the time spent searching for a particular sexp (as well as time spent scrolling) to almost nil.

I think I've hit upon a way to do this, but the only problem is I can't select any of my submenus - they're all greyed out.  I checked through the code and I have no idea why this is the case.

I've attached the file I'm working on.  (I'd post a screenshot, but you can't take screenshots of menus in action.)  With a fully-updated CVS project, the thing will compile and you can see what's going on -- start FRED2, make a new event, and try to replace the do-nothing sexp.  Other than the do-nothing sexp itself (which I didn't subcategorize), nothing in the Change menu is enabled.

Any help? :)
Title: messing with FRED2 popup menus
Post by: Goober5000 on December 21, 2002, 07:55:31 pm
Come on, somebody answer. :) DTP, this is your specialty, isn't it?  (What's the Denmark time difference? :nervous: )
Title: messing with FRED2 popup menus
Post by: Solatar on December 21, 2002, 08:00:48 pm
Depends, where are you?
Title: messing with FRED2 popup menus
Post by: EdrickV on December 21, 2002, 08:40:38 pm
Not sure what the problem is, since I don't have VC++ 6.0, but I do know that you can catch menus in action via a printscreen screenshot. If you mean the submenus are disabled when the program is run, then you might have to set something in the IDE to enable them. (Individual menu items in BCB have an "Enabled" property that can be either true or false.) You might also look for code that might be disabling them. (Remember, FRED2 normally enables and disables menus depending on what exactly you're doing.) Last but not least, make sure they're actually setup to have submenus and it's not treating them as regular menu items. Splitting the change menu up wouldn't be a bad thing, it's longer then my screen is tall.
Title: messing with FRED2 popup menus
Post by: Goober5000 on December 21, 2002, 09:01:39 pm
Quote
Originally posted by Hades
Depends, where are you?


East coast.

Quote
Originally posted by EdrickV
Not sure what the problem is, since I don't have VC++ 6.0, but I do know that you can catch menus in action via a printscreen screenshot.


You're right.  For some reason, it didn't work before.  Here's a screenshot - as you can see, none of the subcategories are enabled.

(http://www.geocities.com/ipw47/fred.txt)

Quote
If you mean the submenus are disabled when the program is run, then you might have to set something in the IDE to enable them. (Individual menu items in BCB have an "Enabled" property that can be either true or false.)


Tried that.

Quote
You might also look for code that might be disabling them. (Remember, FRED2 normally enables and disables menus depending on what exactly you're doing.)


This, I think, is the culprit.  But I already looked through the code and didn't see where this might happen.  (The subroutine in question is sexp_tree::right_clicked.)

Quote
Last but not least, make sure they're actually setup to have submenus and it's not treating them as regular menu items.


Tried this, too.  I don't think this is the problem.

EDIT: Linked the attachment as an image within the post.
Title: Yay, it works!
Post by: Goober5000 on December 22, 2002, 10:55:47 am
Sleeping on a problem and coming back the next day with a good night's sleep is A-1 SUPAR. :) One of my arrays was using i where it should have been using j, and nothing was being added to the new popup menus. :rolleyes: It's fixed now, though.  Look for it in the next release. :)

EDIT: Change committed; everything works. :) Note that a bunch of stuff has been moved around in some of the files, so ignore any conflicts if you get them. :)
Title: messing with FRED2 popup menus
Post by: DTP on December 22, 2002, 02:38:03 pm
:yes: nice job

I may use this occation to tell people that there is now a TBL INFO button present next to initial orders in ship editor.

Pressing this will show the TBL INFO for the current selected ship Type.

if multiple ship types are selected, it cannot be pressed.

Will be availeble from fred2_open 3.4
Title: messing with FRED2 popup menus
Post by: Solatar on December 22, 2002, 03:09:48 pm
:thepimp:
Title: messing with FRED2 popup menus
Post by: Goober5000 on December 22, 2002, 03:14:22 pm
Good stuff. :yes:

I just added primaries-depleted and primary-ammo-pct, useful for when you have ships with ballistic primaries.