Author Topic: Menu  (Read 8427 times)

thirdstreettito

  • Posts: 753
  • Turrets: +107/-1124
    • thirdstreettito's Homepage
Menu
« on: February 24, 2008, 02:54:50 am »
How do I change the Tremulous Menu? The background picture, the placement of buttons. Etc. I have searched and failed.

thirdstreettito

  • Posts: 753
  • Turrets: +107/-1124
    • thirdstreettito's Homepage
Re: Menu
« Reply #1 on: February 25, 2008, 12:42:48 pm »
Anyone going to help?

ODDity

  • Posts: 161
  • Turrets: +21/-7
Re: Menu
« Reply #2 on: February 25, 2008, 02:33:06 pm »
tremulous/base/data-1.1.0.pk3/ui/ - on linux at least the file is called main.menu and also menudef.h but it'll be a C# file of some sort.

If using oticzs menu then youre just going to be looking in the tremulous/base/ui folder for oticzs_main.menu or similar. Somehow that references back to the menudef.h in the .pk3 but I cant really be bothered to work it out.

Time to learn some C# :)

Good luck

ps i could be completely wrong about all this, i just saw your question, opened up some files and read a bit of code.

thirdstreettito

  • Posts: 753
  • Turrets: +107/-1124
    • thirdstreettito's Homepage
Re: Menu
« Reply #3 on: February 25, 2008, 03:03:15 pm »
Still confused. How do I use a different background? How do I move things around? Im on XP btw.

ODDity

  • Posts: 161
  • Turrets: +21/-7
Re: Menu
« Reply #4 on: February 25, 2008, 03:53:35 pm »
Well heres the thing. Youre probably better off working on something like oticzs menu and HUD (which you can download from here somewhere) because otherwise you'll have to extract the files from the .pk3 and recombine them using the same file name and im not sure how that would fly with servers and stuff.

So lets assume youve got oticzs menu in your /tremulous/base/ui/ folder.

In there you'll find a file (on mine at least) called oticzs_main.menu

near the top of that file we have

Code: [Select]
itemDef
    {
      name background
      rect 0 0 640 480
      style WINDOW_STYLE_SHADER
      backcolor 0 0 0 1
      visible 1
      decoration
      background "ui/assets/mainmenu.jpg"
    }

now, the backgroud part at the bottom refers to the mainmenu.jpg that is actually in the /ui/assets folder of the data-1.1.0.pk3. You could give it an absolute path to somewhere else, although at the moment Im not sure why it knows to look in the .pk3. Anyway thats by the by.

Next we have a series of itemDefs.. ill choose this one:

