Page 1 of 1
a way to get a players screen resolution
Posted: Fri Nov 17, 2017 8:29 pm
by CmdrKeen
I'd like to get implemented a way to pull information on a players screen size to make it possible to adjust a large dialog to the players screen without the player having to input the resolution themselves.
It'd also require an event to handle resolution changes in order to resize the dialog.
Re: a way to get a players screen resolution
Posted: Fri Nov 17, 2017 8:40 pm
by Bilka
To save some dev time: Not gonna happen. This isn't deterministic.
Re: a way to get a players screen resolution
Posted: Fri Nov 17, 2017 10:03 pm
by eradicator
Yep. Very unlikely to ever happen. If you absolutely need this you can make per-player mod options for it. Or just use a
"scroll-pane". (I can relate to the problem though *sigh*)
Re: a way to get a players screen resolution
Posted: Fri Nov 17, 2017 10:51 pm
by Rseding91
As other have said: that's not currently possible. However since it sounds like it could be quite useful for mod developers I may look into adding support for it.
Re: a way to get a players screen resolution
Posted: Fri Nov 17, 2017 10:59 pm
by eradicator
Rseding91 wrote:As other have said: that's not currently possible. However since it sounds like it could be quite useful for mod developers I may look into adding support for it.
To me the "i want the screen resolution" thing is mostly a dilemma because it's not currently possible to specify
relative sizes for GUI elements. I.e. i'd like to specify "this GUI frame should be 70% of the current window width and 60% of the current window height". Resolution would (to me) be simply an entry point to calculate those percentages myself. So personally i'd be far more interested in something like LuaGuiElement.style.relative_width = 0.6. Tho i guess knowing the absolute dimensions might still have some benefits when trying to work with very small windows...
Re: a way to get a players screen resolution
Posted: Fri Nov 17, 2017 11:25 pm
by Rseding91
eradicator wrote:Rseding91 wrote:As other have said: that's not currently possible. However since it sounds like it could be quite useful for mod developers I may look into adding support for it.
To me the "i want the screen resolution" thing is mostly a dilemma because it's not currently possible to specify
relative sizes for GUI elements. I.e. i'd like to specify "this GUI frame should be 70% of the current window width and 60% of the current window height". Resolution would (to me) be simply an entry point to calculate those percentages myself. So personally i'd be far more interested in something like LuaGuiElement.style.relative_width = 0.6. Tho i guess knowing the absolute dimensions might still have some benefits when trying to work with very small windows...
That could work but since there's no such concept in the GUI logic it's not something that can be done in any acceptable amount of time. Knowing the players screen resolution and display scale value would allow mods to set up their GUIs exactly how the core game does and that can be done in an acceptable amount of time.
Re: a way to get a players screen resolution
Posted: Sat Nov 18, 2017 12:01 am
by eradicator
Rseding91 wrote:
That could work but since there's no such concept in the GUI logic it's not something that can be done in any acceptable amount of time. Knowing the players screen resolution and display scale value would allow mods to set up their GUIs exactly how the core game does and that can be done in an acceptable amount of time.
I'm definetly not going to complain if we can get on_resolution_changed and player.resolution
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
. It's still far superior than asking the player to manually add mod settings... (i kinda suspected relative size would be to time consuming to integrate now)
Re: a way to get a players screen resolution
Posted: Sat Nov 18, 2017 4:25 am
by CmdrKeen
eradicator wrote:Rseding91 wrote:...
I'm definetly not going to complain if we can get on_resolution_changed and player.resolution
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
. It's still far superior than asking the player to manually add mod settings... (i kinda suspected relative size would be to time consuming to integrate now)
I'm not gonna complain either. I'll probably go the route of helmod for now and have a dropdown available on the per-user mod configuration menu.
Re: a way to get a players screen resolution
Posted: Sat Nov 18, 2017 4:15 pm
by Rseding91
I've added support to read a given players display resolution for 0.16.
The resolution will be what ever the game window is running at.
Re: a way to get a players screen resolution
Posted: Sat Nov 18, 2017 5:35 pm
by Bilka
How will that not turn into broken replays?
Re: a way to get a players screen resolution
Posted: Sat Nov 18, 2017 6:03 pm
by Rseding91
Bilka wrote:How will that not turn into broken replays?
It operates the same way keyboard and mouse input does so you aren't actually reading the live display resolution but what the game was last told it is.
Re: a way to get a players screen resolution
Posted: Sun Nov 19, 2017 7:05 am
by eradicator
Rseding91 wrote:I've added support to read a given players display resolution for 0.16.
The resolution will be what ever the game window is running at.
All hail to the great Rsed.
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
(and once again i notice a severe lack of a :worship: simley on the forums
![Laughing :lol:](./images/smilies/icon_lol.gif)
)