Umenu tutorial?

Discussions about Coding and Scripting
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Umenu tutorial?

Post by TheDane »

Does anyone know of a good clean Umenu tutorial? I haven't been able to find anything usefull myself :noidea

This is an area of Uscript I've never touched and I'd like to dig into it and see what it can do :mrgreen:
Retired.
User avatar
Dr.Flay
Godlike
Posts: 3347
Joined: Thu Aug 04, 2011 9:26 pm
Personal rank: Chaos Evangelist
Location: Kernow, UK
Contact:

Re: Umenu tutorial?

Post by Dr.Flay »

Hmm, I figure a UT99 UncodeX may be your option here.
(G)ott may be able to give you the source for Xbrowser
http://www.ut99.org/viewtopic.php?f=34&t=3284&start=0
http://www.unrealadmin.org/forums/showt ... hp?t=30596
UT99.org

Re: Umenu tutorial?

Post by UT99.org »

billybill wrote:Google is your friend, I learned that when looking for UnrealEdit help and UWindow help. There is very little documentation on this, for the UWindows it was mostly a matter of looking at what other projects did. I'd start off comparing UT and UT Gold since they have entirely different UMenu structures. I recall the XConsole guy working on an MSN Messenger (RIP) for UT which had it's own UMenus. I doubt it would be much different for the UWindow version of it than the actual UMenu that sits at the top of your game client, although I know those rely heavily on localized .int files
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: Umenu tutorial?

Post by Sp0ngeb0b »

Nexgen introduces a nice region layout system for UWindows inside the NexgenContentPanel panel class, you might wanna check it out as well :)
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: Umenu tutorial?

Post by TheDane »

Thanks for your input guys :tu:

Just as I suspected there is no "easy" way into this hehe :-) I feared I had to learn it from snooping into other peoples Work, hey maybe I'll make a simple tutorial as example if I see the logic in all this - snooping in Mapvote and all its files it looks like a lot of stuff is needed for this menu stuff - that should be possible to achieve more simple? I guess time will tell me :mrgreen:

Nexgen is a great suggestion - I'll try look into that, those classes are well commented with each function! I never used Nexgen myself much - Anyone knows the name of the first basic version released with the source code intact and commented? I'll try read up on it at UA, but if someone beats me to the name of it I'll be very thankfull!
Retired.
User avatar
Sp0ngeb0b
Adept
Posts: 376
Joined: Wed Feb 13, 2008 9:16 pm
Location: Cologne
Contact:

Re: Umenu tutorial?

Post by Sp0ngeb0b »

TheDane wrote:Nexgen is a great suggestion - I'll try look into that, those classes are well commented with each function! I never used Nexgen myself much - Anyone knows the name of the first basic version released with the source code intact and commented? I'll try read up on it at UA, but if someone beats me to the name of it I'll be very thankfull!
All released Nexgen versions, starting with the first public released 1.01, to the latest official one 1.12. Do you plan on creating your stuff inside Nexgen as a plugin or do you want to use Nexgen's Core GUI logic for your mod? :)
Website, Forum & UTStats

Image
******************************************************************************
Nexgen Server Controller || My plugins & mods on GitHub
******************************************************************************
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: Umenu tutorial?

Post by TheDane »

Sp0ngeb0b wrote:Do you plan on creating your stuff inside Nexgen as a plugin or do you want to use Nexgen's Core GUI logic for your mod? :)
Thanks for pointing to it :tu: What I want to achieve is nothing that relates to a server controller or mapvote etc. I'm currently making a gamestyle called "Pop Them Friggin Balloons" where I've created a "shop" feature for buy stuff in the game. This shop feature I've created through simply drawing textures and text to the HUD and then opening the menu by keybind and tracking the players input keys for movement through the menues... Some may find that a very strange way to hack arround that, but it's actualy functioning quite well and lets me control the images of items in the shop quite nicely. Now, as I've developed the gamestyle more and more Things have been added and I've gotten some great feedback that calls for further Development. Now the menuing in the HUD class needs rendering each Tick() so as the list of checks expands during Development I've thought about lag issues and will try and see what Umenu (Uwindows?) has to offer me instead?

So... basicly what I need is the knowledge of what basic elements I need to open a window for the player and how to control the contents of that window. And how to create "pages" in it, a select field for the items and a "submit" button to go with it. The mod is single player, so no replication is needed. However, If I'll use it for my other pet project (not made public yet) I'll be needing to implement replication into it too.
Retired.
~V~
Average
Posts: 39
Joined: Thu Dec 13, 2012 5:13 am

Re: Umenu tutorial?

Post by ~V~ »

I do indeed have some things that may help and I'll upload some stuff over the weekend.

For now if you have a look at this, it will show a little how get a window open from the mod menu, and also how to create windows and use elements like buttons etc. and also what to do when a button is clicked:

http://www.unrealize.co.uk/utmods/UScriptTutorial/

It's actually my voice changer mod with a few comments in the code, but I'm not great at documentation.

My messenger app shows how to create a menu bar with a few entries and I'll sort out the source in the next couple of days and upload it.
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: Umenu tutorial?

Post by TheDane »

~V~ wrote:I do indeed have some things that may help and I'll upload some stuff over the weekend.

For now if you have a look at this, it will show a little how get a window open from the mod menu, and also how to create windows and use elements like buttons etc. and also what to do when a button is clicked:

http://www.unrealize.co.uk/utmods/UScriptTutorial/

It's actually my voice changer mod with a few comments in the code, but I'm not great at documentation.

