Tips for mocking up/tweaking/positioning UWindow dialogs?

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

Tips for mocking up/tweaking/positioning UWindow dialogs?

Post by Dizzy »

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?
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
JackGriffin
Godlike
Posts: 3776
Joined: Fri Jan 14, 2011 1:53 pm
Personal rank: -Retired-

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

Post by JackGriffin »

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: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

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

Post by Dizzy »

I know, but this would be useful info to know for any kind of UWindow - not just a message popup.
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
User avatar
Dizzy
Experienced
Posts: 109
Joined: Tue May 21, 2013 3:57 pm
Personal rank: Oaf

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

Post by Dizzy »

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
Join the BunnyTrack.net Discord chat server: https://www.bunnytrack.net/discord
User avatar
sektor2111
Godlike
Posts: 6435
Joined: Sun May 09, 2010 6:15 pm
Location: On the roof.

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

Post by sektor2111 »

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.