Author Topic: Menu background changing  (Read 5364 times)

Firstinaction

  • Posts: 638
  • Turrets: +18/-131
    • F1rst16
Menu background changing
« on: October 03, 2010, 08:41:02 pm »
How can I do... Can someone tell me step by step. ON mac or pc PLZ... I dont care if you flame me because I posted this. But please tell me because I was looking in my base folder just for no reason and I came across these folders with pics. I really want to change my backround. OMFG.... This is too coolll.... and futuristic.

c4

  • Posts: 554
  • Turrets: +9/-22
Re: Menu background changing
« Reply #1 on: October 04, 2010, 01:19:30 am »
again, go into your data-1.1.0.pk3, and find the jpeg file. (Note its location.) Then make a new pk3 with a bunch of z's in front that has the same filepath as the image, and leading to your image, renamed to the default.
eh, i prefer gregorian.net chat better than this. NO download and its LIVE!
 :basilisk: FTW![wiki]basilisk[/wiki]

David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Menu background changing
« Reply #2 on: October 04, 2010, 02:19:23 pm »
AFAIR the menu isn't an image but some weird thing that moves etc.
So it's probably not that simple.
Any maps not in the MG repo?  Email me or come to irc.freenode.net/#mg.
--
My words are mine and mine alone.  I can't speak for anyone else, and there is no one who can speak for me.  If I ever make a post that gives the opinions or positions of other users or groups, then they will be clearly labeled as such.
I'm disappointed that people's past actions have forced me to state what should be obvious.
I am not a dev.  Nothing I say counts for anything.

gimhael

  • Posts: 546
  • Turrets: +70/-16
Re: Menu background changing
« Reply #3 on: October 04, 2010, 04:17:37 pm »
In fact the main menu is defined in the file ui/main.menu (surprise!). There is the path to the background image (ui/assets/mainmenu.jpg) and the black star model that is rendered in front of it (models/splash/splash_screen.md3).

So you can just create a pk3 that overwrites this jpeg and/or md3, or you can overwrite the main.menu and point to your own background image. In this case you have to be careful not to delete the controls of the main menu, but on the other hand you could change their position / style etc. as you want.

theKidbullet

  • Posts: 16
  • Turrets: +1/-0
Re: Menu background changing
« Reply #4 on: October 04, 2010, 10:29:24 pm »
You should be looking at volt's hud for example code. In his hud there is a menu changer for backgrounds which upon clicking the "tremulous" Button the background changes. Also He has different music.

When i looked at how he did it within his hud, it looked really simple

First I'll address your previous questions

1. There is only one gpp hud
2.  The hud files go in a ui folder in
Users/name/library/application support/tremulous/base

First there are many huds for 1.2, my favorite being VoltageGpp
hudImage1
hudImage2

Secondly from reading your previous posts, I'm going to guess that you're on 1.2 and not 1.1 tremulous.

This create somewhat of a problem since in 1.2 the menus are more locked down, and they reset after connecting to a server. But the ingame human/alien hud are still editable.
If you’re on 1.1, changing the music in the mainmenu is really simple, just install a custom hud, or create a custom menu loader and create a mainmenu.menu as explained in volt’s hud making guide, and then look for this line

    onOpen { uiScript stopRefresh ; playlooped "ui/assets/sounds/Volt_intro.wav" }

Right after playlooped within the quotations “here” you need to redefine a new music file, which has to be in .wav file format. Make sure to place the file within your basefolder or tremulous will not be able to find it.

In regards to your menu image switching, if you install volts hud, it’s quite simple to change the backgrounds since he has a background switcher integrated. This means all you have to do is, place your image files within your base folder, then link to them as below

In the file labeled Main.menu

There are several definitions called
   
 //orange nebula background   

 
          itemDef
    {
      name background //name of item
      rect 0 0 640 580 //location of item on screen
      style WINDOW_STYLE_SHADER //its a shader
      backcolor 0 0 0 1 //black
      visible 1 //shown
       decoration
      background "UI/assets/menu/background6.jpg" //location of image
     cvartest cg_background
     showCvar {7}
     }


If you want to just change his images to your own, just replace the location in the quotations following the cvar “background”

If you would like to add onto his menu images do the following within the main.menu
     //orange nebula background   
 
          itemDef
    {
      name background //name of item
      rect 0 0 640 580 //location of item on screen
      style WINDOW_STYLE_SHADER //its a shader
      backcolor 0 0 0 1 //black
      visible 1 //shown
       decoration
      background "location" //location of image
     cvartest cg_background
     showCvar {NextNumberFollowing Last} //Place the next number following the previous one
     }


After you’ve created your new itemdefs to include your new imagebackgrounds, don’t forget to add them to the menu background switcher
  //button
       itemDef
    {
      name SETTINGS         
      type ITEM_TYPE_MULTI
      text ""
      cvar cg_background
      cvarFloatList { "" 1 "" 2 "" 3 "" 4 "" 5 "" 6 "" 7 "" NextNumber } //add your new menu numbers here
     textstyle ITEM_TEXTSTYLE_SHADOWED
      rect 150 50 400 100
      textscale .25         
      forecolor 1 1 1 1
      visible 1
      action
      {
        play "sound/misc/menu3.wav";
      }
    }
    Save the menu, and then reload with /vid_restart
This should solve your problems, remember to look back to the hud making guide for further questions.


theKidbullet

  • Posts: 16
  • Turrets: +1/-0
Re: Menu background changing
« Reply #5 on: October 04, 2010, 10:32:59 pm »
In fact the main menu is defined in the file ui/main.menu (surprise!). There is the path to the background image (ui/assets/mainmenu.jpg) and the black star model that is rendered in front of it (models/splash/splash_screen.md3).

So you can just create a pk3 that overwrites this jpeg and/or md3, or you can overwrite the main.menu and point to your own background image. In this case you have to be careful not to delete the controls of the main menu, but on the other hand you could change their position / style etc. as you want.


Do not create a pk3 to overwrite backgrounds, it's very bad practice and will most likely be more dificult than just creating a main.menu and loading it with custom cvars and new itemdefs to point to new image files.