Tips for mocking up/tweaking/positioning UWindow dialogs?

Discussions about Coding and Scripting
Post Reply
User avatar
Dizzy
Experienced
Posts: 101
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Tips for mocking up/tweaking/positioning UWindow dialogs?

Post by Dizzy » Mon Jan 14, 2019 12:01 am

I'm creating a few UWindow dialog boxes which will appear in-game.

As you may know, UWindows and their child controls are positioned via X/Y/width/height co-ordinates like (20, 150, 200, 50).

Is there any quick way to mock these up to position them without having to fiddle around with the units in the code and then re-compile the code every time a change needs to be made?

It's taken about five re-compiles just to get a simple message window looking right.

How did the UT devs do it? Slow trial and error like this?
Image
Join our UT Discord chat server: https://www.bunnytrack.net/discord

JackGriffin
Godlike
Posts: 3766
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Post by JackGriffin » Mon Jan 14, 2019 1:16 am

Why do this the hard way? Just write to the players HUD. Spawn an inventory item on the player, have that write with PostRender, then destroy itself with a short lifespan. You can have the message feed from a server ini file that you can change at will.

Doing it your way makes your server have (in essence) pop-ups. *No one* likes those. People join to play, not to immediately need to click off some message window so they can get to what they came for. Think of how that makes you feel when you mobile into some website that does this.
So long, and thanks for all the fish

User avatar
Dizzy
Experienced
Posts: 101
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Post by Dizzy » Mon Jan 14, 2019 1:56 am

I know, but this would be useful info to know for any kind of UWindow - not just a message popup.
Image
Join our UT Discord chat server: https://www.bunnytrack.net/discord

User avatar
Dizzy
Experienced
Posts: 101
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf
Contact:

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Post by Dizzy » Tue Jan 15, 2019 3:11 am

User "slade" in the BunnyTrack.net Discord server suggested a good idea for this: using variables instead of hard-coded numbers and changing the variables in-game using "admin set" commands.

I guess it would go something like this:

Code: Select all

// Important to use "var()" and not just "var" apparently
var() int positionX;
var() int positionY;
var() int width;
var() int height;

// Create UWindow controls using the above variables 
// Example:
CloseButton = UWindowSmallButton(CreateControl(class'UWindowSmallButton', positionX, positionY, width, height));
And then in-game:

Code: Select all

admin set MyWindowClassName positionX 200
Image
Join our UT Discord chat server: https://www.bunnytrack.net/discord

User avatar
sektor2111
Godlike
Posts: 4167
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

Re: Tips for mocking up/tweaking/positioning UWindow dialogs

Post by sektor2111 » Tue Jan 15, 2019 6:11 am

Usually I'm not going for rewriting already done stuff. MapVote has a welcome window that can be linked in a Web URL with information or other links - even to a forum. Why do you need another Window ?

Also for that Nexgen thing, I believe you can use PM system for spawning a message to player right from server. Is not somehow the server sending message to target player ? Player 1 is writing message, I think it will reach to server and from server to Player 2.

Post Reply