Jump to content

Squad Select fix for Ultrawide (21:9) Monitors


Constapatience

Recommended Posts

As some of you may know for those of us with ultrawide monitors, when selecting selecting the squad before a mission the boxes don't line up with solders. Not a real big deal but an annoyance. I've been working on a mod for a while to fix this issue. Currently I have it working for 1440p (3440x1440). I am unable to test it for 1080p(2560x1080). But that's not why I am here. I have a problem where at normal aspect ratios (16:9,16:10, 4:3) the squad select is far off to the right and partly out of screen. And even though, yes people who would use this mod wouldn't be playing at the normal rations, I am trying to take into account what if something happens to your monitor and you need to go to a different monitor that is not ultrawide. And from my experience with mods for XCOM 2 you can't load a save with a mod disabled that you have previously been using for that save. So I am trying to find a way to get the resolution of what the user is playing in my script that way I can write a simple if statement to pretty much say "If ultrawide run my script else don't". Any ideas?

 

Here is my script by the way. If you think there is a better way, I am open to criticism, or if you think you can do it much better feel free to take it and use it as a starting point.

 

class UISquadSelectFix extends UIScreenListener;

event OnInit(UIScreen Screen)
{
local UISquadSelect SquadSelect;
local int x, listwidth;
local UIMovie Movie;

SquadSelect = UISquadSelect(Screen);

Movie = SquadSelect.Movie;
listWidth = SquadSelect.SoldierSlotCount * (class'UISquadSelect_ListItem'.default.width + SquadSelect.LIST_ITEM_PADDING);
x = (Movie.UI_RES_X / 2) - (listWidth / 3) - 30;
SquadSelect.m_kSlotList.ItemContainer.SetX(x);

SquadSelect.UpdateData();
}

defaultproperties
{
ScreenClass = UISquadSelect;
}

Link to comment
Share on other sites

Actually nevermind. I redid about half of my script and it seems to be working for all aspect ratios now (4:3) still seems a little wonky but I think that is because at that ratio all 6 squad members barely show up on screen but it's nothing really bad. After I do more testing and clean up some stuff, those of you with ultra wide monitors should be able to look forward to using this.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...