VStanced/mods
Submit a mod
Mods Guides Forum Submit a mod Log in Register

Forum

Questions, builds, help and the odd argument. The mods and guides are out front.

Editing menu's text...
 
Notifications
Clear all

Editing menu's textures

13 Posts
2 Users
0 Reactions
5,921 Views
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter   [#610]

Hey all!

I'm type of person who wants to fix problems myself, but this one... I just can't do it. And i need help.
So, my problem is: i can't place custom textures at submenu's (like options, in game menu, track selector).

They all use main menu's texture. What i want to do is placing different textures on each (options have one texture,
track selector - other etc.) I found which line in .java file is responsible for it. It's Spoiler: osd.createBG( RID_GENERALBG ); Now i just need to replace it. But how?

I need help!

Please!




   
Quote
RedCarDriver
(@redcardriver_1155)
Member Moderator
Joined: 15 years ago
Posts: 1125
 

Are you making sure to save the backgrounds to the same file format as they were originally? If you're replacing a PNG or DDS image with a JPG or BMP image, it's not going to work - because it's looking for one with the exact same name, not just the front part that Windows usually shows you.

In order to make sure you're getting this right: in any window, go to Tools -> Folder Options -> View tab and un-check "Hide file extensions for known file types", and click OK. This should make the extensions show up.



   
ReplyQuote
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter  

I know that. I just can't make new backgrounds for submenus like options, track selector etc.

Here's link to what my trouble looks like:
hide



   
ReplyQuote
RedCarDriver
(@redcardriver_1155)
Member Moderator
Joined: 15 years ago
Posts: 1125
 

Oh. Okay, I misunderstood the problem you were having. Sorry.

Okay: RID_GENERALBG is "Resource ID for the general background". This is a named constant that's defined somewhere in the java sources. You can define your own constants. Check these lines from my painter script:

	final static int RID_BACKGROUND = frontend:0x00C0r;
	final static int RID_BACKGROUND_RGB = frontend:0x0AC0r;

The top one was there originally; the second one is one I wrote. I edited frontend.rpk to create the entry with the ID "0x00000AC0", which is the background for the RGB mode in the painter. If you want multiple backgrounds, you're going to have to edit your frontend.rpk to add them in. (Remember to use resdecode/resconvert, obviously.)



   
ReplyQuote
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter  

Painter script... It's one of few that i didn't checked xD

Huge thanks to you! You're legend! 🙂) 🙂) :awesome:

Added 1 hour 1 minute later:

One more question, if you don't mind...

Is there possibility to add new entry in java file? If there is, how should i do that?



   
ReplyQuote
RedCarDriver
(@redcardriver_1155)
Member Moderator
Joined: 15 years ago
Posts: 1125
 

Not sure what you mean. If you mean a new .java file, I made PainterExtensions.java - it wasn't in the game originally - and I didn't need to put it into any RPK in order to make it work.



   
ReplyQuote
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter  

Oh wait - i just found one thing, which makes things harder...
My code is not RID_BACKGROUND, it's RID_GENERALBG... Damn.



   
ReplyQuote
RedCarDriver
(@redcardriver_1155)
Member Moderator
Joined: 15 years ago
Posts: 1125
 

You can do that, but you need to have defined RID_BACKGROUND in the file. (You can't redefine RID_GENERALBG; it's defined in another file or something.)

If you need another thing, change RID_GENERALBG to, like, RID_OPTIONSBG for the options menu.

You'll also have to add something to the subroutine that builds each menu to change the background, but doing that isn't really something I could walk you through.



   
ReplyQuote
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter  

Idk if you misunderstood, or i am just dumb, but i have defined somewhere RID_GENERALBG. That's what worries me (it's nowhere to be found)
Also, if i edit RID_BACKGROUND, and try to change it with RID_GENERALBG in options, it gives me crash on start.

Added 4 minutes later:

also, there's code from fontend for main menu pic:

<FILE 00000190.res >
typeof	7
superid	0x00000003
typeid	0x00000016
alias	gps_racesetup
isparentcompatible	1.00
</FILE>
<FILE 00000190.rsd >
sourcefile frontend\textures\GPS_FrameRaceSetup.png
</FILE>

Now, i would like to make new entry (define for example RID_OPTIONSBG, would be simple to put). How to do that? (is it even possible without big skills?)



   
ReplyQuote
RedCarDriver
(@redcardriver_1155)
Member Moderator
Joined: 15 years ago
Posts: 1125
 

Yes. I think you're confusing the two separate things that you have to do, with just being one thing, though.

You have to do two steps.

First, edit the RPK, and make a copy of one of those things you quoted. Change the typeid ("typeid 0x00000016") in your copy to something else, and remember that ID.

Then, go into your MainMenu.java file and make a copy of this line (which I'm making up, but somewhere in the code there has to be something that looks like this):

	final static int RID_GENERALBG = frontend:0x00C0r;

...except with GENERALBG changed for whatever name you want, and "0x00C0r;" changed for "[YOUR NEW TEXTURE TYPEID]r;". This should go at the top of the Java file with the rest of the lines that say "final static int".



   
ReplyQuote
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter  

I have some time before school, and i checked option java files again. Guess what i found?

	final static ResourceRef	RID_GENERALBG = new ResourceRef( frontend:0x0016r );

It was right on top!
Well... At least now i did it!

Huuuuge thanks to you!



   
ReplyQuote
RedCarDriver
(@redcardriver_1155)
Member Moderator
Joined: 15 years ago
Posts: 1125
 

You're welcome! Congratulations on getting it done.



   
ReplyQuote
Viper4K
(@viper4k_15080)
Active Member
Joined: 12 years ago
Posts: 10
Topic starter  

😃



   
ReplyQuote
Share: