[REL] Floating UI v1.0 [58197]

Discussion in 'Mod Discussions' started by Raevn, December 10, 2013.

  1. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I haven't released the update yet ;)

    There are a number of tricky issues at the moment:
    • The main menu canvas does not resize instantly; this causes the apparent height/width of the screen to be intially incorrect. Overcoming this is causing no end of headaches; I may just abandon the start screen for now.
    • Making frames float takes the content out of the original flow; this affects things that are centered and resize, such as build menus. Preventing the current visual break of the build menu/economy bars etc. can be fixed easily, but the centering issue isn't as easy (eg. the left side of the build bar stays in the same position, even when the build bar expands; that is, the center point of the build bar doesn't remain stationary).
  2. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    You may have already tried this but why don't you just stick the build bar in a div that fills the width of the screen and have "margin-left: auto; margin-right: auto" do the centering?
  3. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    I think the best way to center stuff in PA is this kind of class:

    .centeritalready {
    display:-webkit-box;
    -webkit-box-pack:center;
    -webkit-box-align:center;
    }
  4. proeleert

    proeleert Post Master General

    Messages:
    1,681
    Likes Received:
    1,656
    The buildbar has issues in vanilla if you resize to small window and have a huge list in it.
  5. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    I love that class name!
  6. cola_colin

    cola_colin Moderator Alumni

    Messages:
    12,074
    Likes Received:
    16,221
    Sad truth is even that one does not work always. Centering things in html really is waaay to hard imho.
  7. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    You're telling me! CSS is like choosing the three hardest ways of doing something and then being forced to do all three.
    Raevn likes this.
  8. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I had considered that method, but it has two downsides:
    • This would prevent any horizontal movement of the build bar
    • The empty space on either side would count as part of the build bar when dragging
  9. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Well I hope you can find out a better way because I'd love to use this mod.
  10. dc443

    dc443 Member

    Messages:
    68
    Likes Received:
    19
    So there are massive build bar issues, plus the chronocam gets dragged while using it -- that just looks super buggy.
  11. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Much closer now. After much hair-pulling (I'm now bald), I've gotten the build bar to work as expected - staying centered even when it resizes, and it resizes without breaking.
    The solution for centering? There's now an option to use the center of the frame as the anchor point, instead of the top-left edge. This also adds a timed check for a change in size of the frame, and if so, it re-centers around the existing center point.

    That explanation made it sound easy. It wasn't. It really, really, really wasn't. You're welcome ;)

    I gave up on the main menu (although the news still floats). There's an issue that means if the main menu grows by even a small amount (say, with the mods list mod enabled), it becomes larger than the initial height of the background area, which causes Bad Things™ to happen. Bad Things™ are bad (like not being able to see the main menu any more).

    @dc443 - thanks for pointing out the issue with the chronocam bar, I'll look into it.

    Some other bonuses that came out of this:
    • Added a Reset button to the settings menu that forgets the remembered positions of all floating frames, returning them to their starting positions (This is a part of the Floating Framework itself, not this mod).
    • Floating Framework now supports dynamic sized frames (ensure the initial div has position set to relative, not absolute/fixed).
    • Added an "autoPosition" option to floating framework, this will look at what you have the offset set to (say, bottomRight) and automatically shift it so that the (in this case) bottom right hand corner of the frame is at the bottom right of the screen. Useful for dynamic frames that you don't know the size of in advance.
    • You can now add content to a frame in the same function call as creating it.
    I need to test these changes on the other mods that use the Floating Framework to make sure nothing breaks, but I've tried to avoid any changes that would do this, so hopefully there won't be much/any work there.

    I need to sleep now. Can't Brain any more. I'll no doubt have nightmares involving CSS.
  12. ORFJackal

    ORFJackal Active Member

    Messages:
    287
    Likes Received:
    248
    [​IMG]
  13. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    I've taken this down from PAMM until I've finished the new version.
  14. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Could you work on this again? Thanks to gamma you shouldn't have the build bar issue anymore. I'd love to have it though since it was really nice to use when it worked.
  15. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    There's a few interesting things here;

    The start screen is no longer completely funky due to the star field. That means the whole delay thing shouldn't be necessary any more (cut code in half by 2!).
    At first glance there appears to be a full-screen div present in all scenes. That makes things easier, also.

    The not-always-visible nature of the build bar is still a problem though. But I'll take another look when I get a chance.
    LavaSnake likes this.
  16. LavaSnake

    LavaSnake Post Master General

    Messages:
    1,620
    Likes Received:
    691
    Thanks! I'd really love to use this again and Uber should definitely make it default.
  17. brianpurkiss

    brianpurkiss Post Master General

    Messages:
    7,879
    Likes Received:
    7,438
    Looks like this mod breaks PA.

    When I start the game, I can't click on any menu items or the login boxes. When I disable this mod, I can.
  18. cptconundrum

    cptconundrum Post Master General

    Messages:
    4,186
    Likes Received:
    4,900
    This mod has been broken for a very long time.
  19. Raevn

    Raevn Moderator Alumni

    Messages:
    4,226
    Likes Received:
    4,324
    Yep, it's not in PAMM anymore for a reason ;). Is this the right mod, or is there an issue with the Floating Framework itself?
  20. brianpurkiss

    brianpurkiss Post Master General

    Messages:
    7,879
    Likes Received:
    7,438
    I figured as much.

Share This Page