Here's the situation. Back at DXEditing, a user named Temorzerella was working on modifying the in-game inventory so that it would have a 6 x 6 grid, as opposed to a 5 x 6 grid. He hit a few snags, and I decided to continue the experiment in his stead. After a bit of work, and a lot of Photoshopping, I was able to modify the original inventory textures so that they could properly display a 6 x 6 grid, and combined that as best I could with the code he supplied, which is shown below.
Now, at the time, I was testing the code in a Shifter-variant mod. I don't know if there was anything wrong with the provided code, or if it was trying to use it in Shifter, but every time I finally managed to compile a DeusEx.u file, the game crashed immediately upon testing the finished product with a new game.
That was (as far as I remember) the last issue I brought up at DXE before the crash. Perhaps someone here can finish the work that was started there, and actually get it TO work.
For now, here's the code.
Temorzerella - DX Editing wrote:Ok, the bad news about this is you pretty much have to edit the DeusEx.u package, but if your cool with redistributing the modified version with your mod, here's how to do it (note then that this mod may interfere with other mods). Also, backup your deusex.u before attempting modifications.
There are three variables in the deus ex player that control the inventory. Add the () expression after these three variables so that you can edit them in the def props.
var travel byte invSlots[30]; // 5x6 grid of inventory slots
var int maxInvRows; // Maximum number of inventory rows
var int maxInvCols; // Maximum number of inventory columns
Change these so they read
var() travel byte invSlots[36]; // 6x6 grid of inventory slots
var() int maxInvRows; // Maximum number of inventory rows
var() int maxInvCols; // Maximum number of inventory columns
Also, you have to overwrite a function. Change the RepairInventory() function to the following.
Now that will give you a 36 space inventory, but it doesn't register yet. Now the maxInvRows and maxInvCols should be editable in your player class def props under the heading DeusExPlayer. Change the columns to 6 and leave the rows at 6. This will create a 36 space inventory, but it will cut off the last row (note that you can place items there though, try this in game by dragging a large item over and seeing it disappears off the right side into an additional column).Code: Select all
function RepairInventory() { local byte LocalInvSlots[36]; // 6x6 grid of inventory slots local int i; local int slotsCol; local int slotsRow; local Inventory curInv; if ((Level.NetMode != NM_Standalone) && (bBeltIsMPInventory)) return; //clean out our temp inventory. for (i = 0; i < 36; i++) LocalInvSlots[i] = 0; // go through our inventory and fill localinvslots if (Inventory != None) { for (curInv = Inventory; curInv != None; curInv = curInv.Inventory) { // Make sure this item is located in a valid position if (( curInv.invPosX != -1 ) && ( curInv.invPosY != -1 )) { // fill inventory slots for( slotsRow=0; slotsRow < curInv.invSlotsY; slotsRow++ ) for ( slotsCol=0; slotsCol < curInv.invSlotsX; slotsCol++ ) LocalInvSlots[((slotsRow + curInv.invPosY) * maxInvCols) + (slotscol + curInv.invPosX)] = 1; } } } // verify that the 2 inventory grids match for (i = 0; i < 36; i++) if (LocalInvSlots[i] < invSlots[i]) //don't stuff slots, that can get handled elsewhere, just clear ones that need it { log("ERROR!!! Slot "$i$" should be "$LocalInvSlots[i]$", but isn't!!!!, repairing"); invSlots[i] = LocalInvSlots[i]; } }
Now for the UI editing (no fun here). We have to make the UI somehow display that last row. Find the PersonaScreenInventory class under ExtensionObject.Window.TabGroupWindow.DeusExBaseWi ndow.PersonaScreenBaseWindow
Now the obvious first solution to this problem is to change the window size for the inventory grid. The function in this class that draws the inventory grid is CreateItemsWindow(). The default grid is 266 by 319 pixels. Increase the 266 by 53 to 319, which gives you a 6x6 grid.
This is where I gave up on trying to change the background to match, but this will create a 6x6 36space inventory. If any of you can finish the work, I welcome your solutions and would like to congratulate you as well.