View Single Post
09/25/14, 06:15 AM   #6
merlight
AddOn Author - Click to view addons
Join Date: Jul 2014
Posts: 671
I tried to make it resizable the easy way, didn't work well. Perhaps adding invisible strips acting as resize handlers and resizing manually could work, but currently I'm not striving to implement that (too much work for uncertain results ). But... as you've shown you're not afraid of Lua, here's something you can use:

Lua Code:
  1. function hackCharacterSheetSize(centerY, desiredHeight)
  2.     local panel = ZO_StatsPanel
  3.     local background = ZO_SharedStatsBackground
  4.     local backgroundTexture = ZO_SharedStatsBackgroundBG
  5.  
  6.     local screenHeight = GuiRoot:GetHeight()
  7.     local centerY = zo_clamp(centerY, screenHeight / -3, screenHeight / 3)
  8.     local desiredHeight = zo_clamp(desiredHeight, 215, screenHeight)
  9.     local scaleY = desiredHeight / 750
  10.  
  11.     -- set background position and size
  12.     background:ClearAnchors()
  13.     background:SetAnchor(RIGHT, nil, RIGHT, 0, 20 + centerY)
  14.     background:SetHeight(750 * scaleY)
  15.  
  16.     -- scale background texture
  17.     backgroundTexture:ClearAnchors()
  18.     backgroundTexture:SetAnchor(TOPLEFT, nil, TOPLEFT, -75, -75 * scaleY)
  19.     backgroundTexture:SetHeight(1024 * scaleY)
  20.  
  21.     -- anchor panel to background (originally they were independent)
  22.     panel:ClearAnchors()
  23.     panel:SetAnchor(TOPRIGHT, background, TOPRIGHT, 0, 8 * scaleY)
  24.     panel:SetAnchor(BOTTOMLEFT, background, BOTTOMLEFT, 0, -12 * scaleY)
  25. end

Just drop it in an add-on, then you can experiment a bit with it ingame using
/script hackCharacterSheetSize(offsetY, height)

/script hackCharacterSheetSize(0, 750)
-- that's the original position & size

/script hackCharacterSheetSize(-150, 550)
-- will move it up and shrink

/script hackCharacterSheetSize(0, 900)
-- will enlarge it, with this height mine takes almost all unshaded space, background spilling into top and bottom strips

When you find the right values, you can insert that call into function MovableStats:SetUpTitleSection() for example.
  Reply With Quote