Author Topic: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...  (Read 9211 times)

0 Members and 1 Guest are viewing this topic.

Offline Yarn

  • 210
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Back to the original topic: I managed to implement this feature for the preload screen, the pilot selection, and the main halls, and it seems to work beautifully! I also added a new command-line parameter, -stretch_menu, for players who prefer the stretched interface. The patch is below. If it looks good to you guys, I'll go ahead and implement this for the rest of the interface.

(Yes, I'm aware that most of the screens don't display properly without -stretch_menu. This is just meant to test the three screens mentioned above.)

(Old code removed; see below for the most recent patch.)
« Last Edit: March 19, 2014, 03:40:18 pm by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
I'm so glad to see you guys actually are working on it!

Any hope for test build to test?

 

Offline zookeeper

  • *knock knock* Who's there? Poe. Poe who?
  • 210
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Awesome. :yes:

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
ngld: While I appreciate your work, at this time, I can not accept it into the engine. There are two issues with it that I would like to see addressed in subsequent versions:
1. It does not adhere to the design patterns established by other table parsers. Take the HUD gauge parser as an example for how to write one that does conform to the patterns used elsewhere while still incorporating OOP design principles.
2. The issue of how to hook up the UI code with the "business" code needs to be addressed.

Also, be aware that m!m is currently working on incorporating Chromium/Awesomium as an interface renderer, and already a good way into it. Maybe it would be a good idea for you two to work together on this, before we get too far into duplicated efforts.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Oooh yeah, loving it :) :yes:

(taken from a 1600x900 window)


(I'll have to look through the code next)

Any hope for test build to test?

As Yarn mentioned this only covers three of the menus, the rest are... kinda wonky. i.e. the mouse action masks don't match the images making navigating around a bit tricky. I think a build would be more appropriate once all the menus are done.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline Yarn

  • 210
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
I made more progress on my patch. All the single-player stuff (save for the fish tank) should be stretch-free now. As a bonus, the in-game debug info doesn't stretch anymore. Here's the patch and a Windows build:

Patch (It's too big to fit in this post.)
Windows build (based on revision 10531)


(In case you don't know what I mean by "fish tank," I'm talking about the fish that appear when you enter vasudanswuvfishes at the Vasudan main hall.)


EDIT: The patch and builds have been updated; see this post for notes.
« Last Edit: March 27, 2014, 01:18:59 am by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline Axem

  • 211
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Could there also be some sort of knowing which mode we're in through lua? Because I made this interface screen and its meant to take up the full screen no matter what. So some sort of true/false thing would help me account for that. Or some kind of scaled coordinates function (which actually might be better).

 

Offline Yarn

  • 210
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Could there also be some sort of knowing which mode we're in through lua? Because I made this interface screen and its meant to take up the full screen no matter what. So some sort of true/false thing would help me account for that. Or some kind of scaled coordinates function (which actually might be better).
If you can provide me with your code, I'll take a look at it and see what I can do.
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline Axem

  • 211
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Well, there is no "code", its a lua script.

When I need to account for coordinates being scaled, I have my own lua function that does that.

Code: [Select]
function AXUI:ScaleCoord(c, xy, base_x, base_y)

--A dumb function that will scale coordinates from a base resolution. Usually base_x and _y are 1024 and 786.
--c is the coordinate we want to scale
--xy = 0 returns the scaled x coord
--xy = 1 returns the scaled y coord

if c ~= nil then

local x_factor = self.Screen.w / base_x
local y_factor = self.Screen.h / base_y
local result = c

if xy == 0 then
result = result * x_factor
elseif xy == 1 then
result = result * y_factor
end

return result

end

end

(Man, I should really rewrite that function, but you get the picture)

To me (though I haven't tried it yet), the interface images aren't starting at 0,0 now, which parts of my script are assuming.

 

Offline Yarn

  • 210
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Actually, I was hoping that you would also provide an interface screen that uses that function. I have never used or done anything with Lua before, and I really don't feel like learning Lua just to make a new interface screen for testing, so I need you or someone else to give me a functional screen, even if it's simple. I should be able to figure things out from there.
« Last Edit: March 16, 2014, 08:41:45 pm by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178

 

Offline Axem

  • 211
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Oh sure.

This is the Script, still in a sort of beta state (No one else use it yet please!)

http://lazymodders.fsmods.net/files/Journal.rar

Its in its own mod folder, go to the barracks to activate the journal. Note that the journal screen ISN'T the barracks screen, it immediately skips to GS_STATE_SCRIPTING when you go to the Barracks screen from the mainhall.

 

Offline Bryan See

  • Has anyone really been far as decided to use even go want to do look more like?
  • 210
  • Trying to redeem.
    • Skype
    • Steam
    • Twitter
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Tried out Yarn's patch and works fine with me. Outstanding work! I can only hope that this fix should be committed to trunk, and the loadout screen should be cleaned from the source of bugs in FSO... :)

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
It is highly likely that this will be committed when it is completed and reviewed.

Fixing bugs in FSO is something we like to see, it would be great to see you submit some patches for bugs either in the loadout screen, or for any of the bugs in mantis.
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...

Windows build (based on revision 10496)


You are the God amongst men!!!

 
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
First the adaptable HUD and now the menus?! Yarn, you are now officially my FSO hero :)

Patch is working mighty fine for me, good job  :yes: :yes:

 

Offline Kolgena

  • 211
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
me gusta. so much gusta.

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • I release things
    • Steam
    • Twitter
    • Mix-Hai Productions
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
This needs to be behind an option or flag somewhere. I much prefer stretched menus to black border bars. Not only that, but this build kills any sort of animorphic stuff I've been toying and trying with for mainhalls.
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes - MjnMixael's Render Boutique
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline niffiwan

  • 211
  • Eluder Class
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
... I also added a new command-line parameter, -stretch_menu, for players who prefer the stretched interface.

:D
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • I release things
    • Steam
    • Twitter
    • Mix-Hai Productions
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
Well I should read, then shouldn't I?
Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes - MjnMixael's Render Boutique
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Yarn

  • 210
Re: [Suggestion] Fix wide screen aspect ratio in briefings, techroom and so on...
I updated the patch and build. All of the regular menus and HUD elements not definable in hud_gauges.tbl should now be completely free of stretching. Here are the notes for this version:
  • I haven't been able to fully test all of the multiplayer screens, and I could not test the ones that require joining a game (as opposed to creating one) or are seemingly inaccessible. However, I did my best to get these screens to work properly without being stretched.
  • Much of the stuff in the ui folder is untouched. The things that I left alone are either unused or used only by the Load Mission screen, which is normally inaccessible; menus using such code will stretch right now. Anything there that is used by the regular menus (to the extent that I can test them, at least) has been fixed. Update: All of this should be fixed now!
  • I haven't taken a good look at Lua yet, but I'm happy to say that Axem's script still appears to work as intended, complete with the background stretching. I don't know if it's possible to stretch a Lua menu based on the -stretch_menu flag, though. Update: You can now use isMenuStretched() to determine whether the -stretch_menu flag is enabled.
  • Since I can't compile FRED, I have no idea if I broke anything there. I would appreciate it if someone can test it for me.
« Last Edit: March 19, 2014, 03:54:33 pm by Yarn »
"Your fighter is running out of oil.  Please check under the hood and add more if necessary"
--strings.tbl, entry 177

"Freespace is very tired.  It is shutting down to get some rest."
--strings.tbl, entry 178