Lone Wolf Development Forums  

Go Back   Lone Wolf Development Forums > Hero Lab Forums > HL - Savage Worlds
Register FAQ Community Today's Posts Search

Notices

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,213

Old September 15th, 2013, 08:15 AM
The positioning fix was a very subtle thing.

Old:
Code:
 
      ~if the height the tables exceeds the available space, we need to divvy
      ~up that space between the tables
      if (portal[oArmor].height + portal[oWeapon].height + portal[oMagicArmr].height + portal[oMagicWeap].height > remain) then
        ~if the armor table is less than half the space, limit the weapon table
        ~to whatever space is leftover
        if (portal[oArmor].height + portal[oMagicArmr].height < remain / 2) then
          portal[oMagicWeap].height = remain - portal[oArmor].height + portal[oMagicArmr].height
          portal[oWeapon].height = remain - portal[oArmor].height + portal[oMagicArmr].height + portal[oMagicWeap].height
        ~if the weapon table is less than half the space, limit the armor table
        ~to whatever space is leftover
        elseif (portal[oWeapon].height + portal[oMagicWeap].height < remain / 2) then
          portal[oMagicArmr].height = remain - portal[oWeapon].height + portal[oMagicWeap].height
          portal[oArmor].height = remain - portal[oWeapon].height + portal[oMagicWeap].height + portal[oMagicArmr].height
        ~otherwise, both tables are larger than half the space, so we need to limit
        ~the height of both of them
        ~NOTE! If we just divide the remaining amount by two and set both tables to
        ~that height, we could end up with both tables being truncated by more than
        ~a half item, with the combined height being a full item short of taking up
        ~the full space. So we have to set the height of one table to half the
        ~remaining space, then subtract that table's final height from our remaining
        ~space, and finally set that as the height for the second table.
        else
          portal[oMagicWeap].height = minimum(portal[oMagicWeap].height,remain / 2)
          portal[oWeapon].height = (remain / 2) - portal[oMagicWeap].height
          portal[oMagicArmr].height = remain - (portal[oWeapon].height + portal[oMagicWeap].height)
          portal[oArmor].height = (remain / 2) - portal[oMagicArmr].height
          endif
        endif
New:
Code:
 
      ~if the height the tables exceeds the available space, we need to divvy
      ~up that space between the tables
      if (portal[oArmor].height + portal[oWeapon].height + portal[oMagicArmr].height + portal[oMagicWeap].height > remain) then
        ~if the armor table is less than half the space, limit the weapon table
        ~to whatever space is leftover
        if (portal[oArmor].height + portal[oMagicArmr].height < remain / 2) then
          portal[oMagicWeap].height = remain - portal[oArmor].height - portal[oMagicArmr].height
          portal[oWeapon].height = remain - portal[oArmor].height - portal[oMagicArmr].height - portal[oMagicWeap].height
        ~if the weapon table is less than half the space, limit the armor table
        ~to whatever space is leftover
        elseif (portal[oWeapon].height + portal[oMagicWeap].height < remain / 2) then
          portal[oMagicArmr].height = remain - portal[oWeapon].height - portal[oMagicWeap].height
          portal[oArmor].height = remain - portal[oWeapon].height - portal[oMagicWeap].height - portal[oMagicArmr].height
        ~otherwise, both tables are larger than half the space, so we need to limit
        ~the height of both of them
        ~NOTE! If we just divide the remaining amount by two and set both tables to
        ~that height, we could end up with both tables being truncated by more than
        ~a half item, with the combined height being a full item short of taking up
        ~the full space. So we have to set the height of one table to half the
        ~remaining space, then subtract that table's final height from our remaining
        ~space, and finally set that as the height for the second table.
        else
          portal[oMagicWeap].height = minimum(portal[oMagicWeap].height,remain / 2)
          portal[oWeapon].height = (remain / 2) - portal[oMagicWeap].height
          portal[oMagicArmr].height = remain - (portal[oWeapon].height - portal[oMagicWeap].height)
          portal[oArmor].height = (remain / 2) - portal[oMagicArmr].height
          endif
        endif
On 5 lines, some of the + were changed to -.
Mathias is offline   #10 Reply With Quote
 


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

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

Forum Jump


All times are GMT -8. The time now is 12:20 AM.


Powered by vBulletin® - Copyright ©2000 - 2024, vBulletin Solutions, Inc.
wolflair.com copyright ©1998-2016 Lone Wolf Development, Inc. View our Privacy Policy here.