Thread Tools Display Modes
05/19/14, 11:12 AM   #1
Dynamite7673
Join Date: Apr 2014
Posts: 20
Inventory Width

I'm not an addon developer but I have programming experience. Between work and kids I don't have time to get into developing addons when so many people are already covering just about everything possible. I do have a need to mod the inventory name field slightly if possible. I use several inventory addons and after a slight modification to 1 of them they all line up and fit without running into anything else or each other with one exception. I noticed with the default UI the item names in inventory text wrap to a second line at some point and I was wondering if it's possible to modify a lua file somewhere to shorten that distance. Items with longer names are running into the icons for Motifs. I'm sure it would seem easier to modify the lua for Motifs but then it'll run into others I have. If this isn't possible I'll live with it but since Grid View exists it would seem it is possible. Any help would be appreciated.
  Reply With Quote
05/19/14, 01:39 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
It's not perfect, but it works for me:

Resize.lua:
Lua Code:
  1. local width = 600
  2.  
  3. local function SetWidth(controlName)
  4.    WINDOW_MANAGER:GetControlByName(controlName):SetWidth(width)
  5. end
  6.  
  7. local function Resize(name, list)
  8.    list = list or "Backpack"
  9.    SetWidth(name)
  10.    SetWidth(name..list)
  11.    SetWidth(name.."SortBy")
  12.    SetWidth(name.."FilterDivider")
  13. end
  14.  
  15. local function ResInv(arg)
  16.    if arg ~= "" then
  17.       width = tonumber(zo_strmatch(arg, "%d+"))
  18.    end
  19.      
  20.    SetWidth("ZO_SharedRightPanelBackground")
  21.    Resize("ZO_PlayerInventory")
  22.    Resize("ZO_PlayerBank")
  23.    Resize("ZO_GuildBank")
  24.    Resize("ZO_StoreWindow", "List")
  25.    Resize("ZO_SmithingTopLevelRefinementPanelInventory")
  26.    Resize("ZO_SmithingTopLevelDeconstructionPanelInventory")
  27.    Resize("ZO_SmithingTopLevelImprovementPanelInventory")
  28.    Resize("ZO_SmithingTopLevelRefinementPanelInventory")
  29.    Resize("ZO_EnchantingTopLevelInventory")
  30.    Resize("ZO_AlchemyTopLevelInventory")
  31. end
  32.  
  33. --usage: /resinv <width>, if <width> is not specified, default value is 600.
  34. SLASH_COMMANDS["/resinv"] = ResInv
  Reply With Quote
05/19/14, 03:01 PM   #3
Dynamite7673
Join Date: Apr 2014
Posts: 20
Where would I put this lua?
  Reply With Quote
05/19/14, 03:45 PM   #4
katkat42
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 155
{your user documents folder}/Elder Scrolls Online/[live|liveeu]/AddOns/InventoryResizer/InventoryResizer.lua

Also, put the following:

Code:
## Title: Inventory Resizer
## APIVersion: 100003

InventoryResizer.lua
in a file named InventoryResizer.txt in the same folder. That ought to do the trick.
  Reply With Quote
05/20/14, 08:02 AM   #5
Dynamite7673
Join Date: Apr 2014
Posts: 20
I went home and did this yesterday. When I logged in and tried to /resinv 500 and opened my inventory nothing changed. Then I opened my settings and my add-on names are overlapping with a big gap at the bottom between addon settings and controls. I do not think this is related bause I remove the added Folder/lua file/Text files I added and went back into the game. The setting menu is still messed up. Anyone else have this issue? Is it a game update? I guess no one can answer that unless they're having the same issue because I have about 40 addons lol.
  Reply With Quote
05/20/14, 08:55 AM   #6
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Dynamite7673 View Post
I went home and did this yesterday. When I logged in and tried to /resinv 500 and opened my inventory nothing changed. Then I opened my settings and my add-on names are overlapping with a big gap at the bottom between addon settings and controls. I do not think this is related bause I remove the added Folder/lua file/Text files I added and went back into the game. The setting menu is still messed up. Anyone else have this issue? Is it a game update? I guess no one can answer that unless they're having the same issue because I have about 40 addons lol.
This is developer discussion, so I thought you want just an example how you can resize inventory. If it is not the case, and you are looking for an addon, move your post to AddOn Search/Requests.

As to the code:
If command /resinv doesn't work for you, you probably did not install lua file correctly. As katkat42 said, you need to create a new folder under AddOns and create two files inside of that folder. InventoryResizer.lua with my sample code and InventoryResizer.txt with text in katkat42's comment.

Command /resinv does resize inventory only until you logout/login your character or use /reloadui. If you want to use this code in addon, you should add function that will resize inventory automatically when addon is loaded and also option to save user defined width. By the way default width of player's inventory is 565px.
  Reply With Quote
05/20/14, 09:03 AM   #7
Dynamite7673
Join Date: Apr 2014
Posts: 20
The reason I asked here is because I assumed(never assume) it would be as simple as changing an existing number in a lua file. I didn't think an addon would be needed for such a simple request. My mistake.
  Reply With Quote
05/20/14, 09:55 AM   #8
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by Dynamite7673 View Post
The reason I asked here is because I assumed(never assume) it would be as simple as changing an existing number in a lua file. I didn't think an addon would be needed for such a simple request. My mistake.
Unfortunately size of default UI windows are defined somewhere in EsoUI source code and to change it you will need an addon.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Inventory Width


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off