My messenger app shows how to create a menu bar with a few entries and I'll sort out the source in the next couple of days and upload it.
AWESOME!!!! :rock: Thank you for sharing this!! I will be patiently awaiting your updated source - but cannot promise I won't snoop into it as in right now! :mrgreen:
Retired.
~V~
Average
Posts: 39
Joined: Thu Dec 13, 2012 5:13 am

Re: Umenu tutorial?

Post by ~V~ »

TheDane wrote:Now, as I've developed the gamestyle more and more Things have been added and I've gotten some great feedback that calls for further Development. Now the menuing in the HUD class needs rendering each Tick() so as the list of checks expands during Development I've thought about lag issues and will try and see what Umenu (Uwindows?) has to offer me instead?
Windows have a couple of functions - BeforePaint() and Paint(), which can be used instead of Tick(), but they are only called when a window is visible. A couple more like Created() and AfterCreate() can be used for setting up initial variables etc, as they are only called once, when the window is first created. With the paint functions you must make sure that you call the superclass or it will disable probably all the windows/menus functions in UT and you may have to kill it with task manager.
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
~V~
Average
Posts: 39
Joined: Thu Dec 13, 2012 5:13 am

Re: Umenu tutorial?

Post by ~V~ »

TheDane wrote:AWESOME!!!! :rock: Thank you for sharing this!! I will be patiently awaiting your updated source - but cannot promise I won't snoop into it as in right now! :mrgreen:
Well the tutorial is ok as is I think. It's quite a simple mod with just one window, so snoop away ;)
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
User avatar
TheDane
Masterful
Posts: 660
Joined: Tue Feb 12, 2008 2:47 pm
Personal rank: Happy fool :-)

Re: Umenu tutorial?

Post by TheDane »

~V~ wrote:Windows have a couple of functions - BeforePaint() and Paint(), which can be used instead of Tick(), but they are only called when a window is visible. A couple more like Created() and AfterCreate() can be used for setting up initial variables etc, as they are only called once, when the window is first created. With the paint functions you must make sure that you call the superclass or it will disable probably all the windows/menus functions in UT and you may have to kill it with task manager.
This is pure gold for me! Thank you so much! Your tutorial is exactly what I was searching for - the point to start and learn the basics. By looking over these three classes I see the structure of the menu system, and I'm just about to compile my first attempt of opening the window using a mutate command lol :-)

.... PRICELESS!! Thanks Again!! :tu:
Retired.
~V~
Average
Posts: 39
Joined: Thu Dec 13, 2012 5:13 am

Re: Umenu tutorial?

Post by ~V~ »

TheDane wrote:
~V~ wrote:Windows have a couple of functions - BeforePaint() and Paint(), which can be used instead of Tick(), but they are only called when a window is visible. A couple more like Created() and AfterCreate() can be used for setting up initial variables etc, as they are only called once, when the window is first created. With the paint functions you must make sure that you call the superclass or it will disable probably all the windows/menus functions in UT and you may have to kill it with task manager.
This is pure gold for me! Thank you so much! Your tutorial is exactly what I was searching for - the point to start and learn the basics. By looking over these three classes I see the structure of the menu system, and I'm just about to compile my first attempt of opening the window using a mutate command lol :-)

.... PRICELESS!! Thanks Again!! :tu:
No problem. Like I said, I'm not great at documentation, but I'll try to add more comments to my code from now on.
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: Umenu tutorial?

Post by Chamberly »

~V~ got some fun uscript to play around with & I like it. lol. :P
Image
Image
Image Edit: Why does my sig not work anymore?
~V~
Average
Posts: 39
Joined: Thu Dec 13, 2012 5:13 am

Re: Umenu tutorial?

Post by ~V~ »

Ok I have uploaded Mercury server + the Messenger client:

http://www.unrealize.co.uk/utmods/MercuryMessenger/

Sorry, it's not hugely commented but the class names will give a clue to their functions. I did write short comments on the server class, but the client part has > 30 class files.

It's split into two parts so that anyone can write their own client app. frontend for it, they just need to make the main class named 'Messenger.uc' then (hopefully) the server will pick it up and use it.

To compile Mercury you must have the Messenger package in EditPackages before it.

The client windows use QuickKeyEnable, which means that they can show without the UT menu popping up or swapping back to the desktop, rather like the console and BDBMapvote do. The downside though is that opening and closing the console may hide the windows and they then need reopening. The windows are transient, which means independent of the actual level. That way the chat doesn't get destroyed/lost when the map changes.

There is one problem in that if you're chatting to someone and they change their name, then you will be chatting to thin air...

There is a semi-debug mode, which you can switch on by setting Debug=True in the ini. All this does is show your own contact in the buddy list.

Usage/Testing:

In your server.ini:
ServerActors=Mercury001.Server
ServerPackages=Messenger004

There is no need to put the server in ServerPackages as it's serverside only.

Set a keybind in User.ini to open the window:
Pause=mutate messenger

You will notice that windows can be close in different ways:

Using just your keybind will toggle windows.
Using Escape will close the the chat windows then the buddy list, if the chat windows are above the buddy list.
Use the [X] to close individual chats.

That's all I can think of for now but if there's anything not understood, leave a message here.

*Edit: you can see I've used a BSD style license to my scripts. It doesn't apply to Radiobox.uc or images (Wormbo's or adapted from one of the default images.) Don't get worried about this - it means you can do WTF you want with it so long as the license/disclaimer remains. You just add 'Modifications by whoever' after it, if you plan on releasing it and care that your name is on it.
irc.globalgamers.net #uscript
http://irc.lc/globalgamers/uscript
Post Reply