Jump to content

The way Inventory and Loot menus are drawn for Gamepad/Controller/Steam Deck players.


Recommended Posts

Hello! I guess there is not that many controller or Steam Deck users which probably also means lack of feedback.
I am a controller user myself (accessibility reasons) and since B42 is nearby I thought it's a good time to suggest a very simple to implement chage.

From the very first day I got this game about one year ago one thing bothered me: invenotry and loot menus cover half of the screen. Even though it is possible to adjust those using mouse or touchpad it is far from comfortable (or precise/symmetrical/alligned for all the perfectionists out there), and then manually made changes don't persist. Half of the screen is enormous on 50" 4k TV by the way. :lol:
That same month I made a mod which changes the math behind how it is drawn. It allows players to chose in percentage how much of the screen space said menus should take on their screen. This includes both vertical and horisontal space as well as positioning. Players can choose to have inventory on the left and loot on the right with plenty of open space in between to finally see their character or keep both menus together on the left. The change to the math behing calculating sizes works well for any common resolution including Steam Deck and split screen players. Chosen layout persists between restarts.

Here is the vanilla part of code behind it in ISPlayerDataObject.lua:

--some code
    else
        local ww = w
        local hh = h
        self.x1left = x;
        self.x1 = x;
        self.y1top = y;
        self.y1 = self.y1top + (hh/2);
        self.w1 = (ww / 2);
        self.h1 = (hh / 2);
        self.x2 = self.x1 + self.w1;
        self.y2 = self.y1;
        self.w2 = (ww / 2);
        self.h2 = (hh / 2);

    end
--some code


Here is the change I made to it:

--some code
    else
        local x = getPlayerScreenLeft(playerID)
        local y = getPlayerScreenTop(playerID)
        local w = getPlayerScreenWidth(playerID)
        local h = getPlayerScreenHeight(playerID)
        local ms = CGUI.Options.ms --loot menu position (boolean)
        local mw = CGUI.Options.mw --inventory + loot width (%)
        local mh = CGUI.Options.mh --inventory height (%)
        local lmh = CGUI.Options.lmh --loot height (%)

        self.x1left = x;
        self.y1top = y;
        self.x1 = x;
        self.w1 = (w * mw / 2);
        self.h1 = (h * mh);
        self.y1 = h - self.h1;

        if ms then
            self.x2 = self.x1 + w - self.w1;
        else
            self.x2 = self.x1 + self.w1;
        end

        self.w2 = self.w1;
        self.h2 = (h * lmh);
    	self.y2 = h - self.h2;
    end
--some code


Here are the screenshots at Steam Deck resolution plus settings used:
Screenshotfrom2023-08-0115-14-01.thumb.jpg.4344f0a72030496f6f3c08f4d424e53e.jpgScreenshotfrom2023-08-0115-14-10.thumb.jpg.9c06106385cab176fc2a2cd84033bae9.jpg

Having mods is great, but when it comes to multiplayer one have to somehow reach to unknown person behind the server and make them add one more mod which is usually not possible.
I would be so happy to see something like this implemented.

Thank you, I love your game.

Edited by somewhatfrog
Link to comment
Share on other sites

  • somewhatfrog changed the title to The way Inventory and Loot menus are drawn for Gamepad/Controller/Steam Deck players.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...