Code: [Select]
itemDef
    {
      name mainmenu
      text "Play"
      type ITEM_TYPE_BUTTON
      style WINDOW_STYLE_EMPTY
      textstyle ITEM_TEXTSTYLE_NORMAL
      rect 256 200 128 20
      textalign ITEM_ALIGN_CENTER
      textalignx 64
      textaligny 20
      forecolor 1 1 1 1
      backcolor 1 0 0 1
      visible 1
      action
      {

Youll see here this is the button you actually click on in the menu to play the game. You can see various alignment options there (ITEM_ALIGN_CENTER) you could align right or left depending. As this is the first item (i believe) it comes first on the list, folled by Mods, Options etc which also have their own "ItemDef" configuration fields.

There is a way im sure to give an item an exact x,y co-ordinate position on the screen.

Thats as far as i can go at the moment, all this i worked out since your last post so YMMV and i dont use windows so things will be a little different. Just have a look at the files from oticzs and see if you can figure out HOW I made these conclusions first, then perhaps spend some time figuring some more out on your own.

Sorry i cant be of more help at the moment, I'm interested in this though so perhaps ill post back when i've more time

Good luck!




David

  • Spam Killer
  • *
  • Posts: 3543
  • Turrets: +249/-273
Re: Menu
« Reply #5 on: February 25, 2008, 03:55:42 pm »
You should replicate it in the ui/ folder tree, and not in pk3's.
Also, its nothing to do with C#.  No idea where you got that from.
And you can't use any custom images or other media without failing the pure check.
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.

ODDity

  • Posts: 161
  • Turrets: +21/-7
Re: Menu
« Reply #6 on: February 25, 2008, 03:57:56 pm »
Ahh ok that explains a lot I didnt think it would fly with the pure server check which is what i put at the top - i didnt see your post David and i have no time to edit now.

All the best

thirdstreettito

  • Posts: 753
  • Turrets: +107/-1124
    • thirdstreettito's Homepage
Re: Menu
« Reply #7 on: February 25, 2008, 04:08:46 pm »
So, I cant use a custom background? I DLed oticz HUD and looked and there are no jpg's. So, what now?

ODDity

  • Posts: 161
  • Turrets: +21/-7
Re: Menu
« Reply #8 on: February 25, 2008, 04:30:11 pm »
Well as David said, which also confirms my suspicion, it is always looking in the .pk3 file for media, such as sounds, music and artwork.

You'll be able to move the menu around by looking at the files as i showed you and even add new parts to the menu if you like, like oticzs has.

I tried giving an absolute path to a different jpg but its still looking in the pk3, so all i got was a black square with a white border around it.

If you change the background.jpg to something else in the pk3 it will undoubtedly work, but then your client will fail, as David said, the pure tremulous checks that servers perform.

Ah well.. i tried :)

EDIT: Indeed changing the image does work - keeping the same file name in the pk3 and swapping it for a different image, but joining "pure temulous" gives "ERROR - invalid game folder"
« Last Edit: February 25, 2008, 04:46:37 pm by ODDity »

Plague

  • Posts: 238
  • Turrets: +13/-13
Re: Menu
« Reply #9 on: February 25, 2008, 05:09:29 pm »
Additionally, http://www.rfactory.org/ is a great resource for the Q3TA menu system, including keyword reference and tutorials.  If you're looking to add entirely new UI features, you'll need to learn C, as the .menu system is a markup language interpreted in the UI module.

benmachine

  • Posts: 915
  • Turrets: +99/-76
    • ben's machinery
Re: Menu
« Reply #10 on: February 25, 2008, 05:41:21 pm »
Since this is the main menu we're talking about, you don't need to worry about pure. After all, you're not often looking at the main menu while connected to the server.
benmachine

thirdstreettito

  • Posts: 753
  • Turrets: +107/-1124
    • thirdstreettito's Homepage
Re: Menu
« Reply #11 on: February 25, 2008, 07:29:56 pm »
Thank you everyone. I'll see what I can come up with in the next month. Anymore input is appreciated.

Circle

  • Posts: 93
  • Turrets: +8/-13
Re: Menu
« Reply #12 on: February 26, 2008, 02:46:33 am »
otic doesn't use a custom backround, he has just removed the planet and text.

Custom images have been used. *goes find the link*

http://tremulous.net/forum/index.php?topic=6286.msg105979#msg105979 <<Modified
http://tremulous-fr.geeknode.org/viewtopic.php?id=973 <<Original
Be assured, it will take some time to understand how to work it.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Menu
« Reply #13 on: February 26, 2008, 03:33:54 am »
custom images can *sortof* be used, since you're not connected to a server in the main menu, the pure check isn't done, but when you disconnect from a pure server the image won't be there.
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

blood2.0

  • Guest
Re: Menu
« Reply #14 on: February 26, 2008, 05:43:37 am »
its a good idea but not worth the devs time i want 1.2!

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Menu
« Reply #15 on: February 26, 2008, 06:35:32 am »
its a good idea but not worth the devs time i want 1.2!
what the fuck?
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Zero Ame

  • Posts: 329
  • Turrets: +33/-15
    • NOS
Re: Menu
« Reply #16 on: February 27, 2008, 12:30:30 am »
You should replicate it in the ui/ folder tree, and not in pk3's.
Also, its nothing to do with C#.  No idea where you got that from.
And you can't use any custom images or other media without failing the pure check.

you can use custom images, i use them in a mod im working on. But you have to keep the same file names and things like that.

Or you can actually copy the data pk3 out of your base and make it into a mod called trem or something like that and then replace files in your data pk3 with the files your modding :P I did that 1 and its pretty cool.

Overdose

  • Posts: 396
  • Turrets: +52/-47
Re: Menu
« Reply #17 on: March 03, 2008, 04:39:06 am »
Thanks for the info, and sorry to hijack but he isn't exactly using all of this... :D

Alright, so I've been able to change the background to the credits splash page. The artist has given me permission to use his artwork on the condition that I include his name and URL. The picture I'm using has that on the right hand side in the middle of the page but its squished up behind the existing credits. So I cropped his name out of the pic, and now I want to add his name at the bottom of the credits page opposite of where it says "CREDITS" at the top. But I can't figure out how to align it down there. Here's what I've got so far -



Code: [Select]
itemDef
    {
      name        "creditstitle"
      group       grpidcredit
      style       WINDOW_STYLE_EMPTY
      rect        320 48 1 1
      textalign   ITEM_ALIGN_CENTER
      textalignx  0
      textaligny  0
      textscale   0.75
      textstyle   ITEM_TEXTSTYLE_NORMAL
      text        "CREDITS"
      forecolor   1 1 1 1
      backcolor   1 0 0 1
      visible     1
      decoration
    }
    itemDef
    {
      name        "creditsbottomtitle"
      group       grpidcredit
      style       WINDOW_STYLE_EMPTY
      rect        320 48 1 1
      textalign   ITEM_ALIGN_CENTER
      textalignx  0
      textaligny  0
      textscale   0.75
      textstyle   ITEM_TEXTSTYLE_NORMAL
      text        "Art by Greg Martin"
      forecolor   1 1 1 1
      backcolor   1 0 0 1
      visible     1
      decoration
    }


The only thing I can figure is that I need to change the values for "rect" but I don't know what rect is. I'm going to continue working on it to try and figure it out, but any help would be appreciated. Also, if I can't get this to align properly I might try and add an 11th line to the credits list and put this guy below Chris Dolby McCarthy. I would much rather use my first option so that I can keep the game dev's separate from the artist.

Thanks.
Chocolate Milk.

kevlarman

  • Posts: 2737
  • Turrets: +291/-295
Re: Menu
« Reply #18 on: March 03, 2008, 04:53:59 am »
x y width height, (top left corner = (0, 0), bottom right = (640,480))
Quote from: Asvarox link=topic=8622.msg169333#msg169333
Ok let's plan it out. Asva, you are nub, go sit on rets, I will build, you two go feed like hell, you go pwn their asses, and everyone else camp in the hallway, roger?
the dretch bites.
-----
|..d| #
|.@.-##
-----

Overdose

  • Posts: 396
  • Turrets: +52/-47
Re: Menu
« Reply #19 on: March 03, 2008, 05:03:30 am »
Thanks, I was able to figure it out. I moved his name and URL to the black stripe at the bottom and resized them appropriately.

All this computer stuff is turning out to be much simpler than I thought it would be :)
Chocolate Milk.