Log in

View Full Version : Dissecting menu_1024_768.ini


scudder
02-17-13, 02:15 AM
Ok, so I'm working on (well, really studying SH3 file structure prior to working on) a new mod, and it's become apparent that the only way to really do it will be to edit the menu_1024_768.ini file. I've been poking through my .ini (already modified by GWX) and reading the readme that comes with sublynx's chart mod. I think I'm getting a pretty good grasp of how it works, but I can't wrap my head around a couple things. Let me give you a chunk of my .ini as an example:

[G31 I20]
Name=Target;Neuer Eintrag fur Konvoy Karte
Type=1031;Stat bmp array
ItemID=0x31000006
ParentID=0x31000000
Pos=-990,1781,1026,1026
Color=0xFFFFFFFF
Materials=1
Display=0;No stretch
Mat 0=data/Menu/Gui/Layout/KonvoyMap.tga
Crop 0=0,0,1,1
MatFlags=0x9
TexFmt=0x9
Drag=true
BmpState=1
NeedFocus=true
SelOne=true
IdGroup=0
StatesColors=0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF

If you'll indulge me, first I want to run through what I THINK I understand already, please feel free to point and laugh at any errors:

This section is for the pulldown convoy route map added as part of GWX 3.0. G31 tells me this is for the navigation map view, and I20 is the item number. I've gathered through reading the forums that each item in a group must have an item number, and they must be sequential and contiguous (i.e. no skipped numbers from the first item to the last, so you can't just delete an item without renumbering the rest).

The "Name" parameter appears optional based on some other items in the file, and can be set to anything.

