Editing main menu user interface
User avatar
C2_Scientist created Editing main menu user interface on Thu Jul 21, 2011 7:13 pm
Post
Hey all,

I'm customizing my main menu UI, editing the C2/Data/Intrface/Main.txt. I've moved and ditched various elements in it, but now I'm stuck! I had this idea to make room for a huge race list on the right half of the screen, and I have the room, but I can't expand the number of items shown at once.

Well, I do have an idea of what I should do, but there's a problem:

Code:
// Scrolling list specs
1       // # of scrollers

1,40    // scroller i.d. , total # scrollable items in list
4,4     // # displayed at once, index of item at "top"
4,7     // index of first,last scrollable item


The 'scroller' here is the list of races. The '40' is the total number of races, the '4' on the second line means 4 items to display for each 'scrolling' page, and the '4,7' means that the first item on the scrolling page is the entry #4 in the textfile, and the last item is the entry #7 in the textfile.

What's an entry? The various UI elements are defined in their individual entries in the textfile, and there are 26 entries for the main menu UI. For example, the Driver-text is one entry, the actual name of the driver is another. The vehicle thumbnail, as you might know, consists of six entries, forming a 3x2 grid of image tiles.

Each race name displayed is one entry.

Entries explained, moving on... if you increase the "7" to "12", the list of races is expanded, but it will be expanded to the positions of the next 5 entries. For example, the car thumbnail tiles are within 5 entries from the last race item, so you would see some of the next races over the car thumbnail tiles.

So I was thinking of moving the race name entries to the end of the entry list, but it can't be done as the game seems to expect a certain order in the elements.

Next I was thinking of simply making about 40 new entries for all races, to the end of the list, making the scroller box to use those instead, and leaving the original four unused. But the problem with this was that I couldn't add new entries, because increasing the number at the top of the textfile didn't seem to have any effect.

Or perhaps I should figure out what the "group" setting does.

Any ideas? I recall there was a few people who have customized UIs... at least Tosh and Harm I think?


PS: although it is a minor concern at the moment, I would like to get rid of, or edit, the rounded boxes serving as shady backgrounds for the various elements. They don't match with my current positioning of elements. Do the DAT-files have anything to with these? Anyway, it's not a big deal right now.

Another one is that for some reason, there didn't seem to be an entry for the APO slot graphics, so I wasn't able to move it.


Cheers!
User avatar
Harmalarm on Thu Jul 21, 2011 7:33 pm
Post
The dat files are indeed models of the blue rounded boxes in the background. You cannot delete them, but you can move the model in plaything! :D just move it, say 480 units down, and it will not be on screen anymore. You need to do this for all the dat files of the menu.

the way you want to create a new track display will probably not work via only text editing. The text is simply read by the c2 executable via certain rules. The number of entries for example. I am pretty sure these are hard-coded. I also don't think that increasing the menu elements number changes anything. It's just there for no reason.

That doesn't mean it is not possible. You would only need to find a way to add entries in between the other menu entries via hex editing. I think that simply adding an entry isn't quite enough though, as it also needs to be operational. Not sure about all of this, but that would be my guess.

Menu editing is extremely sensitive. One mistake, BOOM, CRASH! I had many headaches making the dd2 custom menu.
Toshiba made the track selection screen. A true marvel! It still uses the 4 races per group though. He used an unused menu txt file and modified it, and also modified the executable accordingly. I have a clue of how it works, but not more than that to be honest...

To make a long story short. Editing the txt files is great for moving menu object on the screen, but not enough for adding menu elements (or deleting) You will definitely need to start hex editing.

oh and tosh made some notes on the hex part:
http://www.toshiba-3.com/dotclear/index.php?post/Some-words-about-hex-refs-of-the-menu-items
User avatar
C2_Scientist on Fri Jul 22, 2011 10:05 am
Post
Thanks for that, Harm!

Too bad I know practically nothing about hex editing... I wonder if the .EXE contains a similar value to that at the start of the textfile, defining the number of total entries expected? If yes, would it work if that number was simply increased by X, and then X new entries were added to the end of the textfile? I guess we'll wait for Tosh for his thoughts.

At least I was successful in getting rid of the boxes! I took a shortcut and moved the element in just one of the DAT-files, and then edited the Menumodels.txt to use only that DAT-file. However, since the menu texts seem to become pixelated when they have no background beneath them (for some reason, maybe glidewrapper), I moved the element back down, and then scaled it up to cover the entire screen. Problem solved!

And here's my current progress before the more advanced stuff:
Minimal main menu
User avatar
Harmalarm on Fri Jul 22, 2011 10:31 am
Post
Quote:
I wonder if the .EXE contains a similar value to that at the start of the textfile, defining the number of total entries expected?


probably yes. The stucture is quite similar I think. You would only need to find out where it is located in the .exe hex structure, and you would have to insert a couple of bytes for each menu entry.

clever trick on those boxes then :)

the APO element there in the main menu cannot be moved by the way. I mean, theoretically it should be movable via hex editing, but we don't know where it is located...
For the dd2 mod I simply used two other entries, changed them into images and layed them on top of the APO element. poof! gone! :)
User avatar
Toshiba-3 on Wed Jul 27, 2011 11:26 pm
Post
The text files are just CSS for the hardcoded structure.
You must add/remove entries (or even whole new menu screens, added one for DD2), change/remove background forms, add entries and define what they are and which ressources they use and where they link if they do, all this by hex editing :(

I figured a lot more than what's written in my article when I did the DD2 menus mod but I don't think you'd need more than that for what you want. Also trying to display more or less than 4 tracks at once might be a bit difficult, I think I tried to display one at time and didn't succeed. It's all about action/script referenced in the menu screen headers.

You can always do a comparison between a vanilla V2 exe and the DD2 one to have a look at what we patched, but yes, it is not easy at all. Harm also did a lot of work with fonts and developped some tricks using them. As he explained with the APO. Hex Workshop is a very powerful program when it comes to hex editing (my fav, yes).

The main problem with displaying more than 4 races at once is that it kinda breaks the "group" idea the game menu is handling. We should try to understand a bit more perfectly how it all works (hex-wise) in order to modify this. Might turn out to be very hacky hacky.

I like the idea of a minimalist UI :)
Would have to be more thought design-wise for me though. And I think I would go hardcore minimalism and keep only the very necessary infos. Like the b or e image of the car only, no name, no race details, no APO (hidden), option/menu, start, race list.

I see you hid the network game button, don't forget arrows still work to select them and pressing enter to enter them. For BBQ I deleted these entries completely from the code (well the single player mode related buttons). Yeah, that's right, you can check BBQ as well for a custom UI. /shameless self promotion
Pages: 1



Extra information
It is currently Mon Oct 15, 2018 5:05 pm,

Please Register a username.
In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
Users browsing this forum: No registered users and 2 guests
Moderators: coffeycup, Toshiba-3

Powered by phpBB :: Hosted by n3wton :: Molested by goats
CWA Links
Facebook