UI menu


(TimOOn) #1

Hi there,

I have a question about UI menu. I was wondering whether it’s possible to dynamically edit fields in menus. I mean to change displayed text without editing .pk3 files every time. I know that client cvars can be printed in menu so I tried forcing them for every player. But this doesn’t seem to be a good solution and forcecvar is limited. Is it possible to use server cvars instead of client cvars? Or is there any other solution I haven’t found? :rolleyes:

I would be grateful for any suggestions.


(Mateos) #2

Isn’t it what ETPub and derivated mods have built-in their ingame menu?


(TimOOn) #3

You mean the font changing and menu themes?
Nope

What I wanna do is to create a text filed which I will be able to edit easily.
In menumacros.h is defined a CVARLABEL which simply prints a value of client cvar. Like this:

CVARLABEL( CVARLABEL_X, CVARLABEL_Y, CVARLABEL_W, CVARLABEL_H, CVARLABEL_CVAR, CVARLABEL_TEXT_SCALE, CVARLABEL_TEXT_ALIGN, CVARLABEL_TEXT_ALIGN_X, CVARLABEL_TEXT_ALIGN_Y )

example:

CVARLABEL( 1, 1, 100, 100, r_customwidth, .2, ITEM_ALIGN_LEFT,1,1 )
Will print a value of r_customwidth cvar in the menu, for example "1440" 

I asked weather its possible to do the same thing but use server cvar instead. So I could set this cvar on my server to “blahblah”, and everybody would see “blahblah” in the menu. This would allow me to to easly change informations displayed in menu without messing with .pk3 files.


(Mateos) #4

Well, like dynamic .script, you can create your own mod loading these files; Or unpure server?


(Zelly) #5

I don’t know much about the source just giving input
It would be nice to move as much as the ui as possible over to be accessed by lua(Since it is already on most servers)
Similar to garrys mod perhaps.

Not sure if this is a really a viable option though

It would seem to be more likely that there would be a directory like “ui” in server folder and it could load ui scripts similar to how mapscripts are loaded.


(twt_thunder) #6

I dont think this will be possible without making a mod that supports it.