"Type" is fairly self-explanatory, defines what type of object this is, based on (I'm assuming) a proprietary array of object types built into the game engine somewhere.

"Color" - The "base" color of the object in hex code, in this case white. Never seen by the user as the referenced image is written over it.

"Materials" - Number of reference items (image files, usually) the object needs.

"Display" - one of several pre-defined behaviors for the way the object is displayed

"Mat 0" - The direct reference to the first item needed by this object. If more than one item is needed would be followed by "Mat 1" and so on.

Ok, now on to the stuff I know I don't know :hmmm::

ParentID and ItemID - I assume ParentID references the Group, and ItemID is a hex identifier for this item, but what confuses me is the ItemID value is repeated among several items, so doesn't have to be unique? Not sure what these attributes really do.

Hex colors - I'm familiar with the 6 digit hex colors in RRGGBB format, but there are too many digits here for that, so are they using a different system or is there some kind of prefix appended to each color?

Pos - I assume refers to position on the screen, but what do the 4 coordinates represent? the 4 corners of the image?

Crop 0 - I know some image files contain several small images all loaded into one file, and this appears to be a reference to which part of the larger image to display. What I don't get is how "0,0,1,1" displays the entire source image.

MatFlags, TxtFmt, BmpState, NeedFocus, SelOne, IDGroup. No idea on these. I do know the concept of "focus" in Windows environments, i.e. the window that has focus gets information from input sources, etc., but not sure how that applies here.

StatesColors - This, I'm guessing, defines the "base" color for this object in it's various states from the standpoint of being a window. (i.e. has focus, doesn't have focus, etc.) Kind of a shot in the dark here, an assumption from my distant intro level programming days.

If you've read this far you deserve some kind of commendation, so I thank you. I hope some of you can fill in the gaps/errors in my understanding so I can work a bit more efficiently going forward. I don't mind trial and error, but the knowledge here is vast, and to call me an amateur would be generous. Many thanks to sublynx for his detailed readme, and to the GWX team for putting in comments everywhere in the files they modified.

irish1958
02-17-13, 03:09 PM
There is a post concerning this file with details on how to work with it. I can't find it on search and I do't have my files and notes. Somebody will come along and guide you to it.
:arrgh!:

Sailor Steve
02-17-13, 03:49 PM
Yeah. It looks like you already know more about it than I do. I've done some massive changes but it was always copy/paste from a mod, so I didn't really learn much.

Sorry.

Hitman
02-17-13, 04:02 PM
ParentID and ItemID - I assume ParentID references the Group, and ItemID is a hex identifier for this item, but what confuses me is the ItemID value is repeated among several items, so doesn't have to be unique? Not sure what these attributes really do.

...

Pos - I assume refers to position on the screen, but what do the 4 coordinates represent? the 4 corners of the image?

Yes Item and Parent ID are unique. Usually Item ID is Parent ID with last numbers changed, so they keep a common beginning that highlights that one depends from the other.

Position is the first two numbers X and Y, but IIRC Y value is inverted and counts from the top of the screen downwards. The last two values is the size of the item.

Please note that position for Items that have a parent is counted starting from the parent location. For example, let's say that you have a menu page called "Attack Periscope". It will display a background over the full screen with 0,0, 1024,768

Now you position for example the torpedo tube lights on it like this:

Item=Torpedo Tube lights

512,512,128,128 and that gives you a square of 128,128 whose top left corner is at 512,512 from where the periscope screen started, i.e. from 0,0

Then you want to position the tube 1 lights, so you put the item as child to the torpedo lights background you just created and you go on like this:

Item= Tube 1 light
25,25,64,64

This would mean that the tube 1 light is located 25 pixels right and 25 down from the starting position of the Parent tube lights (512,512) and then be 64x64 pixels big.

Please double check that I got it right, I haven't edited Sh3 menu for ages :D

machiavelli
02-17-13, 05:00 PM
Hi scudder,

Perhaps I can help. Editing this file can be tedious. You'll need a handy tool, the menu_1024_768.ini Renumbering Tool. Very handy. It removes spaces and renumbers things so all is good and working.

I didn't make it, I forgot who did. But whoever did, its a great tool.

Menu_1024.... is one of the more complex files in the game directories. It is quite large too. But its simple to grasp.

machiavelli
02-17-13, 05:01 PM
BTW, keep up the hard work. Looking forward to your mod.

rudewarrior
02-17-13, 05:41 PM
Color is in the format RRGGBBAA, where AA denotes the opacity of the alpha channel. You can look at it as the opacity of the the color chosen. Except, with white/grey/black it works differently, and I haven't quite figured out how.

Also, the menu.ini renumberer referenced above is a product of h.sie. You can find his mod page under his sig in the Realism- and gameplay-related hardcode fixes for SH3.EXE thread stickied at the top of the mods forum.

Good luck! :salute:

scudder
02-17-13, 06:13 PM
Thanks all for the replies, excellent information as usual (and so prompt too!)...and thanks Sailor Steve for the...uh....reading my whole post :up:

Also, in case anyone else happens across this thread, I think I found the thread to which irish1958 was referring, here (http://www.subsim.com/radioroom/showthread.php?t=111832). It concerns SH4, but the structure of the file and it's elements appear largely unchanged. When/if I get this file figured out I'd be happy to collect my knowledge into one post, if someone needs it.

irish1958
02-18-13, 10:33 AM
Keep up the good work

sublynx
02-18-13, 05:38 PM
Onelifecrisis has answered some of your questions in this post:

http://www.subsim.com/radioroom/showthread.php?t=141633

Latemail made a very thorough tutorial on the file, unfortunately only in German. I did find that German tutorial when making my own mod, but can't find it anymore.

If you do write a post about menu_1024_768.ini, please consider writing it as a short tutorial and then perhaps uploading it to the downloads section, where it can be found easily. :arrgh!:

Good luck with your mod!:yeah:

scudder
02-18-13, 09:44 PM
If you do write a post about menu_1024_768.ini, please consider writing it as a short tutorial and then perhaps uploading it to the downloads section, where it can be found easily. :arrgh!:



Will do. Maybe I'll do a text-only post (perhaps I'll lobby for a sticky on that if it's thorough enough) and a PDF for the downloads section? Maybe with pictures where needed? Suddenly I have several projects going at once, bet that's never happened to a modder before...:rotfl2:

sublynx
02-19-13, 06:29 AM
Will do. Maybe I'll do a text-only post (perhaps I'll lobby for a sticky on that if it's thorough enough) and a PDF for the downloads section?

That would be great and it would help a lot young modders as now everyone needs to find the needed info here and there.:rock: